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.require('i18n.input.chrome.inputview.ConditionName');
15 goog.require('i18n.input.chrome.inputview.layouts.RowsOfJP');
16 goog.require('i18n.input.chrome.inputview.layouts.util');
20 var ConditionName = i18n.input.chrome.inputview.ConditionName;
21 var util = i18n.input.chrome.inputview.layouts.util;
22 i18n.input.chrome.inputview.layouts.util.setPrefix('jpkbd-k-');
24 var topFourRows = i18n.input.chrome.inputview.layouts.RowsOfJP.create();
26 // Creates the space row.
27 var globeKey = util.createKey({
28 'condition': ConditionName.SHOW_GLOBE_OR_SYMBOL,
31 var menuKey = util.createKey({
32 'condition': ConditionName.SHOW_MENU,
35 var ctrlKey = util.createKey({
38 var altKey = util.createKey({
42 var leftIMEKey = util.createKey({'widthInWeight': 1});
43 var spaceKey = util.createKey({'widthInWeight': 6});
44 var rightIMEKey = util.createKey({'widthInWeight': 1});
46 // If globeKey or altGrKey is not shown, give its weight to space key.
47 globeKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
48 menuKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
50 var leftKey = util.createKey({
53 var rightKey = util.createKey({
56 var hideKeyboardKey = util.createKey({
73 var spaceRow = util.createLinearLayout({
80 var keyboardView = i18n.input.chrome.inputview.layouts.util.createLayoutView({
82 'children': [topFourRows, spaceRow],
87 var keyboardContainer = i18n.input.chrome.inputview.layouts.util.
89 'id': 'keyboardContainer',
90 'children': [keyboardView]
96 'children': [keyboardContainer]
99 google.ime.chrome.inputview.onLayoutLoaded(data);