Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 } | 379 } |
380 | 380 |
381 if ("abp-status-popup" in this.overlay) | 381 if ("abp-status-popup" in this.overlay) |
382 { | 382 { |
383 let menuSource = this.overlay["abp-status-popup"]; | 383 let menuSource = this.overlay["abp-status-popup"]; |
384 delete this.overlay["abp-status-popup"]; | 384 delete this.overlay["abp-status-popup"]; |
385 | 385 |
386 if (this.overlay.all.length) | 386 if (this.overlay.all.length) |
387 this.overlay.all[0].appendChild(menuSource); | 387 this.overlay.all[0].appendChild(menuSource); |
388 if ("abp-toolbarbutton" in this.overlay) | 388 if ("abp-toolbarbutton" in this.overlay) |
389 this.overlay["abp-toolbarbutton"].appendChild(fixId(menuSource.cloneNode (true), "abp-toolbar")); | 389 this.overlay["abp-toolbarbutton"].appendChild(fixId(menuSource.cloneNode (true), "abp-toolbar")); |
Wladimir Palant
2014/10/23 21:57:40
Shouldn't this go away as well, along with the fix
saroyanm
2014/10/27 21:49:20
In current review we are using abp-status-popup fo
| |
390 } | 390 } |
391 }, | 391 }, |
392 | 392 |
393 /** | 393 /** |
394 * Gets called once the initialization is finished and Adblock Plus elements | 394 * Gets called once the initialization is finished and Adblock Plus elements |
395 * can be added to the UI. | 395 * can be added to the UI. |
396 */ | 396 */ |
397 initDone: function() | 397 initDone: function() |
398 { | 398 { |
399 // The icon might be added already, make sure its state is correct | 399 // The icon might be added already, make sure its state is correct |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1287 this.fillContentContextMenu(popup); | 1287 this.fillContentContextMenu(popup); |
1288 } | 1288 } |
1289 else if (popup.id == "abp-tooltip") | 1289 else if (popup.id == "abp-tooltip") |
1290 this.fillIconTooltip(event, popup.ownerDocument.defaultView); | 1290 this.fillIconTooltip(event, popup.ownerDocument.defaultView); |
1291 else | 1291 else |
1292 { | 1292 { |
1293 let match = /^(abp-(toolbar|status|menuitem)-)popup$/.exec(popup.id); | 1293 let match = /^(abp-(toolbar|status|menuitem)-)popup$/.exec(popup.id); |
1294 if (match) | 1294 if (match) |
1295 { | 1295 { |
1296 let [, prefix, name] = match; | 1296 let [, prefix, name] = match; |
1297 let window = popup.ownerDocument.defaultView; | |
1297 if (name == "toolbar" || name == "status") | 1298 if (name == "toolbar" || name == "status") |
1298 { | 1299 { |
1299 let window = popup.ownerDocument.defaultView; | |
Wladimir Palant
2014/10/23 21:57:40
How about defining the window variable before the
saroyanm
2014/10/27 21:49:20
Oops.
| |
1300 let browser = window.document.getElementById(prefix + "popup-browser") ; | 1300 let browser = window.document.getElementById(prefix + "popup-browser") ; |
1301 browser.setAttribute("src", "chrome://adblockplus/content/ui/popup.htm l"); | 1301 browser.setAttribute("src", "chrome://adblockplus/content/ui/popup.htm l"); |
1302 } | 1302 } |
1303 else | 1303 else |
1304 this.fillIconMenu(event, popup.ownerDocument.defaultView, prefix); | 1304 this.fillIconMenu(event, window, prefix); |
1305 } | 1305 } |
1306 } | 1306 } |
1307 }, | 1307 }, |
1308 | 1308 |
1309 /** | 1309 /** |
1310 * Called when some pop-up in the application window is being hidden | 1310 * Called when some pop-up in the application window is being hidden |
1311 */ | 1311 */ |
1312 onPopupHiding: function(/**Event*/ event) | 1312 onPopupHiding: function(/**Event*/ event) |
1313 { | 1313 { |
1314 if (event.defaultPrevented) | 1314 if (event.defaultPrevented) |
1315 return; | 1315 return; |
1316 | 1316 |
1317 let popup = event.originalTarget; | 1317 let popup = event.originalTarget; |
1318 if (popup.id == "abp-toolbar-popup") | 1318 if (popup.id == "abp-toolbar-popup") |
Wladimir Palant
2014/10/23 21:57:40
What about abp-status-popup?
| |
1319 { | 1319 { |
1320 let window = popup.ownerDocument.defaultView; | 1320 let window = popup.ownerDocument.defaultView; |
1321 let browser = window.document.getElementById("abp-toolbar-popup-browser"); | 1321 let browser = window.document.getElementById("abp-toolbar-popup-browser"); |
1322 browser.setAttribute("src", "about:blank"); | 1322 browser.setAttribute("src", "about:blank"); |
1323 } | 1323 } |
1324 }, | 1324 }, |
1325 | 1325 |
1326 /** | 1326 /** |
1327 * Handles click on toolbar and status bar icons. | 1327 * Handles click on toolbar and status bar icons. |
1328 */ | 1328 */ |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1978 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], | 1978 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], |
1979 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] | 1979 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] |
1980 ]; | 1980 ]; |
1981 | 1981 |
1982 onShutdown.add(function() | 1982 onShutdown.add(function() |
1983 { | 1983 { |
1984 for (let window in UI.applicationWindows) | 1984 for (let window in UI.applicationWindows) |
1985 if (UI.isBottombarOpen(window)) | 1985 if (UI.isBottombarOpen(window)) |
1986 UI.toggleBottombar(window); | 1986 UI.toggleBottombar(window); |
1987 }); | 1987 }); |
LEFT | RIGHT |