qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject qpid-broker-j git commit: QPID-8103: [Broker-J] Reduce code duplication
Date Tue, 27 Feb 2018 10:14:05 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master a2920afbc -> 0314c2a9c


QPID-8103: [Broker-J] Reduce code duplication


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/0314c2a9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/0314c2a9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/0314c2a9

Branch: refs/heads/master
Commit: 0314c2a9cc7b98488bcb506214cec9b7c13784ca
Parents: a2920af
Author: Alex Rudyy <orudyy@apache.org>
Authored: Tue Feb 27 10:13:34 2018 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Tue Feb 27 10:13:34 2018 +0000

----------------------------------------------------------------------
 .../main/java/resources/js/qpid/management/Management.js    | 9 ++++++++-
 .../java/resources/js/qpid/management/query/QueryWidget.js  | 6 +-----
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0314c2a9/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Management.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Management.js
b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Management.js
index bf56bf4..0b181f4 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Management.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Management.js
@@ -365,8 +365,15 @@ define(["dojo/_base/lang",
         Management.prototype.downloadIntoFrame = function (modelObj, parameters, operation)
         {
             var url = this.buildObjectURL(modelObj, parameters, operation);
+            this.downloadUrlIntoFrame(url, "downloader_" + modelObj.name)
+        };
+
+        // summary:
+        //  Downloads given URL into a iframe with given id
+        Management.prototype.downloadUrlIntoFrame = function (url, frameId)
+        {
             var iframe = document.createElement('iframe');
-            iframe.id = "downloader_" + modelObj.name;
+            iframe.id = frameId;
             iframe.style.display = "none";
             document.body.appendChild(iframe);
             iframe.src = url;

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0314c2a9/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
index 892e7ff..21a616c 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
@@ -1001,11 +1001,7 @@ define(["dojo/_base/declare",
                     var id = uuid();
                     params.contentDispositionAttachmentFilename ="query-results-" + id +
".csv";
                     var url = this.management.getQueryUrl({category: this.categoryName, parent:
this.parentObject}, params);
-                    var iframe = document.createElement('iframe');
-                    iframe.id = "query_downloader_" + id;
-                    iframe.style.display = "none";
-                    document.body.appendChild(iframe);
-                    iframe.src = url;
+                    this.management.downloadUrlIntoFrame(url, "query_downloader_" + id);
                 }
             });
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message