aboutsummaryrefslogtreecommitdiffstats
path: root/stylechanger.js
AgeCommit message (Collapse)Author
2008-11-27Follow CVS Head.anekos
etc git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25172 d0d07461-0603-4401-acd4-de1884942a52
2008-11-03 * cosmetic changes.drry
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22654 d0d07461-0603-4401-acd4-de1884942a52
2008-10-06vimp CVS Headに追従(bang[!])の仕様変更に対して)teramako
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20854 d0d07461-0603-4401-acd4-de1884942a52
2008-10-01getCSSFiles の返り血が入れ子になってしまっているのを修正anekos
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20388 d0d07461-0603-4401-acd4-de1884942a52
2008-09-26 * Array に対する `for each` を排除しました。drry
* ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19951 d0d07461-0603-4401-acd4-de1884942a52
2008-09-25CVS HEADに対応(set ↵trapezoid
runtimepathでの読み込み先ディレクトリの複数指定に対応) git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19900 d0d07461-0603-4401-acd4-de1884942a52
2008-08-15highlightコマンドが動いていなかったのを修正teramako
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@17677 d0d07461-0603-4401-acd4-de1884942a52
2008-04-28bug fix and something a littileteramako
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@10692 d0d07461-0603-4401-acd4-de1884942a52
2008-04-25highlightコマンドの仕様変更: ↵teramako
一時的なstyleの適用/削除を可能にした altcolorschmeコマンドの追加: alternative styleの変更用に git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@10482 d0d07461-0603-4401-acd4-de1884942a52
2008-04-13lang/javascript/vimperator-plugins/trunk/stylechanger.js: teramako
・liberator.plugins.styleSheetsMangerへオブジェクト名を変更 ・その他 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@9402 d0d07461-0603-4401-acd4-de1884942a52
2008-04-07lang/javascript/vimperator-plugins/trunk/stylechanger.js:drry
* 正規表現を修正しました。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@9101 d0d07461-0603-4401-acd4-de1884942a52
2008-04-05lang/javascript/vimperator-plugins/stylechanger.js : bug fix and comment addteramako
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@8904 d0d07461-0603-4401-acd4-de1884942a52
2008-04-05lang/javascript/vimperator-plugins/trunk/stylechanger.js:drry
* fixed a missing `,`. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@8900 d0d07461-0603-4401-acd4-de1884942a52
2008-04-05lang/javascript/vimperator-plugins/stylechanger.js : addteramako
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@8899 d0d07461-0603-4401-acd4-de1884942a52
ss="p">(target, name, func){ var original = target[name]; target[name] = function(){ var result = func.apply(this, arguments); var tmp = null; if (result != false) tmp = original.apply(target, arguments); return tmp; }; } preExec(events, 'onEscape', function(){ if (ubiquityManager.panel.state == 'open') gUbiquity.closeWindow(); }); var focusedWindow = null; var focusedElement = null; preExec(commandline, 'open', function(){ focusedWindow = document.commandDispatcher.focusedWindow; focusedElement = document.commandDispatcher.focusedElement; }); // XXX:選択範囲が必要な操作が現状上手く動かない.不便であればコメントアウトしてください. preExec(gUbiquity, 'openWindow', function(anchor, flag){ if(!flag) { commandline.open(':', 'ubiquity ', modes.EX); return false; } }); // ------------------------------------------------- // Command // ------------------------------------------------- commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue', function(args){ if (!args){ gUbiquity.openWindow(getBrowser(), true); return; } ubiquityManager.execute(args); }, { completer: function(context, arg){ ubiquityManager.completer(context, arg.string) } }, true ); // ------------------------------------------------- // Public Section // ------------------------------------------------- var ubiquityManager = { get panel(){ return gUbiquity.__msgPanel; }, get cmdManager(){ return gUbiquity.__cmdManager; }, get nlParser(){ return this.cmdManager.__nlParser; }, get commands(){ return this.cmdManager.__cmdSource.getAllCommands(); }, execute: function(cmds){ var context = this.getContext(); this.nlParser.updateSuggestionList(cmds, context); if (this.nlParser.getNumSuggestions() == 0){ liberator.echoerr('No such command'); return false; } var parsedSentence = this.nlParser.getSentence(0); try { parsedSentence.execute(context); } catch (e) { liberator.echoerr(e); } }, completer: function(context, args){ var matches = args.match(/(\S+)(?:\s+(.+)$)?/); var suggestions = []; for (let cmd in this.commands){ suggestions.push([cmd, this.commands[cmd].description]); } context.title = ['Command','Description']; if (!matches){ context.completions = suggestions; return; } var [cmd, arg] = [matches[1], matches[2]]; if (arg || (cmd && cmd in this.commands) ){ if ( (cmd in this.commands) && this.commands[cmd].preview){ this.getContext(); gUbiquity.__textBox.value = args; if (this.panel.state == 'closed') { gUbiquity.openWindow(getBrowser(), true); } gUbiquity.__updatePreview(); } } else if (cmd){ context.completions = suggestions.filter(function(command){return command[0].indexOf(cmd) == 0;}); return; } return [0, []]; }, getContext: function(){ gUbiquity.__focusedWindow = focusedWindow; gUbiquity.__focusedElement = focusedElement; return gUbiquity.__makeContext(); } }; return ubiquityManager; })(); // vim:ts=4 sw=4 et: