| 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.RowsOfCompact'); | 14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompact'); |
| 15 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactAzerty'); | 15 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactAzerty'); |
| 16 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactNordic'); | 16 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactNordic'); |
| 17 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfCompactZhuyin'); |
| 17 | 18 |
| 18 goog.require('i18n.input.chrome.inputview.layouts.util'); | 19 goog.require('i18n.input.chrome.inputview.layouts.util'); |
| 19 | 20 |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * Creates the top three rows for compact qwerty keyboard. | 23 * Creates the top three rows for compact qwerty keyboard. |
| 23 * | 24 * |
| 24 * @return {!Array.<!Object>} The rows. | 25 * @return {!Array.<!Object>} The rows. |
| 25 */ | 26 */ |
| 26 i18n.input.chrome.inputview.layouts.RowsOfCompact.create = function() { | 27 i18n.input.chrome.inputview.layouts.RowsOfCompact.create = function() { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({ | 171 var shiftRightKey = i18n.input.chrome.inputview.layouts.util.createKey({ |
| 171 'widthInWeight': 1.1 | 172 'widthInWeight': 1.1 |
| 172 }); | 173 }); |
| 173 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ | 174 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 174 'id': 'row3', | 175 'id': 'row3', |
| 175 'children': [shiftLeftKey, leftKeyWithPadding, keySequenceOf7, | 176 'children': [shiftLeftKey, leftKeyWithPadding, keySequenceOf7, |
| 176 rightKeyWithPadding, shiftRightKey] | 177 rightKeyWithPadding, shiftRightKey] |
| 177 }); | 178 }); |
| 178 return [row1, row2, row3]; | 179 return [row1, row2, row3]; |
| 179 }; | 180 }; |
| 181 |
| 182 |
| 183 /** |
| 184 * Creates the top rows of compact zhuyin. |
| 185 * |
| 186 * @return {!Array.<!Object>} The rows. |
| 187 */ |
| 188 i18n.input.chrome.inputview.layouts.RowsOfCompactZhuyin.create = function() { |
| 189 var baseKeySpec = { |
| 190 'widthInWeight': 1.01, |
| 191 'heightInWeight': 3 |
| 192 }; |
| 193 |
| 194 // Row1 |
| 195 var keysOfRow1 = i18n.input.chrome.inputview.layouts.util. |
| 196 createKeySequence(baseKeySpec, 10); |
| 197 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 198 'id': 'row1', |
| 199 'children': [keysOfRow1] |
| 200 }); |
| 201 |
| 202 // Row2 |
| 203 var keysOfRow2 = i18n.input.chrome.inputview.layouts.util. |
| 204 createKeySequence(baseKeySpec, 10); |
| 205 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 206 'id': 'row2', |
| 207 'children': [keysOfRow2] |
| 208 }); |
| 209 |
| 210 //Row3 |
| 211 var keysOfRow3 = i18n.input.chrome.inputview.layouts.util. |
| 212 createKeySequence(baseKeySpec, 10); |
| 213 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 214 'id': 'row3', |
| 215 'children': [keysOfRow3] |
| 216 }); |
| 217 |
| 218 // Row4 |
| 219 var keysOfRow4 = i18n.input.chrome.inputview.layouts.util. |
| 220 createKeySequence(baseKeySpec, 10); |
| 221 var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 222 'id': 'row4', |
| 223 'children': [keysOfRow4] |
| 224 }); |
| 225 |
| 226 var topFourRows = |
| 227 i18n.input.chrome.inputview.layouts.util.createVerticalLayout({ |
| 228 'id': 'topFourRows', |
| 229 'children': [row1, row2, row3, row4] |
| 230 }); |
| 231 |
| 232 var sideKeySpec = { |
| 233 'widthInWeight': 1.1, |
| 234 'heightInWeight': 4 |
| 235 }; |
| 236 var backspaceKey = |
| 237 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec); |
| 238 var enterKey = |
| 239 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec); |
| 240 var shiftKey = |
| 241 i18n.input.chrome.inputview.layouts.util.createKey(sideKeySpec); |
| 242 |
| 243 var sideKeys = i18n.input.chrome.inputview.layouts.util.createVerticalLayout({ |
| 244 'id': 'sideKeys', |
| 245 'children': [backspaceKey, enterKey, shiftKey] |
| 246 }); |
| 247 |
| 248 var topRows = i18n.input.chrome.inputview.layouts.util.createLinearLayout({ |
| 249 'id': 'topRows', |
| 250 'children': [topFourRows, sideKeys] |
| 251 }); |
| 252 return [topRows]; |
| 253 }; |
| OLD | NEW |