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

Side by Side Diff: ui/keyboard/resources/elements/kb-altkey-data.js

Issue 594603002: Compile ui/keyboard/ JS, part 1: remove all warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: Created 6 years, 2 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function() { 5 (function() {
6 var altKeys = {}; 6 var altKeys = {};
7 var idMap = {}; 7 var idMap = {};
8 8
9 /** 9 /**
10 * Creates a unique identifier based on the key provided. 10 * Creates a unique identifier based on the key provided.
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 Polymer('kb-altkey-data', { 26 Polymer('kb-altkey-data', {
27 27
28 /** 28 /**
29 * Retrieves a list of alternative keys to display on a long-press. 29 * Retrieves a list of alternative keys to display on a long-press.
30 * @param {string} char The base character. 30 * @param {string} char The base character.
31 * @param {boolean=} opt_force If true, force the creation of a list 31 * @param {boolean=} opt_force If true, force the creation of a list
32 * even if empty. Used when constructing a set of alternates for keys 32 * even if empty. Used when constructing a set of alternates for keys
33 * with hintTexts. 33 * with hintTexts.
34 * @return {?Object.{id: string, list: string}} 34 * @return {?{id: string, list: string}}
35 */ 35 */
36 getAltkeys: function(char, opt_force) { 36 getAltkeys: function(char, opt_force) {
37 var id = idMap[char]; 37 var id = idMap[char];
38 if (id) { 38 if (id) {
39 return { 39 return {
40 'id': id, 40 'id': id,
41 'keys': altKeys[id] 41 'keys': altKeys[id]
42 }; 42 };
43 } 43 }
44 if (opt_force) { 44 if (opt_force) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 prepend = true; 117 prepend = true;
118 } 118 }
119 set.id = altKeys.id; 119 set.id = altKeys.id;
120 set.offset = leftOffset; 120 set.offset = leftOffset;
121 return set; 121 return set;
122 } 122 }
123 }, 123 },
124 124
125 }); 125 });
126 })(); 126 })();
OLDNEW
« no previous file with comments | « ui/keyboard/resources/compiled_resources.gyp ('k') | ui/keyboard/resources/elements/kb-key-base.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698