Changeset 20024
- Timestamp:
- 09/27/08 12:48:36 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/lookupDictionary.js
r19995 r20024 14 14 url: 'http://eow.alc.co.jp/%s/UTF-8/', 15 15 shortHelp: 'SPACE ALC (英辞郎 on the Web)', 16 xpath: 'id("resultList")' 16 xpath: 'id("resultList")', 17 dictionary: 'en-US', 17 18 },{ 18 19 names: ['goo'], … … 21 22 encode: 'EUC-JP', 22 23 xpath: '//div[@id="incontents"]/*[@class="ch04" or @class="fs14" or contains(@class,"diclst")]', 23 multi: true 24 multi: true, 25 dictionary: 'en-US', 24 26 },{ 25 27 names: ['infokanji'], … … 27 29 shorthelp: 'Infoseek 漢字辞書', 28 30 encode: 'EUC-JP', 29 xpath: '//div[@class="NetDicHead"]' 31 xpath: '//div[@class="NetDicHead"]', 30 32 },{ 31 33 names: ['answers'], 32 34 url: 'http://www.answers.com/%s', 33 35 shortHelp: 'Answers.com(英英辞書)', 34 xpath: 'id("firstDs")' 36 xpath: 'id("firstDs")', 37 dictionary: 'en-US', 35 38 }]; 36 39 … … 78 81 */ 79 82 setDictionary: function (dict) { 80 this.engine.dictionary = dict; 83 var dictionaries = this.getDictionaryList() 84 for (var i=0, max=dictionaries.length ; i<max ; ++i) { 85 if (dictionaries[i] === dict) { 86 this.engine.dictionary = dict; 87 return dict; 88 } 89 } 90 return null; 81 91 }, 82 92 … … 148 158 { 149 159 completer: function (arg) { 150 if (!spellChecker.dictionary()) return [0, []]; 160 if (!spellChecker || 161 !dictionary.dictionary || 162 !spellChecker.setDictionary(dictionary.dictionary)) 163 return [0, []]; 151 164 152 165 var suggestions = spellChecker.suggest(arg); … … 233 246 234 247 var spellChecker = new SpellChecker(); 235 var dict = liberator.globalVariables.lookupDictionary_dictionary || 'en-US';236 var dictionaries = spellChecker.getDictionaryList()237 for (var i=0, max=dictionaries.length ; i<max ; ++i) {238 if (dictionaries[i] === dict) spellChecker.setDictionary(dict);239 }240 248 241 249 var isBeginningWith = liberator.globalVariables.lookupDictionary_beginningWith
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)