OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Cloud Input Tools Authors. All Rights Reserved. |
| 2 // |
| 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 |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 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. |
| 14 |
| 15 /** |
| 16 * @fileoverview Defines the global settings variables for ITA. |
| 17 */ |
| 18 |
| 19 goog.provide('i18n.input.common.GlobalSettings'); |
| 20 |
| 21 goog.require('goog.positioning.Corner'); |
| 22 goog.require('goog.userAgent'); |
| 23 |
| 24 |
| 25 /** |
| 26 * The application name. |
| 27 * |
| 28 * @type {string} |
| 29 */ |
| 30 i18n.input.common.GlobalSettings.ApplicationName = 'jsapi'; |
| 31 |
| 32 |
| 33 /** |
| 34 * The help url for the help button on keyboard. If empty string, the help |
| 35 * button will not be showed. |
| 36 * |
| 37 * @type {string} |
| 38 */ |
| 39 i18n.input.common.GlobalSettings.KeyboardHelpUrl = ''; |
| 40 |
| 41 |
| 42 /** |
| 43 * Whether show min/max button on keyboard. |
| 44 * |
| 45 * @type {boolean} |
| 46 */ |
| 47 i18n.input.common.GlobalSettings.KeyboardShowMinMax = false; |
| 48 |
| 49 |
| 50 /** |
| 51 * Whether to show status bar. |
| 52 * |
| 53 * @type {boolean} |
| 54 */ |
| 55 i18n.input.common.GlobalSettings.ShowStatusBar = true; |
| 56 |
| 57 |
| 58 /** |
| 59 * Whether to show google logo. |
| 60 * |
| 61 * @type {boolean} |
| 62 */ |
| 63 i18n.input.common.GlobalSettings.showGoogleLogo = false; |
| 64 |
| 65 |
| 66 /** |
| 67 * The shortcut key definition for statusbar toggle language command. |
| 68 * |
| 69 * @type {string} |
| 70 */ |
| 71 i18n.input.common.GlobalSettings.StatusBarToggleLanguageShortcut = 'shift'; |
| 72 |
| 73 |
| 74 /** |
| 75 * The shortcut key definition for statusbar toggle sbc/dbc command. |
| 76 * |
| 77 * @type {string} |
| 78 */ |
| 79 i18n.input.common.GlobalSettings.StatusBarToggleSbcShortcut = 'shift+space'; |
| 80 |
| 81 |
| 82 /** |
| 83 * The shortcut key definition for statusbar punctuation command. |
| 84 * |
| 85 * @type {string} |
| 86 */ |
| 87 i18n.input.common.GlobalSettings.StatusBarPunctuationShortcut = 'ctrl+.'; |
| 88 |
| 89 |
| 90 /** |
| 91 * Keyboard default location. |
| 92 * |
| 93 * @type {!goog.positioning.Corner} |
| 94 */ |
| 95 i18n.input.common.GlobalSettings.KeyboardDefaultLocation = |
| 96 goog.positioning.Corner.BOTTOM_END; |
| 97 |
| 98 |
| 99 /** |
| 100 * Handwriting panel default location. |
| 101 * |
| 102 * @type {!goog.positioning.Corner} |
| 103 */ |
| 104 i18n.input.common.GlobalSettings.HandwritingDefaultLocation = |
| 105 goog.positioning.Corner.BOTTOM_END; |
| 106 |
| 107 |
| 108 /** |
| 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. |
| 112 * |
| 113 * @type {boolean} |
| 114 */ |
| 115 i18n.input.common.GlobalSettings.isOfflineMode = false; |
| 116 |
| 117 |
| 118 /** |
| 119 * Whether to sends the fake events when input box value is changed. |
| 120 * |
| 121 * @type {boolean} |
| 122 */ |
| 123 i18n.input.common.GlobalSettings.canSendFakeEvents = true; |
| 124 |
| 125 |
| 126 /** |
| 127 * No need to register handler in capture phase for IE8. |
| 128 * |
| 129 * @type {boolean} |
| 130 */ |
| 131 i18n.input.common.GlobalSettings.canListenInCaptureForIE8 = |
| 132 !goog.userAgent.IE || goog.userAgent.isVersionOrHigher(9); |
| 133 |
| 134 |
| 135 /** |
| 136 * The chrome extension settings. |
| 137 * |
| 138 * @enum {string} |
| 139 */ |
| 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', |
| 145 INPUTTOOL: 'input', |
| 146 INPUTTOOL_STAT: 'input_stat', |
| 147 STATUS_BAR_IFRAME_ID: 'GOOGLE_INPUT_STATUS_BAR' |
| 148 }; |
| 149 |
| 150 |
| 151 /** |
| 152 * @define {string} The name of the product which uses Google Input Tools API. |
| 153 */ |
| 154 i18n.input.common.GlobalSettings.BUILD_SOURCE = 'jsapi'; |
| 155 |
| 156 |
| 157 /** |
| 158 * @define {boolean} Whether uses XMLHttpRequest or not. |
| 159 */ |
| 160 i18n.input.common.GlobalSettings.ENABLE_XHR = false; |
| 161 |
| 162 |
| 163 /** |
| 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. |
| 167 * |
| 168 * @type {boolean} |
| 169 */ |
| 170 i18n.input.common.GlobalSettings.enableStatusBarMetrics = false; |
| 171 |
| 172 |
| 173 /** |
| 174 * Whether to show on-screen keyboard. |
| 175 * false: Hides on-screen keyboard. |
| 176 * true: Shows on-screen keyboard. |
| 177 * |
| 178 * @type {boolean} |
| 179 */ |
| 180 i18n.input.common.GlobalSettings.onScreenKeyboard = true; |
| 181 |
| 182 |
| 183 /** |
| 184 * Whether to enable personal dictionary or not. |
| 185 * |
| 186 * @type {boolean} |
| 187 */ |
| 188 i18n.input.common.GlobalSettings.enableUserDict = false; |
| 189 |
| 190 |
| 191 /** |
| 192 * Defines the max int value. |
| 193 * |
| 194 * @type {number} |
| 195 */ |
| 196 i18n.input.common.GlobalSettings.MAX_INT = 2147483647; |
| 197 |
| 198 |
| 199 /** |
| 200 * Whether enables the user prefs. |
| 201 * |
| 202 * @type {boolean} |
| 203 */ |
| 204 i18n.input.common.GlobalSettings.enableUserPrefs = true; |
| 205 |
| 206 |
| 207 /** |
| 208 * @define {boolean} UI wrapper by iframe. |
| 209 */ |
| 210 i18n.input.common.GlobalSettings.IFRAME_WRAPPER = false; |
| 211 |
| 212 |
| 213 /** |
| 214 * The CSS string. When create a new iframe wrapper, need to install css style |
| 215 * in the iframe document. |
| 216 * |
| 217 * @type {string} |
| 218 * |
| 219 */ |
| 220 i18n.input.common.GlobalSettings.css = ''; |
| 221 |
| 222 |
| 223 /** |
| 224 * Alternative image URL in CSS (e.g. Chrome extension needs a local path). |
| 225 * |
| 226 * @type {string} |
| 227 */ |
| 228 i18n.input.common.GlobalSettings.alternativeImageUrl = ''; |
| 229 |
| 230 |
| 231 /** |
| 232 * @define {boolean} Whether to enable Voice input. |
| 233 */ |
| 234 i18n.input.common.GlobalSettings.enableVoice = false; |
| 235 |
OLD | NEW |