From 9f691e05aae8b0ad1c4f3fe559b0f2f2c9559ea2 Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 27 Aug 2009 12:37:51 +0000 Subject: Follow HEAD for http://vimperator.org/trac/gitweb/?p=liberator.git;a=commit;h=f20c2b315bb05c2e88d0c672f07dc229cc9267d2 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@35099 d0d07461-0603-4401-acd4-de1884942a52 --- uaSwitch.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'uaSwitch.js') 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])] }); })(); -- cgit v1.2.3