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

Side by Side Diff: lib/ui.js

Issue 4762316134416384: Issue 1670 - Removed "Hide placeholders" option from the UI (Firefox) (Closed)
Patch Set: Created Dec. 8, 2014, 6:10 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
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-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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 return; 497 return;
498 498
499 this.firstRunDone = true; 499 this.firstRunDone = true;
500 500
501 let {addonVersion} = require("info"); 501 let {addonVersion} = require("info");
502 let prevVersion = Prefs.currentVersion; 502 let prevVersion = Prefs.currentVersion;
503 if (prevVersion != addonVersion) 503 if (prevVersion != addonVersion)
504 { 504 {
505 Prefs.currentVersion = addonVersion; 505 Prefs.currentVersion = addonVersion;
506 this.addSubscription(window, prevVersion); 506 this.addSubscription(window, prevVersion);
507
508 // The "Hide placeholders" option has been removed from the UI in 2.6.6.38 79
509 // So we reset the option for users updating from older versions.
510 if (prevVersion && Services.vc.compare(prevVersion, "2.6.6.3879") < 0)
511 Prefs.fastcollapse = false;
507 } 512 }
508 }, 513 },
509 514
510 /** 515 /**
511 * Will be set to true after the check whether first-run actions should run 516 * Will be set to true after the check whether first-run actions should run
512 * has been performed. 517 * has been performed.
513 * @type Boolean 518 * @type Boolean
514 */ 519 */
515 firstRunDone: false, 520 firstRunDone: false,
516 521
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 setChecked(prefix + "whitelistsite", siteWhitelist.subscriptions.length && !siteWhitelist.disabled); 1530 setChecked(prefix + "whitelistsite", siteWhitelist.subscriptions.length && !siteWhitelist.disabled);
1526 generateLabel(prefix + "whitelistsite", location.spec.replace(/^mailto:/ , "")); 1531 generateLabel(prefix + "whitelistsite", location.spec.replace(/^mailto:/ , ""));
1527 hideElement(prefix + "whitelistsite", false); 1532 hideElement(prefix + "whitelistsite", false);
1528 } 1533 }
1529 } 1534 }
1530 1535
1531 setDisabled("abp-command-sendReport", !location || !Policy.isBlockableScheme (location) || location.scheme == "mailto"); 1536 setDisabled("abp-command-sendReport", !location || !Policy.isBlockableScheme (location) || location.scheme == "mailto");
1532 1537
1533 setChecked(prefix + "disabled", !Prefs.enabled); 1538 setChecked(prefix + "disabled", !Prefs.enabled);
1534 setChecked(prefix + "frameobjects", Prefs.frameobjects); 1539 setChecked(prefix + "frameobjects", Prefs.frameobjects);
1535 setChecked(prefix + "slowcollapse", !Prefs.fastcollapse); 1540 setChecked(prefix + "slowcollapse", !Prefs.fastcollapse);
Wladimir Palant 2014/12/11 10:23:15 Wait, shouldn't this be removed as well?
Sebastian Noack 2014/12/11 10:41:28 Done.
1536 setChecked(prefix + "savestats", Prefs.savestats); 1541 setChecked(prefix + "savestats", Prefs.savestats);
1537 1542
1538 let {defaultToolbarPosition, statusbarPosition} = require("appSupport"); 1543 let {defaultToolbarPosition, statusbarPosition} = require("appSupport");
1539 let hasToolbar = defaultToolbarPosition; 1544 let hasToolbar = defaultToolbarPosition;
1540 let hasStatusBar = statusbarPosition; 1545 let hasStatusBar = statusbarPosition;
1541 hideElement(prefix + "showintoolbar", !hasToolbar || prefix == "abp-toolbar- "); 1546 hideElement(prefix + "showintoolbar", !hasToolbar || prefix == "abp-toolbar- ");
1542 hideElement(prefix + "showinstatusbar", !hasStatusBar); 1547 hideElement(prefix + "showinstatusbar", !hasStatusBar);
1543 hideElement(prefix + "iconSettingsSeparator", (prefix == "abp-toolbar-" || ! hasToolbar) && !hasStatusBar); 1548 hideElement(prefix + "iconSettingsSeparator", (prefix == "abp-toolbar-" || ! hasToolbar) && !hasStatusBar);
1544 1549
1545 setChecked(prefix + "showintoolbar", this.isToolbarIconVisible()); 1550 setChecked(prefix + "showintoolbar", this.isToolbarIconVisible());
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 * handler the element ID, event and the actual event handler are listed. 1939 * handler the element ID, event and the actual event handler are listed.
1935 * @type Array 1940 * @type Array
1936 */ 1941 */
1937 let eventHandlers = [ 1942 let eventHandlers = [
1938 ["abp-command-sendReport", "command", UI.openReportDialog.bind(UI)], 1943 ["abp-command-sendReport", "command", UI.openReportDialog.bind(UI)],
1939 ["abp-command-filters", "command", UI.openFiltersDialog.bind(UI)], 1944 ["abp-command-filters", "command", UI.openFiltersDialog.bind(UI)],
1940 ["abp-command-sidebar", "command", UI.toggleBottombar.bind(UI)], 1945 ["abp-command-sidebar", "command", UI.toggleBottombar.bind(UI)],
1941 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }], 1946 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }],
1942 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }], 1947 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }],
1943 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )], 1948 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )],
1944 ["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse ")], 1949 ["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse ")],
Wladimir Palant 2014/12/11 10:23:15 And this.
Sebastian Noack 2014/12/11 10:41:28 Done.
1945 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)], 1950 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)],
1946 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)], 1951 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)],
1947 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)], 1952 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)],
1948 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")], 1953 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")],
1949 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")], 1954 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")],
1950 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1955 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1951 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1956 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1952 ]; 1957 ];
1953 1958
1954 onShutdown.add(function() 1959 onShutdown.add(function()
1955 { 1960 {
1956 for (let window in UI.applicationWindows) 1961 for (let window in UI.applicationWindows)
1957 if (UI.isBottombarOpen(window)) 1962 if (UI.isBottombarOpen(window))
1958 UI.toggleBottombar(window); 1963 UI.toggleBottombar(window);
1959 }); 1964 });
OLDNEW
« chrome/content/ui/overlay.xul ('K') | « chrome/locale/en-US/overlay.dtd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld