diff options
Diffstat (limited to 'ubiquity.js')
-rw-r--r-- | ubiquity.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ubiquity.js b/ubiquity.js index 35c11b1..1947ec5 100644 --- a/ubiquity.js +++ b/ubiquity.js @@ -1,7 +1,7 @@ /** * ==VimperatorPlugin== * @name Ubiquity Glue - * @description Vimperator-plugin for Ubiquity + * @description viperator-plugin for Ubiquity * @depend Ubiquity (ubiquity@labs.mozilla.com) * @version 0.1.1a * ==/VimperatorPlugin== @@ -32,14 +32,14 @@ if (!Application.extensions.has(ubiquityID) || !Application.extensions.get(ubiqu Components.utils.reportError('Vimperator: UbiquityGlue: Ubiquity is not installed'); return null; } -function preExec(target, name, func){ +function preExec(target,name,func){ var original = target[name]; target[name] = function(){ - var result = func.apply(this, arguments); + var result = func.apply(this,arguments); var tmp = null; - if (result != false) tmp = original.apply(target, arguments); + if (result != false) tmp = original.apply(target,arguments); return tmp; - }; + } } preExec(events, 'onEscape', function(){ @@ -55,7 +55,7 @@ preExec(commandline, 'open', function(){ // XXX:選択範囲が必要な操作が現状上手く動かない.不便であればコメントアウトしてください. preExec(gUbiquity, 'openWindow', function(anchor, flag){ if(!flag) { - liberator.commandline.open(':', 'ubiquity ', liberator.modes.EX); + commandline.open(':', 'ubiquity ', modes.EX); return false; } }); @@ -63,7 +63,7 @@ preExec(gUbiquity, 'openWindow', function(anchor, flag){ // ------------------------------------------------- // Command // ------------------------------------------------- -commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', +commands.addUserCommand(['ubi[quity]'],'Vimperator Ubiquity Glue', function(args){ args = (typeof args.string == 'undefined') ? args: args.string; if (!args){ @@ -71,7 +71,7 @@ commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', return; } ubiquityManager.execute(args); - }, { + },{ completer: function(filter){ return ubiquityManager.completer(filter); } @@ -110,10 +110,10 @@ var ubiquityManager = { } }, completer: function(args){ - var matches = args.match(/(\S+)(?:\s+(.+)$)?/); + var matches = args.match(/([^\s]+)(?:\s+(.+)$)?/); var suggestions = []; - for (let cmd in this.commands){ - suggestions.push([cmd, this.commands[cmd].description]); + for (var cmd in this.commands){ + suggestions.push([cmd , this.commands[cmd].description]); } if (!matches){ return [0, suggestions]; |