[Pkg-mozext-commits] [firebug] 16/55: Add context menu ID for testing + fix copying POST params (related to issue 5592)

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag firebug-1.10.1
in repository firebug.

commit aa1390a90abde5966e5828d09252133bb9fcb340
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Tue Jul 17 15:14:14 2012 +0200

    Add context menu ID for testing + fix copying POST params (related to issue 5592)
---
 extension/content/firebug/net/netPanel.js | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/extension/content/firebug/net/netPanel.js b/extension/content/firebug/net/netPanel.js
index 47a9f27..bbfd20c 100644
--- a/extension/content/firebug/net/netPanel.js
+++ b/extension/content/firebug/net/netPanel.js
@@ -341,6 +341,7 @@ NetPanel.prototype = Obj.extend(Firebug.ActivablePanel,
         {
             items.push(
                 {
+                    id: "fbCopyUrlParameters",
                     label: "CopyURLParameters",
                     tooltiptext: "net.tip.Copy_URL_Parameters",
                     command: Obj.bindFixed(this.copyURLParams, this, file)
@@ -357,6 +358,7 @@ NetPanel.prototype = Obj.extend(Firebug.ActivablePanel,
                     command: Obj.bindFixed(this.copyParams, this, file)
                 },
                 {
+                    id: "fbCopyPOSTParameters",
                     label: "CopyPOSTParameters",
                     tooltiptext: "net.tip.Copy_POST_Parameters",
                     command: Obj.bindFixed(this.copyPOSTParams, this, file)
@@ -470,21 +472,31 @@ NetPanel.prototype = Obj.extend(Firebug.ActivablePanel,
         return items;
     },
 
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     // Context menu commands
 
     copyURLParams: function(file)
     {
         var params = Url.parseURLParams(file.href);
-        var result = params.map(function(o) { return o.name + ": " + o.value; });
+        var result = params.map(function(o) { return o.name + "=" + o.value; });
         System.copyToClipboard(result.join(Str.lineBreak()));
     },
 
     copyPOSTParams: function(file)
     {
-        var params = NetUtils.getPostText(file, this.context, true);
-        System.copyToClipboard(params);
+        if (!NetUtils.isURLEncodedRequest(file, this.context))
+            return;
+
+        var text = NetUtils.getPostText(file, this.context, true);
+        if (text)
+        {
+            var lines = text.split("\n");
+            var params = Url.parseURLEncodedText(lines[lines.length-1]);
+            var result = params.map(function(o) { return o.name + "=" + o.value; });
+            System.copyToClipboard(result.join(Str.lineBreak()));
+        }
     },
- 
+
     copyParams: function(file)
     {
         var text = NetUtils.getPostText(file, this.context, true);

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