| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; |
| 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 var DictionaryWordsList = options.dictionary_words.DictionaryWordsList; |
| 9 |
| 10 function EditDictionaryOverlay() { |
| 11 OptionsPage.call(this, 'editDictionary', |
| 12 loadTimeData.getString('languageDictionaryOverlayPage'), |
| 13 'language-dictionary-overlay-page'); |
| 14 } |
| 15 |
| 16 cr.addSingletonGetter(EditDictionaryOverlay); |
| 17 |
| 18 EditDictionaryOverlay.prototype = { |
| 19 __proto__: OptionsPage.prototype, |
| 20 |
| 21 wordList_: null, |
| 22 |
| 23 initializePage: function() { |
| 24 OptionsPage.prototype.initializePage.call(this); |
| 25 this.wordList_ = $('language-dictionary-overlay-word-list'); |
| 26 DictionaryWordsList.decorate(this.wordList_); |
| 27 this.wordList_.autoExpands = true; |
| 28 $('language-dictionary-overlay-done-button').onclick = function(e) { |
| 29 OptionsPage.closeOverlay(); |
| 30 }; |
| 31 }, |
| 32 |
| 33 didShowPage: function() { |
| 34 chrome.send('refreshDictionaryWords'); |
| 35 }, |
| 36 |
| 37 setWordList_: function(entries) { |
| 38 entries.push(''); |
| 39 this.wordList_.dataModel = new ArrayDataModel(entries); |
| 40 }, |
| 41 }; |
| 42 |
| 43 EditDictionaryOverlay.setWordList = function(entries) { |
| 44 EditDictionaryOverlay.getInstance().setWordList_(entries); |
| 45 }; |
| 46 |
| 47 return { |
| 48 EditDictionaryOverlay: EditDictionaryOverlay |
| 49 }; |
| 50 }); |
| OLD | NEW |