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

Side by Side Diff: lib/ui.js

Issue 5749479856668672: issue #764 - Adblock Warning opt in message isn't triggered (Closed)
Patch Set: Created July 9, 2014, 6:39 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 1880
1881 insertMessage(element, after, links); 1881 insertMessage(element, after, links);
1882 } 1882 }
1883 1883
1884 let texts = Notification.getLocalizedTexts(notification); 1884 let texts = Notification.getLocalizedTexts(notification);
1885 let titleElement = window.document.getElementById("abp-notification-title"); 1885 let titleElement = window.document.getElementById("abp-notification-title");
1886 titleElement.textContent = texts.title; 1886 titleElement.textContent = texts.title;
1887 let messageElement = window.document.getElementById("abp-notification-messag e"); 1887 let messageElement = window.document.getElementById("abp-notification-messag e");
1888 messageElement.innerHTML = ""; 1888 messageElement.innerHTML = "";
1889 let docLinks = []; 1889 let docLinks = [];
1890 for (let link of notification.links) 1890 if ("links" in notification)
Wladimir Palant 2014/07/09 18:51:46 How about |if (notification.links)| just in case t
saroyanm 2014/07/09 18:57:25 Good point.
1891 docLinks.push(Utils.getDocLink(link)); 1891 for (let link of notification.links)
1892 docLinks.push(Utils.getDocLink(link));
1893
1892 insertMessage(messageElement, texts.message, docLinks); 1894 insertMessage(messageElement, texts.message, docLinks);
1893 1895
1894 messageElement.addEventListener("click", function(event) 1896 messageElement.addEventListener("click", function(event)
1895 { 1897 {
1896 let link = event.target; 1898 let link = event.target;
1897 while (link && link !== messageElement && link.localName !== "a") 1899 while (link && link !== messageElement && link.localName !== "a")
1898 link = link.parentNode; 1900 link = link.parentNode;
1899 if (!link || link.localName !== "a") 1901 if (!link || link.localName !== "a")
1900 return; 1902 return;
1901 event.preventDefault(); 1903 event.preventDefault();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1950 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1949 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1951 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1950 ]; 1952 ];
1951 1953
1952 onShutdown.add(function() 1954 onShutdown.add(function()
1953 { 1955 {
1954 for (let window in UI.applicationWindows) 1956 for (let window in UI.applicationWindows)
1955 if (UI.isBottombarOpen(window)) 1957 if (UI.isBottombarOpen(window))
1956 UI.toggleBottombar(window); 1958 UI.toggleBottombar(window);
1957 }); 1959 });
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