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

Side by Side Diff: lib/inspectorObserver.js

Issue 5765003219042304: EEH inspector integration fix (Closed)
Patch Set: Fix for light DevTools theme Created April 15, 2014, 10:12 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 let InspectorObserver = 7 let InspectorObserver =
8 { 8 {
9 init: function() 9 init: function()
10 { 10 {
(...skipping 22 matching lines...) Expand all
33 let result = stringBundle.GetStringFromName("inspector.button.tooltiptext"); 33 let result = stringBundle.GetStringFromName("inspector.button.tooltiptext");
34 34
35 delete this.inspectorButtonTooltip; 35 delete this.inspectorButtonTooltip;
36 this.__defineGetter__("inspectorButtonTooltip", function() result); 36 this.__defineGetter__("inspectorButtonTooltip", function() result);
37 return this.inspectorButtonTooltip; 37 return this.inspectorButtonTooltip;
38 }, 38 },
39 39
40 inspectorReady: function(eventName, toolbox, panel) 40 inspectorReady: function(eventName, toolbox, panel)
41 { 41 {
42 let panelWindow = panel.panelWin; 42 let panelWindow = panel.panelWin;
43 let inspectBtn = panelWindow.document.getElementById("inspector-inspect-tool button"); 43 let inspectBtn = panelWindow.document.getElementById("inspector-breadcrumbs" );
44 if (!inspectBtn) 44 if (!inspectBtn)
45 return; 45 return;
46 46
47 let tooltiptext = InspectorObserver.inspectorButtonTooltip; 47 let tooltiptext = InspectorObserver.inspectorButtonTooltip;
48 button = panelWindow.document.createElement("toolbarbutton"); 48 button = panelWindow.document.createElement("toolbarbutton");
49 button.setAttribute("id", "inspector-abp-elemhide-toolbutton"); 49 button.setAttribute("id", "inspector-abp-elemhide-toolbutton");
Wladimir Palant 2014/04/15 13:38:19 Nit: I'm not sure why we use that weird id here, I
saroyanm 2014/04/15 13:54:43 Done.
50 button.style.listStyleImage = "url('chrome://adblockplus/skin/abp-status-16. png')"; 50 button.style.listStyleImage = "url('chrome://adblockplus/skin/abp-status-16. png')";
51 button.style.MozImageRegion = "rect(0px, 16px, 16px, 0px)"; 51 button.style.MozImageRegion = "rect(0px, 16px, 16px, 0px)";
52 button.style.paddingTop = "4px"; 52 button.style.paddingTop = "4px";
53 button.setAttribute("class", "devtools-toolbarbutton"); 53 button.setAttribute("class", "devtools-toolbarbutton");
54 button.setAttribute("tooltiptext", tooltiptext); 54 button.setAttribute("tooltiptext", tooltiptext);
55 button.setAttribute("tabindex", "0"); 55 button.setAttribute("tabindex", "0");
56 button.addEventListener("command", function() 56 button.addEventListener("command", function()
57 { 57 {
58 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_b lank", 58 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_b lank",
59 "chrome,centerscreen,resizable,dialog=no", panel.se lection.node); 59 "chrome,centerscreen,resizable,dialog=no", panel.se lection.node);
60 }, false); 60 }, false);
61 inspectBtn.parentNode.insertBefore(button, inspectBtn.nextSibling); 61
62 //Override button style for light DevTools theme
63 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet ", 'class="elemhidehelper-node" href="chrome://elemhidehelper/skin/devToolsOverl ay.css" type="text/css"');
Wladimir Palant 2014/04/15 13:38:19 Nit: class attribute is unnecessary if we aren't g
saroyanm 2014/04/15 13:54:43 Done.
64 panelWindow.document.insertBefore(style, panelWindow.document.firstChild);
65
66 inspectBtn.parentNode.insertBefore(button, inspectBtn);
62 } 67 }
63 }; 68 };
64 69
65 InspectorObserver.init(); 70 InspectorObserver.init();
OLDNEW
« chrome/skin/devToolsOverlay.css ('K') | « chrome/skin/devToolsOverlay.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld