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

Delta Between Two Patch Sets: popup.js

Issue 29336084: Issue 2426 - Open block.html as a popup window (Closed)
Left Patch Set: Open block.html as a popup window Created Feb. 8, 2016, 12:32 p.m.
Right Patch Set: Assume createData parameter has been given Created Feb. 17, 2016, 8:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « metadata.common ('k') | safari/ext/background.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 } 78 }
79 79
80 function onUnload() 80 function onUnload()
81 { 81 {
82 ext.onMessage.removeListener(onMessage); 82 ext.onMessage.removeListener(onMessage);
83 } 83 }
84 84
85 function onMessage(message, sender, callback) 85 function onMessage(message, sender, callback)
86 { 86 {
87 if (message.type == "report-html-page" && sender.page._id == page._id) 87 if (message.type == "report-html-page" && sender.page.id == page.id)
88 document.body.classList.remove("nohtml"); 88 document.body.classList.remove("nohtml");
89 } 89 }
90 90
91 function toggleEnabled() 91 function toggleEnabled()
92 { 92 {
93 var disabled = document.body.classList.toggle("disabled"); 93 var disabled = document.body.classList.toggle("disabled");
94 if (disabled) 94 if (disabled)
95 { 95 {
96 var host = getDecodedHostname(page.url).replace(/^www\./, ""); 96 var host = getDecodedHostname(page.url).replace(/^www\./, "");
97 var filter = Filter.fromText("@@||" + host + "^$document"); 97 var filter = Filter.fromText("@@||" + host + "^$document");
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 function toggleCollapse(event) 140 function toggleCollapse(event)
141 { 141 {
142 var collapser = event.currentTarget; 142 var collapser = event.currentTarget;
143 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option]; 143 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option];
144 collapser.parentNode.classList.toggle("collapsed"); 144 collapser.parentNode.classList.toggle("collapsed");
145 } 145 }
146 146
147 document.addEventListener("DOMContentLoaded", onLoad, false); 147 document.addEventListener("DOMContentLoaded", onLoad, false);
148 window.addEventListener("unload", onUnload, false); 148 window.addEventListener("unload", onUnload, false);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld