| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 else | 163 else |
| 164 title.setAttribute("class", "subscriptionTitle"); | 164 title.setAttribute("class", "subscriptionTitle"); |
| 165 title.textContent = node.getAttribute("title") + " (" + node.getAttribut
e("specialization") + ")"; | 165 title.textContent = node.getAttribute("title") + " (" + node.getAttribut
e("specialization") + ")"; |
| 166 mainTitle = variant.getAttribute("title"); | 166 mainTitle = variant.getAttribute("title"); |
| 167 mainURL = variant.getAttribute("url"); | 167 mainURL = variant.getAttribute("url"); |
| 168 isFirst = false; | 168 isFirst = false; |
| 169 } | 169 } |
| 170 title.setAttribute("flex", "1"); | 170 title.setAttribute("flex", "1"); |
| 171 title.style.marginLeft = (20 * level) + "px"; | 171 title.style.marginLeft = (20 * level) + "px"; |
| 172 item.appendChild(title); | 172 item.appendChild(title); |
| 173 | 173 |
| 174 let variantTitle = document.createElement("description"); | 174 let variantTitle = document.createElement("description"); |
| 175 variantTitle.setAttribute("class", "variant"); | 175 variantTitle.setAttribute("class", "variant"); |
| 176 variantTitle.textContent = variant.getAttribute("title"); | 176 variantTitle.textContent = variant.getAttribute("title"); |
| 177 variantTitle.setAttribute("crop", "end"); | 177 variantTitle.setAttribute("crop", "end"); |
| 178 item.appendChild(variantTitle); | 178 item.appendChild(variantTitle); |
| 179 | 179 |
| 180 list.appendChild(item); | 180 list.appendChild(item); |
| 181 } | 181 } |
| 182 | 182 |
| 183 let supplements = node.getElementsByTagName("supplements"); | 183 let supplements = node.getElementsByTagName("supplements"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 214 while (messageElement.firstChild) | 214 while (messageElement.firstChild) |
| 215 messageElement.removeChild(messageElement.firstChild); | 215 messageElement.removeChild(messageElement.firstChild); |
| 216 messageElement.appendChild(document.createTextNode(beforeLink)); | 216 messageElement.appendChild(document.createTextNode(beforeLink)); |
| 217 let link = document.createElement("label"); | 217 let link = document.createElement("label"); |
| 218 link.className = "text-link"; | 218 link.className = "text-link"; |
| 219 link.setAttribute("tooltiptext", mainSubscriptionURL); | 219 link.setAttribute("tooltiptext", mainSubscriptionURL); |
| 220 link.addEventListener("click", function() UI.loadInBrowser(mainSubscriptionU
RL), false); | 220 link.addEventListener("click", function() UI.loadInBrowser(mainSubscriptionU
RL), false); |
| 221 link.textContent = mainSubscriptionTitle; | 221 link.textContent = mainSubscriptionTitle; |
| 222 messageElement.appendChild(link); | 222 messageElement.appendChild(link); |
| 223 messageElement.appendChild(document.createTextNode(afterLink)); | 223 messageElement.appendChild(document.createTextNode(afterLink)); |
| 224 | 224 |
| 225 addMainCheckbox.value = mainSubscriptionURL; | 225 addMainCheckbox.value = mainSubscriptionURL; |
| 226 addMainCheckbox.setAttribute("_mainSubscriptionTitle", mainSubscriptionTitle
) | 226 addMainCheckbox.setAttribute("_mainSubscriptionTitle", mainSubscriptionTitle
) |
| 227 addMainCheckbox.label = addMainCheckbox.getAttribute("_labelTemplate").repla
ce(/\?1\?/g, mainSubscriptionTitle); | 227 let [label, accesskey] = Utils.splitLabel(addMainCheckbox.getAttribute("_lab
elTemplate")); |
| 228 addMainCheckbox.accessKey = addMainCheckbox.accessKey; | 228 addMainCheckbox.label = label.replace(/\?1\?/g, mainSubscriptionTitle); |
| 229 addMainCheckbox.accessKey = accesskey; |
| 229 } | 230 } |
| 230 else | 231 else |
| 231 { | 232 { |
| 232 messageElement.setAttribute("invisible", "true"); | 233 messageElement.setAttribute("invisible", "true"); |
| 233 addMainCheckbox.setAttribute("invisible", "true"); | 234 addMainCheckbox.setAttribute("invisible", "true"); |
| 234 } | 235 } |
| 235 } | 236 } |
| 236 | 237 |
| 237 function validateURL(url) | 238 function validateURL(url) |
| 238 { | 239 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 subscription.title = title; | 299 subscription.title = title; |
| 299 | 300 |
| 300 if (subscription instanceof DownloadableSubscription && !subscription.lastDown
load) | 301 if (subscription instanceof DownloadableSubscription && !subscription.lastDown
load) |
| 301 Synchronizer.execute(subscription); | 302 Synchronizer.execute(subscription); |
| 302 } | 303 } |
| 303 | 304 |
| 304 function hasSubscription(url) | 305 function hasSubscription(url) |
| 305 { | 306 { |
| 306 return FilterStorage.subscriptions.some(function(subscription) subscription in
stanceof DownloadableSubscription && subscription.url == url); | 307 return FilterStorage.subscriptions.some(function(subscription) subscription in
stanceof DownloadableSubscription && subscription.url == url); |
| 307 } | 308 } |
| OLD | NEW |