Changeset 15909

Show
Ignore:
Timestamp:
07/17/08 07:58:10 (5 years ago)
Author:
teramako
Message:

autocommand登録メソッドの削除とコメント追加

Files:
1 modified

Legend:

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

    r14671 r15909  
    55 * @author         teramako teramako@gmail.com 
    66 * @namespace      http://d.hatena.ne.jp/teramako/ 
    7  * @version        0.3a 
     7 * @version        0.4a 
    88 * ==/VimperatorPlugin== 
    99 * 
     
    4141 *   and excludes to "http://example.com/*" 
    4242 * 
     43 * --------------------------- 
     44 * Autocommand 
     45 * --------------------------- 
     46 * Available events: 
     47 * 'GMInjectedScript'  -> when open either foreground or background 
     48 * 'GMActiveScript'    -> when TabSelect or open foreground 
     49 * e.g.) 
     50 * autocmd GMActiveScript scriptName\.user\.js$ :echo "scriptName is executing" 
     51 *    when any URL and scriptName.user.js is executing 
     52 * 
    4353 * }}} 
    4454 * --------------------------- 
     
    4757 * {{{ 
    4858 * 
    49  * 1). you can access to the sandbox of Greasemonkey !!! 
    50  * 2). you can register commands to execute 
    51  *     when the user script is executed on the URI 
    52  *     @see liberator.plugins.gmperator.addAutoCommand 
     59 * you can access to the sandbox of Greasemonkey !!! 
    5360 * 
    5461 * liberator.plugins.gmperator => ( 
     
    6976 *                                  encludes   : {String[]} 
    7077 *                              ) 
    71  *  addAutoCommand    : function( uri, script, cmd ) 
    72  *                      If both of uri and script are matched 
    73  * 
    7478 * ) 
    7579 * }}} 
     
    133137            } 
    134138            return list.length > 0 ? list : null; 
    135         }, 
    136         addAutoCommand: function(uri, script, cmd){ 
    137             var reg = uri+'.*\n'+script+'\.user\.js'; 
    138             autocommands.add('GMInjectedScript', reg, cmd); 
    139         }, 
    140         removeAutoCommand: function(uri, script){ 
    141             var reg = uri+'.*\n'+script+'\.user\.js'; 
    142             autocommands.remove('GMInjectedScript', reg); 
    143139        }, 
    144140    };