OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 var Utils = exports.Utils = { | 18 var Utils = exports.Utils = { |
19 systemPrincipal: null, | 19 systemPrincipal: null, |
20 getString: function(id) | 20 getString: function(id) |
21 { | 21 { |
22 if (typeof ext !== "undefined" && "i18n" in ext) | 22 return ext.i18n.getMessage("global_" + id); |
23 return ext.i18n.getMessage("global_" + id); | |
24 else | |
25 return id; | |
26 }, | 23 }, |
27 runAsync: function(callback) | 24 runAsync: function(callback) |
28 { | 25 { |
29 if (document.readyState == "loading") | 26 if (document.readyState == "loading") |
30 { | 27 { |
31 // Make sure to not run asynchronous actions before all | 28 // Make sure to not run asynchronous actions before all |
32 // scripts loaded. This caused issues on Opera in the past. | 29 // scripts loaded. This caused issues on Opera in the past. |
33 let onDOMContentLoaded = function() | 30 let onDOMContentLoaded = function() |
34 { | 31 { |
35 document.removeEventListener("DOMContentLoaded", onDOMContentLoaded); | 32 document.removeEventListener("DOMContentLoaded", onDOMContentLoaded); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 { | 106 { |
110 var Prefs = require("prefs").Prefs; | 107 var Prefs = require("prefs").Prefs; |
111 var docLink = Prefs.documentation_link; | 108 var docLink = Prefs.documentation_link; |
112 return docLink.replace(/%LINK%/g, linkID).replace(/%LANG%/g, Utils.appLocale
); | 109 return docLink.replace(/%LINK%/g, linkID).replace(/%LANG%/g, Utils.appLocale
); |
113 }, | 110 }, |
114 | 111 |
115 yield: function() | 112 yield: function() |
116 { | 113 { |
117 } | 114 } |
118 }; | 115 }; |
OLD | NEW |