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

Delta Between Two Patch Sets: desktop-options.js

Issue 29609587: Issue 6031 - Implement Acceptable Ads notification (Closed)
Left Patch Set: Addressed Thomas comments Created Nov. 17, 2017, 4:03 p.m.
Right Patch Set: Created Nov. 21, 2017, 6:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « desktop-options.html ('k') | locale/en_US/desktop-options.json » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 10 matching lines...) Expand all
21 "use strict"; 21 "use strict";
22 22
23 { 23 {
24 let subscriptionsMap = Object.create(null); 24 let subscriptionsMap = Object.create(null);
25 let filtersMap = Object.create(null); 25 let filtersMap = Object.create(null);
26 let collections = Object.create(null); 26 let collections = Object.create(null);
27 let acceptableAdsUrl = null; 27 let acceptableAdsUrl = null;
28 let acceptableAdsPrivacyUrl = null; 28 let acceptableAdsPrivacyUrl = null;
29 let isCustomFiltersLoaded = false; 29 let isCustomFiltersLoaded = false;
30 let {getMessage} = browser.i18n; 30 let {getMessage} = browser.i18n;
31 let {setElementText} = ext.i18n; 31 let {setElementText} = ext.i18n;
saroyanm 2017/11/17 16:10:39 Didin't we convert all ext. to browser. ? I'm not
Thomas Greiner 2017/11/20 18:36:05 No, we merely got rid of the abstraction layer for
saroyanm 2017/11/21 14:58:32 I like, import here, as it's somehow consistent wi
32 let customFilters = []; 32 let customFilters = [];
33 let filterErrors = new Map([ 33 let filterErrors = new Map([
34 ["synchronize_invalid_url", 34 ["synchronize_invalid_url",
35 "options_filterList_lastDownload_invalidURL"], 35 "options_filterList_lastDownload_invalidURL"],
36 ["synchronize_connection_error", 36 ["synchronize_connection_error",
37 "options_filterList_lastDownload_connectionError"], 37 "options_filterList_lastDownload_connectionError"],
38 ["synchronize_invalid_data", 38 ["synchronize_invalid_data",
39 "options_filterList_lastDownload_invalidData"], 39 "options_filterList_lastDownload_invalidData"],
40 ["synchronize_checksum_mismatch", 40 ["synchronize_checksum_mismatch",
41 "options_filterList_lastDownload_checksumMismatch"] 41 "options_filterList_lastDownload_checksumMismatch"]
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 901
902 // General tab 902 // General tab
903 getDocLink("contribute", (link) => 903 getDocLink("contribute", (link) =>
904 { 904 {
905 E("contribute").href = link; 905 E("contribute").href = link;
906 }); 906 });
907 getDocLink("acceptable_ads_criteria", (link) => 907 getDocLink("acceptable_ads_criteria", (link) =>
908 { 908 {
909 setLinks("enable-acceptable-ads-description", link); 909 setLinks("enable-acceptable-ads-description", link);
910 }); 910 });
911 setElementText(E("tracking-warning-1"), "options_tracking_warning_1", 911 setElementText(E("tracking-warning-1"), "options_tracking_warning_1",
saroyanm 2017/11/17 16:10:39 Ideally I think we should be able to specify "tran
Thomas Greiner 2017/11/20 18:36:05 Let's wait for further cases where we'd need that.
saroyanm 2017/11/21 14:58:32 Agree.
912 [getMessage("common_feature_privacy_title"), 912 [getMessage("common_feature_privacy_title"),
913 getMessage("options_acceptableAds_ads_label")]); 913 getMessage("options_acceptableAds_ads_label")]);
914 setElementText(E("tracking-warning-3"), "options_tracking_warning_3", 914 setElementText(E("tracking-warning-3"), "options_tracking_warning_3",
915 [getMessage("options_acceptableAds_privacy_label")]); 915 [getMessage("options_acceptableAds_privacy_label")]);
916 916
917 getDocLink("privacy_friendly_ads", (link) => 917 getDocLink("privacy_friendly_ads", (link) =>
918 { 918 {
919 E("enable-acceptable-ads-privacy-description").href = link; 919 E("enable-acceptable-ads-privacy-description").href = link;
920 }); 920 });
921 getDocLink("adblock_plus_{browser}_dnt", url => 921 getDocLink("adblock_plus_{browser}_dnt", url =>
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 switch (key) 1369 switch (key)
1370 { 1370 {
1371 case "notifications_ignoredcategories": 1371 case "notifications_ignoredcategories":
1372 value = value.indexOf("*") == -1; 1372 value = value.indexOf("*") == -1;
1373 break; 1373 break;
1374 1374
1375 case "notifications_showui": 1375 case "notifications_showui":
1376 hidePref("notifications_ignoredcategories", !value); 1376 hidePref("notifications_ignoredcategories", !value);
1377 break; 1377 break;
1378 case "ui_warn_tracking": 1378 case "ui_warn_tracking":
1379 if (!value) 1379 let showWarning = (value && hasPrivacyConflict());
saroyanm 2017/11/17 16:45:14 Does it make sense to check against value == false
Thomas Greiner 2017/11/20 18:36:05 I'd assume not. If we cannot load the setting, we
saroyanm 2017/11/21 14:58:32 I see an issue with strict equation(not sure if th
Thomas Greiner 2017/11/21 17:17:29 I don't understand what you mean but I'm fine with
1380 E("acceptable-ads").classList.remove("show-warning"); 1380 E("acceptable-ads").classList.toggle("show-warning", showWarning);
Thomas Greiner 2017/11/20 18:36:05 What if the value changes to `true`? We'd probably
saroyanm 2017/11/21 14:58:32 Agree. Done.
1381 break; 1381 break;
1382 } 1382 }
1383 1383
1384 let checkbox = document.querySelector( 1384 let checkbox = document.querySelector(
1385 "[data-pref='" + key + "'] button[role='checkbox']" 1385 "[data-pref='" + key + "'] button[role='checkbox']"
1386 ); 1386 );
1387 if (checkbox) 1387 if (checkbox)
1388 checkbox.setAttribute("aria-checked", value); 1388 checkbox.setAttribute("aria-checked", value);
1389 } 1389 }
1390 1390
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 }); 1458 });
1459 browser.runtime.sendMessage({ 1459 browser.runtime.sendMessage({
1460 type: "subscriptions.listen", 1460 type: "subscriptions.listen",
1461 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1461 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1462 "title", "downloadStatus", "downloading"] 1462 "title", "downloadStatus", "downloading"]
1463 }); 1463 });
1464 1464
1465 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1465 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1466 window.addEventListener("hashchange", onHashChange, false); 1466 window.addEventListener("hashchange", onHashChange, false);
1467 } 1467 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld