aboutsummaryrefslogtreecommitdiffstats
path: root/feedSomeKeys_3.js
diff options
context:
space:
mode:
authoranekos2010-03-02 19:03:32 +0000
committeranekos2010-03-02 19:03:32 +0000
commit581303a74e5ffa2990a59ee5f8474ac5fc233a93 (patch)
tree30a2a4d5a4d7d7f5aa9a6534e98e435bdac4213e /feedSomeKeys_3.js
parentef9737282f88cafb6ebcc1c9838ef8220cf2b732 (diff)
downloadvimperator-plugins-581303a74e5ffa2990a59ee5f8474ac5fc233a93.tar.bz2
fmapc を実装
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36907 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'feedSomeKeys_3.js')
-rwxr-xr-xfeedSomeKeys_3.js50
1 files changed, 41 insertions, 9 deletions
diff --git a/feedSomeKeys_3.js b/feedSomeKeys_3.js
index 6cd5b8b..29772d4 100755
--- a/feedSomeKeys_3.js
+++ b/feedSomeKeys_3.js
@@ -39,7 +39,7 @@ let PLUGIN_INFO =
<name lang="ja">feedSomeKeys 3</name>
<description>feed some defined key events into the Web content</description>
<description lang="ja">キーイベントをWebコンテンツ側に送る</description>
- <version>1.2.0</version>
+ <version>1.3.0</version>
<author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
<license>new BSD License (Please read the source code comments of this plugin)</license>
<license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license>
@@ -79,7 +79,7 @@ lazy fmaps -u='http://code.google.com/p/vimperator-labs/issues/detail' u
// }}}
// INFO {{{
let INFO =
-<plugin name="feedSomeKeys" version="1.2.0"
+<plugin name="feedSomeKeys" version="1.3.0"
href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/feedSomeKeys_3.js"
summary="Feed some defined key events into the Web content"
xmlns="http://vimperator.org/namespaces/liberator">
@@ -277,18 +277,27 @@ let INFO =
function (values)
(values && !values.some(function (value) !list.some(function (event) event === value)));
- function list (filter) {
+ function clear (filter) {
+ let mode = modes.NORMAL;
+ mappings._user[mode] = [
+ map
+ for each (map in mappings._user[mode])
+ if (!map.feedSomeKeys)
+ ];
+ }
+
+ function gets (filter) {
if (filter)
filter = mappings._expandLeader(filter);
-
- liberator.log(filter);
-
- let maps = [
+ return [
map
for (map in mappings._mappingsIterator([modes.NORMAL], mappings._user))
if (map.feedSomeKeys && (!filter || map.names[0] == filter))
];
+ }
+ function list (filter) {
+ let maps = gets(filter);
let template = modules.template;
let list =
<table>
@@ -303,7 +312,6 @@ let INFO =
}
</table>;
- // TODO: Move this to an ItemList to show this automatically
if (list.*.length() == list.text().length()) {
liberator.echomsg("No mapping found");
return;
@@ -383,12 +391,36 @@ let INFO =
].concat(
multi ? [[['-separator', '-s'], commands.OPTION_STRING]]
: []
- )
+ ),
+ completer: function (context, args) {
+ if (multi)
+ return;
+ if (args.length > 1)
+ return;
+ context.title = ['name', 'rhs & url'];
+ context.completions = [
+ [
+ map.names[0],
+ map.feedSomeKeys.rhs + ' for ' + (map.matchingUrls ? map.matchingUrls : 'Global')
+ ]
+ for each (map in gets())
+ ];
+ }
},
true
);
});
+ commands.addUserCommand(
+ ['fmapc'],
+ 'Clear fmappings',
+ function () {
+ clear();
+ },
+ {},
+ true
+ );
+
plugins.libly.$U.around(
mappings,
'getCandidates',