cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [1/3] git commit: UI Detail view: support external links
Date Tue, 29 Jan 2013 22:35:44 GMT
UI Detail view: support external links

If externalLink is specified in detail view field attributes, then
render its value as <a> hyperlink.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b18bca65
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b18bca65
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b18bca65

Branch: refs/heads/ui-plugins
Commit: b18bca651ffed5141c388f13d341c6917bed90f6
Parents: 806105f
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Jan 29 14:32:51 2013 -0800
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Jan 29 14:32:51 2013 -0800

----------------------------------------------------------------------
 ui/scripts/ui/widgets/detailView.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b18bca65/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 4b4fbd5..0b74d90 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -823,7 +823,16 @@
 				 */
 				
         $name.html(_l(value.label));
-        $value.html(_s(content));
+
+        if (!value.isExternalLink) {
+          $value.html(_s(content));
+        } else {
+          $value.html('').append(
+            $('<a>').attr({
+              href: _s(content)
+            }).html(_s(content))
+          );
+        }
 
         // Set up validation metadata
         $value.data('validation-rules', value.validation);


Mime
View raw message