Chromium Code Reviews| Index: chrome/browser/resources/options/language_dictionary_overlay.js |
| diff --git a/chrome/browser/resources/options/language_dictionary_overlay.js b/chrome/browser/resources/options/language_dictionary_overlay.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..653df8855798fc0d46ad0765af321fbab7b3572e |
| --- /dev/null |
| +++ b/chrome/browser/resources/options/language_dictionary_overlay.js |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +cr.define('options', function() { |
| + var OptionsPage = options.OptionsPage; |
| + var ArrayDataModel = cr.ui.ArrayDataModel; |
| + var DictionaryWordsList = options.dictionary_words.DictionaryWordsList; |
| + |
|
Dan Beam
2012/11/16 20:02:27
FYI: you might want to add JSDoc here in a follow
please use gerrit instead
2012/11/16 20:09:58
Will do.
|
| + function EditDictionaryOverlay() { |
| + OptionsPage.call(this, 'editDictionary', |
| + loadTimeData.getString('languageDictionaryOverlayPage'), |
| + 'language-dictionary-overlay-page'); |
| + } |
| + |
| + cr.addSingletonGetter(EditDictionaryOverlay); |
| + |
| + EditDictionaryOverlay.prototype = { |
| + __proto__: OptionsPage.prototype, |
| + |
| + wordList_: null, |
| + |
| + initializePage: function() { |
| + OptionsPage.prototype.initializePage.call(this); |
| + this.wordList_ = $('language-dictionary-overlay-word-list'); |
| + DictionaryWordsList.decorate(this.wordList_); |
| + this.wordList_.autoExpands = true; |
| + $('language-dictionary-overlay-done-button').onclick = function(e) { |
| + OptionsPage.closeOverlay(); |
| + }; |
| + }, |
| + |
| + didShowPage: function() { |
| + chrome.send('refreshDictionaryWords'); |
| + }, |
| + |
| + setWordList_: function(entries) { |
| + entries.push(''); |
| + this.wordList_.dataModel = new ArrayDataModel(entries); |
| + }, |
| + }; |
| + |
| + EditDictionaryOverlay.setWordList = function(entries) { |
| + EditDictionaryOverlay.getInstance().setWordList_(entries); |
| + }; |
| + |
| + return { |
| + EditDictionaryOverlay: EditDictionaryOverlay |
| + }; |
| +}); |