OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 { | 709 { |
710 try | 710 try |
711 { | 711 { |
712 existing.focus(); | 712 existing.focus(); |
713 } catch (e) {} | 713 } catch (e) {} |
714 if (filter) | 714 if (filter) |
715 existing.SubscriptionActions.selectFilter(filter); | 715 existing.SubscriptionActions.selectFilter(filter); |
716 } | 716 } |
717 else | 717 else |
718 { | 718 { |
719 Services.ww.openWindow(null, "chrome://adblockplus/content/ui/filters.xul"
, "_blank", "chrome,centerscreen,resizable,dialog=no", {wrappedJSObject: filter}
); | 719 let {application} = require("info"); |
| 720 if (application == "fennec2") |
| 721 { |
| 722 Cu.import("resource://gre/modules/Prompt.jsm"); |
| 723 let hasAcceptableAds = FilterStorage.subscriptions.some(function(subscri
ption) subscription instanceof DownloadableSubscription && subscription.url == P
refs.subscriptions_exceptionsurl); |
| 724 let promtSettings = |
| 725 { |
| 726 title: Utils.getString("disable_aa_promt_title"), |
| 727 message: Utils.getString("disable_aa_promt_msg_already") |
| 728 }; |
| 729 |
| 730 if (hasAcceptableAds) |
| 731 { |
| 732 promtSettings["buttons"] = [Utils.getString("disable_aa_promt_ok"), Ut
ils.getString("disable_aa_promt_cancel")]; |
| 733 promtSettings["message"] = Utils.getString("disable_aa_promt_msg"); |
| 734 } |
| 735 |
| 736 new Prompt(promtSettings).show(function(data) |
| 737 { |
| 738 if (data.button == 0) |
| 739 UI.toggleAcceptableAds(); |
| 740 }); |
| 741 } |
| 742 else |
| 743 Services.ww.openWindow(null, "chrome://adblockplus/content/ui/filters.xu
l", "_blank", "chrome,centerscreen,resizable,dialog=no", {wrappedJSObject: filte
r}); |
720 } | 744 } |
721 }, | 745 }, |
722 | 746 |
723 /** | 747 /** |
724 * Opens report wizard for the current page. | 748 * Opens report wizard for the current page. |
725 */ | 749 */ |
726 openReportDialog: function(/**Window*/ window) | 750 openReportDialog: function(/**Window*/ window) |
727 { | 751 { |
728 let wnd = Services.wm.getMostRecentWindow("abp:sendReport"); | 752 let wnd = Services.wm.getMostRecentWindow("abp:sendReport"); |
729 if (wnd) | 753 if (wnd) |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], | 1941 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], |
1918 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] | 1942 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] |
1919 ]; | 1943 ]; |
1920 | 1944 |
1921 onShutdown.add(function() | 1945 onShutdown.add(function() |
1922 { | 1946 { |
1923 for (let window in UI.applicationWindows) | 1947 for (let window in UI.applicationWindows) |
1924 if (UI.isBottombarOpen(window)) | 1948 if (UI.isBottombarOpen(window)) |
1925 UI.toggleBottombar(window); | 1949 UI.toggleBottombar(window); |
1926 }); | 1950 }); |
OLD | NEW |