| OLD | NEW |
| 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 { |
| 11 let gDevTools; | 11 let gDevTools; |
| 12 try | 12 try |
| 13 { | 13 { |
| 14 ({gDevTools}) = Cu.import("resource:///modules/devtools/gDevTools.jsm", nu
ll); | 14 ({gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", nul
l)); |
| 15 } | 15 } |
| 16 catch(e) | 16 catch(e) |
| 17 { | 17 { |
| 18 // No developer tools or unsupported version - ignore. | 18 // No developer tools or unsupported version - ignore. |
| 19 return; | 19 return; |
| 20 } | 20 } |
| 21 | 21 |
| 22 gDevTools.on("inspector-ready", this.inspectorReady); | 22 gDevTools.on("inspector-ready", this.inspectorReady); |
| 23 onShutdown.add(function() | 23 onShutdown.add(function() |
| 24 { | 24 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 button = panelWindow.document.createElement("toolbarbutton"); | 47 button = panelWindow.document.createElement("toolbarbutton"); |
| 48 button.setAttribute("id", "ehh-inspector-toolbarbutton"); | 48 button.setAttribute("id", "ehh-inspector-toolbarbutton"); |
| 49 button.setAttribute("class", "devtools-toolbarbutton"); | 49 button.setAttribute("class", "devtools-toolbarbutton"); |
| 50 button.setAttribute("tooltiptext", tooltiptext); | 50 button.setAttribute("tooltiptext", tooltiptext); |
| 51 button.setAttribute("tabindex", "0"); | 51 button.setAttribute("tabindex", "0"); |
| 52 button.addEventListener("command", function() | 52 button.addEventListener("command", function() |
| 53 { | 53 { |
| 54 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_b
lank", | 54 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_b
lank", |
| 55 "chrome,centerscreen,resizable,dialog=no", panel.se
lection.node); | 55 "chrome,centerscreen,resizable,dialog=no", panel.se
lection.node); |
| 56 }, false); | 56 }, false); |
| 57 | 57 |
| 58 //Override button style for light DevTools theme | 58 //Override button style for light DevTools theme |
| 59 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet
", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); | 59 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet
", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); |
| 60 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); | 60 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); |
| 61 | 61 |
| 62 inspectBtn.parentNode.insertBefore(button, inspectBtn); | 62 inspectBtn.parentNode.insertBefore(button, inspectBtn); |
| 63 } | 63 } |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 InspectorObserver.init(); | 66 InspectorObserver.init(); |
| OLD | NEW |