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.SpaceRow');
16 goog.require('i18n.input.chrome.inputview.ConditionName');
17 goog.require('i18n.input.chrome.inputview.layouts.util');
21 * Creates the spaceKey row.
23 * @return {!Object} The spaceKey row.
25 i18n.input.chrome.inputview.layouts.SpaceRow.create = function() {
26 var globeKey = i18n.input.chrome.inputview.layouts.util.createKey({
27 'condition': i18n.input.chrome.inputview.ConditionName.SHOW_GLOBE_OR_SYMBOL,
30 var menuKey = i18n.input.chrome.inputview.layouts.util.createKey({
31 'condition': i18n.input.chrome.inputview.ConditionName.SHOW_MENU,
34 var ctrlKey = i18n.input.chrome.inputview.layouts.util.createKey({
37 var altKey = i18n.input.chrome.inputview.layouts.util.createKey({
40 var spaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
43 var enSwitcher = i18n.input.chrome.inputview.layouts.util.createKey({
45 'condition': i18n.input.chrome.inputview.ConditionName.
48 var altGrKey = i18n.input.chrome.inputview.layouts.util.createKey({
49 'widthInWeight': 1.25,
50 'condition': i18n.input.chrome.inputview.ConditionName.
53 // If globeKey or altGrKey is not shown, give its weight to space key.
54 globeKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
55 menuKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
56 altGrKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
57 enSwitcher['spec']['giveWeightTo'] = spaceKey['spec']['id'];
59 var leftKey = i18n.input.chrome.inputview.layouts.util.createKey({
62 var rightKey = i18n.input.chrome.inputview.layouts.util.createKey({
65 var hideKeyboardKey = i18n.input.chrome.inputview.layouts.util.createKey({
68 var spaceKeyRow = i18n.input.chrome.inputview.layouts.util.
71 'children': [globeKey, menuKey, ctrlKey, altKey, spaceKey,
72 enSwitcher, altGrKey, leftKey, rightKey, hideKeyboardKey]