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

Side by Side Diff: options.js

Issue 29339616: Issue 3908 - Don't show website link for subscriptions that don't specify a homepage (Closed)
Patch Set: Created April 8, 2016, 5:15 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
« no previous file with comments | « no previous file | no next file » | 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-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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 else if (item.lastDownload > 0) 203 else if (item.lastDownload > 0)
204 { 204 {
205 var dateTime = i18n_formatDateTime(item.lastDownload * 1000); 205 var dateTime = i18n_formatDateTime(item.lastDownload * 1000);
206 dateElement.textContent = dateTime[0]; 206 dateElement.textContent = dateTime[0];
207 timeElement.textContent = dateTime[1]; 207 timeElement.textContent = dateTime[1];
208 element.classList.remove("show-message"); 208 element.classList.remove("show-message");
209 } 209 }
210 } 210 }
211 211
212 var websiteElement = element.querySelector(".context-menu .website"); 212 var websiteElement = element.querySelector(".context-menu .website");
213 if (websiteElement)
214 {
215 if (item.homepage)
216 websiteElement.setAttribute("href", item.homepage);
217 else
218 websiteElement.setAttribute("aria-hidden", true);
219 }
220
213 var sourceElement = element.querySelector(".context-menu .source"); 221 var sourceElement = element.querySelector(".context-menu .source");
214 if (websiteElement && item.homepage)
215 websiteElement.setAttribute("href", item.homepage);
216 if (sourceElement) 222 if (sourceElement)
217 sourceElement.setAttribute("href", item.url); 223 sourceElement.setAttribute("href", item.url);
218 } 224 }
219 }; 225 };
220 226
221 Collection.prototype.clearAll = function() 227 Collection.prototype.clearAll = function()
222 { 228 {
223 this.items = []; 229 this.items = [];
224 for (var i = 0; i < this.details.length; i++) 230 for (var i = 0; i < this.details.length; i++)
225 { 231 {
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 }); 1149 });
1144 ext.backgroundPage.sendMessage( 1150 ext.backgroundPage.sendMessage(
1145 { 1151 {
1146 type: "subscriptions.listen", 1152 type: "subscriptions.listen",
1147 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1153 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1148 "title", "downloadStatus", "downloading"] 1154 "title", "downloadStatus", "downloading"]
1149 }); 1155 });
1150 1156
1151 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1157 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1152 })(); 1158 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld