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 --- appendAnchor.js | 2 +- applauncher.js | 2 +- autoproxychanger.js | 6 +++--- command_menu.js | 2 +- direct_bookmark.js | 8 ++++---- direct_hb.js | 2 +- encodingSwitcherCommand.js | 32 ++++++++++++++++---------------- every.js | 4 ++-- exopen.js | 2 +- gmperator.js | 2 +- hateDAopener.js | 6 +++--- hatenaStar.js | 9 +++------ ldrize_cooperation.js | 2 +- ldrize_cooperation_fetch_flv.js | 2 +- lo.js | 10 +++++----- localkeymode.js | 2 +- lookupDictionary.js | 4 ++-- matanico.js | 4 ++-- migemized_find.js | 11 ++++------- mixiecho.js | 7 +++---- nico_related_videos.js | 10 +++++----- nicontroller.js | 8 ++++---- readcatlater.js | 17 +++++++---------- refcontrol.js | 2 +- speeddial.js | 7 ++++--- statstat.js | 4 ++-- stella.js | 6 +++--- tabsort.js | 3 +-- tombloo.js | 4 ++-- twissr.js | 4 ++-- uaSwitch.js | 11 +++++------ uaSwitchLite.js | 2 +- ubiquity.js | 2 +- ubiquityNeta.js | 4 ++-- unicode.js | 4 ++-- wassr.js | 3 ++- 36 files changed, 100 insertions(+), 110 deletions(-) diff --git a/appendAnchor.js b/appendAnchor.js index ac6a05c..3d32538 100644 --- a/appendAnchor.js +++ b/appendAnchor.js @@ -53,7 +53,7 @@ let PLUGIN_INFO = // register command liberator.modules.commands.addUserCommand(['anc'], 'append anchors to texts look like url', - function(arg, special) { + function(arg) { const doc = window.content.document; const range = doc.createRange(); diff --git a/applauncher.js b/applauncher.js index ae28700..c03cfe5 100644 --- a/applauncher.js +++ b/applauncher.js @@ -58,7 +58,7 @@ liberator.plugins.AppLauncher = (function(){ arg = (typeof arg.string == 'undefined' ? arg : arg.string); self.launch(arg); }, { - completer: function( context, arg, special){ + completer: function(context, arg){ var filter = context.filter; context.title = [ 'Name', 'Description']; if (!filter){ diff --git a/autoproxychanger.js b/autoproxychanger.js index 47c78f3..0fdb1f2 100644 --- a/autoproxychanger.js +++ b/autoproxychanger.js @@ -259,12 +259,12 @@ function applyProxy(proxy) { } commands.addUserCommand(['proxy'], 'Proxy settings', - function(args, bang) { - if (bang) applyProxyByName('default'); + function(args) { + if (args.bang) applyProxyByName('default'); else applyProxyByName(args.string); }, { bang: true, - completer: function(context, arg, special) { + completer: function(context, arg) { context.title = ['Name', 'Usage']; var list = context.filter ? proxy_settings.filter( function(el) this.test(el.name), new RegExp('^'+context.filter)) diff --git a/command_menu.js b/command_menu.js index 8efcdbd..f101ee7 100644 --- a/command_menu.js +++ b/command_menu.js @@ -204,7 +204,7 @@ let PLUGIN_INFO = liberator.echoerr('menu not found'); }, { - completer: function (context, arg, bang) { + completer: function (context, arg) { const gps = function (it) getPathString(it, equal(root), getElementName, isClickable); const fp = function (it) [gps(it), it.tooltipText || '']; return [0, _find(context.filter).map(fp)]; diff --git a/direct_bookmark.js b/direct_bookmark.js index dbec3f4..9b65b6c 100644 --- a/direct_bookmark.js +++ b/direct_bookmark.js @@ -589,8 +589,8 @@ for Migemo search: require XUL/Migemo Extension liberator.modules.commands.addUserCommand(['btags'],"Update Social Bookmark Tags", function(arg){setTimeout(function(){getTagsAsync().call([])},0)}, {}); liberator.modules.commands.addUserCommand(['bentry'],"Goto Bookmark Entry Page", - function(service, special){ - service = service.string || useServicesByPost.split(/\s*/)[0]; + function(args){ + var service = args.string || useServicesByPost.split(/\s*/)[0]; var currentService = services[service] || null; if(!currentService || !currentService.entryPage) { return; @@ -616,7 +616,7 @@ for Migemo search: require XUL/Migemo Extension } return ascii.join('').toLowerCase(); } - }), special ? liberator.NEW_TAB : liberator.CURRENT_TAB); + }), args.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); },{ completer: function(filter) [0, useServicesByPost.split(/\s*/).map(function(p) [p, services[p].description])] @@ -673,7 +673,7 @@ for Migemo search: require XUL/Migemo Extension d.error(function(e){liberator.echoerr("direct_bookmark.js: Exception throwed! " + e);liberator.log(e);}); setTimeout(function(){first.call();},0); },{ - completer: function(context, arg, special){ + completer: function(context, arg){ let filter = context.filter; var match_result = filter.match(/((?:\[[^\]]*\])*)\[?(.*)/); //[all, commited, now inputting] var m = new RegExp(XMigemoCore && isUseMigemo ? "^(" + XMigemoCore.getRegExp(match_result[2]) + ")" : "^" + match_result[2],'i'); diff --git a/direct_hb.js b/direct_hb.js index 040a8d6..3d2183c 100644 --- a/direct_hb.js +++ b/direct_hb.js @@ -199,7 +199,7 @@ } addHatenaBookmarks(hatenaUser,hatenaPassword,modules.buffer.URL,arg,isNormalize); },{ - completer: function(context, arg, special){ + completer: function(context, arg){ let filter = context.filter; //var match_result = filter.match(/(.*)\[(\w*)$/); //[all, commited, now inputting] var match_result = filter.match(/((?:\[[^\]]*\])+)?\[?(.*)/); //[all, commited, now inputting] diff --git a/encodingSwitcherCommand.js b/encodingSwitcherCommand.js index 8071313..309fd59 100644 --- a/encodingSwitcherCommand.js +++ b/encodingSwitcherCommand.js @@ -96,10 +96,10 @@ liberator.modules.commands.addUserCommand(['fileencoding','fenc'],'set the chara } }, { - completer: function(context, arg, special){ - let filter = context.filter; - context.completions = completion( encodings, filter); - } + completer: function(context){ + let filter = context.filter; + context.completions = completion(encodings, filter); + } } ); liberator.modules.commands.addUserCommand(['autodetector','audet'],'set auto detect character encoding', function(args) { @@ -128,10 +128,10 @@ liberator.modules.commands.addUserCommand(['autodetector','audet'],'set auto det } }, { - completer: function(context, arg, special){ - let filter = context.filter; - context.completions = completion( detectors, filter); - } + completer: function(context, arg){ + let filter = context.filter; + context.completions = completion(detectors, filter); + } } ); function listCharset(arg, current, list){ @@ -157,10 +157,10 @@ liberator.modules.commands.addUserCommand(['listencoding','lsenc'],'list all enc var arg = args.string == undefined ? args: args.string; listCharset(arg, liberator.modules.options.fileencoding, encodings); },{ - completer: function(context, arg, special){ - let filter = context.filter; - context.completions = completion( encodings, filter); - } + completer: function(context, arg){ + let filter = context.filter; + context.completions = completion(encodings, filter); + } } ); liberator.modules.commands.addUserCommand(['listdetector','lsdet'],'list all auto detectors', @@ -168,10 +168,10 @@ liberator.modules.commands.addUserCommand(['listdetector','lsdet'],'list all aut var arg = args.string == undefined ? args: args.string; listCharset(arg, liberator.modules.options.autodetector, detectors); },{ - completer: function(context, arg, special){ - let filter = context.filter; - context.completions = completion( detectors, filter); - } + completer: function(context, arg){ + let filter = context.filter; + context.completions = completion(detectors, filter); + } } ); diff --git a/every.js b/every.js index 24a9c2f..94e5544 100644 --- a/every.js +++ b/every.js @@ -155,7 +155,7 @@ let PLUGIN_INFO = liberator.modules.commands.addUserCommand( ['delay'], 'delay', - function (arg, bang, count) { + function (arg) { let cmd = arg.string; let f = function () { if (liberator.mode == liberator.modules.modes.COMMAND_LINE) { @@ -164,7 +164,7 @@ let PLUGIN_INFO = liberator.execute(cmd); } }; - setTimeout(f, msec(count)); + setTimeout(f, msec(arg.count)); }, { count: true, diff --git a/exopen.js b/exopen.js index 696f102..c1d7029 100644 --- a/exopen.js +++ b/exopen.js @@ -7,7 +7,7 @@ var PLUGIN_INFO = 2.0pre http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/exopen.js pekepekesamurai -0.10 +0.10.1 http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/hateDAopener.js snaka MIT style license - 1.1.0 + 1.1.1 Add Hatena Star. はてなスターをつける。 mattn - 0.1.1 + 0.1.2 2.2pre 2.2pre http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/hatenaStar.js @@ -57,9 +57,9 @@ function addHatenaStar (elem) { } liberator.modules.commands.addUserCommand(['hatenastar', 'hatenas'], 'add Hatena Star', - function (arg, special) { + function (args) { try { - arg = arg.string; + var arg = args.string; let result = buffer.evaluateXPath(StarXPath); let m = arg.match(/^(\d+)\?$/); if (m) { @@ -72,9 +72,6 @@ liberator.modules.commands.addUserCommand(['hatenastar', 'hatenas'], 'add Hatena } } } catch (e) { liberator.echoerr('hatenaStar: ' + e); } - }, { - bang: true, - count: true } ); diff --git a/ldrize_cooperation.js b/ldrize_cooperation.js index 1836f0f..1d0ae32 100644 --- a/ldrize_cooperation.js +++ b/ldrize_cooperation.js @@ -255,7 +255,7 @@ if (liberator.plugins.LDRizeCooperation == undefined) (function(){ liberator.modules.commands.addUserCommand(["mb","m","minibuffer"],"Execute Minibuffer", function(arg){ self.Minibuffer.execute(arg.string.replace(/\\+/g,"")) }, { - completer: function(context,arg,special){ + completer: function(context,arg){ var filter = context.filter; var completionList = []; var command = self.Minibuffer.command; diff --git a/ldrize_cooperation_fetch_flv.js b/ldrize_cooperation_fetch_flv.js index 42d5347..423fe47 100644 --- a/ldrize_cooperation_fetch_flv.js +++ b/ldrize_cooperation_fetch_flv.js @@ -286,7 +286,7 @@ liberator.modules.commands.addUserCommand( groupId = arg.string; }, { - completer: function(context,arg,special){ + completer: function(context,arg){ Deferred.http.get(nicoWatchEndPoint + "sm2757983").next(function(watchResult){ var html = parseHTML(watchResult.responseText, ['img', 'script']); var mylists = getElementsByXPath('id("mylist_add_group_id")/option', html).map(function(element) [element.value, element.innerHTML]); diff --git a/lo.js b/lo.js index d91d742..6860410 100644 --- a/lo.js +++ b/lo.js @@ -79,8 +79,8 @@ commands.addUserCommand( ['fo[pen]', 'filteropen'], 'Filtered open', - function (args, bang) { - let where = charToWhere(args['-where'], bang ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); + function (args) { + let where = charToWhere(args['-where'], args.bang ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); let [i, links] = [1, filteredLinks(args.join(''))]; if (!links.length) return; @@ -105,7 +105,7 @@ [['-interval', '-i'], commands.OPTION_INT], [['-where', '-w'], commands.OPTION_STRING], ], - completer: function (context, arg, bang) { + completer: function (context, arg) { context.title = ['URL', 'Text Content']; context.completions = filteredLinks(context.filter).map(function (it) ([it.href, it.textContent])); }, @@ -131,8 +131,8 @@ commands.addUserCommand( ['lo[pen]', 'linkopen'], 'Filtered open', - function (args, bang) { - let where = charToWhere(args['-where'], bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); + function (args) { + let where = charToWhere(args['-where'], args.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); let numUrl = args[0]; let m = numUrl.match(/^(\d+),(.+)$/); if (m) { diff --git a/localkeymode.js b/localkeymode.js index e27468c..4bec49e 100644 --- a/localkeymode.js +++ b/localkeymode.js @@ -312,7 +312,7 @@ liberator.plugins.LocalKeyMode = (function() { } } }, { - completer: function(context, arg, special) { + completer: function(context, arg) { let filter = context.filter; var names = self.completeNames; context.title = ['Name','Description']; diff --git a/lookupDictionary.js b/lookupDictionary.js index ae821d5..a7e0ea9 100644 --- a/lookupDictionary.js +++ b/lookupDictionary.js @@ -148,12 +148,12 @@ SITE_DEFINITION.forEach(function (dictionary) { commands.addUserCommand( dictionary.names, dictionary.shortHelp, - function (args,special) { + function (args) { var arg = args.string; var sel = (window.content.window.getSelection) ? window.content.window.getSelection().toString() : null; - if (special && sel) arg = sel; + if (args.bang && sel) arg = sel; if (!arg) return; var url; if (dictionary.urlEncode) { diff --git a/matanico.js b/matanico.js index 1225a7f..48dea01 100644 --- a/matanico.js +++ b/matanico.js @@ -260,7 +260,7 @@ let scraper = new NicoScraper(); liberator.modules.commands.addUserCommand( ['matanico'], 'update Twitter status to current video/search page information and comment', - function (args, special) { + function (args) { let arg = args.string; try { // build post string ----- @@ -285,7 +285,7 @@ liberator.modules.commands.addUserCommand( } // ':matanico!' display the evaluated format. - if (special) { + if (args.bang) { liberator.modules.util.copyToClipboard(postString, true); return; } diff --git a/migemized_find.js b/migemized_find.js index 70c1163..f6cf70c 100644 --- a/migemized_find.js +++ b/migemized_find.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = Migemized Find Migemize default page search. デフォルトのドキュメント内検索をミゲマイズする。 - 2.9.2 + 2.9.3 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -649,14 +649,11 @@ let PLUGIN_INFO = ['rml', 'removemigelight'], 'Remove migelight', function (args) { - // HEAD (2) - if (args != undefined) - args = args.string; - if (!args) + if (!args.string) return MF.removeHighlight(MF.highlightColor); - if (args == 'all') + if (args.string == 'all') return [f() for each (f in MF.storage.highlightRemovers)]; - args.split(/\s+/).forEach(MF.removeHighlight, MF); + args.string.split(/\s+/).forEach(MF.removeHighlight, MF); } ); diff --git a/mixiecho.js b/mixiecho.js index 953588f..2f27b7c 100644 --- a/mixiecho.js +++ b/mixiecho.js @@ -111,12 +111,11 @@ xhr.send(params.join('&')); } commands.addUserCommand(["mixiecho"], "Change mixi echo", - function(arg, special){ - arg = arg.string; - if (special || arg.length == 0) + function(arg){ + if (arg.bang || arg.string.length == 0) showFollowersStatus() else - sayEcho(arg); + sayEcho(arg.string); },{ bang: true } diff --git a/nico_related_videos.js b/nico_related_videos.js index 40700ec..14bcc97 100644 --- a/nico_related_videos.js +++ b/nico_related_videos.js @@ -2,7 +2,7 @@ // @name Nico Related Videos // @description-ja ニコニコ動画のオススメ動画のリスト // @license Creative Commons 2.1 (Attribution + Share Alike) -// @version 1.3.0 +// @version 1.3.1 // ==/VimperatorPlugin== // // Author: @@ -78,8 +78,8 @@ commands.addUserCommand( ['nicorelated'], 'niconico related videos', - function (url, bang) { - (url.string === undefined) || (url = url.string); + function (args) { + let url = args.string; url = (function () { if (url == nothing) return 'http://www.nicovideo.jp/'; @@ -90,11 +90,11 @@ if (url.indexOf('http://') == -1) return 'http://www.nicovideo.jp/search/' + encodeURIComponent(url); })() || url; - liberator.open(url, bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); + liberator.open(url, args.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); }, { bang: true, - completer: function (context, arg, bang) { + completer: function (context, arg) { if ((buffer.URL != last.url) || !last.completions.length) { last.completions = []; getRelatedVideos().forEach(function (it) last.completions.push([it.url, it.title])); diff --git a/nicontroller.js b/nicontroller.js index 4add0bf..bf531c7 100644 --- a/nicontroller.js +++ b/nicontroller.js @@ -486,12 +486,12 @@ liberator.modules.commands.addUserCommand( liberator.modules.commands.addUserCommand( ['nicoseek'], 'controll seek bar', - function(args, special) { + function(args) { try { let arg = (args.length > 1) ? args[0].toString() : args.string; - special ? controller.seekBy(arg) : controller.seekTo(arg); + args.bang ? controller.seekBy(arg) : controller.seekTo(arg); } catch(e) { liberator.echoerr(e); } }, @@ -503,12 +503,12 @@ liberator.modules.commands.addUserCommand( liberator.modules.commands.addUserCommand( ['nicovolume'], 'controll volume', - function(args, special) { + function(args) { try { let arg = (args.length > 1) ? args[0].toString() : args.string; - special ? controller.volumeBy(arg) : controller.volumeTo(arg); + args.bang ? controller.volumeBy(arg) : controller.volumeTo(arg); } catch(e) { liberator.echoerr(e); } }, diff --git a/readcatlater.js b/readcatlater.js index bc5688b..065ab1b 100644 --- a/readcatlater.js +++ b/readcatlater.js @@ -245,7 +245,7 @@ let PLUGIN_INFO = return liberator.globalVariables.readcatlater_reverse ? result.reverse() : result; } catch (e) { liberator.log(e); } } - function completer (context, arg, bang) { + function completer (context, arg) { context.title = ['URL', 'Title']; context.completions = RCL_Bookmarks(context.filter). filter(function (it) it.id). @@ -269,11 +269,8 @@ let PLUGIN_INFO = commands.addUserCommand( ['readcatlater', 'rcl'], 'read cat later', - function (args, _, num, extra) { - // for HEAD - if (args.string != undefined) - args = args.string; - var res = addEntry(window.content.document, splitBySpaces(args)); + function (args) { + var res = addEntry(window.content.document, splitBySpaces(args.string)); if (res) liberator.echo('"' + buffer.title + '" was added'); else @@ -286,20 +283,20 @@ let PLUGIN_INFO = commands.addUserCommand( ['readcatnow', 'rcn'], 'read cat now', - function (arg, bang, num, extra) { + function (arg) { let opennum = arg['-number']; if (opennum) { liberator.log(typeof opennum) let us = RCL_Bookmarks(arg.literalArg).reverse().splice(0, opennum).map(function (it) it.URI); liberator.open(us, liberator.NEW_BACKGROUND_TAB); - if (!bang) { + if (!arg.bang) { us.forEach(removeItems); liberator.echo('[' + us + '] was removed.'); } } else { let uri = arg.string; openURI(uri); - if (!bang && removeItems(uri)) + if (!arg.bang && removeItems(uri)) liberator.echo('"' + uri + '" was removed.'); } }, @@ -314,7 +311,7 @@ let PLUGIN_INFO = commands.addUserCommand( ['deletecatnow', 'dcn'], 'delete cat now', - function (arg, bang, num, extra) { + function (arg) { let uri = arg.string; if (removeItems(uri)) liberator.echo('"' + uri + '" was removed.'); diff --git a/refcontrol.js b/refcontrol.js index 890dc4d..c556471 100644 --- a/refcontrol.js +++ b/refcontrol.js @@ -138,7 +138,7 @@ commands.addUserCommand(['addref'], 'add referrer control setting', function(arg } sites[domain] = perf; }, { - completer: function(context, args, special) { + completer: function(context, args) { //var last = context.contextList.slice(-1)[0]; var list; var pos = 0; diff --git a/speeddial.js b/speeddial.js index 7c7a134..5530b1b 100644 --- a/speeddial.js +++ b/speeddial.js @@ -16,15 +16,16 @@ var nsISupportsString = Components.interfaces.nsISupportsWString || Components.interfaces.nsISupportsString; liberator.modules.commands.addUserCommand(["sd", "speeddial"], "speeddial", - function(arg, special){ - arg = arg.string; + function(args){ + var arg = args.string; if (arg.match(/^[0-9]+$/)) arg = pref.getComplexValue("extensions.speeddial.thumbnail-" + arg + "-url", nsISupportsString).data; else if (arg.length == 0) arg = "chrome://speeddial/content/speeddial.xul"; - liberator.open(arg, special ? liberator.NEW_TAB : liberator.CURRENT_TAB); + liberator.open(arg, args.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); }, { + bang: true, completer: function(filter) { candidates = []; for (var n = 1; n <= 9; n++) { diff --git a/statstat.js b/statstat.js index 6e0bc6d..ff74471 100644 --- a/statstat.js +++ b/statstat.js @@ -85,10 +85,10 @@ commands.addUserCommand( ['statstat'], 'Run statstat', - function (arg, bang, count) { + function (arg) { if (stat.handle) clearInterval(stat.handle); - let interval = count ? count * 100 : 100; + let interval = arg.count ? arg.count * 100 : 100; stat.action = e2a(arg.string); stat.handle = setInterval(function () stat.execute(), interval); }, diff --git a/stella.js b/stella.js index 54e84b7..5bcb9a3 100644 --- a/stella.js +++ b/stella.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = すてら For Niconico/YouTube, Add control commands and information display(on status line). ニコニコ動画/YouTube 用。操作コマンドと情報表示(ステータスライン上に)追加します。 - 0.20.6 + 0.20.7 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -1372,11 +1372,11 @@ Thanks: cmdName.replace(/[\[\]]+/g, '') + ' - Stella', (funcS instanceof Function) ? funcS - : function (arg, bang) { + : function (arg) { if (!self.isValid) U.raise('Stella: Current page is not supported'); let p = self.player; - let func = bang ? funcB : funcS; + let func = arg.bang ? funcB : funcS; if (p.has(func, 'rwt')) p.toggle(func); else if (p.has(func, 'rw')) diff --git a/tabsort.js b/tabsort.js index e52b286..e140358 100755 --- a/tabsort.js +++ b/tabsort.js @@ -95,11 +95,10 @@ let PLUGIN_INFO = commands.addUserCommand( ['tabso[rt]'], 'Sort tabs', - function (arg, bang) { + function (arg) { tabSort(memberCompare(arg['-target'] || 'title')); }, { - bang: false, argCount: '0', options: [ [['-target', '-t'], commands.OPTION_STRING, targetValidater, targetOptions], diff --git a/tombloo.js b/tombloo.js index c5f7744..aee9fd7 100644 --- a/tombloo.js +++ b/tombloo.js @@ -75,7 +75,7 @@ commands.addUserCommand( commands.addUserCommand( ['tombloo'], 'Post by Tombloo', - function (args, special) { + function (args) { //let f = Tombloo.Service.extractors[args.string]; let arg = args.string.replace(/\\(?=\u0020)/g, ''); liberator.log(args.string, 0); @@ -83,7 +83,7 @@ commands.addUserCommand( let f = Tombloo.Service.extractors[arg]; (typeof f === 'object') - ? Tombloo.Service.share(getContext(), f, special) + ? Tombloo.Service.share(getContext(), f, args.bang) : liberator.echoerr(args.string + ' is not Tombloo command'); }, { diff --git a/twissr.js b/twissr.js index 33e926f..bd9ba51 100644 --- a/twissr.js +++ b/twissr.js @@ -5,8 +5,8 @@ (function(){ liberator.modules.commands.addUserCommand(["twissr"], "Change Twitter & Wassr status", - function(arg, special){ - arg = (special ? '! ' : ' ') + arg.string; + function(arg){ + arg = (arg.bang ? '! ' : ' ') + arg.string; liberator.execute('twitter' + arg); liberator.execute('wassr' + arg); }, 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])] }); })(); diff --git a/uaSwitchLite.js b/uaSwitchLite.js index 2bfcf93..2b6d796 100644 --- a/uaSwitchLite.js +++ b/uaSwitchLite.js @@ -128,7 +128,7 @@ UASwitcherLite.prototype = { function(arg) self.switcher[ (arg.string || arg+'').replace(/\\+/g,'') ](), { - completer: function(context, args, special){ + completer: function(context, args){ var filter = context.filter; context.title = ['Description', 'User Agent']; if (!filter) { diff --git a/ubiquity.js b/ubiquity.js index 64ec03e..c36f9a4 100644 --- a/ubiquity.js +++ b/ubiquity.js @@ -71,7 +71,7 @@ commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', } ubiquityManager.execute(args); }, { - completer: function(context, arg, special){ + completer: function(context, arg){ ubiquityManager.completer(context, arg.string) } }, diff --git a/ubiquityNeta.js b/ubiquityNeta.js index 5f8f341..6d5200b 100644 --- a/ubiquityNeta.js +++ b/ubiquityNeta.js @@ -8,7 +8,7 @@ (function() { if (typeof gUbiquity === 'undefined') return; liberator.commands.addUserCommand(["ubiquity"], "Ubiquity", - function(arg, special){ + function(arg){ var anchor = document.getElementById("content"); if (window.location == "chrome://browser/content/browser.xul") anchor = anchor.selectedBrowser; @@ -17,7 +17,7 @@ var context = gUbiquity.__makeContext(); var previewBlock = document.getElementById("cmd-preview").contentDocument.getElementById("preview"); gUbiquity.__cmdManager.updateInput(arg||'', context, previewBlock); - if (special) { + if (arg.special) { gUbiquity.__cmdManager.execute(context); gUbiquity.closeWindow(); } diff --git a/unicode.js b/unicode.js index 2278b99..a1076e3 100644 --- a/unicode.js +++ b/unicode.js @@ -68,8 +68,8 @@ let PLUGIN_INFO = commands.addUserCommand( ['unicode', 'uc'], 'unicode (un)escape', - function (arg, bang) - copyAndEcho((bang ? unescape : escape)(arg.string)), + function (arg) + copyAndEcho((arg.bang ? unescape : escape)(arg.string)), {argCount: '*', bang: true}, true ); diff --git a/wassr.js b/wassr.js index 451a9b6..5c027ac 100644 --- a/wassr.js +++ b/wassr.js @@ -258,7 +258,8 @@ liberator.echo(html, true); } liberator.modules.commands.addUserCommand(["wassr"], "Change wassr status", - function(arg, special){ + function(arg){ + var special = arg.bang; var password; var username; try { -- cgit v1.2.3