Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: lib/utils.js

Issue 5749582424178688: Ported over anti-adblock message notification (Closed)
Left Patch Set: Created Feb. 28, 2014, 6:41 p.m.
Right Patch Set: Created March 21, 2014, 1:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « lib/prefs.js ('k') | metadata.common » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 let runAsyncQueue; 18 let runAsyncQueue;
19 19
20 var Utils = exports.Utils = { 20 var Utils = exports.Utils = {
21 systemPrincipal: null, 21 systemPrincipal: null,
22 getString: function(id) 22 getString: function(id)
23 { 23 {
24 return id; 24 if (typeof ext !== "undefined" && "i18n" in ext)
25 return ext.i18n.getMessage("global_" + id);
26 else
27 return id;
25 }, 28 },
26 29
27 // This function can take additional parameters. Second paramater will be 30 // This function can take additional parameters. Second paramater will be
28 // passed as this variable to the callback and any additional parameters as 31 // passed as this variable to the callback and any additional parameters as
29 // callback parameters. 32 // callback parameters.
30 runAsync: function(callback) 33 runAsync: function(callback)
31 { 34 {
32 callback = callback.bind.apply(callback, Array.prototype.slice.call(argument s, 1)); 35 callback = callback.bind.apply(callback, Array.prototype.slice.call(argument s, 1));
33 36
34 if (typeof runAsyncQueue == "undefined") 37 if (typeof runAsyncQueue == "undefined")
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return selectedItem; 136 return selectedItem;
134 }, 137 },
135 138
136 getDocLink: function(linkID) 139 getDocLink: function(linkID)
137 { 140 {
138 var Prefs = require("prefs").Prefs; 141 var Prefs = require("prefs").Prefs;
139 var docLink = Prefs.documentation_link; 142 var docLink = Prefs.documentation_link;
140 return docLink.replace(/%LINK%/g, linkID).replace(/%LANG%/g, Utils.appLocale ); 143 return docLink.replace(/%LINK%/g, linkID).replace(/%LANG%/g, Utils.appLocale );
141 } 144 }
142 }; 145 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld