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

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

Issue 4859491858251776: Fix the approach used in ieFirstRun.js (Closed)
Patch Set: Created March 21, 2014, 4:58 p.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
« html/static/js/firstRun.js ('K') | « html/static/js/firstRun.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/static/js/ieFirstRun.js
===================================================================
--- a/html/static/js/ieFirstRun.js
+++ b/html/static/js/ieFirstRun.js
@@ -1,50 +1,35 @@
-var AdblockPlus = {
- require: function(param)
- {
- if (param == "prefs")
- {
- return {
- Prefs:
- {
- documentation_link: ""
- }
+var AdblockPlus = (function()
+{
+ var scopes = {
+ prefs: {
+ Prefs: { documentation_link: "" }
+ },
+ utils: {
+ Utils: { appLocale: "" }
+ },
+ filterClasses: {
+ Filter: {
+ fromText: {
+ matches: function(param) { return true }
}
}
- if (param == "utils")
- {
- return {
- Utils:
- {
- appLocale: ""
- }
- }
- }
- if (param == "filterClasses")
- {
- return {
- Filter:
- {
- fromText: function(param)
- {
- return {
- matches: function(param) {
- return true;
- }
- }
- }
- }
- }
- }
- return {};
+ }
+ };
+
+ var result = {
+ require: function(module) {
+ return scopes[module];
}
-}
+ };
-function initWrappers()
-{
- AdblockPlus.getMessage = function(section, param)
- {
- return window.Settings.GetMessage(section, param);
- }
- Prefs.documentation_link = window.Settings.GetDocumentationLink();
- Utils.appLocale = window.Settings.GetAppLocale();
-}
+ window.addEventListener("load", function()
Wladimir Palant 2014/03/31 09:50:29 This won't work in older IE versions. How about yo
Eric 2014/06/25 16:21:06 And by older, that includes IE 8, unfortunately, a
+ {
+ result.getMessage = function(section, param) {
+ return Settings.GetMessage(section, param);
+ }
+ scopes.prefs.Prefs.documentation_link = Settings.GetDocumentationLink();
+ scopes.utils.Utils.appLocale = Settings.GetAppLocale();
+ }, false);
+
+ return result;
+})();
« html/static/js/firstRun.js ('K') | « html/static/js/firstRun.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld