Changeset 29860

Show
Ignore:
Timestamp:
02/10/09 21:27:58 (4 years ago)
Author:
anekos
Message:

HTMLSEL / SEL が動いていなかったのを修正

Files:
1 modified

Legend:

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

    r29671 r29860  
    99<author mail="teramako@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/teramako/">teramako</author> 
    1010<license>MPL 1.1/GPL 2.0/LGPL 2.1</license> 
    11 <version>0.7</version> 
     11<version>0.7.1</version> 
    1212<detail><![CDATA[ 
    1313== Command == 
     
    132132    get URL () buffer.URL, 
    133133    get SEL () { 
    134         if (sel) 
    135             return sel; 
    136         else if (selection.rangeCount < 1) 
     134        var sel = ''; 
     135        var win = new XPCNativeWrapper(window.content.window); 
     136        var selection =  win.getSelection(); 
     137        if (selection.rangeCount < 1) 
    137138            return ''; 
    138139 
     
    143144    }, 
    144145    get HTMLSEL () { 
    145         if (htmlsel) 
    146             return sel; 
    147         else if (selection.rangeCount < 1) 
     146        var htmlsel = ''; 
     147        var win = new XPCNativeWrapper(window.content.window); 
     148        var selection =  win.getSelection(); 
     149        if (selection.rangeCount < 1) 
    148150            return ''; 
    149151 
     
    199201function replaceVariable(str){ 
    200202    if (!str) return ''; 
    201     var win = new XPCNativeWrapper(window.content.window); 
    202     var sel = '', htmlsel = ''; 
    203     var selection =  win.getSelection(); 
    204203    function replacer(orig, name){ //{{{ 
    205204        if (name == '')