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: Removed remaining UI code, updated version check Created Dec. 11, 2014, 10:40 a.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/locale/en-US/overlay.dtd ('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-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 81
509 // So we reset the option for users updating from older versions.
510 if (prevVersion && Services.vc.compare(prevVersion, "2.6.6.3881") < 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);
1536 setChecked(prefix + "savestats", Prefs.savestats); 1540 setChecked(prefix + "savestats", Prefs.savestats);
1537 1541
1538 let {defaultToolbarPosition, statusbarPosition} = require("appSupport"); 1542 let {defaultToolbarPosition, statusbarPosition} = require("appSupport");
1539 let hasToolbar = defaultToolbarPosition; 1543 let hasToolbar = defaultToolbarPosition;
1540 let hasStatusBar = statusbarPosition; 1544 let hasStatusBar = statusbarPosition;
1541 hideElement(prefix + "showintoolbar", !hasToolbar || prefix == "abp-toolbar- "); 1545 hideElement(prefix + "showintoolbar", !hasToolbar || prefix == "abp-toolbar- ");
1542 hideElement(prefix + "showinstatusbar", !hasStatusBar); 1546 hideElement(prefix + "showinstatusbar", !hasStatusBar);
1543 hideElement(prefix + "iconSettingsSeparator", (prefix == "abp-toolbar-" || ! hasToolbar) && !hasStatusBar); 1547 hideElement(prefix + "iconSettingsSeparator", (prefix == "abp-toolbar-" || ! hasToolbar) && !hasStatusBar);
1544 1548
1545 setChecked(prefix + "showintoolbar", this.isToolbarIconVisible()); 1549 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. 1938 * handler the element ID, event and the actual event handler are listed.
1935 * @type Array 1939 * @type Array
1936 */ 1940 */
1937 let eventHandlers = [ 1941 let eventHandlers = [
1938 ["abp-command-sendReport", "command", UI.openReportDialog.bind(UI)], 1942 ["abp-command-sendReport", "command", UI.openReportDialog.bind(UI)],
1939 ["abp-command-filters", "command", UI.openFiltersDialog.bind(UI)], 1943 ["abp-command-filters", "command", UI.openFiltersDialog.bind(UI)],
1940 ["abp-command-sidebar", "command", UI.toggleBottombar.bind(UI)], 1944 ["abp-command-sidebar", "command", UI.toggleBottombar.bind(UI)],
1941 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }], 1945 ["abp-command-togglesitewhitelist", "command", function() { UI.toggleFilter(si teWhitelist); }],
1942 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }], 1946 ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pa geWhitelist); }],
1943 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )], 1947 ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects" )],
1944 ["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse ")],
1945 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)], 1948 ["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)],
1946 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)], 1949 ["abp-command-togglesync", "command", UI.toggleSync.bind(UI)],
1947 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)], 1950 ["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)],
1948 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")], 1951 ["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showi nstatusbar")],
1949 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")], 1952 ["abp-command-enable", "command", UI.togglePref.bind(UI, "enabled")],
1950 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1953 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1951 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1954 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1952 ]; 1955 ];
1953 1956
1954 onShutdown.add(function() 1957 onShutdown.add(function()
1955 { 1958 {
1956 for (let window in UI.applicationWindows) 1959 for (let window in UI.applicationWindows)
1957 if (UI.isBottombarOpen(window)) 1960 if (UI.isBottombarOpen(window))
1958 UI.toggleBottombar(window); 1961 UI.toggleBottombar(window);
1959 }); 1962 });
OLDNEW
« no previous file with comments | « chrome/locale/en-US/overlay.dtd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld