diff options
author | pekepeke | 2008-11-01 04:24:26 +0000 |
---|---|---|
committer | pekepeke | 2008-11-01 04:24:26 +0000 |
commit | 40f13ee987f551cb5bccfa8330e4738f1191c2a9 (patch) | |
tree | bc7e78689711875e384b207bc99eba104bf7cad9 /encodingSwitcherCommand.js | |
parent | adda95c12d27f64b046a9af4c36c9e40944d4c91 (diff) | |
download | vimperator-plugins-40f13ee987f551cb5bccfa8330e4738f1191c2a9.tar.bz2 |
handling for 2.0pre
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22491 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'encodingSwitcherCommand.js')
-rw-r--r-- | encodingSwitcherCommand.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/encodingSwitcherCommand.js b/encodingSwitcherCommand.js index 8ca0982..bf3cba6 100644 --- a/encodingSwitcherCommand.js +++ b/encodingSwitcherCommand.js @@ -80,7 +80,8 @@ function completion(array, filter){ return array.filter(function(v) v[0].toLowerCase().indexOf(filter) == 0); } -liberator.commands.addUserCommand(['fileencoding','fenc'],'set the charactor encoding for the current page', function(value) { +liberator.modules.commands.addUserCommand(['fileencoding','fenc'],'set the charactor encoding for the current page', function(args) { + var value = args.string == undefined ? args: args.string; if(!value) { var fenc = getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset; liberator.echo("fileencoding: "+fenc); @@ -99,7 +100,8 @@ liberator.commands.addUserCommand(['fileencoding','fenc'],'set the charactor enc [0,completion( encodings, filter)] } ); -liberator.commands.addUserCommand(['autodetector','audet'],'set auto detect character encoding', function(value) { +liberator.modules.commands.addUserCommand(['autodetector','audet'],'set auto detect character encoding', function(args) { + var value = args.string == undefined ? args: args.string; var pref = Cc['@mozilla.org/preferences-service;1'].getService(Ci.nsIPrefBranch); if(!value) { var audet = pref.getComplexValue('intl.charset.detector',Ci.nsISupportsString).data; @@ -146,17 +148,19 @@ function listCharset(arg, current, list){ str.push('</table>'); liberator.echo( str.join(''), true); } -liberator.commands.addUserCommand(['listencoding','lsenc'],'list all encodings', - function(arg){ - listCharset(arg, liberator.options.fileencoding, encodings); +liberator.modules.commands.addUserCommand(['listencoding','lsenc'],'list all encodings', + function(args){ + var arg = args.string == undefined ? args: args.string; + listCharset(arg, liberator.modules.options.fileencoding, encodings); },{ completer: function(filter) [0,completion(encodings, filter)] } ); -liberator.commands.addUserCommand(['listdetector','lsdet'],'list all auto detectors', - function(arg){ - listCharset(arg, liberator.options.autodetector, detectors); +liberator.modules.commands.addUserCommand(['listdetector','lsdet'],'list all auto detectors', + function(args){ + var arg = args.string == undefined ? args: args.string; + listCharset(arg, liberator.modules.options.autodetector, detectors); },{ completer: function(filter) [0,completion(detectors, filter)] |