Changeset 21797

Show
Ignore:
Timestamp:
10/21/08 19:27:41 (5 years ago)
Author:
janus_wel
Message:

liberator -> liberator.modules

  • buffer
  • commandline
  • commands
  • hints
  • ..etc

コマンド追加時に使う addUserCommand の第 3 引数に指定する関数の第 1 引数が String から Object に変更したのに対応

  • ldrize_cooperation_fetch_flv.js
  • lookupDictionary.js
  • matanico.js
  • nicontroller.js
  • nnp_cooperation.js
  • reading.js
  • youtubeamp.js

migemo_hint.js で一時的にグローバルオブジェクト plugins を定義
応急処置なのであとで削る必要あり

Location:
lang/javascript/vimperator-plugins/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/autoIgnoreKey.js

    r11680 r21797  
    4545function passAllKeysIfTarget() { 
    4646    var uri = content.document.documentURI; 
    47     liberator.modes.passAllKeys = isMatch(uri); 
     47    liberator.modules.modes.passAllKeys = isMatch(uri); 
    4848    //liberator.log('load page: ' + gBrowser.selectedBrowser.contentDocument.URL); 
    4949} 
  • lang/javascript/vimperator-plugins/trunk/direct_bookmark.js

    r19734 r21797  
    11// Vimperator plugin: 'Direct Post to Social Bookmarks' 
    22// Version: 0.12 
    3 // Last Change: 22-Sep-2008. Jan 2008 
     3// Last Change: 21-Oct-2008. Jan 2008 
    44// License: Creative Commons 
    55// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid 
     
    397397            }, 
    398398            icon:function(url){ 
    399                 var url = liberator.buffer.URL; 
     399                var url = liberator.modules.buffer.URL; 
    400400                var cryptoHash = Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash); 
    401401                cryptoHash.init(Ci.nsICryptoHash.MD5); 
     
    541541        return first; 
    542542    } 
    543     liberator.commands.addUserCommand(['btags'],"Update Social Bookmark Tags", 
     543    liberator.modules.commands.addUserCommand(['btags'],"Update Social Bookmark Tags", 
    544544        function(arg){setTimeout(function(){getTags().call([])},0)}, {}); 
    545     liberator.commands.addUserCommand(['bentry'],"Goto Bookmark Entry Page", 
     545    liberator.modules.commands.addUserCommand(['bentry'],"Goto Bookmark Entry Page", 
    546546        function(service, special){ 
    547547            service = service || useServicesByPost.split(/\s*/)[0]; 
     
    552552            liberator.open(currentService.entryPage 
    553553                .replace(/%URL(?:::(ESC|MD5))?%/g, function(x, t){ 
    554                     if(!t) return liberator.buffer.URL.replace(/#/, '%23'); 
    555                     if(t == "ESC") return encodeURIComponent(liberator.buffer.URL); 
     554                    if(!t) return liberator.modules.buffer.URL.replace(/#/, '%23'); 
     555                    if(t == "ESC") return encodeURIComponent(liberator.modules.buffer.URL); 
    556556                    if(t == "MD5"){ 
    557                         var url = liberator.buffer.URL; 
     557                        var url = liberator.modules.buffer.URL; 
    558558                        var cryptoHash = Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash); 
    559559                        cryptoHash.init(Ci.nsICryptoHash.MD5); 
     
    576576        } 
    577577    ); 
    578     liberator.commands.addUserCommand(['bicon'],"Show Bookmark Count as Icon", 
     578    liberator.modules.commands.addUserCommand(['bicon'],"Show Bookmark Count as Icon", 
    579579        function(arg){ 
    580             var url = getNormalizedPermalink(liberator.buffer.URL); 
     580            var url = getNormalizedPermalink(liberator.modules.buffer.URL); 
    581581            var html = useServicesByTag.split(/\s*/).map(function(service){ 
    582582                var currentService = services[service] || null; 
     
    586586            liberator.echo(html, true); 
    587587        }, {}); 
    588     liberator.commands.addUserCommand(['sbm'],"Post to Social Bookmark", 
     588    liberator.modules.commands.addUserCommand(['sbm'],"Post to Social Bookmark", 
    589589        function(arg){ 
    590590            var comment = ""; 
     
    616616            } 
    617617 
    618             var url = liberator.buffer.URL; 
    619             var title = liberator.buffer.title; 
     618            var url = liberator.modules.buffer.URL; 
     619            var title = liberator.modules.buffer.title; 
    620620 
    621621            targetServices.split(/\s*/).forEach(function(service){ 
     
    641641            }, 
    642642            options: [ 
    643                 [['-s','-service'], liberator.commands.OPTION_STRING], 
     643                [['-s','-service'], liberator.modules.commands.OPTION_STRING], 
    644644            ] 
    645645        } 
  • lang/javascript/vimperator-plugins/trunk/ldrize_cooperation.js

    r13815 r21797  
    11// Vimperator plugin: 'Cooperation LDRize Mappings' 
    22// Version: 0.21 
    3 // Last Change: 13-Jun-2008. Jan 2008 
     3// Last Change: 21-Oct-2008. Jan 2008 
    44// License: Creative Commons 
    55// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid 
     
    162162                if(sandbox.window.LDRize != undefined && sandbox.window.Minibuffer != undefined){ 
    163163                    sandbox.window.addEventListener("focus",function(){ 
    164                         self.LDRize = window.eval("self",sandbox.LDRize.getSiteinfo); 
    165                         self.Minibuffer = window.eval("command",sandbox.Minibuffer.addCommand); 
     164                        self.LDRize = sandbox.LDRize; 
     165                        self.Minibuffer = sandbox.Minibuffer.command; 
    166166                    },false); 
    167167                    if(window.content.wrappedJSObject == sandbox.unsafeWindow){ 
    168                         self.LDRize = window.eval("self",sandbox.LDRize.getSiteinfo); 
    169                         self.Minibuffer = window.eval("command",sandbox.Minibuffer.addCommand); 
     168                        self.LDRize = sandbox.LDRize; 
     169                        self.Minibuffer = sandbox.Minibuffer.command; 
    170170                    } 
    171171                } 
     
    175175            var self = this; 
    176176            keys.forEach(function(x){ 
    177                     var map = liberator.mappings.getDefault(null,x) || liberator.mappings.get(null,x); 
     177                    var map = liberator.modules.mappings.getDefault(null,x) || liberator.modules.mappings.get(null,x); 
    178178                    var oldAction = map.action; 
    179179                    var getter = "getPrev"; 
     
    198198            var self = this; 
    199199 
    200             var originalHinttags = liberator.options.hinttags; 
    201             var originalExtendedHinttags = liberator.options.hinttags; 
     200            var originalHinttags = liberator.modules.options.hinttags; 
     201            var originalExtendedHinttags = liberator.modules.options.hinttags; 
    202202 
    203203            function setHinttags(enable){ 
     
    205205                    var siteinfo = self.LDRize.getSiteinfo(); 
    206206                    if(siteinfo.link && siteinfo.paragraph){ 
    207                         liberator.options.hinttags = siteinfo.paragraph + "/" + siteinfo.link; 
    208                         liberator.options.extendedhinttags = siteinfo.paragraph + "/" + siteinfo.link; 
     207                        liberator.modules.options.hinttags = siteinfo.paragraph + "/" + siteinfo.link; 
     208                        liberator.modules.options.extendedhinttags = siteinfo.paragraph + "/" + siteinfo.link; 
    209209                    }else{ 
    210                         liberator.options.hinttags = originalHinttags; 
    211                         liberator.options.extendedhinttags = originalExtendedHinttags; 
     210                        liberator.modules.options.hinttags = originalHinttags; 
     211                        liberator.modules.options.extendedhinttags = originalExtendedHinttags; 
    212212                    } 
    213213                }else{ 
    214                     liberator.options.hinttags = originalHinttags; 
    215                     liberator.options.extendedhinttags = originalExtendedHinttags; 
     214                    liberator.modules.options.hinttags = originalHinttags; 
     215                    liberator.modules.options.extendedhinttags = originalExtendedHinttags; 
    216216                } 
    217217            } 
     
    219219 
    220220            //Mappings 
    221             liberator.mappings.addUserMap([liberator.modes.NORMAL], [",f"], 
     221            liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], [",f"], 
    222222                "Start QuickHint mode with LDRize", 
    223223                function(){ 
    224224                    setHinttags(true); 
    225                     liberator.hints.show(liberator.modes.QUICK_HINT); 
     225                    liberator.modules.hints.show(liberator.modules.modes.QUICK_HINT); 
    226226                    setHinttags(self.isEnableLDRizeCooperation() && self.isModHints); 
    227227                } ,{}); 
    228228 
    229             liberator.mappings.addUserMap([liberator.modes.NORMAL], ["f"], 
     229            liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], ["f"], 
    230230                "Start QuickHint mode", 
    231231                function(){ 
    232232                    setHinttags(self.isEnableLDRizeCooperation() && self.isModHints); 
    233                     liberator.hints.show(liberator.modes.QUICK_HINT); 
     233                    liberator.modules.hints.show(liberator.modules.modes.QUICK_HINT); 
    234234                },{}); 
    235235 
    236             liberator.mappings.addUserMap([liberator.modes.NORMAL], ["F"], 
     236            liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], ["F"], 
    237237                "Start QuickHint mode, but open link in a new tab", 
    238238                function(){ 
    239239                    setHinttags(self.isEnableLDRizeCooperation() && self.isModHints); 
    240                     liberator.hints.show(liberator.modes.QUICK_HINT, "t"); 
     240                    liberator.modules.hints.show(liberator.modules.modes.QUICK_HINT, "t"); 
    241241                },{}); 
    242242 
    243             liberator.mappings.addUserMap([liberator.modes.NORMAL], [";"], 
     243            liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], [";"], 
    244244                "Start an extended hint mode", 
    245245                function(arg){ 
     
    247247 
    248248                    if(arg == "f") 
    249                         liberator.hints.show(liberator.modes.ALWAYS_HINT, "o"); 
     249                        liberator.modules.hints.show(liberator.modules.modes.ALWAYS_HINT, "o"); 
    250250                    else if(arg == "F") 
    251                         liberator.hints.show(liberator.modes.ALWAYS_HINT, "t"); 
     251                        liberator.modules.hints.show(liberator.modules.modes.ALWAYS_HINT, "t"); 
    252252                    else 
    253                         liberator.hints.show(liberator.modes.EXTENDED_HINT, arg); 
     253                        liberator.modules.hints.show(liberator.modules.modes.EXTENDED_HINT, arg); 
    254254                }, 
    255                 { flags: liberator.Mappings.flags.ARGUMENT }); 
     255                { flags: liberator.modules.Mappings.flags.ARGUMENT }); 
    256256            //Commands 
    257             liberator.commands.addUserCommand(["pin"], "LDRize Pinned Links", 
     257            liberator.modules.commands.addUserCommand(["pin"], "LDRize Pinned Links", 
    258258                function(){ 
    259259                    var links = self.getPinnedItems(); 
     
    262262                        showString += link + "<br/>"; 
    263263                    }); 
    264                     liberator.commandline.echo(showString, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); 
     264                    liberator.modules.commandline.echo(showString, liberator.modules.commandline.HL_NORMAL, liberator.modules.commandline.FORCE_MULTILINE); 
    265265                } ,{}); 
    266             liberator.commands.addUserCommand(["mb","m","minibuffer"], "Execute Minibuffer", 
     266            liberator.modules.commands.addUserCommand(["mb","m","minibuffer"], "Execute Minibuffer", 
    267267                function(arg){self.Minibuffer.execute(arg)}, 
    268268                { 
     
    278278                    } 
    279279                }); 
    280             liberator.commands.addUserCommand(["pindownload"], "Download pinned links by any software", 
     280            liberator.modules.commands.addUserCommand(["pindownload"], "Download pinned links by any software", 
    281281                function(arg){ self.downloadLinksByProgram(self.getPinnedItems());} ,{}); 
    282             liberator.commands.addUserCommand(["toggleldrizecooperation","toggleldrc"], "Toggle LDRize Cooperation", 
     282            liberator.modules.commands.addUserCommand(["toggleldrizecooperation","toggleldrc"], "Toggle LDRize Cooperation", 
    283283            function(arg){ self.isEnable = !self.isEnable}, {}); 
    284284            //Options 
    285             liberator.options.add(['ldrc','ldrizecooperation'],'LDRize cooperation','boolean',this.isEnable, 
     285            liberator.modules.options.add(['ldrc','ldrizecooperation'],'LDRize cooperation','boolean',this.isEnable, 
    286286                { 
    287287                    setter: function(value){ self.isEnable = value; }, 
     
    289289                } 
    290290            ); 
    291             liberator.options.add(['ldrchints'],'mod hinttags for LDRize','boolean',this.isModHints, 
     291            liberator.modules.options.add(['ldrchints'],'mod hinttags for LDRize','boolean',this.isModHints, 
    292292                { 
    293293                    setter: function(value){ self.isModHints = value; }, 
     
    336336                            if(typeof x.handler == "object"){ 
    337337                                var args = x.handler[1].map(function(s){ return s.replace(/%URL%/g,url).replace(/%TITLE%/g,title); }); 
    338                                 liberator.io.run(x.handler[0],args,false); 
     338                                liberator.modules.io.run(x.handler[0],args,false); 
    339339                            }else if(typeof x.handler == "string"){ 
    340                                 liberator.io.run(x.handler,[url],false); 
     340                                liberator.modules.io.run(x.handler,[url],false); 
    341341                            }else if(typeof x.handler == "function"){ 
    342342                                x.handler(url.toString(),title); 
  • lang/javascript/vimperator-plugins/trunk/ldrize_cooperation_fetch_flv.js

    r8967 r21797  
    11// Vimperator plugin: 'Cooperation LDRize Mappings - Niconico Flv Fetchearg || liberator.buffer.URLr' 
    22// Version: 0.4 
    3 // Last Change: 06-Apr-2008. Jan 2008 
     3// Last Change: 21-Oct-2008. Jan 2008 
    44// License: Creative Commons 
    55// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid 
     
    6767        xhr.send(null); 
    6868    } 
    69     liberator.commands.addUserCommand(['fetchflv'],'Download flv file from Nicovideo', 
     69    liberator.modules.commands.addUserCommand(['fetchflv'],'Download flv file from Nicovideo', 
    7070        function(arg){ 
    71             httpGET(arg || liberator.buffer.URL,function(responseText){ 
     71            httpGET(arg.string || liberator.modules.buffer.URL,function(responseText){ 
    7272                var [,title] = responseText.match(/<title>(.*?)<\/title>/i); 
    7373                liberator.log(title); 
    74                 NiconicoFlvHandler(arg || liberator.buffer.URL,title); 
     74                NiconicoFlvHandler(arg.string || liberator.modules.buffer.URL,title); 
    7575            }); 
    7676        },{} 
  • lang/javascript/vimperator-plugins/trunk/lookupDictionary.js

    r21395 r21797  
    142142        dictionary.names, 
    143143        dictionary.shortHelp, 
    144         function(arg,special){ 
     144        function(args,special){ 
     145            var arg = args.string; 
     146 
    145147            var sel = (window.content.window.getSelection) ? 
    146148                window.content.window.getSelection().toString() : null; 
  • lang/javascript/vimperator-plugins/trunk/matanico.js

    r20930 r21797  
    55 * @description-ja  今見てる動画のタイトルとコメントを Twitter に投稿する 
    66 * @author          janus_wel <janus_wel@fb3.so-net.ne.jp> 
    7  * @version         0.60 
    8  * @minversion      1.1 
     7 * @version         0.62 
     8 * @minversion      2.0pre 2008/10/16 
    99 * ==VimperatorPlugin== 
    1010 * 
     
    9090NicoScraper.prototype = { 
    9191    constants: { 
    92         VERSION:          '0.50', 
     92        VERSION:          '0.62', 
    9393        WATCH_PAGE:       1, 
    9494        WATCH_URL:        '^http://www\\.nicovideo\\.jp/watch/[a-z]{2}\\d+', 
     
    118118    }, 
    119119 
    120     getURL: function() { return liberator.buffer.URL; }, 
     120    getURL: function() { return liberator.modules.buffer.URL; }, 
    121121 
    122122    getSubject: function() { 
     
    177177var scraper = new NicoScraper; 
    178178 
    179 liberator.commands.addUserCommand(['matanico'], "update Twitter's status to current video name and comment", 
    180     function(arg, special) { 
     179liberator.modules.commands.addUserCommand(['matanico'], "update Twitter's status to current video name and comment", 
     180    function(args, special) { 
    181181        try { 
     182            var arg = args.string; 
     183 
    182184            // build post string ----- 
    183185            var post_string; 
     
    239241            // ':matanico!' display the evaluated format. 
    240242            if(special) { 
    241                 liberator.util.copyToClipboard(post_string, true); 
     243                liberator.modules.util.copyToClipboard(post_string, true); 
    242244                return; 
    243245            } 
  • lang/javascript/vimperator-plugins/trunk/migemo_hint.js

    r14136 r21797  
    11// Vimperator plugin: 'Hint Matching with XUL/Migemo' 
    2 // Last Change: 16-Jun-2008. Jan 2008 
     2// Last Change: 21-Oct-2008. Jan 2008 
    33// License: Creative Commons 
    44// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid 
     
    2020    return function(hintString) r.test(hintString); 
    2121} 
     22 
     23plugins = {}; 
     24plugins.customHintMatcher = liberator.plugins.customHintMatcher; 
  • lang/javascript/vimperator-plugins/trunk/nicontroller.js

    r20930 r21797  
    55 * @description-ja  ニコニコ動画のプレーヤーをキーボードで操作できるようにする。 
    66 * @author          janus_wel <janus_wel@fb3.so-net.ne.jp> 
    7  * @version         0.52 
    8  * @minversion      1.2 
     7 * @version         0.53 
     8 * @minversion      2.0pre 2008/10/16 
    99 * ==VimperatorPlugin== 
    1010 * 
     
    7979// N 秒前にシークする。 
    8080// 指定なしの場合 10 秒前。 
    81 liberator.mappings.addUserMap( 
    82     [liberator.modes.NORMAL], 
     81liberator.modules.mappings.addUserMap( 
     82    [liberator.modules.modes.NORMAL], 
    8383    [',n-'], 
    8484    'seek by count backward', 
     
    8787        liberator.execute(':nicoseek! ' + '-' + count); 
    8888    }, 
    89     { flags: liberator.Mappings.flags.COUNT } 
     89    { flags: liberator.modules.Mappings.flags.COUNT } 
    9090); 
    9191 
     
    9393// N 秒後にシークする。 
    9494// 指定なしの場合 10 秒後。 
    95 liberator.mappings.addUserMap( 
    96     [liberator.modes.NORMAL], 
     95liberator.modules.mappings.addUserMap( 
     96    [liberator.modules.modes.NORMAL], 
    9797    [',n+'], 
    9898    'seek by count forward', 
     
    101101        liberator.execute(':nicoseek! ' + count); 
    102102    }, 
    103     { flags: liberator.Mappings.flags.COUNT } 
     103    { flags: liberator.modules.Mappings.flags.COUNT } 
    104104); 
    105105EOM 
     
    187187 
    188188    constants: { 
    189         VERSION:        '0.51', 
     189        VERSION:        '0.53', 
    190190 
    191191        CARDINAL_NUMBER:    10, 
     
    262262    }, 
    263263 
    264     getURL: function() { return liberator.buffer.URL; }, 
     264    getURL: function() { return liberator.modules.buffer.URL; }, 
    265265 
    266266    _flvplayer: function() { 
     
    413413 
    414414// command register 
    415 liberator.commands.addUserCommand( 
     415liberator.modules.commands.addUserCommand( 
    416416    ['nicoinfo'], 
    417417    'display player information', 
     
    422422                'controller version : ' + controller.getControllerVersion(), 
    423423            ].join("\n"); 
    424             liberator.echo(info, liberator.commandline.FORCE_MULTILINE); 
     424            liberator.echo(info, liberator.modules.commandline.FORCE_MULTILINE); 
    425425        } 
    426426        catch(e) { liberator.echoerr(e); } 
     
    429429); 
    430430 
    431 liberator.commands.addUserCommand( 
     431liberator.modules.commands.addUserCommand( 
    432432    ['nicopause'], 
    433433    'toggle play / pause', 
     
    439439); 
    440440 
    441 liberator.commands.addUserCommand( 
     441liberator.modules.commands.addUserCommand( 
    442442    ['nicomute'], 
    443443    'toggle mute', 
     
    449449); 
    450450 
    451 liberator.commands.addUserCommand( 
     451liberator.modules.commands.addUserCommand( 
    452452    ['nicommentvisible'], 
    453453    'toggle comment visible', 
     
    459459); 
    460460 
    461 liberator.commands.addUserCommand( 
     461liberator.modules.commands.addUserCommand( 
    462462    ['nicorepeat'], 
    463463    'toggle repeat', 
     
    469469); 
    470470 
    471 liberator.commands.addUserCommand( 
     471liberator.modules.commands.addUserCommand( 
    472472    ['nicoseek'], 
    473473    'controll seek bar', 
    474     function(arg, special) { 
    475         try      { special ? controller.seekBy(arg) : controller.seekTo(arg); } 
     474    function(args, special) { 
     475        try      { 
     476            var arg = (args.arguments.length > 1) 
     477                ? args.arguments[0].toString() 
     478                : args.string; 
     479            special ? controller.seekBy(arg) : controller.seekTo(arg); 
     480        } 
    476481        catch(e) { liberator.echoerr(e); } 
    477482    }, 
     
    481486); 
    482487 
    483 liberator.commands.addUserCommand( 
     488liberator.modules.commands.addUserCommand( 
    484489    ['nicovolume'], 
    485490    'controll volume', 
    486     function(arg, special) { 
    487         try      { special ? controller.volumeBy(arg) : controller.volumeTo(arg); } 
     491    function(args, special) { 
     492        try      { 
     493            var arg = (args.arguments.length > 1) 
     494                ? args.arguments[0].toString() 
     495                : args.string; 
     496            special ? controller.volumeBy(arg) : controller.volumeTo(arg); 
     497        } 
    488498        catch(e) { liberator.echoerr(e); } 
    489499    }, 
     
    493503); 
    494504 
    495 liberator.commands.addUserCommand( 
     505liberator.modules.commands.addUserCommand( 
    496506    ['nicosize'], 
    497507    'toggle video size', 
     
    503513); 
    504514 
    505 liberator.commands.addUserCommand( 
     515liberator.modules.commands.addUserCommand( 
    506516    ['nicodescription'], 
    507517    'toggle display or not the description for video', 
    508     function(arg) { 
     518    function() { 
    509519        try      { controller.toggleDescription(); } 
    510520        catch(e) { liberator.echoerr(e); } 
     
    513523); 
    514524 
    515 liberator.commands.addUserCommand( 
     525liberator.modules.commands.addUserCommand( 
    516526    ['nicomment'], 
    517527    'fill comment box', 
    518     function(arg) { 
     528    function(args) { 
    519529        try      { 
     530            var arg = args.string; 
     531 
    520532            var command, comment; 
    521533            [command, comment] = expandExCommand(arg); 
     
    535547); 
    536548 
    537 liberator.commands.addUserCommand( 
     549liberator.modules.commands.addUserCommand( 
    538550    ['nicommand'], 
    539551    'fill command box', 
    540552    function(arg) { 
    541         try      { controller.setValue('inputArea.MailInput.text', arg); } 
     553        try      { controller.setValue('inputArea.MailInput.text', arg.string); } 
    542554        catch(e) { liberator.echoerr(e); } 
    543555    }, 
    544556    { 
    545         completer: function(arg){ 
     557        completer: function(args){ 
     558            var arg = args.string; 
     559 
    546560            // get available commands by roll 
    547561            var availableCommands = controller.getAvailableCommands(); 
     
    593607    small:  38, 
    594608}; 
    595 const EMSP = ' '; 
     609const EMSP = '\u3000'; 
    596610const NBSP = '\u00a0'; 
    597611const LF = '\u000a'; 
  • lang/javascript/vimperator-plugins/trunk/nnp_cooperation.js

    r21342 r21797  
    66 * @author          janus_wel <janus_wel@fb3.so-net.ne.jp> 
    77 * @version         0.32 
    8  * @minversion      1.2 
     8 * @minversion      2.0pre 2008/10/16 
    99 * ==VimperatorPlugin== 
    1010 * 
     
    6363// N 番目の動画を再生する。 
    6464// 指定なしの場合次の動画が再生される。 
    65 liberator.mappings.addUserMap( 
    66     [liberator.modes.NORMAL], 
     65liberator.modules.mappings.addUserMap( 
     66    [liberator.modules.modes.NORMAL], 
    6767    [',nn'], 
    6868    'play next item in NicoNicoPlaylist', 
     
    7171        liberator.execute(':nnpplaynext ' + count); 
    7272    }, 
    73     { flags: liberator.Mappings.flags.COUNT } 
     73    { flags: liberator.modules.Mappings.flags.COUNT } 
    7474); 
    7575 
     
    7777// 上から N 個の動画を削除する。 
    7878// 指定なしの場合一番上の動画が削除される。 
    79 liberator.mappings.addUserMap( 
    80     [liberator.modes.NORMAL], 
     79liberator.modules.mappings.addUserMap( 
     80    [liberator.modules.modes.NORMAL], 
    8181    [',nr'], 
    8282    'remove item in NicoNicoPlaylist', 
     
    8686        liberator.execute(':nnpgetlist'); 
    8787    }, 
    88     { flags: liberator.Mappings.flags.COUNT } 
     88    { flags: liberator.modules.Mappings.flags.COUNT } 
    8989); 
    9090 
     
    144144 
    145145// scrape from div element that inserted by NicoNicoPlaylist 
    146 liberator.commands.addUserCommand(['nnpgetlist'], 'get NicoNicoPlaylist', 
    147     function (arg) { 
     146liberator.modules.commands.addUserCommand(['nnpgetlist'], 'get NicoNicoPlaylist', 
     147    function (args) { 
     148        var arg = (args.arguments.length > 1) 
     149            ? args.arguments[0].toString() 
     150            : args.string; 
     151 
    148152        // check existence of NicoNicoPlaylist 
    149153        var playlist = $f('//div[contains(@id, "playlistcontroller_")]'); 
     
    205209                                        .replace(/\$ITEMS/g,   items.join('')); 
    206210 
    207         liberator.echo(str, liberator.commandline.FORCE_MULTILINE); 
     211        liberator.echo(str, liberator.modules.commandline.FORCE_MULTILINE); 
    208212    },{} 
    209213); 
     
    251255].forEach( 
    252256    function ([command, description, eventname]){ 
    253         liberator.commands.addUserCommand(command, description, 
     257        liberator.modules.commands.addUserCommand(command, description, 
    254258            function (arg) { 
    255259                var r = document.createEvent("CommandEvent"); 
    256                 r.initCommandEvent(eventname, true, true, arg); 
     260                r.initCommandEvent(eventname, true, true, arg.string); 
    257261                window.content.dispatchEvent(r); 
    258262            },{} 
  • lang/javascript/vimperator-plugins/trunk/reading.js

    r20930 r21797  
    55 * @description-ja  今見てるページの URL とタイトルをコメントといっしょに Twitter に投稿する 
    66 * @author          janus_wel <janus_wel@fb3.so-net.ne.jp> 
    7  * @version         0.21 
    8  * @minversion      1.2 
     7 * @version         0.22 
     8 * @minversion      2.0pre 2008/10/16 
    99 * ==VimperatorPlugin== 
    1010 * 
     
    5757Scraper.prototype = { 
    5858    constants: { 
    59         VERSION:    '0.21', 
     59        VERSION:    '0.22', 
    6060    }, 
    6161 
     
    6363 
    6464    getURL: function() { 
    65         return liberator.buffer.URL; 
     65        return liberator.modules.buffer.URL; 
    6666    }, 
    6767 
     
    7777}; 
    7878 
    79 liberator.commands.addUserCommand(['reading'], "update Twitter's status to current page title, URL and comment", 
    80     function(arg, special) { 
     79liberator.modules.commands.addUserCommand(['reading'], "update Twitter's status to current page title, URL and comment", 
     80    function(args, special) { 
    8181        try { 
     82            var arg = args.string; 
     83 
    8284            // build post string ----- 
    8385            var post_string; 
     
    101103            // ':matanico!' display the evaluated format. 
    102104            if(special) { 
    103                 liberator.util.copyToClipboard(post_string, true); 
     105                liberator.modules.util.copyToClipboard(post_string, true); 
    104106                return; 
    105107            } 
  • lang/javascript/vimperator-plugins/trunk/youtubeamp.js

    r20940 r21797  
    55 * @description-ja  YouTube のプレーヤーをキーボードで操作できるようにする。 
    66 * @author          janus_wel <janus_wel@fb3.so-net.ne.jp> 
    7  * @version         0.11 
    8  * @minversion      1.2 
     7 * @version         0.12 
     8 * @minversion      2.0pre 2008/10/16 
    99 * ==VimperatorPlugin== 
    1010 * 
     
    6161 
    6262    constants: { 
    63         VERSION: '0.10', 
     63        VERSION: '0.12', 
    6464 
    6565        CARDINAL_NUMBER: 10, 
     
    103103    }, 
    104104 
    105     getURL: function() { return liberator.buffer.URL; }, 
     105    getURL: function() { return liberator.modules.buffer.URL; }, 
    106106 
    107107    _player: function() { 
     
    251251 
    252252// command register 
    253 liberator.commands.addUserCommand( 
     253liberator.modules.commands.addUserCommand( 
    254254    ['ytinfo'], 
    255255    'display player information', 
     
    259259                'controller version : ' + controller.getControllerVersion(), 
    260260            ].join('\n'); 
    261             liberator.echo(info, liberator.commandline.FORCE_MULTILINE); 
     261            liberator.echo(info, liberator.modules.commandline.FORCE_MULTILINE); 
    262262        } 
    263263        catch(e) { liberator.echoerr(e); } 
     
    266266); 
    267267 
    268 liberator.commands.addUserCommand( 
     268liberator.modules.commands.addUserCommand( 
    269269    ['ytpause'], 
    270270    'toggle play / pause', 
     
    276276); 
    277277 
    278 liberator.commands.addUserCommand( 
     278liberator.modules.commands.addUserCommand( 
    279279    ['ytmute'], 
    280280    'toggle mute', 
     
    286286); 
    287287 
    288 liberator.commands.addUserCommand( 
     288liberator.modules.commands.addUserCommand( 
    289289    ['ytseek'], 
    290290    'control seek bar', 
    291     function(arg, special) { 
    292         try      { special ? controller.seekBy(arg) : controller.seekTo(arg); } 
     291    function(args, special) { 
     292        try { 
     293            var arg = (args.arguments.length > 1) 
     294                ? args.arguments[0].toString() 
     295                : args.string; 
     296            special ? controller.seekBy(arg) : controller.seekTo(arg); 
     297        } 
    293298        catch(e) { liberator.echoerr(e); } 
    294299    }, 
     
    298303); 
    299304 
    300 liberator.commands.addUserCommand( 
     305liberator.modules.commands.addUserCommand( 
    301306    ['ytvolume'], 
    302307    'control volume', 
    303     function(arg, special) { 
    304         try      { special ? controller.volumeBy(arg) : controller.volumeTo(arg); } 
     308    function(args, special) { 
     309        try      { 
     310            var arg = (args.arguments.length > 1) 
     311                ? args.arguments[0].toString() 
     312                : args.string; 
     313            special ? controller.volumeBy(arg) : controller.volumeTo(arg); 
     314        } 
    305315        catch(e) { liberator.echoerr(e); } 
    306316    }, 
     
    310320); 
    311321 
    312 liberator.commands.addUserCommand( 
     322liberator.modules.commands.addUserCommand( 
    313323    ['ytsize'], 
    314324    'toggle video size',