From a45ac830bde0a944dfe87f359cbfb97961d0a31c Mon Sep 17 00:00:00 2001 From: pekepeke Date: Sun, 14 Dec 2008 15:43:14 +0000 Subject: pluginManager対応 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26698 d0d07461-0603-4401-acd4-de1884942a52 --- autoproxychanger.js | 90 ++++++++++++++++++++++++------------------------- localkeymode.js | 96 ++++++++++++++++++++++++++--------------------------- refcontrol.js | 92 ++++++++++++++++++++++++-------------------------- 3 files changed, 137 insertions(+), 141 deletions(-) diff --git a/autoproxychanger.js b/autoproxychanger.js index a9988f2..b77dbfb 100644 --- a/autoproxychanger.js +++ b/autoproxychanger.js @@ -1,48 +1,48 @@ -/** - * ==VimperatorPlugin== - * @name autoproxychanger.js - * @description proxy setting plugin - * @description-ja プロクシ設定 - * @minVersion 2.0pre - * @author pekepeke - * @version 0.1.2 - * ==/VimperatorPlugin== - * - * Usage: - * :proxy [setting_name] -> set proxy setting to setting_name - * :proxy! -> set proxy setting to default setting - * :toggleautoproxy -> proxy autochanger on/off toggle - * - * The proxy_settings is a string variable which can set on - * vimperatorrc as following. - * - * let autochanger_proxy_settings = "[{ name:'disable', usage: 'direct connection', proxy:{type:0} }]" - * let autochanger_proxy_enabled = "true" - * - * or your can set it using inline JavaScript. - * - * liberator.globalVariables.autochanger_proxy_enabled = true; - * liberator.globalVariables.autochanger_proxy_settings = [{ - * name : 'disable', - * usage : 'direct connection', - * proxy :{ - * type :0, - * }, - * },{ - * name : 'http', - * usage : 'localhost proxy', - * proxy :{ - * type : 1, - * http : 'localhost', - * http_port : 8080, - * }, - * url : /http:\/\/www.nicovideo.jp/, - * run : 'java.exe', - * args : ['C:\Personal\Apps\Internet\NicoCacheNl\NicoCache_nl.jar'], - * }]; - * EOM - * - */ +var PLUGIN_INFO = + + autoproxychanger + setting proxy + proxyの設定・自動切り替え + 0.1.2 + pekepeke + 2.0pre + 2.0pre + set proxy setting to setting_name +:proxy! -> set proxy setting to default setting +:toggleautoproxy -> proxy autochanger on/off toggle + +The proxy_settings is a string variable which can set on +vimperatorrc as following. + +let autochanger_proxy_settings = "[{ name:'disable', usage: 'direct connection', proxy:{type:0} }]" +let autochanger_proxy_enabled = "true" + +or your can set it using inline JavaScript. + +liberator.globalVariables.autochanger_proxy_enabled = true; +liberator.globalVariables.autochanger_proxy_settings = [{ + name : 'disable', + usage : 'direct connection', + proxy :{ + type :0, + }, + },{ + name : 'http', + usage : 'localhost proxy', + proxy :{ + type : 1, + http : 'localhost', + http_port : 8080, + }, + url : /http:\/\/www.nicovideo.jp/, + run : 'java.exe', + args : ['C:\Personal\Apps\Internet\NicoCacheNl\NicoCache_nl.jar'], + }]; +EOM + ]]> +; liberator.plugins.AutoProxyChanger = (function() { var gVar = liberator.globalVariables; diff --git a/localkeymode.js b/localkeymode.js index cf9bf7c..6bf20e3 100644 --- a/localkeymode.js +++ b/localkeymode.js @@ -1,49 +1,49 @@ -/** - * ==VimperatorPlugin== - * @name local key mode - * @description assign temporary usermodemap - * @description-ja 一時的なキーマップの割り当てを行います。 - * @version 0.2.1a - * ==/VimperatorPlugin== - * - * Usage: - * - * :togglelocalkeymode - 有効/無効のトグルです。(ステータスバーのアイコンクリックでも切り替え可能) - * :loadkeymaps - 任意のキーマップの読み込みを行う - * :clearkeymaps - loadkeymaps の読み込みを無効にする - * - * .vimperatorrc - * g:localkeymode_enable : [true=有効/false=無効(デフォルト)] - * - * .vimperatorrrc 設定例: - * let g:localkeymode_enable = "true" - * javascript <?', {noremap:true}], - * ['q', 'd', {noremap:true}], - * ], - * ]; - * EOM - * - * 備考: - * * - */ +var PLUGIN_INFO = + + localkeymode + assign temporary keymap + 一時的なキーマップの割り当て + 0.2.1b + pekepeke + 2.0pre + 2.0pre + ?', {noremap:true}], + ['q', 'd', {noremap:true}], + ], +]; +EOM + +Url_RegExp : 設定を有効にしたいURL(正規表現での指定) +key : 割り当てたいキー名(Arrayで複数指定可能) +command/function : キーに割り当てたいコマンド/メソッド。 + コマンドは ':hoge' のように先頭に':'を付加してください。 +extra : noremap, count 等の指定。addUserMap にて使用されます。 + ]]> +; + liberator.plugins.LocalKeyMode = (function() { // アイコン定義 @@ -197,7 +197,7 @@ liberator.plugins.LocalKeyMode = (function() { keymaps.removekeys.forEach( function( key ) { var org = mappings.get( modes.NORMAL, key); if (org) self.storekeymaps.push( cloneMap(org, [key]) ); - self.helpstring += key+' -> [Delete KeyMap]\n'; + self.helpstring += key+' -> [Delete KeyMap]
\n'; mappings.remove( modes.NORMAL, key); } ); keymaps.keys.forEach( function( m ) { @@ -208,7 +208,7 @@ liberator.plugins.LocalKeyMode = (function() { } ); mappings.addUserMap([modes.NORMAL], m.names, m.description, m.action, {flags:m.flags, rhs:m.rhs, noremap:m.noremap }); - self.helpstring += m.names+' -> '+m.rhs+'\n'; + self.helpstring += m.names+' -> '+m.rhs+'
\n'; } ); this.isBinding = true; }, diff --git a/refcontrol.js b/refcontrol.js index 68ba6f3..fa265d7 100644 --- a/refcontrol.js +++ b/refcontrol.js @@ -1,42 +1,38 @@ -/** - * ==VimperatorPlugin== - * @name refcontrol - * @description control referrer - * @description-ja リファラー制御 - * @version 0.1.0 - * ==/VimperatorPlugin== - * - * Usage: - * - * :togglerefcontrol - 有効/無効のトグルです。(ステータスバーのアイコンクリックでも切り替え可能) - * :addref - リファラー設定追加(再起動すると消えます) - * - * .vimperatorrc - * g:localkeymode_enable : [true=有効/false=無効(デフォルト)] - * - * .vimperatorrrc 設定例: - * let g:refcontrol_enabled = "true" - * javascript < - * '@DEFAULT' はデフォルト設定を指します。 - * - * param> - * @NORMAL : 通常の動作です。 - * @FORGE : ドメインのルートをリファラにセットします。 - * '' : リファラーを送信しません - * url : 指定したURLでリファラーを送信します。 - * - * 備考: - * - */ +var PLUGIN_INFO = + + refcontrol + control referrer + リファラー制御 + 0.1.0a + pekepeke + 2.0pre + 2.0pre + +; + liberator.plugins.RefControl = (function() { const Cc = Components.classes; @@ -44,15 +40,15 @@ const Ci = Components.interfaces; const ENABLE_ICON = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMA/wAAAP+JwC+QAAAB' - + 't0lEQVR4nI1RTWsTURQ9d96bTJpMW8bY0pEspB80IBJtQzctkpWI4KrgHxAFQXDlxh8gKBTc' - + 'uHXRje78Af6AoqCCVSjBfi9MGakyJiZ5X9dFFZPpIl7O5r17zj3vnkcMlkFhbvX29LWbU5eX' - + 'hO9jsNjZo80Pe69fbb14pto/JJE3e/1O7f7jcCwvPIAzfJAQ5WqtNFu1lrx1X4xPX7x0d22y' - + 'POU0XA9WDcBpWAVY5ITITVSSTxsyiOJCKTYK7LKz/5kQLGG0NBlEsSSSYGkU+NRjMmUMeX5e' - + 'Omaj2eghbABGMzNLZjba6f8UOJYAWct2mIAZ1sAxpNXt7q+fQb5I5P3dMcMFwMxOKWW6qew0' - + 'd1rHh+MTsemaP79ARCAQgZnBJ2mIQKTJbqe543WSw8bzB0myz5F0YeDCwAXSglWvp7TW2tq8' - + 'jzO54/Sosf6wdfCZGAxgdKYWziyG5xdAVCzPR5WVEc+adi/99vX77tvW9pvW9vu0scHsTiwH' - + 'QMKPFm9Un3ysv9RLT7+MVer9XXk6EGcV3qHQvHC2fiu+eq8wt4ytgQyyDv0I56+cW33UfzNE' - + 'wGBRjPqPvwHSQByM8Fg+IQAAAABJRU5ErkJggg=='; + + 'qklEQVR4nI1RPWgUYRSct/stexc3xvX8udV4BhPUiI1RUsnVglgJCh52aaxs0llrpZVNWhVr' + + 'wdZCFGwsohCRJKAmqLnoheDd5X52v2+/sUiEzfoTh6mGmfeY94RgVK3tGd537MKV8plJ1/Ow' + + 'HbTpt7k3S8+eNBaX6i8fS7l6bWL60d6DSbC74DoAc36IICV6Hf39qzt797rqfZnjj8Xg6Enb' + + 'h7Ug824A4qCoPM+s6PVl5YfRQCkyCWjzs7ctEQyWDvhhpEQUqEySn/07jBHHKyhLGk2jd3AD' + + 'MJokFUmjrf7PgKUCJE2Z7hQgkRpYQqW60++2/cIuEedXx5wXAEmbJInpt5QfDm+sfx7aH5m+' + + '2fqCiEAgApLg5jVc3201PvVWPwrBofHzp6cfhpURagcAjEVs0kRDBBAn8N0BadZX3t+/sfb6' + + 'qRAEMDh6Lhg9G4xMQOT4xaluzKKTmk7cWquXxsbeztzc+DDbXHgFYCuQRVStxZ125ertsDLe' + + 'XV2en5lqzj/PVuIfWTx86kjt3uSDuHzpVlb/a2CTwYnqoct3soqDf6K98MI23mWVn59g+pcs' + + 'KKOSAAAAAElFTkSuQmCC'; const DISABLE_ICON = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMA/wAAAP+JwC+QAAAB' -- cgit v1.2.3