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-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 14 matching lines...) Expand all Loading... |
25 var iframe = document.getElementById("share-popup"); | 25 var iframe = document.getElementById("share-popup"); |
26 var glassPane = document.getElementById("glass-pane"); | 26 var glassPane = document.getElementById("glass-pane"); |
27 var popupMessageReceived = false; | 27 var popupMessageReceived = false; |
28 | 28 |
29 var popupMessageListener = function(event) | 29 var popupMessageListener = function(event) |
30 { | 30 { |
31 var originFilter = Filter.fromText("||adblockplus.org^"); | 31 var originFilter = Filter.fromText("||adblockplus.org^"); |
32 if (!originFilter.matches(event.origin, "OTHER", null, null)) | 32 if (!originFilter.matches(event.origin, "OTHER", null, null)) |
33 return; | 33 return; |
34 | 34 |
35 var data = JSON.parse(event.data); | 35 var data = event.data; |
36 iframe.width = data.width; | 36 iframe.width = data.width; |
37 iframe.height = data.height; | 37 iframe.height = data.height; |
38 popupMessageReceived = true; | 38 popupMessageReceived = true; |
39 window.removeEventListener("message", popupMessageListener); | 39 window.removeEventListener("message", popupMessageListener); |
40 }; | 40 }; |
41 window.addEventListener("message", popupMessageListener); | 41 window.addEventListener("message", popupMessageListener); |
42 | 42 |
43 var listenCount = 0; | 43 var listenCount = 0; |
44 var popupLoadListener = function() | 44 var popupLoadListener = function() |
45 { | 45 { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 document.documentElement.className = classList.join(" "); | 130 document.documentElement.className = classList.join(" "); |
131 | 131 |
132 initTranslations(); | 132 initTranslations(); |
133 initSocialLinks(variant); | 133 initSocialLinks(variant); |
134 | 134 |
135 var donateLink = document.getElementById("share-donate"); | 135 var donateLink = document.getElementById("share-donate"); |
136 donateLink.href = getDocLink("donate") + "&variant=" + variant; | 136 donateLink.href = getDocLink("donate") + "&variant=" + variant; |
137 } | 137 } |
138 | 138 |
139 window.addEventListener("load", init); | 139 window.addEventListener("load", init); |
OLD | NEW |