Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 alert(errors.join("\n")); | 528 alert(errors.join("\n")); |
529 else if (onSuccess) | 529 else if (onSuccess) |
530 onSuccess(); | 530 onSuccess(); |
531 }); | 531 }); |
532 } | 532 } |
533 | 533 |
534 function openDocLink(id) | 534 function openDocLink(id) |
535 { | 535 { |
536 getDocLink(id, (link) => | 536 getDocLink(id, (link) => |
537 { | 537 { |
538 if (id == "share-general") | 538 location.href = link; |
539 openSharePopup(link); | |
540 else | |
541 location.href = link; | |
542 }); | 539 }); |
543 } | 540 } |
544 | 541 |
545 function switchTab(id) | 542 function switchTab(id) |
546 { | 543 { |
547 location.hash = id; | 544 location.hash = id; |
548 } | 545 } |
549 | 546 |
550 function execAction(action, element) | 547 function execAction(action, element) |
551 { | 548 { |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
892 | 889 |
893 getDocLink("subscriptions", (link) => | 890 getDocLink("subscriptions", (link) => |
894 { | 891 { |
895 setLinks("filter-lists-description", link); | 892 setLinks("filter-lists-description", link); |
896 }); | 893 }); |
897 | 894 |
898 E("custom-filters-raw").setAttribute("placeholder", | 895 E("custom-filters-raw").setAttribute("placeholder", |
899 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"])); | 896 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"])); |
900 | 897 |
901 // Help tab | 898 // Help tab |
902 getDocLink("faq", (link) => | 899 getDocLink("adblock_plus_report_issue", (link) => |
903 { | 900 { |
904 E("link-faq").setAttribute("href", link); | 901 setLinks("report-issue", link); |
902 }); | |
903 getDocLink("adblock_plus_report_ad", (link) => | |
904 { | |
905 setLinks("report-ad", link); | |
906 }); | |
907 getDocLink("adblock_plus_report_bug", (link) => | |
908 { | |
909 setLinks("report-bug", link); | |
910 }); | |
911 getDocLink("reporter_other_link", (link) => | |
912 { | |
913 setLinks("report-forum", link); | |
905 }); | 914 }); |
906 getDocLink("social_twitter", (link) => | 915 getDocLink("social_twitter", (link) => |
907 { | 916 { |
908 E("link-twitter").setAttribute("href", link); | 917 E("twitter").setAttribute("href", link); |
909 }); | 918 }); |
910 getDocLink("social_facebook", (link) => | 919 getDocLink("social_facebook", (link) => |
911 { | 920 { |
912 E("link-facebook").setAttribute("href", link); | 921 E("facebook").setAttribute("href", link); |
913 }); | 922 }); |
914 getDocLink("social_gplus", (link) => | 923 getDocLink("social_gplus", (link) => |
915 { | 924 { |
916 E("link-gplus").setAttribute("href", link); | 925 E("google-plus").setAttribute("href", link); |
917 }); | |
918 getDocLink("social_renren", (link) => | |
919 { | |
920 E("link-renren").setAttribute("href", link); | |
921 }); | 926 }); |
922 getDocLink("social_weibo", (link) => | 927 getDocLink("social_weibo", (link) => |
923 { | 928 { |
924 E("link-weibo").setAttribute("href", link); | 929 E("weibo").setAttribute("href", link); |
925 }); | |
926 | |
927 // Set forum link | |
928 ext.backgroundPage.sendMessage({ | |
929 type: "app.get", | |
930 what: "platform" | |
931 }, | |
932 (platform) => | |
933 { | |
934 ext.backgroundPage.sendMessage({ | |
935 type: "app.get", | |
936 what: "application" | |
937 }, | |
938 (application) => | |
939 { | |
940 if (platform == "chromium" && application != "opera") | |
941 application = "chrome"; | |
942 | |
943 getDocLink(application + "_support", (link) => | |
944 { | |
945 E("link-forum").setAttribute("href", link); | |
946 }); | |
947 }); | |
948 }); | 930 }); |
949 | 931 |
950 E("dialog").addEventListener("keydown", function(e) | 932 E("dialog").addEventListener("keydown", function(e) |
951 { | 933 { |
952 switch (getKey(e)) | 934 switch (getKey(e)) |
953 { | 935 { |
954 case "Escape": | 936 case "Escape": |
955 closeDialog(); | 937 closeDialog(); |
956 break; | 938 break; |
957 case "Tab": | 939 case "Tab": |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 { | 978 { |
997 let dialog = E("dialog"); | 979 let dialog = E("dialog"); |
998 dialog.setAttribute("aria-hidden", true); | 980 dialog.setAttribute("aria-hidden", true); |
999 dialog.removeAttribute("aria-labelledby"); | 981 dialog.removeAttribute("aria-labelledby"); |
1000 document.body.removeAttribute("data-dialog"); | 982 document.body.removeAttribute("data-dialog"); |
1001 focusedBeforeDialog.focus(); | 983 focusedBeforeDialog.focus(); |
1002 } | 984 } |
1003 | 985 |
1004 function showNotification(text) | 986 function showNotification(text) |
1005 { | 987 { |
1006 E("notification").setAttribute("aria-hidden", false); | 988 E("notification").setAttribute("aria-hidden", false); |
ire
2017/08/24 10:08:44
The aria-live attribute could also be relevant her
saroyanm
2017/08/24 14:18:25
Agree
saroyanm
2017/08/24 18:40:54
Done.
| |
1007 E("notification-text").textContent = text; | 989 E("notification-text").textContent = text; |
1008 setTimeout(hideNotification, 3000); | 990 setTimeout(hideNotification, 3000); |
ire
2017/08/24 10:08:43
(Personal Opinion) I think 3 seconds is too short
saroyanm
2017/08/24 14:18:26
That's specified in the specs, let's be consistent
ire
2017/08/25 09:59:44
Acknowledged.
| |
1009 } | 991 } |
1010 | 992 |
1011 function hideNotification() | 993 function hideNotification() |
1012 { | 994 { |
1013 E("notification").setAttribute("aria-hidden", true); | 995 E("notification").setAttribute("aria-hidden", true); |
ire
2017/08/24 10:08:44
NIT: Clear the textContent as well?
saroyanm
2017/08/24 14:18:26
Yes, I'll update that.
saroyanm
2017/08/24 18:40:54
Done.
| |
996 E("notification-text").textContent = ""; | |
1014 } | 997 } |
1015 | 998 |
1016 function setAcceptableAds() | 999 function setAcceptableAds() |
1017 { | 1000 { |
1018 let option = "none"; | 1001 let option = "none"; |
1019 document.forms["acceptable-ads"].classList.remove("show-dnt-notification"); | 1002 document.forms["acceptable-ads"].classList.remove("show-dnt-notification"); |
1020 if (acceptableAdsUrl in subscriptionsMap) | 1003 if (acceptableAdsUrl in subscriptionsMap) |
1021 { | 1004 { |
1022 option = "ads"; | 1005 option = "ads"; |
1023 } | 1006 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1387 }); | 1370 }); |
1388 ext.backgroundPage.sendMessage({ | 1371 ext.backgroundPage.sendMessage({ |
1389 type: "subscriptions.listen", | 1372 type: "subscriptions.listen", |
1390 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1373 filter: ["added", "disabled", "homepage", "lastDownload", "removed", |
1391 "title", "downloadStatus", "downloading"] | 1374 "title", "downloadStatus", "downloading"] |
1392 }); | 1375 }); |
1393 | 1376 |
1394 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1377 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1395 window.addEventListener("hashchange", onHashChange, false); | 1378 window.addEventListener("hashchange", onHashChange, false); |
1396 } | 1379 } |
LEFT | RIGHT |