Index: html/static/js/ieFirstRun.js |
=================================================================== |
--- a/html/static/js/ieFirstRun.js |
+++ b/html/static/js/ieFirstRun.js |
@@ -1,50 +1,44 @@ |
-var AdblockPlus = { |
- require: function(param) |
+var AdblockPlus = (function() |
+{ |
+ var scopes = |
+ { |
+ prefs: |
{ |
- if (param == "prefs") |
+ Prefs: {documentation_link: ""} |
+ }, |
+ utils: |
+ { |
+ Utils: {appLocale: ""} |
+ }, |
+ filterClasses: |
+ { |
+ Filter: |
+ { |
+ fromText: |
{ |
- return { |
- Prefs: |
- { |
- documentation_link: "" |
- } |
- } |
+ 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 {}; |
+ } |
} |
-} |
+ }; |
-function initWrappers() |
-{ |
- AdblockPlus.getMessage = function(section, param) |
+ var result = |
+ { |
+ require: function(module) |
{ |
- return window.Settings.GetMessage(section, param); |
+ return scopes[module]; |
} |
- 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); |
+ } |
+ scopes.prefs.Prefs.documentation_link = Settings.GetDocumentationLink(); |
+ scopes.utils.Utils.appLocale = Settings.GetAppLocale(); |
+ }, false); |
+ |
+ return result; |
+})(); |