diff options
author | drry | 2008-11-03 15:38:28 +0000 |
---|---|---|
committer | drry | 2008-11-03 15:38:28 +0000 |
commit | 596c1ec007a3f431b84da3fed1a30871e8bd64dc (patch) | |
tree | 6e6fc3e053889d7a044e90eb0f4c5e7ec143084d | |
parent | b95f775693bc6aaa150c995cce9faa50aee45b4b (diff) | |
download | vimperator-plugins-596c1ec007a3f431b84da3fed1a30871e8bd64dc.tar.bz2 |
* fixed a typo.
* fixed a regex.
* et cetera.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22653 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | ubiquity.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ubiquity.js b/ubiquity.js index ab3881e..e1f152a 100644 --- a/ubiquity.js +++ b/ubiquity.js @@ -1,7 +1,7 @@ /** * ==VimperatorPlugin== * @name Ubiquity Glue - * @description viperator-plugin for Ubiquity + * @description Vimperator-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(){ @@ -63,14 +63,14 @@ preExec(gUbiquity, 'openWindow', function(anchor, flag){ // ------------------------------------------------- // Command // ------------------------------------------------- -commands.addUserCommand(['ubi[quity]'],'Vimperator Ubiquity Glue', +commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', function(args){ if (!args){ gUbiquity.openWindow(getBrowser(), true); return; } ubiquityManager.execute(args); - },{ + }, { completer: function(filter){ return ubiquityManager.completer(filter); } @@ -109,10 +109,10 @@ var ubiquityManager = { } }, completer: function(args){ - var matches = args.match(/([^\s]+)(?:\s+(.+)$)?/); + var matches = args.match(/(\S+)(?:\s+(.+)$)?/); var suggestions = []; - for (var cmd in this.commands){ - suggestions.push([cmd , this.commands[cmd].description]); + for (let cmd in this.commands){ + suggestions.push([cmd, this.commands[cmd].description]); } if (!matches){ return [0, suggestions]; |