aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2016-10-06 05:01:37 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2016-10-06 05:05:23 +0900
commit671066541e391863fee2a9dfb83e4a332d3422a8 (patch)
tree88df8dbe9e28f5516c3bd3a51051784ee281db13
parent9d39aaf18ffc12155cafc292675f8f9827fff666 (diff)
downloadmikutter-671066541e391863fee2a9dfb83e4a332d3422a8.tar.gz
Web上のリソースを扱うためのwebプラグイン追加 refs #866
-rw-r--r--core/plugin/intent/intent.rb5
-rw-r--r--core/plugin/web/.mikutter.yml12
-rw-r--r--core/plugin/web/model/web.rb (renamed from core/plugin/intent/model/web.rb)2
-rw-r--r--core/plugin/web/web.rb8
4 files changed, 21 insertions, 6 deletions
diff --git a/core/plugin/intent/intent.rb b/core/plugin/intent/intent.rb
index a20ac0d7..862a1a84 100644
--- a/core/plugin/intent/intent.rb
+++ b/core/plugin/intent/intent.rb
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
require_relative 'model/intent'
require_relative 'model/intent_token'
-require_relative 'model/web'
Plugin.create(:intent) do
# _uri_ を開くことができる Model を列挙するためのフィルタ
@@ -45,10 +44,6 @@ Plugin.create(:intent) do
self
end
- intent Plugin::Intent::Web, label: 'Open in foreign browser' do |intent_token|
- Gtk.openurl(intent_token.model.perma_link.to_s)
- end
-
on_open do |object|
case object
when Plugin::Intent::IntentToken
diff --git a/core/plugin/web/.mikutter.yml b/core/plugin/web/.mikutter.yml
new file mode 100644
index 00000000..cedf2b25
--- /dev/null
+++ b/core/plugin/web/.mikutter.yml
@@ -0,0 +1,12 @@
+---
+slug: :web
+depends:
+ mikutter: '3.5'
+ plugin:
+ - uitranslator
+version: '1.0'
+author: toshi_a
+name: Web
+description: >-
+ Webページを扱う機能を提供する。
+ http,httpsリンクを外部ブラウザを起動することができる
diff --git a/core/plugin/intent/model/web.rb b/core/plugin/web/model/web.rb
index 2af854f4..dd7bb889 100644
--- a/core/plugin/intent/model/web.rb
+++ b/core/plugin/web/model/web.rb
@@ -6,7 +6,7 @@ Web上のリソースを示す汎用的なModel。
例えば、URLはWebブラウザで開くことができるが、intentは最終的に全てModelに変換できなければならないため、Modelが用意されていない多くのURLは取り扱うことができない。
=end
-module Plugin::Intent
+module Plugin::Web
class Web < Retriever::Model
register :web
diff --git a/core/plugin/web/web.rb b/core/plugin/web/web.rb
new file mode 100644
index 00000000..a7192523
--- /dev/null
+++ b/core/plugin/web/web.rb
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+require_relative 'model/web'
+
+Plugin.create(:web) do
+ intent Plugin::Web::Web, label: _('外部ブラウザで開く') do |intent_token|
+ Gtk.openurl(intent_token.model.perma_link.to_s)
+ end
+end