incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [29/49] git commit: CS-16573: cloudstack UI - register ISO - encode data passed to API call.
Date Sat, 27 Oct 2012 10:02:26 GMT
CS-16573: cloudstack UI - register ISO - encode data passed to API call.


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

Branch: refs/heads/marvin-parallel
Commit: 48c2e6b844c1be0709010a02f9972bd5e159a35c
Parents: 8fff59e
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Wed Oct 24 11:33:09 2012 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Wed Oct 24 15:09:07 2012 -0700

----------------------------------------------------------------------
 ui/scripts/templates.js |   43 +++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/48c2e6b8/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index aa6468a..c3c82c8 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -889,25 +889,34 @@
              
 
               action: function(args) {
-                var array1 = [];
-                array1.push("&name=" + todb(args.data.name));
-                array1.push("&displayText=" + todb(args.data.description));
-                array1.push("&url=" + todb(args.data.url));
-                array1.push("&zoneid=" + args.data.zone);
-                array1.push("&isextractable=" + (args.data.isExtractable=="on"));
-                array1.push("&bootable=" + (args.data.isBootable=="on"));
-
-                if(args.$form.find('.form-item[rel=osTypeId]').css("display") != "none")
-                  array1.push("&osTypeId=" + args.data.osTypeId);
-
-                if(args.$form.find('.form-item[rel=isPublic]').css("display") != "none")
-                  array1.push("&ispublic=" + (args.data.isPublic == "on"));
-                if(args.$form.find('.form-item[rel=isFeatured]').css("display") != "none")
-                  array1.push("&isfeatured=" + (args.data.isFeatured == "on"));
+							  var data = {
+								  name: args.data.name,
+									displayText: args.data.description,
+									url: args.data.url,
+									zoneid: args.data.zone,
+									isextractable: (args.data.isExtractable=="on"),
+									bootable: (args.data.isBootable=="on") 
+								};		  
+
+                if(args.$form.find('.form-item[rel=osTypeId]').css("display") != "none")
{
+								  $.extend(data, {
+									  osTypeId: args.data.osTypeId
+									});
+								}
+                if(args.$form.find('.form-item[rel=isPublic]').css("display") != "none")
{
+								  $.extend(data, {
+									  ispublic: (args.data.isPublic == "on")
+									});								
+								}
+                if(args.$form.find('.form-item[rel=isFeatured]').css("display") != "none")
{
+								  $.extend(data, {
+									  isfeatured: (args.data.isFeatured == "on")
+									});
+								}
 
                 $.ajax({
-                  url: createURL("registerIso" + array1.join("")),
-                  dataType: "json",
+                  url: createURL('registerIso'),
+                  data: data,
                   success: function(json) {
                     var items = json.registerisoresponse.iso;	//items might have more than
one array element if it's create ISOs for all zones.
                     args.response.success({data:items[0]});


Mime
View raw message