1 // Copyright 2014 The Cloud Input Tools Authors. All Rights Reserved.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
16 * @fileoverview Defines the global settings variables for ITA.
19 goog.provide('i18n.input.common.GlobalSettings');
21 goog.require('goog.positioning.Corner');
22 goog.require('goog.userAgent');
26 * The application name.
30 i18n.input.common.GlobalSettings.ApplicationName = 'jsapi';
34 * The help url for the help button on keyboard. If empty string, the help
35 * button will not be showed.
39 i18n.input.common.GlobalSettings.KeyboardHelpUrl = '';
43 * Whether show min/max button on keyboard.
47 i18n.input.common.GlobalSettings.KeyboardShowMinMax = false;
51 * Whether to show status bar.
55 i18n.input.common.GlobalSettings.ShowStatusBar = true;
59 * Whether to show google logo.
63 i18n.input.common.GlobalSettings.showGoogleLogo = false;
67 * The shortcut key definition for statusbar toggle language command.
71 i18n.input.common.GlobalSettings.StatusBarToggleLanguageShortcut = 'shift';
75 * The shortcut key definition for statusbar toggle sbc/dbc command.
79 i18n.input.common.GlobalSettings.StatusBarToggleSbcShortcut = 'shift+space';
83 * The shortcut key definition for statusbar punctuation command.
87 i18n.input.common.GlobalSettings.StatusBarPunctuationShortcut = 'ctrl+.';
91 * Keyboard default location.
93 * @type {!goog.positioning.Corner}
95 i18n.input.common.GlobalSettings.KeyboardDefaultLocation =
96 goog.positioning.Corner.BOTTOM_END;
100 * Handwriting panel default location.
102 * @type {!goog.positioning.Corner}
104 i18n.input.common.GlobalSettings.HandwritingDefaultLocation =
105 goog.positioning.Corner.BOTTOM_END;
109 * Whether is offline mode. If true, IME will be switched to offline and all
110 * tracking (server ping, ga, csi, etc.) are disabled.
111 * TODO(shuchen): Later we will use this flag to switch to ITA offline decoder.
115 i18n.input.common.GlobalSettings.isOfflineMode = false;
119 * Whether to sends the fake events when input box value is changed.
123 i18n.input.common.GlobalSettings.canSendFakeEvents = true;
127 * No need to register handler in capture phase for IE8.
131 i18n.input.common.GlobalSettings.canListenInCaptureForIE8 =
132 !goog.userAgent.IE || goog.userAgent.isVersionOrHigher(9);
136 * The chrome extension settings.
140 i18n.input.common.GlobalSettings.chromeExtension = {
141 ACT_FLAG: 'IS_INPUT_ACTIVE',
142 ACTIVE_UI_IFRAME_ID: 'GOOGLE_INPUT_ACTIVE_UI',
143 APP_FLAG: 'GOOGLE_INPUT_NON_CHEXT_FLAG',
144 CHEXT_FLAG: 'GOOGLE_INPUT_CHEXT_FLAG',
146 INPUTTOOL_STAT: 'input_stat',
147 STATUS_BAR_IFRAME_ID: 'GOOGLE_INPUT_STATUS_BAR'
152 * @define {string} The name of the product which uses Google Input Tools API.
154 i18n.input.common.GlobalSettings.BUILD_SOURCE = 'jsapi';
158 * @define {boolean} Whether uses XMLHttpRequest or not.
160 i18n.input.common.GlobalSettings.ENABLE_XHR = false;
164 * Whether enables the statistics for IME's status bar.
165 * TODO(shuchen): Investigates how to make sure status bar won't send
166 * duplicated metrics requests. And then we can remove this flag.
170 i18n.input.common.GlobalSettings.enableStatusBarMetrics = false;
174 * Whether to show on-screen keyboard.
175 * false: Hides on-screen keyboard.
176 * true: Shows on-screen keyboard.
180 i18n.input.common.GlobalSettings.onScreenKeyboard = true;
184 * Whether to enable personal dictionary or not.
188 i18n.input.common.GlobalSettings.enableUserDict = false;
192 * Defines the max int value.
196 i18n.input.common.GlobalSettings.MAX_INT = 2147483647;
200 * Whether enables the user prefs.
204 i18n.input.common.GlobalSettings.enableUserPrefs = true;
208 * @define {boolean} UI wrapper by iframe.
210 i18n.input.common.GlobalSettings.IFRAME_WRAPPER = false;
214 * The CSS string. When create a new iframe wrapper, need to install css style
215 * in the iframe document.
220 i18n.input.common.GlobalSettings.css = '';
224 * Alternative image URL in CSS (e.g. Chrome extension needs a local path).
228 i18n.input.common.GlobalSettings.alternativeImageUrl = '';
232 * @define {boolean} Whether to enable Voice input.
234 i18n.input.common.GlobalSettings.enableVoice = false;
238 * Whether to enable global event delegate.
242 i18n.input.common.GlobalSettings.enableGlobalEventDelegate = true;
246 * Whether to adapter in mobile devices.
250 i18n.input.common.GlobalSettings.mobile = goog.userAgent.MOBILE;