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

Side by Side Diff: js/desktop-options.js

Issue 29736629: Issue 6532 - Removes required subscription title input field (Closed) Base URL: https://hg.adblockplus.org/adblockplusui
Patch Set: Address PS1 comments Created April 3, 2018, 9:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 url: findParentData(element, "access", false) 730 url: findParentData(element, "access", false)
731 }); 731 });
732 break; 732 break;
733 case "validate-import-subscription": 733 case "validate-import-subscription":
734 let form = findParentData(element, "validation", true); 734 let form = findParentData(element, "validation", true);
735 if (!form) 735 if (!form)
736 return; 736 return;
737 737
738 if (form.checkValidity()) 738 if (form.checkValidity())
739 { 739 {
740 addEnableSubscription(E("import-list-url").value, 740 addEnableSubscription(E("import-list-url").value);
741 E("import-list-title").value);
742 form.reset(); 741 form.reset();
743 closeDialog(); 742 closeDialog();
744 } 743 }
745 else 744 else
746 { 745 {
747 form.querySelector(":invalid").focus(); 746 form.querySelector(":invalid").focus();
748 } 747 }
749 break; 748 break;
750 } 749 }
751 } 750 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 sendMessageHandleErrors({ 1221 sendMessageHandleErrors({
1223 type: "filters.add", 1222 type: "filters.add",
1224 text: "@@||" + host.toLowerCase() + "^$document" 1223 text: "@@||" + host.toLowerCase() + "^$document"
1225 }); 1224 });
1226 } 1225 }
1227 1226
1228 domain.value = ""; 1227 domain.value = "";
1229 E("whitelisting-add-button").disabled = true; 1228 E("whitelisting-add-button").disabled = true;
1230 } 1229 }
1231 1230
1232 function addEnableSubscription(url, title, homepage) 1231 function addEnableSubscription(url, homepage)
Thomas Greiner 2018/04/06 13:57:27 Please don't change the signature of this function
Jon Sonesen 2018/04/09 04:12:01 Acknowledged. I did dig around the code in this fi
Thomas Greiner 2018/04/09 11:26:59 It's called in line 584 as `addEnableSubscription(
Thomas Greiner 2018/04/27 09:48:46 No need to remove the "homepage" argument as part
1233 { 1232 {
1234 let messageType = null; 1233 let messageType = null;
1235 let knownSubscription = subscriptionsMap[url]; 1234 let knownSubscription = subscriptionsMap[url];
1236 if (knownSubscription && knownSubscription.disabled == true) 1235 if (knownSubscription && knownSubscription.disabled == true)
1237 messageType = "subscriptions.toggle"; 1236 messageType = "subscriptions.toggle";
1238 else 1237 else
1239 messageType = "subscriptions.add"; 1238 messageType = "subscriptions.add";
1240 1239
1241 let message = { 1240 let message = {
1242 type: messageType, 1241 type: messageType,
1243 url 1242 url
1244 }; 1243 };
1245 if (title)
1246 message.title = title;
1247 if (homepage) 1244 if (homepage)
1248 message.homepage = homepage; 1245 message.homepage = homepage;
1249 1246
1250 browser.runtime.sendMessage(message); 1247 browser.runtime.sendMessage(message);
1251 } 1248 }
1252 1249
1253 function onFilterMessage(action, filter) 1250 function onFilterMessage(action, filter)
1254 { 1251 {
1255 switch (action) 1252 switch (action)
1256 { 1253 {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 "ui_warn_tracking"] 1497 "ui_warn_tracking"]
1501 }); 1498 });
1502 port.postMessage({ 1499 port.postMessage({
1503 type: "subscriptions.listen", 1500 type: "subscriptions.listen",
1504 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1501 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1505 "title", "downloadStatus", "downloading"] 1502 "title", "downloadStatus", "downloading"]
1506 }); 1503 });
1507 1504
1508 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1505 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1509 window.addEventListener("hashchange", onHashChange, false); 1506 window.addEventListener("hashchange", onHashChange, false);
OLDNEW

Powered by Google App Engine
This is Rietveld