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

Unified Diff: lib/ui.js

Issue 6286955629248512: disable acceptable ads from first run page (Closed)
Patch Set: Created April 30, 2014, 1:16 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
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -716,7 +716,31 @@
}
else
{
- Services.ww.openWindow(null, "chrome://adblockplus/content/ui/filters.xul", "_blank", "chrome,centerscreen,resizable,dialog=no", {wrappedJSObject: filter});
+ let {application} = require("info");
+ if (application == "fennec2")
+ {
+ Cu.import("resource://gre/modules/Prompt.jsm");
+ let hasAcceptableAds = FilterStorage.subscriptions.some(function(subscription) subscription instanceof DownloadableSubscription && subscription.url == Prefs.subscriptions_exceptionsurl);
+ let promtSettings =
+ {
+ title: Utils.getString("disable_aa_promt_title"),
+ message: Utils.getString("disable_aa_promt_msg_already")
+ };
+
+ if (hasAcceptableAds)
+ {
+ promtSettings["buttons"] = [Utils.getString("disable_aa_promt_ok"), Utils.getString("disable_aa_promt_cancel")];
+ promtSettings["message"] = Utils.getString("disable_aa_promt_msg");
+ }
+
+ new Prompt(promtSettings).show(function(data)
+ {
+ if (data.button == 0)
+ UI.toggleAcceptableAds();
+ });
+ }
+ else
+ Services.ww.openWindow(null, "chrome://adblockplus/content/ui/filters.xul", "_blank", "chrome,centerscreen,resizable,dialog=no", {wrappedJSObject: filter});
}
},
« chrome/locale/en-US/global.properties ('K') | « chrome/locale/en-US/global.properties ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld