OLD | NEW |
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
2 // limitations under the License. | 2 // limitations under the License. |
3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
7 // | 7 // |
8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
9 // | 9 // |
10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 'zhuyin' | 88 'zhuyin' |
89 ]; | 89 ]; |
90 | 90 |
91 | 91 |
92 /** | 92 /** |
93 * The keysets that have compact keyset. | 93 * The keysets that have compact keyset. |
94 * | 94 * |
95 * @type {!Array.<string>} | 95 * @type {!Array.<string>} |
96 */ | 96 */ |
97 util.KEYSETS_HAVE_COMPACT = [ | 97 util.KEYSETS_HAVE_COMPACT = [ |
98 'be', | |
99 'ca', | 98 'ca', |
100 'ca-eng', | 99 'ca-eng', |
101 'de', | 100 'de', |
102 'dk', | 101 'dk', |
103 'fi', | 102 'fi', |
104 'fr', | 103 'fr', |
105 'gb-extd', | 104 'gb-extd', |
106 'ie', | 105 'ie', |
107 'is', | 106 'is', |
| 107 'nl', |
108 'no', | 108 'no', |
109 'pinyin-zh-CN', | 109 'pinyin-zh-CN', |
110 'se', | 110 'se', |
111 'us', | 111 'us', |
112 'zhuyin' | 112 'zhuyin' |
113 ]; | 113 ]; |
114 | 114 |
115 | 115 |
116 /** | 116 /** |
117 * A regular expression for the end of a sentence. | 117 * A regular expression for the end of a sentence. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 * instead. | 259 * instead. |
260 * | 260 * |
261 * @param {string} invisibleCharacter The character can't be shown. | 261 * @param {string} invisibleCharacter The character can't be shown. |
262 * @return {string} The replacement. | 262 * @return {string} The replacement. |
263 */ | 263 */ |
264 util.getVisibleCharacter = function(invisibleCharacter) { | 264 util.getVisibleCharacter = function(invisibleCharacter) { |
265 var map = util.DISPLAY_MAPPING; | 265 var map = util.DISPLAY_MAPPING; |
266 if (map[invisibleCharacter]) { | 266 if (map[invisibleCharacter]) { |
267 return map[invisibleCharacter]; | 267 return map[invisibleCharacter]; |
268 } | 268 } |
| 269 // For non-spacing marks (e.g. \u05b1), ChromeOS cannot display it correctly |
| 270 // until there is a character before it to combine with. |
| 271 if (/[\u0591-\u05cf]/.test(invisibleCharacter)) { |
| 272 return '\u00a0' + invisibleCharacter; |
| 273 } |
269 return invisibleCharacter; | 274 return invisibleCharacter; |
270 }; | 275 }; |
271 | 276 |
272 | 277 |
273 /** | 278 /** |
274 * Whether this is a letter key. | 279 * Whether this is a letter key. |
275 * | 280 * |
276 * @param {!Array.<string>} characters The characters. | 281 * @param {!Array.<string>} characters The characters. |
277 * @return {boolean} True if this is a letter key. | 282 * @return {boolean} True if this is a letter key. |
278 */ | 283 */ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 * | 323 * |
319 * @param {string} keyboardCode The keyboard code. | 324 * @param {string} keyboardCode The keyboard code. |
320 * @return {string} The config file name which contains the keyset. | 325 * @return {string} The config file name which contains the keyset. |
321 */ | 326 */ |
322 util.getConfigName = function(keyboardCode) { | 327 util.getConfigName = function(keyboardCode) { |
323 // Strips out all the suffixes in the keyboard code. | 328 // Strips out all the suffixes in the keyboard code. |
324 return keyboardCode.replace(/\..*$/, ''); | 329 return keyboardCode.replace(/\..*$/, ''); |
325 }; | 330 }; |
326 | 331 |
327 }); // goog.scope | 332 }); // goog.scope |
OLD | NEW |