[Pkg-mozext-commits] [firexpath] 23/51: Issue19 Fixed the inspect functionality with Firebug1.7.
David Prévot
taffit at moszumanska.debian.org
Sun Mar 22 15:08:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firexpath.
commit b115ec90bf754d6d2dc220d01fcd0f38f5656ae3
Author: pierre.tholence at gmail.com <pierre.tholence at gmail.com@dfa30af4-1965-11df-8728-136f2c2ca76e>
Date: Sat Mar 19 13:26:46 2011 +0000
Issue19 Fixed the inspect functionality with Firebug1.7.
git-svn-id: http://firepath.googlecode.com/svn/trunk@28 dfa30af4-1965-11df-8728-136f2c2ca76e
---
content/FirePathPanel.js | 189 +++++++++++++++++++++++++----------------------
1 file changed, 100 insertions(+), 89 deletions(-)
diff --git a/content/FirePathPanel.js b/content/FirePathPanel.js
index 3f60d8e..271acc9 100644
--- a/content/FirePathPanel.js
+++ b/content/FirePathPanel.js
@@ -504,6 +504,9 @@ Firebug.FirePathPanel.prototype = extend(Firebug.Panel,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// Inspector management methods
+ // make the panel inspectable (new in Firebug 1.7)
+ inspectable: true,
+
startInspecting: function() {
this.inspecting = true;
this.previousLocation = this.location;
@@ -511,8 +514,13 @@ Firebug.FirePathPanel.prototype = extend(Firebug.Panel,
this.setResult(null, null);
},
- stopInspecting: function(cancelled) {
+ stopInspecting: function(inspectingNode, cancelled) {
this.inspecting = false;
+ // in Firebug 1.7 the signature of this method changed
+ // before there was only on arg: cancelled.
+ if (!Firebug.Inspector._resolveInspectingPanelName) {
+ cancelled = inspectingNode;
+ }
if(cancelled) {
this.navigate(this.previousLocation);
this.firePathBar.selector = this.previousSelector;
@@ -1832,105 +1840,108 @@ Firebug.FirePathPanel.ResultHighlightModule = extend(Firebug.Module,
// ************************************************************************************************
// Overwrite inspector to make sure it stay on the FirePath tab (instead of going to the HTML tab)
-overwriteMethodForPanel(
- Firebug.Inspector,
- "startInspecting",
- panelName,
- function (context) {
- if (this.inspecting || !context || !context.loaded)
- return;
+// Firebug 1.7 allow to have inspectable panel so this is no longuer needed.
+if (!Firebug.Inspector._resolveInspectingPanelName) {
+ overwriteMethodForPanel(
+ Firebug.Inspector,
+ "startInspecting",
+ panelName,
+ function (context) {
+ if (this.inspecting || !context || !context.loaded)
+ return;
- this.inspecting = true;
- this.inspectingContext = context;
+ this.inspecting = true;
+ this.inspectingContext = context;
- context.chrome.setGlobalAttribute("cmd_toggleInspecting", "checked", "true");
- this.attachInspectListeners(context);
+ context.chrome.setGlobalAttribute("cmd_toggleInspecting", "checked", "true");
+ this.attachInspectListeners(context);
- // Remember the previous panel and bar state so we can revert if the user cancels
- this.previousPanelName = context.panelName;
- this.previousSidePanelName = context.sidePanelName;
- this.previouslyCollapsed = $("fbContentBox").collapsed;
- this.previouslyFocused = context.detached && context.chrome.isFocused();
+ // Remember the previous panel and bar state so we can revert if the user cancels
+ this.previousPanelName = context.panelName;
+ this.previousSidePanelName = context.sidePanelName;
+ this.previouslyCollapsed = $("fbContentBox").collapsed;
+ this.previouslyFocused = context.detached && context.chrome.isFocused();
- var panel;
- if(this.previouslyCollapsed) {
- panel = context.chrome.selectPanel("html");
- this.previousObject = panel.selection;
- } else {
- panel = context.getPanel(panelName);
- }
-
- if (context.detached)
- FirebugChrome.focus();
- else
- Firebug.showBar(true);
+ var panel;
+ if(this.previouslyCollapsed) {
+ panel = context.chrome.selectPanel("html");
+ this.previousObject = panel.selection;
+ } else {
+ panel = context.getPanel(panelName);
+ }
- panel.panelNode.focus();
- panel.startInspecting();
+ if (context.detached)
+ FirebugChrome.focus();
+ else
+ Firebug.showBar(true);
- if (context.hoverNode)
- this.inspectNode(context.hoverNode);
- }
-);
+ panel.panelNode.focus();
+ panel.startInspecting();
-overwriteMethodForPanel(
- Firebug.Inspector,
- "stopInspecting",
- panelName,
- function(cancelled, waitForClick){
- if (!this.inspecting)
- return;
-
- var context = this.inspectingContext;
-
- if (this.inspectTimeout) {
- context.clearTimeout(this.inspectTimeout);
- delete this.inspectTimeout;
+ if (context.hoverNode)
+ this.inspectNode(context.hoverNode);
}
-
- this.detachInspectListeners(context);
- if (!waitForClick)
- this.detachClickInspectListeners(context.window);
-
- context.chrome.setGlobalAttribute("cmd_toggleInspecting", "checked", "false");
-
- this.inspecting = false;
-
- var htmlPanel = context.getPanel("html");
- var firePathPanel = context.getPanel(panelName);
-
- if (this.previouslyFocused)
- context.chrome.focus();
-
- if (cancelled) {
- if (this.previouslyCollapsed)
- Firebug.showBar(false);
+ );
+
+ overwriteMethodForPanel(
+ Firebug.Inspector,
+ "stopInspecting",
+ panelName,
+ function(cancelled, waitForClick){
+ if (!this.inspecting)
+ return;
- if (this.previousPanelName == "html")
- context.chrome.select(this.previousObject);
- else
- context.chrome.selectPanel(this.previousPanelName, this.previousSidePanelName);
- }
- else {
- if(this.previouslyCollapsed) {
- context.chrome.select(htmlPanel.selection);
- context.chrome.getSelectedPanel().panelNode.focus();
+ var context = this.inspectingContext;
+
+ if (this.inspectTimeout) {
+ context.clearTimeout(this.inspectTimeout);
+ delete this.inspectTimeout;
+ }
+
+ this.detachInspectListeners(context);
+ if (!waitForClick)
+ this.detachClickInspectListeners(context.window);
+
+ context.chrome.setGlobalAttribute("cmd_toggleInspecting", "checked", "false");
+
+ this.inspecting = false;
+
+ var htmlPanel = context.getPanel("html");
+ var firePathPanel = context.getPanel(panelName);
+
+ if (this.previouslyFocused)
+ context.chrome.focus();
+
+ if (cancelled) {
+ if (this.previouslyCollapsed)
+ Firebug.showBar(false);
+
+ if (this.previousPanelName == "html")
+ context.chrome.select(this.previousObject);
+ else
+ context.chrome.selectPanel(this.previousPanelName, this.previousSidePanelName);
}
+ else {
+ if(this.previouslyCollapsed) {
+ context.chrome.select(htmlPanel.selection);
+ context.chrome.getSelectedPanel().panelNode.focus();
+ }
+ }
+
+ if(this.previouslyCollapsed)
+ htmlPanel.stopInspecting(htmlPanel.selection, cancelled);
+ else
+ firePathPanel.stopInspecting(cancelled);
+
+ this.inspectNode(null);
+
+ delete this.previousObject;
+ delete this.previousPanelName;
+ delete this.previousSidePanelName;
+ delete this.inspectingContext;
}
-
- if(this.previouslyCollapsed)
- htmlPanel.stopInspecting(htmlPanel.selection, cancelled);
- else
- firePathPanel.stopInspecting(cancelled);
-
- this.inspectNode(null);
-
- delete this.previousObject;
- delete this.previousPanelName;
- delete this.previousSidePanelName;
- delete this.inspectingContext;
- }
-);
+ );
+}
Firebug.registerPanel(Firebug.FirePathPanel);
Firebug.registerModule(Firebug.FirePathPanel.LocationHighlightModule, Firebug.FirePathPanel.ResultHighlightModule);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firexpath.git
More information about the Pkg-mozext-commits
mailing list