1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfJP');
16 goog.require('i18n.input.chrome.inputview.layouts.util');
20 goog.scope(function() {
21 var util = i18n.input.chrome.inputview.layouts.util;
25 * Creates the top four rows for Japanese keyboard.
27 * @return {!Array.<!Object>} The rows.
29 i18n.input.chrome.inputview.layouts.RowsOfJP.create = function() {
36 var keySequenceOf15 = util.createKeySequence(baseKeySpec, 15);
37 var row1 = util.createLinearLayout({
39 'children': [keySequenceOf15]
45 // First linear layout at the left of the enter.
46 var tabKey = util.createKey({
49 var keySequenceOf11 = util.
50 createKeySequence(baseKeySpec, 11);
51 var slashKey = util.createKey({
54 var row2 = util.createLinearLayout({
56 'children': [tabKey, keySequenceOf11, slashKey]
59 // Second linear layout at the right of the enter.
60 var capslockKey = util.createKey({
63 var keySequenceOf12 = util.
64 createKeySequence(baseKeySpec, 12);
65 var row3 = util.createLinearLayout({
67 'children': [capslockKey, keySequenceOf12]
70 // Vertical layout contains the two rows at the left of the enter.
71 var vLayout = util.createVerticalLayout({
73 'children': [row2, row3]
76 // Vertical layout contains enter key.
77 var enterKey = util.createKey({
78 'widthInWeight': 1.25,
81 var enterLayout = util.
82 createVerticalLayout({
84 'children': [enterKey]
87 // Linear layout contains the two vertical layout.
88 var row2and3 = util.createLinearLayout({
90 'children': [vLayout, enterLayout]
94 var shiftLeft = util.createKey({
97 keySequenceOf11 = util.createKeySequence(
99 var shiftRight = util.createKey({
100 'widthInWeight': 1.75
102 var row4 = util.createLinearLayout({
104 'children': [shiftLeft, keySequenceOf11, shiftRight]
107 return [row1, row2and3, row4];