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.layouts.RowsOf101'); | 14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOf101'); |
15 | 15 |
16 goog.require('i18n.input.chrome.inputview.layouts.util'); | 16 goog.require('i18n.input.chrome.inputview.layouts.util'); |
17 | 17 |
18 | 18 |
| 19 goog.scope(function() { |
| 20 var layouts = i18n.input.chrome.inputview.layouts; |
| 21 var util = layouts.util; |
| 22 |
| 23 |
19 /** | 24 /** |
20 * Creates the top four rows for 101 keyboard. | 25 * Creates the top four rows for 101 keyboard. |
21 * | 26 * |
22 * @return {!Array.<!Object>} The rows. | 27 * @return {!Array.<!Object>} The rows. |
23 */ | 28 */ |
24 i18n.input.chrome.inputview.layouts.RowsOf101.create = function() { | 29 layouts.RowsOf101.create = function() { |
25 var baseKeySpec = { | 30 var baseKeySpec = { |
26 'widthInWeight': 1, | 31 'widthInWeight': 1, |
27 'heightInWeight': 1 | 32 'heightInWeight': 1 |
28 }; | 33 }; |
29 | 34 |
30 // Row1 | 35 var keySequenceOf13 = util.createKeySequence(baseKeySpec, 13); |
31 var backquoteKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 36 var backspaceKey = util.createKey({ |
32 'widthInWeight': 0.94 | 37 'widthInWeight': 1.46 |
33 }); | 38 }); |
34 var keySequenceOf12 = i18n.input.chrome.inputview.layouts.util. | 39 var row1 = util.createLinearLayout({ |
35 createKeySequence(baseKeySpec, 12); | |
36 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({ | |
37 'widthInWeight': 1.42 | |
38 }); | |
39 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ | |
40 'id': 'row1', | 40 'id': 'row1', |
41 'children': [backquoteKey, keySequenceOf12, backspaceKey] | 41 'children': [keySequenceOf13, backspaceKey] |
42 }); | 42 }); |
43 | 43 |
44 // Row2 | 44 // Row2 |
45 var tabKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 45 var tabKey = util.createKey({ |
46 'widthInWeight': 1.38 | 46 'widthInWeight': 1.46 |
47 }); | 47 }); |
48 keySequenceOf12 = i18n.input.chrome.inputview.layouts.util. | 48 keySequenceOf13 = util. |
49 createKeySequence(baseKeySpec, 12); | 49 createKeySequence(baseKeySpec, 13); |
50 var backSlashKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 50 var row2 = util.createLinearLayout({ |
51 'widthInWeight': 0.98 | |
52 }); | |
53 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ | |
54 'id': 'row2', | 51 'id': 'row2', |
55 'children': [tabKey, keySequenceOf12, backSlashKey] | 52 'children': [tabKey, keySequenceOf13] |
56 }); | 53 }); |
57 | 54 |
58 // Row3 | 55 // Row3 |
59 var capslockKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 56 var capslockKey = util.createKey({ |
60 'widthInWeight': 1.68 | 57 'widthInWeight': 1.76 |
61 }); | 58 }); |
62 var keySequenceOf11 = i18n.input.chrome.inputview.layouts.util. | 59 var keySequenceOf11 = util. |
63 createKeySequence(baseKeySpec, 11); | 60 createKeySequence(baseKeySpec, 11); |
64 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 61 var enterKey = util.createKey({ |
65 'widthInWeight': 1.68 | 62 'widthInWeight': 1.7 |
66 }); | 63 }); |
67 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ | 64 var row3 = util.createLinearLayout({ |
68 'id': 'row3', | 65 'id': 'row3', |
69 'children': [capslockKey, keySequenceOf11, enterKey] | 66 'children': [capslockKey, keySequenceOf11, enterKey] |
70 }); | 67 }); |
71 | 68 |
72 // Row4 | 69 // Row4 |
73 var shiftLeftKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 70 var shiftLeftKey = util.createKey({ |
74 'widthInWeight': 2.12 | 71 'widthInWeight': 2.23 |
75 }); | 72 }); |
76 var keySequenceOf9 = i18n.input.chrome.inputview.layouts.util. | 73 var keySequenceOf10 = util. |
77 createKeySequence(baseKeySpec, 9); | 74 createKeySequence(baseKeySpec, 10); |
78 var slashKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 75 var shiftRightKey = util.createKey({ |
79 'widthInWeight': 1.08 | 76 'widthInWeight': 2.23 |
80 }); | 77 }); |
81 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 78 var row4 = util.createLinearLayout({ |
82 'widthInWeight': 2.16 | |
83 }); | |
84 var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ | |
85 'id': 'row4', | 79 'id': 'row4', |
86 'children': [shiftLeftKey, keySequenceOf9, slashKey, shiftRightKey] | 80 'children': [shiftLeftKey, keySequenceOf10, shiftRightKey] |
87 }); | 81 }); |
88 | 82 |
89 return [row1, row2, row3, row4]; | 83 return [row1, row2, row3, row4]; |
90 }; | 84 }; |
| 85 |
| 86 }); // goog.scope |
OLD | NEW |