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

Delta Between Two Patch Sets: lib/ui.js

Issue 5294633391226880: issue 1435 - Port popup.html from Chrome/Safari/Opera to Firefox (Closed)
Left Patch Set: Created Oct. 17, 2014, 11:23 a.m.
Right Patch Set: Created Oct. 27, 2014, 9:40 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
« chrome/content/ui/utils.js ('K') | « chrome/skin/popup.png ('k') | no next file » | 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 <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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 { 371 {
372 if (element.hasAttribute("id")) 372 if (element.hasAttribute("id"))
373 element.setAttribute("id", element.getAttribute("id").replace("abp-statu s", newId)); 373 element.setAttribute("id", element.getAttribute("id").replace("abp-statu s", newId));
374 374
375 for (let i = 0, len = element.children.length; i < len; i++) 375 for (let i = 0, len = element.children.length; i < len; i++)
376 fixId(element.children[i], newId); 376 fixId(element.children[i], newId);
377 377
378 return element; 378 return element;
379 } 379 }
380 380
381 if ("abp-status-popup" in this.overlay) 381 if ("abp-status-popup" in this.overlay)
Thomas Greiner 2014/10/17 15:02:21 This whole block appears to be have been overlooke
saroyanm 2014/10/21 13:39:21 Thomas I didn't left comment in this block as we d
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"));
390 } 390 }
391 }, 391 },
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
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, match[1]); 1304 this.fillIconMenu(event, window, prefix);
Thomas Greiner 2014/10/17 15:02:21 You're still using `match[1]` here instead of `pre
saroyanm 2014/10/21 13:39:21 Oops.
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)
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld