Show
Ignore:
Timestamp:
09/05/08 17:39:22 (3 months ago)
Author:
drry
Message:
  • removed an unused variable.
  • et cetera.
Files:
1 modified

Legend:

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

    r16415 r18895  
    1414//    すると、クリップボードにその漢字がコピーされます。 
    1515 
    16 (function () { try{ 
     16(function () { try { 
    1717 
    1818  var copycompl = []; 
     
    2121    var re = /[一-龠]+/g; 
    2222    var ignore = /検索|関連/; 
    23     var spaces = /^\s+$/; 
    2423    var req = new XMLHttpRequest(); 
    2524    var word = encodeURIComponent(word); 
     
    2827    var f = function () { 
    2928      var cnt = {}; 
    30       for each (var it in req.responseText.match(re)) { 
    31         if (!it.match || it.match(ignore)) 
     29      for each (let it in req.responseText.match(re)) { 
     30        if (ignore.test(it)) 
    3231          continue; 
    3332        if (cnt[it]) 
     
    3736      } 
    3837      var cnta = []; 
    39       for (var i in cnt) { 
     38      for (let i in cnt) { 
    4039        if (cnt[i] < 3) 
    4140          continue; 
     
    4544      copycompl = cnta; 
    4645      liberator.commandline.open(":", "gkcopy ", liberator.modes.EX); 
    47     };  
     46    }; 
    4847    req.onreadystatechange = function (aEvt) { 
    49       if (req.readyState == 4) { 
    50         if(req.status == 200) { 
    51           f(); 
    52         } 
     48      if (req.readyState == 4 && req.status == 200) { 
     49        f(); 
    5350      } 
    5451    }; 
    55     req.send(null);  
     52    req.send(null); 
    5653  } 
    5754 
    5855  liberator.commands.addUserCommand( 
    5956    ['gkanji', 'googlekanji'], 
    60     'google kanji', 
    61     function (word) { 
    62       getKanji(word); 
    63     } 
     57    'Google kanji', 
     58    getKanji 
    6459  ); 
    6560 
    6661  function copyToClipboard (copytext) { 
    67     const supstr  = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString); 
    68     const trans   = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable); 
    69     const clipid  = Ci.nsIClipboard; 
    70     const clip    = Cc["@mozilla.org/widget/clipboard;1"].getService(clipid); 
    71        
     62    const supstr = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString); 
     63    const trans  = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable); 
     64    const clipid = Ci.nsIClipboard; 
     65    const clip   = Cc["@mozilla.org/widget/clipboard;1"].getService(clipid); 
     66 
    7267    supstr.data = copytext; 
    7368    trans.addDataFlavor("text/unicode"); 
     
    7974  liberator.commands.addUserCommand( 
    8075    ['gkcopy'], 
    81     'google kanji', 
    82     function (word) { 
    83       copyToClipboard(word);  
    84     }, 
    85     { 
    86       completer: function (args) { 
    87         return [0, copycompl]; 
    88       } 
    89     } 
     76    'Google kanji', 
     77    copyToClipboard, 
     78    { completer: function (args) [0, copycompl] } 
    9079  ); 
    9180 
    9281 
    93 }catch(e){liberator.log(e)}})(); 
     82} catch (e) { liberator.log(e) } })();