[Pkg-mozext-commits] [firebug] 40/82: Add tooltip for variables in closures in DOM panel + some reformatting
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:45:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag fbtest-1.11.2
in repository firebug.
commit 6bba298b86bf4c8d6ea0b18a653c21941af7ecf6
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date: Tue Jan 1 17:15:33 2013 +0100
Add tooltip for variables in closures in DOM panel + some reformatting
---
extension/content/firebug/dom/domPanel.js | 32 +++++++++++++++----------------
extension/locale/en-US/firebug.properties | 4 ++++
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/extension/content/firebug/dom/domPanel.js b/extension/content/firebug/dom/domPanel.js
index f4a95a4..41dffa9 100644
--- a/extension/content/firebug/dom/domPanel.js
+++ b/extension/content/firebug/dom/domPanel.js
@@ -83,7 +83,7 @@ const DirTablePlate = domplate(Firebug.Rep,
role: "presentation"},
DIV({"class": "memberLabel $member.type\\Label", title: "$member.title"},
SPAN({"class": "memberLabelPrefix"}, "$member.prefix"),
- SPAN({title: "$member.title"}, "$member.name")
+ SPAN({title: "$member|getMemberNameTooltip"}, "$member.name")
)
),
TD({"class": "memberValueCell", $readOnly: "$member.readOnly",
@@ -142,6 +142,11 @@ const DirTablePlate = domplate(Firebug.Rep,
}];
},
+ getMemberNameTooltip: function(member)
+ {
+ return member.title || member.scopeNameTooltip;
+ },
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
onClick: function(event)
@@ -543,27 +548,19 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
{
this.addMember(object, "ordinal", ordinals, name, val, level, 0, context, isScope);
}
- else if (typeof(val) == "function")
+ else if (typeof val === "function")
{
- if (isClassFunction(val))
- {
- if (Dom.isDOMMember(object, name))
- this.addMember(object, "domClass", domClasses, name, val, level, domMembers[name], context, isScope);
- else
- this.addMember(object, "userClass", userClasses, name, val, level, 0, context, isScope);
- }
- else if (Dom.isDOMMember(object, name))
- {
+ var classFunc = isClassFunction(val), domMember = Dom.isDOMMember(object, name);
+ if (domMember && classFunc)
+ this.addMember(object, "domClass", domClasses, name, val, level, domMembers[name], context, isScope);
+ else if (domMember)
this.addMember(object, "domFunction", domFuncs, name, val, level, domMembers[name], context, isScope);
- }
+ else if (classFunc)
+ this.addMember(object, "userClass", userClasses, name, val, level, 0, context, isScope);
else if (!Firebug.showUserFuncs && Firebug.showInlineEventHandlers)
- {
this.addMember(object, "userFunction", domHandlers, name, val, level, 0, context, isScope);
- }
else
- {
this.addMember(object, "userFunction", userFuncs, name, val, level, 0, context, isScope);
- }
}
else
{
@@ -758,6 +755,9 @@ Firebug.DOMBasePanel.prototype = Obj.extend(Firebug.Panel,
}
}
+ if (parentIsScope)
+ member.scopeNameTooltip = Locale.$STRF("dom.tip.scopeMemberName", ["%" + name]);
+
// Set prefix for user defined properties. This prefix help the user to distinguish
// among simple properties and those defined using getter and/or (only a) setter.
// XXX This should be rewritten to use 'descriptor', and I believe the unwrapping
diff --git a/extension/locale/en-US/firebug.properties b/extension/locale/en-US/firebug.properties
index cf8fd74..e06482c 100644
--- a/extension/locale/en-US/firebug.properties
+++ b/extension/locale/en-US/firebug.properties
@@ -231,6 +231,10 @@ dom.scopeParentName=(parent scope)
# LOCALIZATION NOTE (dom.tip.scopeName): Used within the DOM panel as a tooltip when hovering
# "(closure)".
dom.tip.scopeName=Use <func>.%closureVariable to access in the Command Line
+# LOCALIZATION NOTE (dom.tip.scopeMemberName): Used within the DOM panel as a tooltip when
+# hovering a variable in a closure.
+# %S: the variable name - starts with "%"
+dom.tip.scopeMemberName=Use <func>.%S to access in the Command Line
# LOCALIZATION NOTE (firebug.reps.declarativeScope, firebug.reps.objectScope, firebug.reps.withScope):
# Labels shown to describe different types of closure scopes.
firebug.reps.declarativeScope=[declarative scope]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list