| 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 | 9 |
| 10 const OptionsPage = options.OptionsPage; | 10 const OptionsPage = options.OptionsPage; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 for (var i = 0; i < inputMethodListData.length; i++) { | 129 for (var i = 0; i < inputMethodListData.length; i++) { |
| 130 var inputMethod = inputMethodListData[i]; | 130 var inputMethod = inputMethodListData[i]; |
| 131 var input = document.createElement('input'); | 131 var input = document.createElement('input'); |
| 132 input.type = 'checkbox'; | 132 input.type = 'checkbox'; |
| 133 input.inputMethodId = inputMethod.id; | 133 input.inputMethodId = inputMethod.id; |
| 134 // Listen to user clicks. | 134 // Listen to user clicks. |
| 135 input.addEventListener('click', | 135 input.addEventListener('click', |
| 136 this.handleCheckboxClick_.bind(this)); | 136 this.handleCheckboxClick_.bind(this)); |
| 137 var label = document.createElement('label'); | 137 var label = document.createElement('label'); |
| 138 label.appendChild(input); | 138 label.appendChild(input); |
| 139 label.appendChild(document.createTextNode(inputMethod.displayName)); | 139 // Adding a space between the checkbox and the text. This is a bit |
| 140 // dirty, but we rely on a space character for all other checkboxes. |
| 141 label.appendChild(document.createTextNode( |
| 142 ' ' + inputMethod.displayName)); |
| 140 label.style.display = 'none'; | 143 label.style.display = 'none'; |
| 141 label.languageCodeSet = inputMethod.languageCodeSet; | 144 label.languageCodeSet = inputMethod.languageCodeSet; |
| 142 // Add the configure button if the config page is present for this | 145 // Add the configure button if the config page is present for this |
| 143 // input method. | 146 // input method. |
| 144 if (inputMethod.id in INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME) { | 147 if (inputMethod.id in INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME) { |
| 145 var pageName = INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME[inputMethod.id]; | 148 var pageName = INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME[inputMethod.id]; |
| 146 var button = this.createConfigureInputMethodButton_(inputMethod.id, | 149 var button = this.createConfigureInputMethodButton_(inputMethod.id, |
| 147 pageName); | 150 pageName); |
| 148 label.appendChild(button); | 151 label.appendChild(button); |
| 149 } | 152 } |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 $('language-options-ui-language-button').style.display = 'none'; | 788 $('language-options-ui-language-button').style.display = 'none'; |
| 786 $('language-options-ui-notification-bar').style.display = 'block'; | 789 $('language-options-ui-notification-bar').style.display = 'block'; |
| 787 }; | 790 }; |
| 788 | 791 |
| 789 // Export | 792 // Export |
| 790 return { | 793 return { |
| 791 LanguageOptions: LanguageOptions | 794 LanguageOptions: LanguageOptions |
| 792 }; | 795 }; |
| 793 | 796 |
| 794 }); | 797 }); |
| OLD | NEW |