OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 addLanguageList.addEventListener('click', | 82 addLanguageList.addEventListener('click', |
83 this.handleAddLanguageListClick_.bind(this)); | 83 this.handleAddLanguageListClick_.bind(this)); |
84 } else { | 84 } else { |
85 // Listen to add language dialog ok button. | 85 // Listen to add language dialog ok button. |
86 var addLanguageOkButton = $('add-language-overlay-ok-button'); | 86 var addLanguageOkButton = $('add-language-overlay-ok-button'); |
87 addLanguageOkButton.addEventListener('click', | 87 addLanguageOkButton.addEventListener('click', |
88 this.handleAddLanguageOkButtonClick_.bind(this)); | 88 this.handleAddLanguageOkButtonClick_.bind(this)); |
89 | 89 |
90 // Show experimental features if enabled. | 90 // Show experimental features if enabled. |
91 if (templateData.experimentalSpellCheckFeatures == 'true') { | 91 if (templateData.experimentalSpellCheckFeatures == 'true') { |
92 $('auto-spell-correction-option').classList.remove('hidden'); | 92 $('auto-spell-correction-option').hidden = false; |
93 } | 93 } |
94 } | 94 } |
95 }, | 95 }, |
96 | 96 |
97 // The preference is a CSV string that describes preload engines | 97 // The preference is a CSV string that describes preload engines |
98 // (i.e. active input methods). | 98 // (i.e. active input methods). |
99 preloadEnginesPref: 'settings.language.preload_engines', | 99 preloadEnginesPref: 'settings.language.preload_engines', |
100 // The list of preload engines, like ['mozc', 'pinyin']. | 100 // The list of preload engines, like ['mozc', 'pinyin']. |
101 preloadEngines_: [], | 101 preloadEngines_: [], |
102 // The preference is a string that describes the spell check | 102 // The preference is a string that describes the spell check |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // Make it look like a text label. | 323 // Make it look like a text label. |
324 uiLanguageButton.className = 'text-button'; | 324 uiLanguageButton.className = 'text-button'; |
325 // Remove the event listner. | 325 // Remove the event listner. |
326 uiLanguageButton.onclick = undefined; | 326 uiLanguageButton.onclick = undefined; |
327 } else if (languageCode in templateData.uiLanguageCodeSet) { | 327 } else if (languageCode in templateData.uiLanguageCodeSet) { |
328 // If the language is supported as UI language, users can click on | 328 // If the language is supported as UI language, users can click on |
329 // the button to change the UI language. | 329 // the button to change the UI language. |
330 if (cr.commandLine.options['--bwsi']) { | 330 if (cr.commandLine.options['--bwsi']) { |
331 // In the guest mode for ChromeOS, changing UI language does not make | 331 // In the guest mode for ChromeOS, changing UI language does not make |
332 // sense because it does not take effect after browser restart. | 332 // sense because it does not take effect after browser restart. |
333 uiLanguageButton.className = 'hidden'; | 333 uiLanguageButton.hidden = true; |
334 } else { | 334 } else { |
335 uiLanguageButton.textContent = | 335 uiLanguageButton.textContent = |
336 localStrings.getString('display_in_this_language'); | 336 localStrings.getString('display_in_this_language'); |
337 uiLanguageButton.className = ''; | 337 uiLanguageButton.className = ''; |
338 // Send the change request to Chrome. | 338 // Send the change request to Chrome. |
339 uiLanguageButton.onclick = function(e) { | 339 uiLanguageButton.onclick = function(e) { |
340 chrome.send('uiLanguageChange', [languageCode]); | 340 chrome.send('uiLanguageChange', [languageCode]); |
341 } | 341 } |
342 } | 342 } |
343 if (cr.isChromeOS) { | 343 if (cr.isChromeOS) { |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 LanguageOptions.uiLanguageSaved = function() { | 765 LanguageOptions.uiLanguageSaved = function() { |
766 $('language-options-ui-language-button').style.display = 'none'; | 766 $('language-options-ui-language-button').style.display = 'none'; |
767 $('language-options-ui-notification-bar').style.display = 'block'; | 767 $('language-options-ui-notification-bar').style.display = 'block'; |
768 }; | 768 }; |
769 | 769 |
770 // Export | 770 // Export |
771 return { | 771 return { |
772 LanguageOptions: LanguageOptions | 772 LanguageOptions: LanguageOptions |
773 }; | 773 }; |
774 }); | 774 }); |
OLD | NEW |