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

Unified Diff: third_party/google_input_tools/src/chrome/os/inputview/elements/content/compactkeymodel.js

Issue 701603002: Update to google-input-tools version 1.0.5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/google_input_tools/src/chrome/os/inputview/elements/content/compactkeymodel.js
diff --git a/third_party/google_input_tools/src/chrome/os/inputview/elements/content/compactkeymodel.js b/third_party/google_input_tools/src/chrome/os/inputview/elements/content/compactkeymodel.js
new file mode 100644
index 0000000000000000000000000000000000000000..e26d9b243a68583bf9d465bbf9c8ab7bd3494149
--- /dev/null
+++ b/third_party/google_input_tools/src/chrome/os/inputview/elements/content/compactkeymodel.js
@@ -0,0 +1,108 @@
+// Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
+// limitations under the License.
+// See the License for the specific language governing permissions and
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// distributed under the License is distributed on an "AS-IS" BASIS,
+// Unless required by applicable law or agreed to in writing, software
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// You may obtain a copy of the License at
+// you may not use this file except in compliance with the License.
+// Licensed under the Apache License, Version 2.0 (the "License");
+//
+goog.provide('i18n.input.chrome.inputview.elements.content.CompactKeyModel');
+
+goog.require('i18n.input.chrome.inputview.MoreKeysShiftOperation');
+
+
+goog.scope(function() {
+var MoreKeysShiftOperation = i18n.input.chrome.inputview.MoreKeysShiftOperation;
+
+
+/**
+ * The model of compact key.
+ *
+ * @param {number} marginLeftPercent The left margin.
+ * @param {number} marginRightPercent The right margin.
+ * @param {boolean} isGrey Whether it is grey.
+ * @param {!Array.<string>} moreKeys The more keys.
+ * @param {MoreKeysShiftOperation} moreKeysShiftOperation
+ * The type of opearation when the shift key is down.
+ * @param {string} textOnShift The text to display on shift.
+ * @param {Object.<string, !Object>} textOnContext Map for changing the key
+ * based on the current input context.
+ * @param {string=} textCssClass The css class for the text.
+ * @param {string=} title Overrides the displayed text on the key.
+ * @constructor
+ * @extends {i18n.input.chrome.inputview.elements.content.FunctionalKey}
+ */
+i18n.input.chrome.inputview.elements.content.CompactKeyModel =
+ function(marginLeftPercent, marginRightPercent, isGrey, moreKeys,
+ moreKeysShiftOperation, textOnShift, textOnContext, textCssClass, title) {
+
+ /**
+ * The left margin.
+ *
+ * @type {number}
+ */
+ this.marginLeftPercent = marginLeftPercent || 0;
+
+ /**
+ * The right margin.
+ *
+ * @type {number}
+ */
+ this.marginRightPercent = marginRightPercent || 0;
+
+ /**
+ * True if it is grey.
+ *
+ * @type {boolean}
+ */
+ this.isGrey = !!isGrey;
+
+ /**
+ * The more keys array.
+ *
+ * @type {!Array.<string>}
+ */
+ this.moreKeys = moreKeys || [];
+
+ /**
+ * The type of shift operation of moreKeys.
+ *
+ * @type {MoreKeysShiftOperation}
+ */
+ this.moreKeysShiftOperation = moreKeysShiftOperation ?
+ moreKeysShiftOperation : MoreKeysShiftOperation.TO_UPPER_CASE;
+
+ /**
+ * The text when shift is pressed down.
+ *
+ * @type {string}
+ */
+ this.textOnShift = textOnShift;
+
+ /**
+ * The css class for the text.
+ *
+ * @type {string}
+ */
+ this.textCssClass = textCssClass || '';
+
+ /**
+ * Map for changing the key based on the current input context.
+ *
+ * @type {Object.<string, !Object>}
+ */
+ this.textOnContext = textOnContext || {};
+
+ /**
+ * Alternate title for the key. Title is displayed, whereas text is
+ * what is actually committed.
+ */
+ this.title = title || '';
+};
+}); // goog.scope
+

Powered by Google App Engine
This is Rietveld 408576698