Changeset 9245

Show
Ignore:
Timestamp:
04/10/08 14:25:05 (5 years ago)
Author:
drry
Message:

lang/javascript/vimperator-plugins/trunk/gmperator.js:

  • td 要素が抜け落ちていたのを修整しました。ごめんなさい。
  • ほか。
Files:
1 modified

Legend:

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

    r9102 r9245  
    3131 * And cannot get back. 
    3232 * 
    33  * ex) 
     33 * e.g.) 
    3434 * :gmset! {filename} -n fooScriptName -i http://*,https://* -e http://example.com/* 
    3535 *   toggle enable or disable, 
     
    4444 * {{{ 
    4545 * 
    46  * 1). can access to the sandbox of Greasemonkey !!! 
    47  * 2). can register commands which execute 
     46 * 1). you can access to the sandbox of Greasemonkey !!! 
     47 * 2). you can register commands to execute 
    4848 *     when the user script is executed on the URI 
    4949 *     @see liberator.plugins.gmperator.addAutoCommand 
     
    6767 *                              ) 
    6868 *  addAutoCommand    : function( uri, script, cmd ) 
    69  *                      If both of uri and script is match 
     69 *                      If both of uri and script are matched 
    7070 * 
    7171 * ) 
     
    8989    // ----------------------- 
    9090    // {{{ 
    91     var manager =  { 
     91    var manager = { 
    9292        register: function (uri,sandbox,script){ 
    9393            var panelID = getPanelID(sandbox.window); 
     
    9898                gmCon = new GmContainer(uri,sandbox); 
    9999                containers[panelID] = gmCon; 
    100                 this.__defineGetter__(panelID,function(){return gmCon;}); 
    101                 log('gmpeartor: redisted: '+ panelID + ' - ' + uri); 
     100                this.__defineGetter__(panelID,function() gmCon); 
     101                log('gmpeartor: Registered: ' + panelID + ' - ' + uri); 
    102102            } 
    103103            gmCon.sandbox = sandbox; 
     
    106106            autocommands.trigger('GMInjectedScript',uri+'\n'+script.filename); 
    107107        }, 
    108         get gmScripts(){ 
    109             return getScripts(); 
    110         }, 
    111         get allItem(){ 
    112             return containers; 
    113         }, 
    114         get currentPanel(){ 
    115             return getBrowser().mCurrentTab.linkedPanel; 
    116         }, 
    117         get currentContainer(){ 
    118             return containers[this.currentPanel] || null; 
    119         }, 
     108        get gmScripts() getScripts(), 
     109        get allItem() containers, 
     110        get currentPanel() getBrowser().mCurrentTab.linkedPanel, 
     111        get currentContainer() containers[this.currentPanel] || null, 
    120112        get currentSandbox(){ 
    121113            var id = this.currentPanel; 
     
    171163            } 
    172164        } 
    173         liberator.log(win + 'is no found'); 
     165        liberator.log(win + 'is not found'); 
    174166    } 
    175167    function updateGmContainerList(e){ 
     
    193185        var scripts = getScripts(); 
    194186        var reg; 
    195         var table, tr; 
    196187        if (special || arg == 'full'){ 
    197188            reg = new RegExp('.*'); 
     
    206197            } 
    207198        } else { 
    208             table = <table/>; 
     199            var table = <table/>; 
     200            var tr; 
    209201            for each(var script in scripts){ 
    210202                tr = <tr/>; 
     
    231223                var contents = script[prop.toLowerCase()]; 
    232224                if (typeof contents == "string"){ 
    233                     tr.* += <>{contents}</>; 
     225                    tr.* += <td>{contents}</td>; 
    234226                } else { 
     227                    var td = <td/>; 
    235228                    contents.forEach(function(c,i,a){ 
    236                         tr.* += <>{c}</>; 
    237                         if (a[i+1]) tr.* += <br/>; 
     229                        td.* += c; 
     230                        if (a[i+1]) td.* += <br/>; 
    238231                    }); 
     232                    tr.* += td; 
    239233                } 
    240234                table.* += tr; 
     
    284278        */ 
    285279    },{ 
    286         completer: function(filter){ 
    287             return scriptsCompleter(filter,true); 
    288         } 
     280        completer: function(filter) scriptsCompleter(filter,true) 
    289281    } 
    290282); //}}} 
     
    330322            'Caution: the change is permanent, not the only session.<br/>And cannot get back.' 
    331323        ].join(''), 
    332         completer: function(filter){ 
    333             return scriptsCompleter(filter, false); 
    334         } 
     324        completer: function(filter) 
     325            scriptsCompleter(filter, false) 
    335326    } 
    336327); //}}} 
     
    350341} 
    351342GmContainer.prototype = { 
    352     addScript :  function(script){ 
    353         if (this.hasScript(script)) return false; 
    354  
    355         return this.scripts.push(script); 
    356     }, 
     343    addScript : function(script) !this.hasScript(script) && this.scripts.push(script) || false, 
    357344    hasScript : function(script){ 
    358345        var filename; 
     
    362349            default: return null; 
    363350        } 
    364         return this.scripts.some(function(s){ return s.filename == filename; }); 
    365     } 
    366 } // }}} 
     351        return this.scripts.some(function(s) s.filename == filename); 
     352    } 
     353}; // }}} 
    367354function getScripts(){ //{{{ 
    368355    var config = new Config();