Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: chrome/browser/resources/options/language_dictionary_overlay.js

Issue 11362063: Editing the custom spelling dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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, 'dictionary',
csilv 2012/11/14 20:01:52 nit: I think 'editDictionary' might be a better id
please use gerrit instead 2012/11/14 22:54:46 Done.
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698