OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(kochi): Generalize the notification as a component and put it | 5 // TODO(kochi): Generalize the notification as a component and put it |
6 // in js/cr/ui/notification.js . | 6 // in js/cr/ui/notification.js . |
7 | 7 |
8 cr.define('options', function() { | 8 cr.define('options', function() { |
9 const OptionsPage = options.OptionsPage; | 9 const OptionsPage = options.OptionsPage; |
10 const LanguageList = options.LanguageList; | 10 const LanguageList = options.LanguageList; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Show experimental features if enabled. | 95 // Show experimental features if enabled. |
96 if (templateData.experimentalSpellCheckFeatures == 'true') | 96 if (templateData.experimentalSpellCheckFeatures == 'true') |
97 $('auto-spell-correction-option').hidden = false; | 97 $('auto-spell-correction-option').hidden = false; |
98 | 98 |
99 // Handle spell check enable/disable. | 99 // Handle spell check enable/disable. |
100 if (!cr.isMac) { | 100 if (!cr.isMac) { |
101 Preferences.getInstance().addEventListener( | 101 Preferences.getInstance().addEventListener( |
102 this.enableSpellCheckPref, | 102 this.enableSpellCheckPref, |
103 this.updateEnableSpellCheck_.bind(this)); | 103 this.updateEnableSpellCheck_.bind(this)); |
104 } | 104 } |
| 105 } |
105 | 106 |
106 $('language-confirm').onclick = function() { | 107 $('language-confirm').onclick = |
107 OptionsPage.closeOverlay(); | 108 OptionsPage.closeOverlay.bind(OptionsPage); |
108 }; | |
109 } | |
110 | 109 |
111 // Listen to user clicks on the "Change touch keyboard settings..." | 110 // Listen to user clicks on the "Change touch keyboard settings..." |
112 // button (if it exists). | 111 // button (if it exists). |
113 var virtualKeyboardButton = $('language-options-virtual-keyboard'); | 112 var virtualKeyboardButton = $('language-options-virtual-keyboard'); |
114 if (virtualKeyboardButton) { | 113 if (virtualKeyboardButton) { |
115 // TODO(yusukes): would be better to hide the button if no virtual | 114 // TODO(yusukes): would be better to hide the button if no virtual |
116 // keyboard is registered. | 115 // keyboard is registered. |
117 virtualKeyboardButton.onclick = function(e) { | 116 virtualKeyboardButton.onclick = function(e) { |
118 OptionsPage.navigateToPage('virtualKeyboards'); | 117 OptionsPage.navigateToPage('virtualKeyboards'); |
119 }; | 118 }; |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 LanguageOptions.uiLanguageSaved = function() { | 813 LanguageOptions.uiLanguageSaved = function() { |
815 $('language-options-ui-language-button').style.display = 'none'; | 814 $('language-options-ui-language-button').style.display = 'none'; |
816 $('language-options-ui-notification-bar').style.display = 'block'; | 815 $('language-options-ui-notification-bar').style.display = 'block'; |
817 }; | 816 }; |
818 | 817 |
819 // Export | 818 // Export |
820 return { | 819 return { |
821 LanguageOptions: LanguageOptions | 820 LanguageOptions: LanguageOptions |
822 }; | 821 }; |
823 }); | 822 }); |
OLD | NEW |