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

Side by Side Diff: ui/webui/resources/js/i18n_behavior.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well Created 3 years, 12 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
« no previous file with comments | « ui/webui/resources/js/cr/ui/tree.js ('k') | ui/webui/resources/js/load_time_data.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'I18nBehavior' is a behavior to mix in loading of 7 * 'I18nBehavior' is a behavior to mix in loading of
8 * internationalization strings. 8 * internationalization strings.
9 * 9 *
10 * Example: 10 * Example:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 var rawString = this.i18nRaw_.apply(this, args); 57 var rawString = this.i18nRaw_.apply(this, args);
58 return parseHtmlSubset('<b>' + rawString + '</b>', opts.tags, opts.attrs) 58 return parseHtmlSubset('<b>' + rawString + '</b>', opts.tags, opts.attrs)
59 .firstChild.innerHTML; 59 .firstChild.innerHTML;
60 }, 60 },
61 61
62 /** 62 /**
63 * Returns true if a translation exists for |id|. 63 * Returns true if a translation exists for |id|.
64 * @param {string} id 64 * @param {string} id
65 * @return {boolean} 65 * @return {boolean}
66 */ 66 */
67 i18nExists: function(id) { return loadTimeData.valueExists(id); }, 67 i18nExists: function(id) {
68 return loadTimeData.valueExists(id);
69 },
68 }; 70 };
69 71
70 /** 72 /**
71 * TODO(stevenjb): Replace with an interface. b/24294625 73 * TODO(stevenjb): Replace with an interface. b/24294625
72 * @typedef {{ 74 * @typedef {{
73 * i18n: function(string, ...string): string}}, 75 * i18n: function(string, ...string): string}},
74 * i18nAdvanced: function({ 76 * i18nAdvanced: function({
75 * substitutions: (Array<string>|undefined), 77 * substitutions: (Array<string>|undefined),
76 * attrs: (Object<function(Node, string):boolean>|undefined), 78 * attrs: (Object<function(Node, string):boolean>|undefined),
77 * tags: (Array<string>|undefined)}, opts), 79 * tags: (Array<string>|undefined)}, opts),
78 * i18nExists: function(string) 80 * i18nExists: function(string)
79 * }} 81 * }}
80 */ 82 */
81 I18nBehavior.Proto; 83 I18nBehavior.Proto;
OLDNEW
« no previous file with comments | « ui/webui/resources/js/cr/ui/tree.js ('k') | ui/webui/resources/js/load_time_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698