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

Unified Diff: html/static/js/firstRun.js

Issue 11300014: Injecting libadblockplus into IE (Closed)
Patch Set: Created July 29, 2013, 5:30 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: html/static/js/firstRun.js
===================================================================
--- a/html/static/js/firstRun.js
+++ b/html/static/js/firstRun.js
@@ -14,11 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-
-var require = AdblockPlus.require;
-var Prefs = require("prefs").Prefs;
-var Utils = require("utils").Utils;
-var Filter = require("filterClasses").Filter;
+var require;
function addListener(object, type, listener)
{
@@ -45,12 +41,18 @@
function openSharePopup(url)
{
+ var Prefs = require("prefs").Prefs;
+ var Utils = require("utils").Utils;
+ var Filter = require("filterClasses").Filter;
+
+
var iframe = document.getElementById("share-popup");
var glassPane = document.getElementById("glass-pane");
var popupMessageReceived = false;
var popupMessageListener = function(event)
{
+ var Filter = require("filterClasses").Filter;
var originFilter = Filter.fromText("||adblockplus.org^");
if (!originFilter.matches(event.origin, "OTHER", null, null))
return;
@@ -117,6 +119,9 @@
function getDocLink(page)
{
+ var Prefs = require("prefs").Prefs;
+ var Utils = require("utils").Utils;
+
return Prefs.documentation_link
.replace(/%LINK%/g, page)
.replace(/%LANG%/g, Utils.appLocale);
@@ -136,16 +141,21 @@
"share2-connection": "first-run-share2-or"
};
- document.title = AdblockPlus.getMessage("first-run-title-install");
+ document.title = Settings.GetMessage("first-run", "first-run-title-install");
for (var i in mapping)
{
var element = document.getElementById(i);
- element.innerText = AdblockPlus.getMessage(mapping[i]);
+ element.innerText = Settings.GetMessage("first-run", mapping[i]);
}
}
function init()
{
+ require = function(p){
+ eval("var response = " + Settings.require(p) + ";");
+ return response;
+ }
+
// Choose a share text variant randomly
var variant = Math.floor(Math.random() * 2) + 1;
var classList = document.documentElement.className.split(" ");
« no previous file with comments | « .hgsubstate ('k') | html/templates/firstRun.html » ('j') | html/templates/firstRun.html » ('J')

Powered by Google App Engine
This is Rietveld