Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: third_party/google_input_tools/src/chrome/os/inputview/layouts/rowsofnumberpad.js

Issue 697653003: Add google-input-tools resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Defer build patch for later CL. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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");
13 //
14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOfNumberpad');
15 goog.require('i18n.input.chrome.inputview.layouts.util');
16
17
18 /**
19 * Creates the rows for compact numberpad keyboard.
20 *
21 * @return {!Array.<!Object>} The rows.
22 */
23 i18n.input.chrome.inputview.layouts.RowsOfNumberpad.create = function() {
24 var baseKeySpec = {
25 'widthInWeight': 1,
26 'heightInWeight': 0.75
27 };
28
29 var smallKeySpec = {
30 'widthInWeight': 0.75,
31 'heightInWeight': 0.75
32 };
33
34 // Row1
35 var smallkeySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
36 createKeySequence(smallKeySpec, 3);
37 var keySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
38 createKeySequence(baseKeySpec, 3);
39 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
40 'widthInWeight': 1.2,
41 'heightInWeight': 0.75
42 });
43 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
44 'id': 'row1',
45 'children': [smallkeySequenceOf3, keySequenceOf3, backspaceKey]
46 });
47
48 // Row2
49 smallkeySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
50 createKeySequence(smallKeySpec, 3);
51 keySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
52 createKeySequence(baseKeySpec, 3);
53 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
54 'widthInWeight': 1.2,
55 'heightInWeight': 0.75
56 });
57 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
58 'id': 'row2',
59 'children': [smallkeySequenceOf3, keySequenceOf3, enterKey]
60 });
61
62 // Row3
63 smallkeySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
64 createKeySequence(smallKeySpec, 3);
65 var keySequenceOf2 = i18n.input.chrome.inputview.layouts.util.
66 createKeySequence(baseKeySpec, 2);
67 var rightKeyWithPadding = i18n.input.chrome.inputview.layouts.util.createKey({
68 'widthInWeight': 2.2,
69 'heightInWeight': 0.75
70 });
71 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
72 'id': 'row3',
73 'children': [smallkeySequenceOf3, keySequenceOf2, rightKeyWithPadding]
74 });
75
76 // Row4
77 var spaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
78 'widthInWeight': 2.25,
79 'heightInWeight': 0.75
80 });
81 keySequenceOf3 = i18n.input.chrome.inputview.layouts.util.
82 createKeySequence(baseKeySpec, 3);
83 var hideKey = i18n.input.chrome.inputview.layouts.util.createKey({
84 'widthInWeight': 1.2,
85 'heightInWeight': 0.75
86 });
87 var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
88 'id': 'row4',
89 'children': [spaceKey, keySequenceOf3, hideKey]
90 });
91
92 return [row1, row2, row3, row4];
93 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698