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');
20 goog.scope(function() {
21 var layouts = i18n.input.chrome.inputview.layouts;
22 var util = layouts.util;
26 * Creates the spaceKey row.
28 * @return {!Object} The spaceKey row.
30 layouts.SpaceRow.create = function() {
31 var globeKey = util.createKey({
32 'condition': i18n.input.chrome.inputview.ConditionName.SHOW_GLOBE_OR_SYMBOL,
35 var menuKey = util.createKey({
36 'condition': i18n.input.chrome.inputview.ConditionName.SHOW_MENU,
39 var ctrlKey = util.createKey({
42 var altKey = util.createKey({
45 var spaceKey = util.createKey({
48 var enSwitcher = util.createKey({
50 'condition': i18n.input.chrome.inputview.ConditionName.
53 var altGrKey = util.createKey({
54 'widthInWeight': 1.25,
55 'condition': i18n.input.chrome.inputview.ConditionName.
58 // If globeKey or altGrKey is not shown, give its weight to space key.
59 globeKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
60 menuKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
61 altGrKey['spec']['giveWeightTo'] = spaceKey['spec']['id'];
62 enSwitcher['spec']['giveWeightTo'] = spaceKey['spec']['id'];
64 var leftKey = util.createKey({
67 var rightKey = util.createKey({
70 var hideKeyboardKey = util.createKey({
73 var spaceKeyRow = util.createLinearLayout({
75 'children': [ctrlKey, altKey, globeKey, menuKey, spaceKey,
76 enSwitcher, altGrKey, leftKey, rightKey, hideKeyboardKey]