diff options
author | mattn | 2008-10-22 02:06:43 +0000 |
---|---|---|
committer | mattn | 2008-10-22 02:06:43 +0000 |
commit | 22bde63d6337b1bb97784253baeb7b5ceed7ca3d (patch) | |
tree | 51155e7192d710fcaa97f9e6d3c424fc1fdc997b /uaSwitch.js | |
parent | a9f0463950a5d2e51e68915aced881dc917fcd47 (diff) | |
download | vimperator-plugins-22bde63d6337b1bb97784253baeb7b5ceed7ca3d.tar.bz2 |
follow latest vimperator.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@21812 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'uaSwitch.js')
-rw-r--r-- | uaSwitch.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/uaSwitch.js b/uaSwitch.js index f759fd1..4f2f39c 100644 --- a/uaSwitch.js +++ b/uaSwitch.js @@ -26,11 +26,13 @@ });
// register Vimperator command
- liberator.commands.addUserCommand(['ua'], 'Switch User Agent', function(arg, special){
+ 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);
}, {
+ bang: true,
completer: function(filter, special)
[0, getItems().map(function(n) [n.label, n.label])]
});
|