diff options
Diffstat (limited to 'uaSwitch.js')
-rw-r--r-- | uaSwitch.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/uaSwitch.js b/uaSwitch.js index 4f2f39c..1aa9f4c 100644 --- a/uaSwitch.js +++ b/uaSwitch.js @@ -26,14 +26,13 @@ });
// register Vimperator command
- liberator.modules.commands.addUserCommand(['ua'], 'Switch User Agent', function(arg, special){
- arg = arg.string;
- if (special) useragentswitcher_options();
- else if (!arg) liberator.echo('UserAgent: ' + getItems().filter(function(n) n.checked)[0].label);
- else window.eval(getItems().filter(function(n) n.label == arg)[0].oncommand);
+ liberator.modules.commands.addUserCommand(['ua'], 'Switch User Agent', function(args){
+ if (args.bang) useragentswitcher_options();
+ else if (!arg.string) liberator.echo('UserAgent: ' + getItems().filter(function(n) n.checked)[0].label);
+ else window.eval(getItems().filter(function(n) n.label == arg.string)[0].oncommand);
}, {
bang: true,
- completer: function(filter, special)
+ completer: function(filter)
[0, getItems().map(function(n) [n.label, n.label])]
});
})();
|