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-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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 element.setAttribute("data-search", title.toLowerCase()); | 166 element.setAttribute("data-search", title.toLowerCase()); |
167 var control = element.querySelector(".control[role='checkbox']"); | 167 var control = element.querySelector(".control[role='checkbox']"); |
168 if (control) | 168 if (control) |
169 control.setAttribute("aria-checked", item.disabled == false); | 169 control.setAttribute("aria-checked", item.disabled == false); |
170 | 170 |
171 var downloadStatus = item.downloadStatus; | 171 var downloadStatus = item.downloadStatus; |
172 var dateElement = element.querySelector(".date"); | 172 var dateElement = element.querySelector(".date"); |
173 var timeElement = element.querySelector(".time"); | 173 var timeElement = element.querySelector(".time"); |
174 if(dateElement && timeElement) | 174 if(dateElement && timeElement) |
175 { | 175 { |
176 var error = element.querySelector(".error"); | 176 var message = element.querySelector(".message"); |
177 if (downloadStatus && downloadStatus != "synchronize_ok") | 177 ext.backgroundPage.sendMessage( |
178 { | 178 { |
179 if (downloadStatus in filterErrors) | 179 type: "subscriptions.isDownloading", |
180 error.textContent = getMessage(filterErrors[downloadStatus]); | 180 url: item.url |
181 else | 181 }, |
182 error.textContent = item.downloadStatus; | 182 function(isDownloading) |
183 element.classList.add("error"); | 183 { |
184 } | 184 if (isDownloading) |
185 else if (item.lastDownload > 0) | 185 { |
186 { | 186 var text = getMessage("options_filterList_lastDownload_inProgress"); |
187 var dateTime = i18n_formatDateTime(item.lastDownload * 1000); | 187 message.textContent = text; |
188 dateElement.textContent = dateTime[0]; | 188 element.classList.add("show-message"); |
189 timeElement.textContent = dateTime[1]; | 189 } |
190 element.classList.remove("error", "progress"); | 190 else if (downloadStatus && downloadStatus != "synchronize_ok") |
191 } | 191 { |
192 else | 192 if (downloadStatus in filterErrors) |
193 { | 193 message.textContent = getMessage(filterErrors[downloadStatus]); |
194 var text = getMessage("options_filterList_lastDownload_inProgress"); | 194 else |
Thomas Greiner
2016/02/04 15:28:17
Interesting that you would set the text only when
saroyanm
2016/02/04 17:50:06
You are right, I've updated the implementation,
A
Thomas Greiner
2016/02/04 20:23:44
Agreed, let's leave it for now if it's merely a mi
| |
195 element.querySelector(".progress").textContent = text; | 195 message.textContent = item.downloadStatus; |
196 element.classList.add("progress"); | 196 element.classList.add("show-message"); |
197 } | 197 } |
198 else if (item.lastDownload > 0) | |
199 { | |
200 var dateTime = i18n_formatDateTime(item.lastDownload * 1000); | |
201 dateElement.textContent = dateTime[0]; | |
202 timeElement.textContent = dateTime[1]; | |
203 element.classList.remove("show-message"); | |
204 } | |
205 }); | |
198 } | 206 } |
199 var websiteElement = element.querySelector(".context-menu .website"); | 207 var websiteElement = element.querySelector(".context-menu .website"); |
200 var sourceElement = element.querySelector(".context-menu .source"); | 208 var sourceElement = element.querySelector(".context-menu .source"); |
201 if (websiteElement && item.homepage) | 209 if (websiteElement && item.homepage) |
202 websiteElement.setAttribute("href", item.homepage); | 210 websiteElement.setAttribute("href", item.homepage); |
203 if (sourceElement) | 211 if (sourceElement) |
204 sourceElement.setAttribute("href", item.url); | 212 sourceElement.setAttribute("href", item.url); |
205 } | 213 } |
206 }; | 214 }; |
207 | 215 |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 filter: ["added", "loaded", "removed"] | 1018 filter: ["added", "loaded", "removed"] |
1011 }); | 1019 }); |
1012 ext.backgroundPage.sendMessage( | 1020 ext.backgroundPage.sendMessage( |
1013 { | 1021 { |
1014 type: "subscriptions.listen", | 1022 type: "subscriptions.listen", |
1015 filter: ["added", "disabled", "homepage", "lastDownload", "removed", "title" ] | 1023 filter: ["added", "disabled", "homepage", "lastDownload", "removed", "title" ] |
1016 }); | 1024 }); |
1017 | 1025 |
1018 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1026 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1019 })(); | 1027 })(); |
LEFT | RIGHT |