OLD | NEW |
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
2 // limitations under the License. | 2 // limitations under the License. |
3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
7 // | 7 // |
8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
9 // | 9 // |
10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
11 // you may not use this file except in compliance with the License. | 11 // you may not use this file except in compliance with the License. |
12 // Licensed under the Apache License, Version 2.0 (the "License"); | 12 // Licensed under the Apache License, Version 2.0 (the "License"); |
13 // | 13 // |
14 goog.provide('i18n.input.chrome.inputview.content.util'); | 14 goog.provide('i18n.input.chrome.inputview.content.util'); |
15 | 15 |
16 goog.require('goog.array'); | 16 goog.require('goog.array'); |
| 17 goog.require('i18n.input.chrome.ElementType'); |
17 goog.require('i18n.input.chrome.inputview.Css'); | 18 goog.require('i18n.input.chrome.inputview.Css'); |
18 goog.require('i18n.input.chrome.inputview.Direction'); | 19 goog.require('i18n.input.chrome.inputview.Direction'); |
19 goog.require('i18n.input.chrome.inputview.SpecNodeName'); | 20 goog.require('i18n.input.chrome.inputview.SpecNodeName'); |
20 goog.require('i18n.input.chrome.inputview.StateType'); | 21 goog.require('i18n.input.chrome.inputview.StateType'); |
21 goog.require('i18n.input.chrome.inputview.elements.ElementType'); | |
22 | 22 |
23 goog.scope(function() { | 23 goog.scope(function() { |
24 var ElementType = i18n.input.chrome.inputview.elements.ElementType; | 24 var ElementType = i18n.input.chrome.ElementType; |
25 var SpecNodeName = i18n.input.chrome.inputview.SpecNodeName; | 25 var SpecNodeName = i18n.input.chrome.inputview.SpecNodeName; |
26 | 26 |
27 | 27 |
28 /** | 28 /** |
29 * The prefix of the key id. | 29 * The prefix of the key id. |
30 * | 30 * |
31 * @type {string} | 31 * @type {string} |
32 * @private | 32 * @private |
33 */ | 33 */ |
34 i18n.input.chrome.inputview.content.util.keyIdPrefix_ = 'sk-'; | 34 i18n.input.chrome.inputview.content.util.keyIdPrefix_ = 'sk-'; |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 keyList.push(key); | 528 keyList.push(key); |
529 } | 529 } |
530 | 530 |
531 i18n.input.chrome.inputview.content.util.insertModifierKeys_(keyList, | 531 i18n.input.chrome.inputview.content.util.insertModifierKeys_(keyList, |
532 is102, opt_compactKeyboardId); | 532 is102, opt_compactKeyboardId); |
533 for (var i = 0; i < keyList.length; i++) { | 533 for (var i = 0; i < keyList.length; i++) { |
534 var key = keyList[i]; | 534 var key = keyList[i]; |
535 mapping[key['spec'][SpecNodeName.ID]] = viewIdPrefix + i; | 535 mapping[key['spec'][SpecNodeName.ID]] = viewIdPrefix + i; |
536 } | 536 } |
537 var layout = is102 ? '102kbd' : '101kbd'; | 537 var layout = is102 ? '102kbd' : '101kbd'; |
538 var result = []; | 538 var result = {}; |
539 result[SpecNodeName.KEY_LIST] = keyList; | 539 result[SpecNodeName.KEY_LIST] = keyList; |
540 result[SpecNodeName.MAPPING] = mapping; | 540 result[SpecNodeName.MAPPING] = mapping; |
541 result[SpecNodeName.LAYOUT] = layout; | 541 result[SpecNodeName.LAYOUT] = layout; |
542 result[SpecNodeName.HAS_ALTGR_KEY] = hasAltGrKey; | 542 result[SpecNodeName.HAS_ALTGR_KEY] = hasAltGrKey; |
543 result[SpecNodeName.SHOW_MENU_KEY] = true; | 543 result[SpecNodeName.SHOW_MENU_KEY] = true; |
544 return result; | 544 return result; |
545 }; | 545 }; |
546 | 546 |
547 | 547 |
548 /** | 548 /** |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 keyList.push(i18n.input.chrome.inputview.content.util.createEnSwitcherKey()); | 616 keyList.push(i18n.input.chrome.inputview.content.util.createEnSwitcherKey()); |
617 keyList.push(i18n.input.chrome.inputview.content.util.createAltgrKey()); | 617 keyList.push(i18n.input.chrome.inputview.content.util.createAltgrKey()); |
618 keyList.push(i18n.input.chrome.inputview.content.util.createArrowKey( | 618 keyList.push(i18n.input.chrome.inputview.content.util.createArrowKey( |
619 i18n.input.chrome.inputview.Direction.LEFT)); | 619 i18n.input.chrome.inputview.Direction.LEFT)); |
620 keyList.push(i18n.input.chrome.inputview.content.util.createArrowKey( | 620 keyList.push(i18n.input.chrome.inputview.content.util.createArrowKey( |
621 i18n.input.chrome.inputview.Direction.RIGHT)); | 621 i18n.input.chrome.inputview.Direction.RIGHT)); |
622 keyList.push(i18n.input.chrome.inputview.content.util. | 622 keyList.push(i18n.input.chrome.inputview.content.util. |
623 createHideKeyboardKey()); | 623 createHideKeyboardKey()); |
624 }; | 624 }; |
625 }); // goog.scope | 625 }); // goog.scope |
OLD | NEW |