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: Formatting fixed Created July 15, 2014, 8:28 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
« no previous file with comments | « html/static/js/ieEventListenerPolyfill.js ('k') | html/templates/firstRun.html » ('j') | 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,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: ""
- }
- }
- }
- if (param == "utils")
- {
- return {
- Utils:
- {
- appLocale: ""
- }
- }
- }
- if (param == "filterClasses")
- {
- return {
- Filter:
- {
- fromText: function(param)
- {
- return {
- matches: function(param) {
- return true;
- }
- }
- }
- }
- }
- }
- return {};
+ matches: function(param) {return true}
+ }
Felix Dahlke 2014/07/16 11:05:17 Indentation is still off here :P
+ }
}
-}
+ };
-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)
Felix Dahlke 2014/07/16 11:05:17 Simpler: result.getMessage = Settings.GetMessage;
Oleksandr 2014/07/16 11:19:41 This doesn't work. Settings.GetMessage is a method
Felix Dahlke 2014/07/18 12:43:36 Oh :P
+ {
+ return Settings.GetMessage(section, param);
+ }
+ scopes.prefs.Prefs.documentation_link = Settings.GetDocumentationLink();
+ scopes.utils.Utils.appLocale = Settings.GetAppLocale();
+ }, false);
+
+ return result;
+})();
« no previous file with comments | « html/static/js/ieEventListenerPolyfill.js ('k') | html/templates/firstRun.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld