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

Delta Between Two Patch Sets: desktop-options.js

Issue 29616555: Issue 6082 - Update suport section in the help tab (Closed)
Left Patch Set: Created Nov. 23, 2017, 11:43 a.m.
Right Patch Set: General "issue" reporting text Created Nov. 24, 2017, 1:49 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 getDocLink("subscriptions", (link) => 959 getDocLink("subscriptions", (link) =>
960 { 960 {
961 E("filter-lists-learn-more").setAttribute("href", link); 961 E("filter-lists-learn-more").setAttribute("href", link);
962 }); 962 });
963 963
964 E("custom-filters-raw").setAttribute("placeholder", 964 E("custom-filters-raw").setAttribute("placeholder",
965 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"])); 965 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"]));
966 966
967 // Help tab 967 // Help tab
968 getDocLink("adblock_plus_report_bug", (link) =>
969 {
970 setLinks("report-bug", link);
971 });
968 getDocLink("{browser}_support", url => 972 getDocLink("{browser}_support", url =>
969 { 973 {
970 setLinks("visit-forum", url); 974 setLinks("visit-forum", url);
971 }); 975 });
972 getDocLink("social_twitter", (link) => 976 getDocLink("social_twitter", (link) =>
973 { 977 {
974 E("twitter").setAttribute("href", link); 978 E("twitter").setAttribute("href", link);
975 }); 979 });
976 getDocLink("social_facebook", (link) => 980 getDocLink("social_facebook", (link) =>
977 { 981 {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 if (subscription.recommended == "privacy") 1103 if (subscription.recommended == "privacy")
1100 { 1104 {
1101 privacyList = subscription; 1105 privacyList = subscription;
1102 break; 1106 break;
1103 } 1107 }
1104 } 1108 }
1105 return acceptableAdsList && acceptableAdsList.disabled == false && 1109 return acceptableAdsList && acceptableAdsList.disabled == false &&
1106 privacyList && privacyList.disabled == false; 1110 privacyList && privacyList.disabled == false;
1107 } 1111 }
1108 1112
1113 function setPrivacyConflict()
1114 {
1115 let acceptableAdsForm = E("acceptable-ads");
1116 if (hasPrivacyConflict())
1117 {
1118 getPref("ui_warn_tracking", (showTrackingWarning) =>
1119 {
1120 acceptableAdsForm.classList.toggle("show-warning", showTrackingWarning);
1121 });
1122 }
1123 else
1124 {
1125 acceptableAdsForm.classList.remove("show-warning");
1126 }
1127 }
1128
1109 function populateLists() 1129 function populateLists()
1110 { 1130 {
1111 subscriptionsMap = Object.create(null); 1131 subscriptionsMap = Object.create(null);
1112 filtersMap = Object.create(null); 1132 filtersMap = Object.create(null);
1113 1133
1114 // Empty collections and lists 1134 // Empty collections and lists
1115 for (let property in collections) 1135 for (let property in collections)
1116 collections[property].clearAll(); 1136 collections[property].clearAll();
1117 1137
1118 setCustomFiltersView("empty"); 1138 setCustomFiltersView("empty");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 knownSubscription.originalTitle = subscription.title; 1268 knownSubscription.originalTitle = subscription.title;
1249 else 1269 else
1250 knownSubscription[property] = subscription[property]; 1270 knownSubscription[property] = subscription[property];
1251 } 1271 }
1252 subscription = knownSubscription; 1272 subscription = knownSubscription;
1253 } 1273 }
1254 switch (action) 1274 switch (action)
1255 { 1275 {
1256 case "disabled": 1276 case "disabled":
1257 updateSubscription(subscription); 1277 updateSubscription(subscription);
1278 setPrivacyConflict();
1258 break; 1279 break;
1259 case "downloading": 1280 case "downloading":
1260 case "downloadStatus": 1281 case "downloadStatus":
1261 case "homepage": 1282 case "homepage":
1262 case "lastDownload": 1283 case "lastDownload":
1263 case "title": 1284 case "title":
1264 updateSubscription(subscription); 1285 updateSubscription(subscription);
1265 break; 1286 break;
1266 case "added": 1287 case "added":
1267 let {url, recommended} = subscription; 1288 let {url, recommended} = subscription;
1268 // Handle custom subscription 1289 // Handle custom subscription
1269 if (/^~user/.test(url)) 1290 if (/^~user/.test(url))
1270 { 1291 {
1271 loadCustomFilters(subscription.filters); 1292 loadCustomFilters(subscription.filters);
1272 return; 1293 return;
1273 } 1294 }
1274 else if (url in subscriptionsMap) 1295 else if (url in subscriptionsMap)
1275 updateSubscription(subscription); 1296 updateSubscription(subscription);
1276 else 1297 else
1277 addSubscription(subscription); 1298 addSubscription(subscription);
1278 1299
1279 if (isAcceptableAds(url)) 1300 if (isAcceptableAds(url))
1280 setAcceptableAds(); 1301 setAcceptableAds();
1281 1302
1282 if ((url == acceptableAdsUrl || recommended == "privacy") &&
1283 hasPrivacyConflict())
1284 {
1285 getPref("ui_warn_tracking", (showTrackingWarning) =>
1286 {
1287 if (showTrackingWarning)
1288 E("acceptable-ads").classList.add("show-warning");
1289 });
1290 }
1291
1292 collections.filterLists.addItem(subscription); 1303 collections.filterLists.addItem(subscription);
1304 setPrivacyConflict();
1293 break; 1305 break;
1294 case "removed": 1306 case "removed":
1295 if (subscription.recommended) 1307 if (subscription.recommended)
1296 { 1308 {
1297 subscription.disabled = true; 1309 subscription.disabled = true;
1298 onSubscriptionMessage("disabled", subscription); 1310 onSubscriptionMessage("disabled", subscription);
1299 } 1311 }
1300 else 1312 else
1301 { 1313 {
1302 delete subscriptionsMap[subscription.url]; 1314 delete subscriptionsMap[subscription.url];
1303 if (isAcceptableAds(subscription.url)) 1315 if (isAcceptableAds(subscription.url))
1304 { 1316 {
1305 setAcceptableAds(); 1317 setAcceptableAds();
1306 } 1318 }
1307 else 1319 else
1308 { 1320 {
1309 collections.more.removeItem(subscription); 1321 collections.more.removeItem(subscription);
1310 } 1322 }
1311 } 1323 }
1324
1312 collections.filterLists.removeItem(subscription); 1325 collections.filterLists.removeItem(subscription);
1326 setPrivacyConflict();
1313 break; 1327 break;
1314 } 1328 }
1315 } 1329 }
1316 1330
1317 function hidePref(key, value) 1331 function hidePref(key, value)
1318 { 1332 {
1319 let element = document.querySelector("[data-pref='" + key + "']"); 1333 let element = document.querySelector("[data-pref='" + key + "']");
1320 if (element) 1334 if (element)
1321 element.setAttribute("aria-hidden", value); 1335 element.setAttribute("aria-hidden", value);
1322 } 1336 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 switch (key) 1371 switch (key)
1358 { 1372 {
1359 case "notifications_ignoredcategories": 1373 case "notifications_ignoredcategories":
1360 value = value.indexOf("*") == -1; 1374 value = value.indexOf("*") == -1;
1361 break; 1375 break;
1362 1376
1363 case "notifications_showui": 1377 case "notifications_showui":
1364 hidePref("notifications_ignoredcategories", !value); 1378 hidePref("notifications_ignoredcategories", !value);
1365 break; 1379 break;
1366 case "ui_warn_tracking": 1380 case "ui_warn_tracking":
1367 let showWarning = (value && hasPrivacyConflict()); 1381 setPrivacyConflict();
1368 E("acceptable-ads").classList.toggle("show-warning", showWarning);
1369 break; 1382 break;
1370 } 1383 }
1371 1384
1372 let checkbox = document.querySelector( 1385 let checkbox = document.querySelector(
1373 "[data-pref='" + key + "'] button[role='checkbox']" 1386 "[data-pref='" + key + "'] button[role='checkbox']"
1374 ); 1387 );
1375 if (checkbox) 1388 if (checkbox)
1376 checkbox.setAttribute("aria-checked", value); 1389 checkbox.setAttribute("aria-checked", value);
1377 } 1390 }
1378 1391
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 }); 1459 });
1447 browser.runtime.sendMessage({ 1460 browser.runtime.sendMessage({
1448 type: "subscriptions.listen", 1461 type: "subscriptions.listen",
1449 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1462 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1450 "title", "downloadStatus", "downloading"] 1463 "title", "downloadStatus", "downloading"]
1451 }); 1464 });
1452 1465
1453 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1466 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1454 window.addEventListener("hashchange", onHashChange, false); 1467 window.addEventListener("hashchange", onHashChange, false);
1455 } 1468 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld