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

Side by Side Diff: new-options.js

Issue 29519636: Issue 5538 - Implement "Help" tab for new options page (Closed)
Patch Set: Created Aug. 25, 2017, 10:54 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 | « new-options.html ('k') | skin/new-options.css » ('j') | 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 <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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 alert(errors.join("\n")); 523 alert(errors.join("\n"));
524 else if (onSuccess) 524 else if (onSuccess)
525 onSuccess(); 525 onSuccess();
526 }); 526 });
527 } 527 }
528 528
529 function openDocLink(id) 529 function openDocLink(id)
530 { 530 {
531 getDocLink(id, (link) => 531 getDocLink(id, (link) =>
532 { 532 {
533 if (id == "share-general") 533 location.href = link;
534 openSharePopup(link);
535 else
536 location.href = link;
537 }); 534 });
538 } 535 }
539 536
540 function switchTab(id) 537 function switchTab(id)
541 { 538 {
542 location.hash = id; 539 location.hash = id;
543 } 540 }
544 541
545 function execAction(action, element) 542 function execAction(action, element)
546 { 543 {
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 881
885 getDocLink("subscriptions", (link) => 882 getDocLink("subscriptions", (link) =>
886 { 883 {
887 setLinks("filter-lists-description", link); 884 setLinks("filter-lists-description", link);
888 }); 885 });
889 886
890 E("custom-filters-raw").setAttribute("placeholder", 887 E("custom-filters-raw").setAttribute("placeholder",
891 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"])); 888 getMessage("options_customFilters_edit_placeholder", ["/ads/track/*"]));
892 889
893 // Help tab 890 // Help tab
894 getDocLink("faq", (link) => 891 getDocLink("adblock_plus_report_issue", (link) =>
895 { 892 {
896 E("link-faq").setAttribute("href", link); 893 setLinks("report-issue", link);
894 });
895 getDocLink("adblock_plus_report_ad", (link) =>
896 {
897 setLinks("report-ad", link);
898 });
899 getDocLink("adblock_plus_report_bug", (link) =>
900 {
901 setLinks("report-bug", link);
902 });
903 getDocLink("reporter_other_link", (link) =>
904 {
905 setLinks("report-forum", link);
897 }); 906 });
898 getDocLink("social_twitter", (link) => 907 getDocLink("social_twitter", (link) =>
899 { 908 {
900 E("link-twitter").setAttribute("href", link); 909 E("twitter").setAttribute("href", link);
901 }); 910 });
902 getDocLink("social_facebook", (link) => 911 getDocLink("social_facebook", (link) =>
903 { 912 {
904 E("link-facebook").setAttribute("href", link); 913 E("facebook").setAttribute("href", link);
905 }); 914 });
906 getDocLink("social_gplus", (link) => 915 getDocLink("social_gplus", (link) =>
907 { 916 {
908 E("link-gplus").setAttribute("href", link); 917 E("google-plus").setAttribute("href", link);
909 });
910 getDocLink("social_renren", (link) =>
911 {
912 E("link-renren").setAttribute("href", link);
913 }); 918 });
914 getDocLink("social_weibo", (link) => 919 getDocLink("social_weibo", (link) =>
915 { 920 {
916 E("link-weibo").setAttribute("href", link); 921 E("weibo").setAttribute("href", link);
917 });
918
919 // Set forum link
920 ext.backgroundPage.sendMessage({
921 type: "app.get",
922 what: "platform"
923 },
924 (platform) =>
925 {
926 ext.backgroundPage.sendMessage({
927 type: "app.get",
928 what: "application"
929 },
930 (application) =>
931 {
932 if (platform == "chromium" && application != "opera")
933 application = "chrome";
934
935 getDocLink(application + "_support", (link) =>
936 {
937 E("link-forum").setAttribute("href", link);
938 });
939 });
940 }); 922 });
941 923
942 E("dialog").addEventListener("keydown", function(e) 924 E("dialog").addEventListener("keydown", function(e)
943 { 925 {
944 switch (getKey(e)) 926 switch (getKey(e))
945 { 927 {
946 case "Escape": 928 case "Escape":
947 closeDialog(); 929 closeDialog();
948 break; 930 break;
949 case "Tab": 931 case "Tab":
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 }); 1349 });
1368 ext.backgroundPage.sendMessage({ 1350 ext.backgroundPage.sendMessage({
1369 type: "subscriptions.listen", 1351 type: "subscriptions.listen",
1370 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1352 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1371 "title", "downloadStatus", "downloading"] 1353 "title", "downloadStatus", "downloading"]
1372 }); 1354 });
1373 1355
1374 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1356 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1375 window.addEventListener("hashchange", onHashChange, false); 1357 window.addEventListener("hashchange", onHashChange, false);
1376 } 1358 }
OLDNEW
« no previous file with comments | « new-options.html ('k') | skin/new-options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld