Changeset 9404

Show
Ignore:
Timestamp:
04/13/08 20:20:52 (6 months ago)
Author:
teramako
Message:

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

Files:
1 modified

Legend:

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

    r8695 r9404  
    11/** 
    2  * vimperator plugin 
    3  * Add `copy' command 
    4  * For vimperator 0.6pre 
    5  * @author teramako teramako@gmail.com 
    6  * @version 0.2 
     2 * ==VimperatorPlugin== 
     3 * @name           copy.js 
     4 * @description    enable to copy strings from a template (like CopyURL+) 
     5 * @description-ja テンプレートから文字列のコピーを可能にします(CopyURL+みたなもの) 
     6 * @minVersion     0.6pre 
     7 * @author         teramako teramako@gmail.com 
     8 * @version        0.3 
     9 * ==/VimperatorPlugin== 
    710 * 
    811 * Usage: 
     
    1316 * :copy %TITLE%              -> copied the title of the current page 
    1417 * :copy title                -> same as `:copy %TITLE%' by default 
    15  * :copy! liberator.version  -> copy the value of liberator.version 
     18 * :copy! liberator.version   -> copy the value of liberator.version 
    1619 * 
    1720 * If non-argument, used `default' 
     
    3235 *        %SEL%     -> to the string of selection 
    3336 *        %HTMLSEL% -> to the html string of selection 
     37 * 
     38 * The copy_templates is a string variable which can set on 
     39 * vimperatorrc as following. 
     40 * 
     41 * let copy_templates = "[ {label:'titleAndURL', value:'%TITLE%\n%URL%'}, {label:'title', value:'%TITLE%'} ]" 
     42 * 
     43 * or your can set it using inline JavaScript. 
     44 * 
     45 * javascript <<EOM 
     46 * liberator.globalVariables.copy_templates = uneval([ 
     47 *   { label: 'titleAndURL',    value: '%TITLE%\n%URL%' }, 
     48 *   { label: 'title',          value: '%TITLE%' }, 
     49 *   { label: 'anchor',         value: '<a href="%URL%">%TITLE%</a>' }, 
     50 *   { label: 'selanchor',      value: '<a href="%URL%" title="%TITLE%">%SEL%</a>' }, 
     51 *   { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' }, 
     52 * ]); 
     53 * EOM 
    3454 */ 
    35 const templates = [ 
     55const templates = window.eval(liberator.globalVariables.copy_templates) || [ 
    3656        { label: 'titleAndURL',    value: '%TITLE%\n%URL%' }, 
    3757        { label: 'title',          value: '%TITLE%' },