diff options
author | teramako | 2008-11-28 15:17:56 +0000 |
---|---|---|
committer | teramako | 2008-11-28 15:17:56 +0000 |
commit | b3f37390bb8bbdcd89627608c379a055291e6ea6 (patch) | |
tree | 713cf42435b194f164c3f29b9c8ab8cbbe9515c5 /tombloo.js | |
parent | 5a88999296543a4cbf7a81ab7878e9fd0f1d5f41 (diff) | |
download | vimperator-plugins-b3f37390bb8bbdcd89627608c379a055291e6ea6.tar.bz2 |
follow CVS HEAD
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25285 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'tombloo.js')
-rw-r--r-- | tombloo.js | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -43,14 +43,13 @@ function getContext(){ commands.addUserCommand(['tomblooAction'],'Execute Tombloo actions', function(arg){ - TomblooService.Tombloo.Service.actions[arg].execute(); + TomblooService.Tombloo.Service.actions[arg.string].execute(); },{ - completer: function(filter){ - var completionList = new Array(); - for(let name in TomblooService.Tombloo.Service.actions) - if(name.indexOf(filter) > -1) - completionList.push([name,name]); - return [0,completionList]; + completer: function(context){ + context.title = ['Tombloo Actions']; + context.completions = [[name,name] for(name in TomblooService.Tombloo.Service.actions)].filter(function($_){ + return this.test($_[0]); + }, new RegExp(context.filter, 'i')); } } ); @@ -60,13 +59,11 @@ commands.addUserCommand(['tombloo'],'Post by Tombloo', TomblooService.Tombloo.Service.share(getContext(),TomblooService.Tombloo.Service.extractors[arg.string],special); },{ bang: true, - completer: function(filter){ + completer: function(context){ var completionList = new Array(); var exts = TomblooService.Tombloo.Service.check(getContext()); - for(let i=0,l=exts.length; i < l; i++) - if(exts[i].name.indexOf(filter) > -1) - completionList.push([exts[i].name,exts[i].name]); - return [0,completionList]; + context.title = ['Tombloo']; + context.completions = [[exts[i].name, exts[i].name] for(i in exts)].filter(function($_) this.test($_[0]), new RegExp(context.filter, 'i')) } } ); |