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

Side by Side Diff: lib/ui.js

Issue 5181328018374656: A better approach to make Contribute button Australis-compatible (Closed)
Patch Set: Created Nov. 21, 2013, 12:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/ui/overlay.xul ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 let uri = this.getCurrentLocation(window); 706 let uri = this.getCurrentLocation(window);
707 if (uri) 707 if (uri)
708 { 708 {
709 let {getBrowser} = require("appSupport"); 709 let {getBrowser} = require("appSupport");
710 window.openDialog("chrome://adblockplus/content/ui/sendReport.xul", "_bl ank", "chrome,centerscreen,resizable=no", getBrowser(window).contentWindow, uri) ; 710 window.openDialog("chrome://adblockplus/content/ui/sendReport.xul", "_bl ank", "chrome,centerscreen,resizable=no", getBrowser(window).contentWindow, uri) ;
711 } 711 }
712 } 712 }
713 }, 713 },
714 714
715 /** 715 /**
716 * Closes icon's menu when a button is clicked to prevent ugly effects such
717 * as https://bugzilla.mozilla.org/show_bug.cgi?id=940693.
718 */
719 closeIconMenu: function(/**Window*/ window)
720 {
721 for each (let id in ["abp-toolbar-popup", "abp-status-popup"])
722 {
723 let element = window.document.getElementById(id);
724 if (element && element.state == "open")
725 element.hidePopup();
726 }
727 },
728
729 /**
730 * Opens our contribution page. 716 * Opens our contribution page.
731 */ 717 */
732 openContributePage: function(/**Window*/ window) 718 openContributePage: function(/**Window*/ window)
733 { 719 {
734 this.loadDocLink("contribute", window); 720 this.loadDocLink("contribute", window);
735 }, 721 },
736 722
737 /** 723 /**
738 * Executed on first run, adds a filter subscription and notifies that user 724 * Executed on first run, adds a filter subscription and notifies that user
739 * about that. 725 * about that.
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }], 2016 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }],
2031 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }], 2017 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }],
2032 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )], 2018 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )],
2033 ["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse ")], 2019 ["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse ")],
2034 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)], 2020 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)],
2035 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)], 2021 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)],
2036 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)], 2022 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)],
2037 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")], 2023 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")],
2038 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")], 2024 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")],
2039 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 2025 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
2040 ["abp-command-contribute", "command", UI.closeIconMenu.bind(UI)], 2026 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
2041 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)],
2042 ["abp-command-contribute-hide", "command", UI.closeIconMenu.bind(UI)]
2043 ]; 2027 ];
2044 2028
2045 onShutdown.add(function() 2029 onShutdown.add(function()
2046 { 2030 {
2047 for (let window in UI.applicationWindows) 2031 for (let window in UI.applicationWindows)
2048 if (UI.isBottombarOpen(window)) 2032 if (UI.isBottombarOpen(window))
2049 UI.toggleBottombar(window); 2033 UI.toggleBottombar(window);
2050 }); 2034 });
OLDNEW
« no previous file with comments | « chrome/content/ui/overlay.xul ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld