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: { |
Felix Dahlke
2014/07/04 13:40:32
Opening braces of multi-line object literals shoul
|
+ Prefs: { documentation_link: "" } |
Felix Dahlke
2014/07/04 13:40:32
No space after "{" or before "}" for object litera
|
+ }, |
+ utils: { |
+ Utils: { appLocale: "" } |
Felix Dahlke
2014/07/04 13:40:32
Indentation should be 2 spaces per level.
|
+ }, |
+ 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() |
+ { |
+ result.getMessage = function(section, param) { |
+ return Settings.GetMessage(section, param); |
Felix Dahlke
2014/07/04 13:40:32
Indentation is off here.
|
+ } |
Felix Dahlke
2014/07/04 13:40:32
Is that trailing whitespace?
|
+ scopes.prefs.Prefs.documentation_link = Settings.GetDocumentationLink(); |
+ scopes.utils.Utils.appLocale = Settings.GetAppLocale(); |
+ }, false); |
+ |
+ return result; |
+})(); |