[Pkg-mozext-commits] [firebug] 75/82: Add link to more info (related to issue 6200)

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:45:42 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 2da78d4d4c5275bb9eff077f9bbdbc11783d5f64
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Mon Feb 4 14:27:26 2013 +0100

    Add link to more info (related to issue 6200)
---
 extension/content/firebug/chrome/reps.js           |  3 +-
 .../content/firebug/console/commandLineHelp.js     | 42 ++++++++++++++--------
 extension/locale/en-US/firebug.properties          |  2 +-
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/extension/content/firebug/chrome/reps.js b/extension/content/firebug/chrome/reps.js
index 58cbefd..1b9d25e 100644
--- a/extension/content/firebug/chrome/reps.js
+++ b/extension/content/firebug/chrome/reps.js
@@ -3040,8 +3040,9 @@ FirebugReps.Description = domplate(Firebug.Rep,
 {
     className: "Description",
 
+    // Use SPAN to make sure the description is nicely inserted into existing text inline.
     tag:
-        DIV({onclick: "$onClickLink"}),
+        SPAN({onclick: "$onClickLink"}),
 
     render: function(text, parentNode, listener)
     {
diff --git a/extension/content/firebug/console/commandLineHelp.js b/extension/content/firebug/console/commandLineHelp.js
index 0fbddff..001a452 100644
--- a/extension/content/firebug/console/commandLineHelp.js
+++ b/extension/content/firebug/console/commandLineHelp.js
@@ -9,8 +9,9 @@ define([
     "firebug/chrome/window",
     "firebug/lib/xpcom",
     "firebug/lib/events",
+    "firebug/lib/object",
 ],
-function(Firebug, Domplate, Locale, Dom, CommandLineExposed, Win, Xpcom, Events) {
+function(Firebug, Domplate, Locale, Dom, CommandLineExposed, Win, Xpcom, Events, Obj) {
 with (Domplate) {
 
 // ********************************************************************************************* //
@@ -25,6 +26,8 @@ var CMD_TYPE_PROPERTY = 3;
 
 const prompts = Xpcom.CCSV("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService");
 
+var CLOSURE_INSPECTOR_HELP_URL = "https://getfirebug.com/wiki/index.php/Closure_Inspector";
+
 // ********************************************************************************************* //
 // Command Line Help
 
@@ -153,13 +156,16 @@ var TipsList = domplate(
 
 var Tip = domplate(
 {
-    tag:
+    loop:
         FOR("tip", "$tips",
-            LI({"class": "tip"},
-                SPAN("$tip|getText"),
-                SPAN("&nbsp"),
-                SPAN({"class": "example"},"$tip|getExample")
-            )
+            TAG("$tag", "$tip")
+        ),
+
+    tag:
+        LI({"class": "tip"},
+            SPAN({"class": "text"}, "$tip|getText"),
+            SPAN("&nbsp"),
+            SPAN({"class": "example"},"$tip|getExample")
         ),
 
     getText: function(object)
@@ -260,19 +266,27 @@ var CommandLineHelp = domplate(
         var table = TipsList.tag.replace({}, logGroupBody);
         var list = table.lastChild;
 
-        var tips = [];
-
-        tips.push({
+        // #1) Render basic command line syntaxt tip
+        var tip = {
             example: "1 + 1",
             text: "console.cmd.tip.javascript"
-        });
+        };
+        Tip.tag.append({tip: tip}, list);
 
-        tips.push({
+        // #2) Render closure syntax tip
+        tip = {
             example: "myObject.%closureVarName",
             text: "console.cmd.tip.closures"
-        });
+        };
+
+        function onClickLink()
+        {
+            Win.openNewTab(CLOSURE_INSPECTOR_HELP_URL);
+        }
 
-        Tip.tag.append({tips: tips}, list);
+        var node = Tip.tag.append({tip: tip}, list);
+        var textNode = node.getElementsByClassName("text").item(0);
+        FirebugReps.Description.render(Locale.$STR(tip.text), textNode, onClickLink);
     }
 });
 
diff --git a/extension/locale/en-US/firebug.properties b/extension/locale/en-US/firebug.properties
index fba6946..4fe7d3f 100644
--- a/extension/locale/en-US/firebug.properties
+++ b/extension/locale/en-US/firebug.properties
@@ -1563,7 +1563,7 @@ console.cmd.tip_title_desc=Learn Command Line Tips & Tricks
 # Description for Command Line tips that is logged
 # in the the Console panel if the user types "help" into the command line.
 console.cmd.tip.javascript=Any valid JavaScript expression can be executed on the Command Line. Example:
-console.cmd.tip.closures=In order to access variables in closures use '.%' syntax. Example:
+console.cmd.tip.closures=In order to access variables in closures use '.%' syntax (see <a>more</a>). Example:
 
 # LOCALIZATION NOTE (console.cmd.help.$): Description for Command Line API that is logged
 # in the the Console panel if the user types "help" into the command line.

-- 
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