Left: | ||
Right: |
OLD | NEW |
---|---|
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1119 | 1119 |
1120 for (var i = 0; i < shareResources.length; i++) | 1120 for (var i = 0; i < shareResources.length; i++) |
1121 checkShareResource(shareResources[i], onResult); | 1121 checkShareResource(shareResources[i], onResult); |
1122 } | 1122 } |
1123 | 1123 |
1124 ext.onMessage.addListener(function(message) | 1124 ext.onMessage.addListener(function(message) |
1125 { | 1125 { |
1126 switch (message.type) | 1126 switch (message.type) |
1127 { | 1127 { |
1128 case "app.respond": | 1128 case "app.respond": |
1129 if (message.action == "addSubscription") | 1129 switch (message.action) |
1130 { | 1130 { |
1131 var subscription = message.args[0]; | 1131 case "addSubscription": |
1132 var dialog = E("dialog-content-predefined"); | 1132 var subscription = message.args[0]; |
1133 dialog.querySelector("h3").textContent = subscription.title || ""; | 1133 var dialog = E("dialog-content-predefined"); |
1134 dialog.querySelector(".url").textContent = subscription.url; | 1134 dialog.querySelector("h3").textContent = subscription.title || ""; |
1135 openDialog("predefined"); | 1135 dialog.querySelector(".url").textContent = subscription.url; |
1136 openDialog("predefined"); | |
1137 break; | |
1138 case "switchToOptionsSection": | |
Thomas Greiner
2016/04/04 12:46:36
Detail: Is this specific to the options page? We c
Sebastian Noack
2016/04/05 13:32:02
Fine with me using a more generic name that doesn'
Thomas Greiner
2016/04/06 12:49:12
I'd suggest "focusSection" to no limit ourselves t
Sebastian Noack
2016/04/06 17:38:29
Done.
| |
1139 document.body.setAttribute("data-tab", message.args[0]); | |
1140 break; | |
1136 } | 1141 } |
1137 break; | 1142 break; |
1138 case "filters.respond": | 1143 case "filters.respond": |
1139 onFilterMessage(message.action, message.args[0]); | 1144 onFilterMessage(message.action, message.args[0]); |
1140 break; | 1145 break; |
1141 case "prefs.respond": | 1146 case "prefs.respond": |
1142 onPrefMessage(message.action, message.args[0], false); | 1147 onPrefMessage(message.action, message.args[0], false); |
1143 break; | 1148 break; |
1144 case "subscriptions.respond": | 1149 case "subscriptions.respond": |
1145 onSubscriptionMessage(message.action, message.args[0]); | 1150 onSubscriptionMessage(message.action, message.args[0]); |
1146 break; | 1151 break; |
1147 } | 1152 } |
1148 }); | 1153 }); |
1149 | 1154 |
1150 ext.backgroundPage.sendMessage( | 1155 ext.backgroundPage.sendMessage( |
1151 { | 1156 { |
1152 type: "app.listen", | 1157 type: "app.listen", |
1153 filter: ["addSubscription"] | 1158 filter: ["addSubscription", "switchToOptionsSection"] |
1154 }); | 1159 }); |
1155 ext.backgroundPage.sendMessage( | 1160 ext.backgroundPage.sendMessage( |
1156 { | 1161 { |
1157 type: "filters.listen", | 1162 type: "filters.listen", |
1158 filter: ["added", "loaded", "removed"] | 1163 filter: ["added", "loaded", "removed"] |
1159 }); | 1164 }); |
1160 ext.backgroundPage.sendMessage( | 1165 ext.backgroundPage.sendMessage( |
1161 { | 1166 { |
1162 type: "prefs.listen", | 1167 type: "prefs.listen", |
1163 filter: ["notifications_ignoredcategories", "notifications_showui", | 1168 filter: ["notifications_ignoredcategories", "notifications_showui", |
1164 "safari_contentblocker", "show_devtools_panel", | 1169 "safari_contentblocker", "show_devtools_panel", |
1165 "shouldShowBlockElementMenu"] | 1170 "shouldShowBlockElementMenu"] |
1166 }); | 1171 }); |
1167 ext.backgroundPage.sendMessage( | 1172 ext.backgroundPage.sendMessage( |
1168 { | 1173 { |
1169 type: "subscriptions.listen", | 1174 type: "subscriptions.listen", |
1170 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1175 filter: ["added", "disabled", "homepage", "lastDownload", "removed", |
1171 "title"] | 1176 "title"] |
1172 }); | 1177 }); |
1173 | 1178 |
1174 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1179 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1175 })(); | 1180 })(); |
OLD | NEW |