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

Delta Between Two Patch Sets: common.js

Issue 29321336: Issue 2381 - Added share overlay to options page (Closed)
Left Patch Set: Rebased to a40c644fc2aa Created July 29, 2015, 12:27 p.m.
Right Patch Set: Rebased to 4a68f2a456d6 and set strict mode in common.js Created Sept. 23, 2015, 1:54 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 | « background.js ('k') | firstRun.html » ('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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17
18 "use strict";
17 19
saroyanm 2015/09/08 17:33:49 I think we should use "strict" here as well, but n
Thomas Greiner 2015/09/23 14:03:05 The reason for that is that adding strict mode aft
18 (function(global) 20 (function(global)
19 { 21 {
20 global.E = function E(id) 22 global.E = function E(id)
21 { 23 {
22 return document.getElementById(id); 24 return document.getElementById(id);
23 } 25 }
24 26
25 global.getDocLink = function(link, callback) 27 global.getDocLink = function(link, callback)
26 { 28 {
27 ext.backgroundPage.sendMessage({ 29 ext.backgroundPage.sendMessage({
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 { 114 {
113 var rootElement = iframe.contentDocument.documentElement; 115 var rootElement = iframe.contentDocument.documentElement;
114 var width = rootElement.dataset.width; 116 var width = rootElement.dataset.width;
115 var height = rootElement.dataset.height; 117 var height = rootElement.dataset.height;
116 if (width && height) 118 if (width && height)
117 resizePopup(width, height); 119 resizePopup(width, height);
118 } 120 }
119 121
120 if (popupMessageReceived) 122 if (popupMessageReceived)
121 { 123 {
122 iframe.className = "visible"; 124 iframe.className = "visible";
saroyanm 2015/09/08 17:33:49 This implementation is inconsistent, with other si
Thomas Greiner 2015/09/23 14:03:05 Agreed, let's work on consistency changes separate
123 125
124 var popupCloseListener = function() 126 var popupCloseListener = function()
125 { 127 {
126 iframe.className = glassPane.className = ""; 128 iframe.className = glassPane.className = "";
127 document.removeEventListener("click", popupCloseListener); 129 document.removeEventListener("click", popupCloseListener);
128 }; 130 };
129 document.addEventListener("click", popupCloseListener, false); 131 document.addEventListener("click", popupCloseListener, false);
130 } 132 }
131 else 133 else
132 { 134 {
133 glassPane.className = ""; 135 glassPane.className = "";
134 window.removeEventListener("message", popupMessageListener); 136 window.removeEventListener("message", popupMessageListener);
135 } 137 }
136 138
137 iframe.removeEventListener("load", popupLoadListener); 139 iframe.removeEventListener("load", popupLoadListener);
138 }; 140 };
139 iframe.addEventListener("load", popupLoadListener, false); 141 iframe.addEventListener("load", popupLoadListener, false);
140 142
141 iframe.src = url; 143 iframe.src = url;
142 glassPane.className = "visible"; 144 glassPane.className = "visible";
143 } 145 }
144 })(this); 146 })(this);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld