cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [09/16] git commit: updated refs/heads/master to b074fc7
Date Fri, 07 Aug 2015 21:10:23 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 915d23a..171d34b 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -15,7 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 (function(cloudStack, $) {
-	var ostypeObjs;
+    var ostypeObjs;
 
     cloudStack.sections.templates = {
         title: 'label.menu.templates',
@@ -111,7 +111,7 @@
                                 docID: 'helpNetworkOfferingName',
                                 preFilter: cloudStack.preFilter.createTemplate,
                                 fields: {
-                                	url: {
+                                    url: {
                                         label: 'label.url',
                                         docID: 'helpRegisterTemplateURL',
                                         validation: {
@@ -136,41 +136,41 @@
                                         label: 'label.zone',
                                         docID: 'helpRegisterTemplateZone',
                                         select: function(args) {
-                                        	if(g_regionsecondaryenabled == true) {
-                                        		args.response.success({
+                                            if(g_regionsecondaryenabled == true) {
+                                                args.response.success({
                                                     data: [{
                                                         id: -1,
                                                         description: "All Zones"
                                                     }]
                                                 });
-                                        	} else {
-	                                            $.ajax({
-	                                                url: createURL("listZones&available=true"),
-	                                                dataType: "json",
-	                                                async: true,
-	                                                success: function(json) {
-	                                                    var zoneObjs = [];
-	                                                    var items = json.listzonesresponse.zone;
-	                                                    if (items != null) {
-	                                                        for (var i = 0; i < items.length; i++) {
-	                                                            zoneObjs.push({
-	                                                                id: items[i].id,
-	                                                                description: items[i].name
-	                                                            });
-	                                                        }
-	                                                    }
-	                                                    if (isAdmin() && !(cloudStack.context.projects && cloudStack.context.projects[0])) {
-	                                                        zoneObjs.unshift({
-	                                                            id: -1,
-	                                                            description: "All Zones"
-	                                                        });
-	                                                    }
-	                                                    args.response.success({
-	                                                        data: zoneObjs
-	                                                    });
-	                                                }
-	                                            });
-                                        	}
+                                            } else {
+                                                $.ajax({
+                                                    url: createURL("listZones&available=true"),
+                                                    dataType: "json",
+                                                    async: true,
+                                                    success: function(json) {
+                                                        var zoneObjs = [];
+                                                        var items = json.listzonesresponse.zone;
+                                                        if (items != null) {
+                                                            for (var i = 0; i < items.length; i++) {
+                                                                zoneObjs.push({
+                                                                    id: items[i].id,
+                                                                    description: items[i].name
+                                                                });
+                                                            }
+                                                        }
+                                                        if (isAdmin() && !(cloudStack.context.projects && cloudStack.context.projects[0])) {
+                                                            zoneObjs.unshift({
+                                                                id: -1,
+                                                                description: "All Zones"
+                                                            });
+                                                        }
+                                                        args.response.success({
+                                                            data: zoneObjs
+                                                        });
+                                                    }
+                                                });
+                                            }
                                         }
                                     },
                                     hypervisor: {
@@ -184,7 +184,7 @@
                                             var apiCmd;
                                             if (args.zone == -1) { //All Zones
                                                 //apiCmd = "listHypervisors&zoneid=-1"; //"listHypervisors&zoneid=-1" has been changed to return only hypervisors available in all zones (bug 8809)
-                                            	apiCmd = "listHypervisors";
+                                                apiCmd = "listHypervisors";
                                             }
                                             else {
                                                 apiCmd = "listHypervisors&zoneid=" + args.zone;
@@ -218,7 +218,7 @@
 
                                                     $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
                                                 } else if ($(this).val() == "XenServer") {
-                                                	$form.find('.form-item[rel=rootDiskControllerType]').hide();
+                                                    $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
                                                     $form.find('.form-item[rel=keyboardType]').hide();
 
@@ -401,7 +401,7 @@
                                                     description: 'TAR'
                                                 });
                                             } else if (args.hypervisor == "Hyperv") {
-                                            	items.push({
+                                                items.push({
                                                     id: 'VHD',
                                                     description: 'VHD'
                                                 });
@@ -425,8 +425,8 @@
                                                 dataType: "json",
                                                 async: true,
                                                 success: function(json) {
-                                                	var ostypeObjs = json.listostypesresponse.ostype;
-                                                	args.response.success({
+                                                    var ostypeObjs = json.listostypesresponse.ostype;
+                                                    args.response.success({
                                                         data: ostypeObjs
                                                     });
                                                 }
@@ -792,7 +792,7 @@
                                                     description: 'TAR'
                                                 });
                                             } else if (args.hypervisor == "Hyperv") {
-                                            	items.push({
+                                                items.push({
                                                     id: 'VHD',
                                                     description: 'VHD'
                                                 });
@@ -816,8 +816,8 @@
                                                 dataType: "json",
                                                 async: true,
                                                 success: function(json) {
-                                                	var ostypeObjs = json.listostypesresponse.ostype;
-                                                	args.response.success({
+                                                    var ostypeObjs = json.listostypesresponse.ostype;
+                                                    args.response.success({
                                                         data: ostypeObjs
                                                     });
                                                 }
@@ -1038,49 +1038,49 @@
 
                                     //***** addResourceDetail *****
                                     //XenServer only (starts here)
-  					                if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
-  					                	$.ajax({
-  					                		url: createURL('addResourceDetail'),
-  					                		data: {
-  					                			resourceType: 'template',
-  					                			resourceId: args.context.templates[0].id,
-  					                			'details[0].key': 'hypervisortoolsversion',
-  					                			'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
-  					                		},
-  					                		success: function(json) {
-  					                			 var jobId = json.addResourceDetailresponse.jobid;
-  		                                         var addResourceDetailIntervalID = setInterval(function() {
-  		                                             $.ajax({
-  		                                                 url: createURL("queryAsyncJobResult&jobid=" + jobId),
-  		                                                 dataType: "json",
-  		                                                 success: function(json) {
-  		                                                     var result = json.queryasyncjobresultresponse;
-
-  		                                                     if (result.jobstatus == 0) {
-  		                                                         return; //Job has not completed
-  		                                                     } else {
-  		                                                         clearInterval(addResourceDetailIntervalID);
-
-  		                                                         if (result.jobstatus == 1) {
-  		                                                        	 //do nothing
-  		                                                         } else if (result.jobstatus == 2) {
-  		                                                        	 cloudStack.dialog.notice({
-  		                                                                 message: "message.XSTools61plus.update.failed" + " " + _s(result.jobresult.errortext)
-  		                                                             });
-  		                                                         }
-  		                                                     }
-  		                                                 },
-  		                                                 error: function(XMLHttpResponse) {
-  		                                                     cloudStack.dialog.notice({
-  		                                                         message: "message.XSTools61plus.update.failed" + " " + parseXMLHttpResponse(XMLHttpResponse)
-  		                                                     });
-  		                                                 }
-  		                                             });
-  		                                         }, g_queryAsyncJobResultInterval);
-  					                		}
-  					                	});
-  								    }
-  							        //XenServer only (ends here)
+                                      if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
+                                          $.ajax({
+                                              url: createURL('addResourceDetail'),
+                                              data: {
+                                                  resourceType: 'template',
+                                                  resourceId: args.context.templates[0].id,
+                                                  'details[0].key': 'hypervisortoolsversion',
+                                                  'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
+                                              },
+                                              success: function(json) {
+                                                   var jobId = json.addResourceDetailresponse.jobid;
+                                                   var addResourceDetailIntervalID = setInterval(function() {
+                                                       $.ajax({
+                                                           url: createURL("queryAsyncJobResult&jobid=" + jobId),
+                                                           dataType: "json",
+                                                           success: function(json) {
+                                                               var result = json.queryasyncjobresultresponse;
+
+                                                               if (result.jobstatus == 0) {
+                                                                   return; //Job has not completed
+                                                               } else {
+                                                                   clearInterval(addResourceDetailIntervalID);
+
+                                                                   if (result.jobstatus == 1) {
+                                                                       //do nothing
+                                                                   } else if (result.jobstatus == 2) {
+                                                                       cloudStack.dialog.notice({
+                                                                           message: "message.XSTools61plus.update.failed" + " " + _s(result.jobresult.errortext)
+                                                                       });
+                                                                   }
+                                                               }
+                                                           },
+                                                           error: function(XMLHttpResponse) {
+                                                               cloudStack.dialog.notice({
+                                                                   message: "message.XSTools61plus.update.failed" + " " + parseXMLHttpResponse(XMLHttpResponse)
+                                                               });
+                                                           }
+                                                       });
+                                                   }, g_queryAsyncJobResultInterval);
+                                              }
+                                          });
+                                      }
+                                      //XenServer only (ends here)
 
 
                                     //***** listTemplates *****
@@ -1168,28 +1168,28 @@
                                     }
 
                                     if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
-                                    	var ostypeObjs;
-    	                            	$.ajax({
-    	                                    url: createURL("listOsTypes"),
-    	                                    dataType: "json",
-    	                                    async: false,
-    	                                    success: function(json) {
-    	                                    	var ostypeObjs = json.listostypesresponse.ostype;
-    	                                    }
-    	                                });
-
-                                    	if (ostypeObjs != undefined) {
-                                    		var ostypeName;
-                                    		for (var i = 0; i < ostypeObjs.length; i++) {
-                                    			if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
-                                    				ostypeName = ostypeObjs[i].description;
-                                    				break;
-                                    			}
-                                    		}
-                                    		if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
-                                    			hiddenFields.push('xenserverToolsVersion61plus');
-                                    		}
-                                    	}
+                                        var ostypeObjs;
+                                        $.ajax({
+                                            url: createURL("listOsTypes"),
+                                            dataType: "json",
+                                            async: false,
+                                            success: function(json) {
+                                                var ostypeObjs = json.listostypesresponse.ostype;
+                                            }
+                                        });
+
+                                        if (ostypeObjs != undefined) {
+                                            var ostypeName;
+                                            for (var i = 0; i < ostypeObjs.length; i++) {
+                                                if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
+                                                    ostypeName = ostypeObjs[i].description;
+                                                    break;
+                                                }
+                                            }
+                                            if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
+                                                hiddenFields.push('xenserverToolsVersion61plus');
+                                            }
+                                        }
                                     }
 
                                     return hiddenFields;
@@ -1282,17 +1282,17 @@
                                         label: 'label.os.type',
                                         isEditable: true,
                                         select: function(args) {
-                                        	var ostypeObjs;
+                                            var ostypeObjs;
                                             $.ajax({
                                                 url: createURL("listOsTypes"),
                                                 dataType: "json",
                                                 async: false,
                                                 success: function(json) {
-                                                	ostypeObjs = json.listostypesresponse.ostype;
+                                                    ostypeObjs = json.listostypesresponse.ostype;
                                                 }
                                             });
 
-                                        	var items = [];
+                                            var items = [];
                                             $(ostypeObjs).each(function() {
                                                 items.push({
                                                     id: this.id,
@@ -1347,23 +1347,23 @@
                                     $.ajax({
                                         url: createURL("listTemplates"),
                                         data: {
-                                        	templatefilter: "self",
-                                        	id: args.context.templates[0].id
+                                            templatefilter: "self",
+                                            id: args.context.templates[0].id
                                         },
                                         success: function(json) {
-                                        	var jsonObj = json.listtemplatesresponse.template[0];
-
-                                        	if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
-                                        	    if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
-                                        	        jsonObj.xenserverToolsVersion61plus = true;
-                                        	    else
-                                        	        jsonObj.xenserverToolsVersion61plus = false;
-                                        	}
-
-                                        	args.response.success({
-                                        	    actionFilter: templateActionfilter,
-                                        	    data: jsonObj
-                                        	});
+                                            var jsonObj = json.listtemplatesresponse.template[0];
+
+                                            if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
+                                                if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
+                                                    jsonObj.xenserverToolsVersion61plus = true;
+                                                else
+                                                    jsonObj.xenserverToolsVersion61plus = false;
+                                            }
+
+                                            args.response.success({
+                                                actionFilter: templateActionfilter,
+                                                data: jsonObj
+                                            });
                                         }
                                     });
                                 }
@@ -1389,31 +1389,31 @@
 
 
                                     dataProvider: function(args) {  // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing)
-                                    	$.ajax({
+                                        $.ajax({
                                             url: createURL("listTemplates"),
                                             data: {
-                                            	templatefilter: "self",
-                                            	id: args.context.templates[0].id
+                                                templatefilter: "self",
+                                                id: args.context.templates[0].id
                                             },
                                             success: function(json) {
-                                            	var jsonObjs = json.listtemplatesresponse.template;
-
-                                            	if (jsonObjs != undefined) {
-                                            		for (var i = 0; i < jsonObjs.length; i++) {
-                                            			var jsonObj = jsonObjs[i];
-                                            			if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
-                                                    	    if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
-                                                    	        jsonObj.xenserverToolsVersion61plus = true;
-                                                    	    else
-                                                    	        jsonObj.xenserverToolsVersion61plus = false;
-                                                    	}
-                                            		}
-                                            	}
-
-                                            	args.response.success({
-                                            	    actionFilter: templateActionfilter,
-                                            	    data: jsonObjs
-                                            	});
+                                                var jsonObjs = json.listtemplatesresponse.template;
+
+                                                if (jsonObjs != undefined) {
+                                                    for (var i = 0; i < jsonObjs.length; i++) {
+                                                        var jsonObj = jsonObjs[i];
+                                                        if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
+                                                            if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
+                                                                jsonObj.xenserverToolsVersion61plus = true;
+                                                            else
+                                                                jsonObj.xenserverToolsVersion61plus = false;
+                                                        }
+                                                    }
+                                                }
+
+                                                args.response.success({
+                                                    actionFilter: templateActionfilter,
+                                                    data: jsonObjs
+                                                });
                                             }
                                         });
                                     },
@@ -1502,14 +1502,14 @@
                                                  },
                                                  action: function(args) {
                                                      var data = {
-                                                     	id: args.context.templates[0].id,
-                                                     	destzoneid: args.data.destinationZoneId
+                                                         id: args.context.templates[0].id,
+                                                         destzoneid: args.data.destinationZoneId
                                                      };
                                                      $.extend(data, {
                                                          sourcezoneid: args.context.zones[0].zoneid
                                                      });
 
-                                                 	$.ajax({
+                                                     $.ajax({
                                                          url: createURL('copyTemplate'),
                                                          data: data,
                                                          success: function(json) {
@@ -1550,28 +1550,28 @@
                                                 }
 
                                                 if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
-                                                	var ostypeObjs;
-                	                            	$.ajax({
-                	                                    url: createURL("listOsTypes"),
-                	                                    dataType: "json",
-                	                                    async: false,
-                	                                    success: function(json) {
-                	                                    	ostypeObjs = json.listostypesresponse.ostype;
-                	                                    }
-                	                                });
-
-                                                	if (ostypeObjs != undefined) {
-                                                		var ostypeName;
-                                                		for (var i = 0; i < ostypeObjs.length; i++) {
-                                                			if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
-                                                				ostypeName = ostypeObjs[i].description;
-                                                				break;
-                                                			}
-                                                		}
-                                                		if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
-                                                			hiddenFields.push('xenserverToolsVersion61plus');
-                                                		}
-                                                	}
+                                                    var ostypeObjs;
+                                                    $.ajax({
+                                                        url: createURL("listOsTypes"),
+                                                        dataType: "json",
+                                                        async: false,
+                                                        success: function(json) {
+                                                            ostypeObjs = json.listostypesresponse.ostype;
+                                                        }
+                                                    });
+
+                                                    if (ostypeObjs != undefined) {
+                                                        var ostypeName;
+                                                        for (var i = 0; i < ostypeObjs.length; i++) {
+                                                            if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
+                                                                ostypeName = ostypeObjs[i].description;
+                                                                break;
+                                                            }
+                                                        }
+                                                        if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
+                                                            hiddenFields.push('xenserverToolsVersion61plus');
+                                                        }
+                                                    }
                                                 }
 
                                                 return hiddenFields;
@@ -1595,7 +1595,7 @@
                                                 zoneid: {
                                                     label: 'label.zone.id'
                                                 },
-                                            	isready: {
+                                                isready: {
                                                     label: 'state.Ready',
                                                     converter: cloudStack.converters.toBooleanText
                                                 },
@@ -1681,17 +1681,17 @@
                                                     label: 'label.os.type',
                                                     isEditable: true,
                                                     select: function(args) {
-                                                    	var ostypeObjs;
+                                                        var ostypeObjs;
                                                         $.ajax({
                                                             url: createURL("listOsTypes"),
                                                             dataType: "json",
                                                             async: false,
                                                             success: function(json) {
-                                                            	ostypeObjs = json.listostypesresponse.ostype;
+                                                                ostypeObjs = json.listostypesresponse.ostype;
                                                             }
                                                         });
 
-                                                    	var items = [];
+                                                        var items = [];
                                                         $(ostypeObjs).each(function() {
                                                             items.push({
                                                                 id: this.id,
@@ -1737,19 +1737,19 @@
 
 
                                             dataProvider: function(args) {  // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing) > select a zone from listing > Details tab
-                                            	var jsonObj = args.context.zones[0];
-
-                                            	if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
-                                            	    if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
-                                            	        jsonObj.xenserverToolsVersion61plus = true;
-                                            	    else
-                                            	        jsonObj.xenserverToolsVersion61plus = false;
-                                            	}
-
-                                            	args.response.success({
-                                            	    actionFilter: templateActionfilter,
-                                            	    data: jsonObj
-                                            	});
+                                                var jsonObj = args.context.zones[0];
+
+                                                if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
+                                                    if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
+                                                        jsonObj.xenserverToolsVersion61plus = true;
+                                                    else
+                                                        jsonObj.xenserverToolsVersion61plus = false;
+                                                }
+
+                                                args.response.success({
+                                                    actionFilter: templateActionfilter,
+                                                    data: jsonObj
+                                                });
                                             }
                                         }
                                     }}
@@ -1832,41 +1832,41 @@
                                         label: 'label.zone',
                                         docID: 'helpRegisterISOZone',
                                         select: function(args) {
-                                        	if(g_regionsecondaryenabled == true) {
-                                        		args.response.success({
+                                            if(g_regionsecondaryenabled == true) {
+                                                args.response.success({
                                                     data: [{
                                                         id: -1,
                                                         description: "All Zones"
                                                     }]
                                                 });
-                                        	} else {
-	                                            $.ajax({
-	                                                url: createURL("listZones&available=true"),
-	                                                dataType: "json",
-	                                                async: true,
-	                                                success: function(json) {
-	                                                    var zoneObjs = [];
-	                                                    var items = json.listzonesresponse.zone;
-	                                                    if (items != null) {
-	                                                        for (var i = 0; i < items.length; i++) {
-	                                                            zoneObjs.push({
-	                                                                id: items[i].id,
-	                                                                description: items[i].name
-	                                                            });
-	                                                        }
-	                                                    }
-	                                                    if (isAdmin() && !(cloudStack.context.projects && cloudStack.context.projects[0])) {
-	                                                        zoneObjs.unshift({
-	                                                            id: -1,
-	                                                            description: "All Zones"
-	                                                        });
-	                                                    }
-	                                                    args.response.success({
-	                                                        data: zoneObjs
-	                                                    });
-	                                                }
-	                                            });
-                                        	}
+                                            } else {
+                                                $.ajax({
+                                                    url: createURL("listZones&available=true"),
+                                                    dataType: "json",
+                                                    async: true,
+                                                    success: function(json) {
+                                                        var zoneObjs = [];
+                                                        var items = json.listzonesresponse.zone;
+                                                        if (items != null) {
+                                                            for (var i = 0; i < items.length; i++) {
+                                                                zoneObjs.push({
+                                                                    id: items[i].id,
+                                                                    description: items[i].name
+                                                                });
+                                                            }
+                                                        }
+                                                        if (isAdmin() && !(cloudStack.context.projects && cloudStack.context.projects[0])) {
+                                                            zoneObjs.unshift({
+                                                                id: -1,
+                                                                description: "All Zones"
+                                                            });
+                                                        }
+                                                        args.response.success({
+                                                            data: zoneObjs
+                                                        });
+                                                    }
+                                                });
+                                            }
                                         }
                                     },
 
@@ -1886,7 +1886,7 @@
                                             required: true
                                         },
                                         select: function(args) {
-                                        	$.ajax({
+                                            $.ajax({
                                                 url: createURL("listOsTypes"),
                                                 dataType: "json",
                                                 async: true,
@@ -2047,7 +2047,7 @@
                                         break;
                                     case "shared":
                                         $.extend(data, {
-                                        	isofilter: 'shared'
+                                            isofilter: 'shared'
                                         });
                                         break;
                                     case "featured":
@@ -2316,17 +2316,17 @@
                                         label: 'label.os.type',
                                         isEditable: true,
                                         select: function(args) {
-                                        	if (ostypeObjs == undefined) {
-	                                            $.ajax({
-	                                                url: createURL("listOsTypes"),
-	                                                dataType: "json",
-	                                                async: false,
-	                                                success: function(json) {
-	                                                	ostypeObjs = json.listostypesresponse.ostype;
-	                                                }
-	                                            });
-                                        	}
-                                        	var items = [];
+                                            if (ostypeObjs == undefined) {
+                                                $.ajax({
+                                                    url: createURL("listOsTypes"),
+                                                    dataType: "json",
+                                                    async: false,
+                                                    success: function(json) {
+                                                        ostypeObjs = json.listostypesresponse.ostype;
+                                                    }
+                                                });
+                                            }
+                                            var items = [];
                                             $(ostypeObjs).each(function() {
                                                 items.push({
                                                     id: this.id,
@@ -2460,16 +2460,16 @@
                                             },
                                             action: function(args) {
                                                 var data = {
-                                                	id: args.context.isos[0].id,
-                                                	destzoneid: args.data.destinationZoneId
+                                                    id: args.context.isos[0].id,
+                                                    destzoneid: args.data.destinationZoneId
                                                 };
                                                 if (args.context.zones[0].zoneid != undefined) {
                                                     $.extend(data, {
-                                                    	sourcezoneid: args.context.zones[0].zoneid
+                                                        sourcezoneid: args.context.zones[0].zoneid
                                                     });
                                                 }
 
-                                            	$.ajax({
+                                                $.ajax({
                                                     url: createURL('copyIso'),
                                                     data: data,
                                                     success: function(json) {
@@ -2610,17 +2610,17 @@
                                                     label: 'label.os.type',
                                                     isEditable: true,
                                                     select: function(args) {
-                                                    	var ostypeObjs;
+                                                        var ostypeObjs;
                                                         $.ajax({
                                                             url: createURL("listOsTypes"),
                                                             dataType: "json",
                                                             async: false,
                                                             success: function(json) {
-                                                            	ostypeObjs = json.listostypesresponse.ostype;
+                                                                ostypeObjs = json.listostypesresponse.ostype;
                                                             }
                                                         });
 
-                                                    	var items = [];
+                                                        var items = [];
                                                         $(ostypeObjs).each(function() {
                                                             items.push({
                                                                 id: this.id,
@@ -2735,8 +2735,8 @@
             /*
             if(g_regionsecondaryenabled != true) {
                 allowedActions.push("copyISO");
-			}
-			*/
+            }
+            */
         }
 
         // "Create VM"
@@ -2746,7 +2746,7 @@
      if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))  //if neither root-admin, nor item owner
      || jsonObj.isready == false)
      || (jsonObj.bootable == false)
-     || (jsonObj.domainid ==	1 && jsonObj.account ==	"system")
+     || (jsonObj.domainid ==    1 && jsonObj.account ==    "system")
      ) {
        //do nothing
      }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui-custom/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/accountsWizard.js b/ui/scripts/ui-custom/accountsWizard.js
index 3e2a646..9349234 100644
--- a/ui/scripts/ui-custom/accountsWizard.js
+++ b/ui/scripts/ui-custom/accountsWizard.js
@@ -130,88 +130,88 @@
                         dataType: "json",
                         async: false,
                         success: function(json) {
-                        	//for testing only (begin)
-                        	/*
-                        	json = {
-                        		    "ldapuserresponse": {
-                        		        "count": 11,
-                        		        "LdapUser": [
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "Administrator",
-                        		                "domain": "CN=Administrator"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "Guest",
-                        		                "domain": "CN=Guest"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "IUSR_HYD-QA12",
-                        		                "domain": "CN=IUSR_HYD-QA12"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "IWAM_HYD-QA12",
-                        		                "domain": "CN=IWAM_HYD-QA12"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "SUPPORT_388945a0",
-                        		                "domain": "CN=SUPPORT_388945a0"
-                        		            },
-                        		            {
-                        		                "principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
-                        		                "firstname": "jessica",
-                        		                "lastname": "j",
-                        		                "username": "jessica",
-                        		                "domain": "CN=jessica j"
-                        		            },
-                        		            {
-                        		                "principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
-                        		                "username": "krbtgt",
-                        		                "domain": "CN=krbtgt"
-                        		            },
-                        		            {
-                        		                "email": "sadhu@sadhu.com",
-                        		                "principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
-                        		                "firstname": "sadhu",
-                        		                "username": "sadhu",
-                        		                "domain": "CN=sadhu"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
-                        		                "firstname": "sangee1",
-                        		                "lastname": "hariharan",
-                        		                "username": "sangee1",
-                        		                "domain": "CN=sangee1 hariharan"
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
-                        		                "firstname": "sanjeev",
-                        		                "username": "sanjeev",
-                        		                "domain": "CN=sanjeev n."
-                        		            },
-                        		            {
-                        		                "email": "test@test.com",
-                        		                "principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
-                        		                "firstname": "test1",
-                        		                "username": "test1dddd",
-                        		                "domain": "CN=test1dddd"
-                        		            }
-                        		        ]
-                        		    }
-                        		};
-                        	*/
-                        	//for testing only (end)
+                            //for testing only (begin)
+                            /*
+                            json = {
+                                    "ldapuserresponse": {
+                                        "count": 11,
+                                        "LdapUser": [
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "Administrator",
+                                                "domain": "CN=Administrator"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "Guest",
+                                                "domain": "CN=Guest"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "IUSR_HYD-QA12",
+                                                "domain": "CN=IUSR_HYD-QA12"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "IWAM_HYD-QA12",
+                                                "domain": "CN=IWAM_HYD-QA12"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "SUPPORT_388945a0",
+                                                "domain": "CN=SUPPORT_388945a0"
+                                            },
+                                            {
+                                                "principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
+                                                "firstname": "jessica",
+                                                "lastname": "j",
+                                                "username": "jessica",
+                                                "domain": "CN=jessica j"
+                                            },
+                                            {
+                                                "principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
+                                                "username": "krbtgt",
+                                                "domain": "CN=krbtgt"
+                                            },
+                                            {
+                                                "email": "sadhu@sadhu.com",
+                                                "principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
+                                                "firstname": "sadhu",
+                                                "username": "sadhu",
+                                                "domain": "CN=sadhu"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
+                                                "firstname": "sangee1",
+                                                "lastname": "hariharan",
+                                                "username": "sangee1",
+                                                "domain": "CN=sangee1 hariharan"
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
+                                                "firstname": "sanjeev",
+                                                "username": "sanjeev",
+                                                "domain": "CN=sanjeev n."
+                                            },
+                                            {
+                                                "email": "test@test.com",
+                                                "principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
+                                                "firstname": "test1",
+                                                "username": "test1dddd",
+                                                "domain": "CN=test1dddd"
+                                            }
+                                        ]
+                                    }
+                                };
+                            */
+                            //for testing only (end)
 
                             if (json.ldapuserresponse.count > 0) {
                                 $(json.ldapuserresponse.LdapUser).each(function() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index 86901c5..d0fb90f 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -1137,18 +1137,18 @@
                     // Next button
                     if ($target.closest('div.button.next').size()) {
                         //step 2 - select template/ISO
-                    	if($activeStep.hasClass('select-iso')) {
-                    		if ($activeStep.find('.content:visible input:checked').size() == 0) {
-	                            cloudStack.dialog.notice({
-	                                message: 'message.step.1.continue'
-	                            });
-	                            return false;
-	                        }
-	                        $(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
-	                        	$form: $form,
-                            	currentStep: 2
+                        if($activeStep.hasClass('select-iso')) {
+                            if ($activeStep.find('.content:visible input:checked').size() == 0) {
+                                cloudStack.dialog.notice({
+                                    message: 'message.step.1.continue'
+                                });
+                                return false;
+                            }
+                            $(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
+                                $form: $form,
+                                currentStep: 2
                             });
-                    	}
+                        }
 
                         //step 6 - select network
                         if ($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui-custom/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js
index 531da78..597b757 100644
--- a/ui/scripts/ui-custom/regions.js
+++ b/ui/scripts/ui-custom/regions.js
@@ -37,9 +37,9 @@
                             $li.data('region-data', region);
 
                             /* e.g.
-							region.endpoint	== "http://localhost:8080/client/"
-							document.location.href == "http://localhost:8080/client/#"
-							*/
+                            region.endpoint    == "http://localhost:8080/client/"
+                            document.location.href == "http://localhost:8080/client/#"
+                            */
                             if (document.location.href.indexOf(region.endpoint) != -1) {
                                 currentRegion = region;
                                 $li.addClass('active');

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui-custom/zoneChart.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneChart.js b/ui/scripts/ui-custom/zoneChart.js
index 989c4c2..51d5eea 100644
--- a/ui/scripts/ui-custom/zoneChart.js
+++ b/ui/scripts/ui-custom/zoneChart.js
@@ -262,7 +262,7 @@
                                             if ($.inArray(trafficType.dependsOn, validTrafficTypes) == -1) { //if its dependsOn is not a valid traffic type, either
                                                 return true; //skip this item
                                             }
-                                            //else, if its dependsOn is a valid traffic type, continue to Make list item	(e.g. providers.dependsOn is 'guest')
+                                            //else, if its dependsOn is a valid traffic type, continue to Make list item    (e.g. providers.dependsOn is 'guest')
                                         } else {
                                             return true; //if it doesn't have dependsOn, skip this item
                                         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index 7e1a2a2..6ebc1b0 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -298,89 +298,89 @@
             var fields;
 
             if (hypervisor == 'VMware') {
-            	fields = {
-            		vSwitchName: {
-	                    label: 'label.vswitch.name' ,
-	                    defaultValue: trafficData.vSwitchName
-	                },
-	                vlanId: {
-	                        label: 'label.vlan.id',
-	                	defaultValue: trafficData.vlanId
-	                }
-	            };
-
-            	if(zoneType == 'Advanced') {
-	            	if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
-	            		if(trafficData.vSwitchType == null) {
-	            			 var useDvs = false;
-	                         $.ajax({
-	                             url: createURL('listConfigurations'),
-	                             data: {
-	                                 name: 'vmware.use.dvswitch'
-	                             },
-	                             async: false,
-	                             success: function(json) {
-	                                 if (json.listconfigurationsresponse.configuration[0].value == 'true') {
-	                                     useDvs = true;
-	                                 }
-	                             }
-	                         });
-	                         if (useDvs == true) {
-	                        	 var useNexusDvs = false;
-	                             $.ajax({
-	                                 url: createURL('listConfigurations'),
-	                                 data: {
-	                                     name: 'vmware.use.nexus.vswitch'
-	                                 },
-	                                 async: false,
-	                                 success: function(json) {
-	                                     if (json.listconfigurationsresponse.configuration[0].value == 'true') {
-	                                         useNexusDvs = true;
-	                                     }
-	                                 }
-	                             });
-	                             if (useNexusDvs == true) {
-	                            	 trafficData.vSwitchType = 'nexusdvs';
-	                            	 fields.vSwitchName.defaultValue = 'epp0';
-	                             } else {
-	                            	 trafficData.vSwitchType = 'vmwaredvs';
-	                            	 fields.vSwitchName.defaultValue = 'dvSwitch0';
-	                             }
-	                         } else { //useDvs == false
-	                        	 trafficData.vSwitchType = 'vmwaresvs';
-	                        	 fields.vSwitchName.defaultValue = 'vSwitch0';
-	                         }
-	            		}
-
-	            		$.extend(fields, {
-	            		    vSwitchType: {
-	                                label: 'label.vSwitch.type',
-	            		        select: function (args) {
-	            		            args.response.success({
-	            		                data: [{
-	            		                    id: 'nexusdvs',
-	            		                    description: 'Cisco Nexus 1000v Distributed Virtual Switch'
-	            		                }, {
-	            		                    id: 'vmwaresvs',
-	            		                    description: 'VMware vNetwork Standard Virtual Switch'
-	            		                }, {
-	            		                    id: 'vmwaredvs',
-	            		                    description: 'VMware vNetwork Distributed Virtual Switch'
-	            		                }]
-	            		            });
-	            		        },
-	    		                defaultValue: trafficData.vSwitchType
-	            		    }
-	            		});
-	            	}
-            	}
+                fields = {
+                    vSwitchName: {
+                        label: 'label.vswitch.name' ,
+                        defaultValue: trafficData.vSwitchName
+                    },
+                    vlanId: {
+                            label: 'label.vlan.id',
+                        defaultValue: trafficData.vlanId
+                    }
+                };
+
+                if(zoneType == 'Advanced') {
+                    if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
+                        if(trafficData.vSwitchType == null) {
+                             var useDvs = false;
+                             $.ajax({
+                                 url: createURL('listConfigurations'),
+                                 data: {
+                                     name: 'vmware.use.dvswitch'
+                                 },
+                                 async: false,
+                                 success: function(json) {
+                                     if (json.listconfigurationsresponse.configuration[0].value == 'true') {
+                                         useDvs = true;
+                                     }
+                                 }
+                             });
+                             if (useDvs == true) {
+                                 var useNexusDvs = false;
+                                 $.ajax({
+                                     url: createURL('listConfigurations'),
+                                     data: {
+                                         name: 'vmware.use.nexus.vswitch'
+                                     },
+                                     async: false,
+                                     success: function(json) {
+                                         if (json.listconfigurationsresponse.configuration[0].value == 'true') {
+                                             useNexusDvs = true;
+                                         }
+                                     }
+                                 });
+                                 if (useNexusDvs == true) {
+                                     trafficData.vSwitchType = 'nexusdvs';
+                                     fields.vSwitchName.defaultValue = 'epp0';
+                                 } else {
+                                     trafficData.vSwitchType = 'vmwaredvs';
+                                     fields.vSwitchName.defaultValue = 'dvSwitch0';
+                                 }
+                             } else { //useDvs == false
+                                 trafficData.vSwitchType = 'vmwaresvs';
+                                 fields.vSwitchName.defaultValue = 'vSwitch0';
+                             }
+                        }
+
+                        $.extend(fields, {
+                            vSwitchType: {
+                                    label: 'label.vSwitch.type',
+                                select: function (args) {
+                                    args.response.success({
+                                        data: [{
+                                            id: 'nexusdvs',
+                                            description: 'Cisco Nexus 1000v Distributed Virtual Switch'
+                                        }, {
+                                            id: 'vmwaresvs',
+                                            description: 'VMware vNetwork Standard Virtual Switch'
+                                        }, {
+                                            id: 'vmwaredvs',
+                                            description: 'VMware vNetwork Distributed Virtual Switch'
+                                        }]
+                                    });
+                                },
+                                defaultValue: trafficData.vSwitchType
+                            }
+                        });
+                    }
+                }
             } else {
-	            fields = {
-	                label: {
-	                    label: hypervisor + ' ' + _l('label.traffic.label'),
-	                    defaultValue: trafficData.label
-	                }
-	            };
+                fields = {
+                    label: {
+                        label: hypervisor + ' ' + _l('label.traffic.label'),
+                        defaultValue: trafficData.label
+                    }
+                };
             }
 
             cloudStack.dialog.createForm({
@@ -727,7 +727,7 @@
                             $('<option>').attr({
                                 value: 'L3VPN'
                             }).html('L3VPN'),
-		                    $('<option>').attr({
+                            $('<option>').attr({
                                 value: 'VSP'
                             }).html('VSP'),
                             $('<option>').attr({

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 6f2b7a8..4079936 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -49,9 +49,9 @@
             // Description text
             var formDesc;
             if (typeof(args.form.desc) == 'function') {
-            	formDesc = args.form.desc(args);
+                formDesc = args.form.desc(args);
             } else { //typeof(args.form.desc) == 'string' or 'undefined'
-            	formDesc = args.form.desc;
+                formDesc = args.form.desc;
             }
             $('<span>').addClass('message').prependTo($formContainer).html(
                 _l(formDesc)
@@ -239,7 +239,7 @@
                             if (($target.is(':checked') && !isReverse) ||
                                 ($target.is(':unchecked') && isReverse)) {
 
-                            	$dependent.css('display', 'inline-block'); //show dependent dropdown field
+                                $dependent.css('display', 'inline-block'); //show dependent dropdown field
                                 $dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826)
 
                                 $dependent.each(function() {
@@ -281,11 +281,11 @@
                         context: args.context,
                         response: {
                             success: function(args) {
-                            	if (args.data == undefined || args.data.length == 0) {
-                            		var $option = $('<option>')
+                                if (args.data == undefined || args.data.length == 0) {
+                                    var $option = $('<option>')
                                     .appendTo($input)
                                     .html("");
-                            	} else {
+                                } else {
                                 $(args.data).each(function() {
                                     var id;
                                     if (field.valueField)
@@ -305,7 +305,7 @@
                                             .data('json-obj', this)
                                             .html(_s(desc));
                                 });
-                            	}
+                                }
 
                                 if (field.defaultValue) {
                                     $input.val(_s(strOrFunc(field.defaultValue, args.data)));
@@ -410,14 +410,14 @@
                             name: key,
                             type: 'checkbox'
                         }).appendTo($value);
-                    	var isChecked;
-                    	if (typeof (field.isChecked) == 'function') {
-                    	    isChecked = field.isChecked(args);
-                    	} else {
-                    	    isChecked = field.isChecked;
-                    	}
+                        var isChecked;
+                        if (typeof (field.isChecked) == 'function') {
+                            isChecked = field.isChecked(args);
+                        } else {
+                            isChecked = field.isChecked;
+                        }
                         if (isChecked) {
-                        	$input.attr('checked', strOrFunc(field.isChecked, args));
+                            $input.attr('checked', strOrFunc(field.isChecked, args));
                         } else {
                             // This is mainly for IE compatibility
                             setTimeout(function() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index d1d9aeb..f602d44 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -235,11 +235,11 @@
                                         }
 
                                         if (messages.complete) {
-                                        	if( messages.complete(args2.data) != null && messages.complete(args2.data).length > 0) {
-                                        		 cloudStack.dialog.notice({
+                                            if( messages.complete(args2.data) != null && messages.complete(args2.data).length > 0) {
+                                                 cloudStack.dialog.notice({
                                                      message: messages.complete(args2.data)
                                                  });
-                                        	}
+                                            }
                                         }
                                         if (additional && additional.complete) additional.complete($.extend(true, args, {
                                             $detailView: $detailView
@@ -311,7 +311,7 @@
                     if (messages && messages.confirm) {
                         cloudStack.dialog.confirm({
                             message: messages.confirm(messageArgs),
-			    isWarning: messages.isWarning,
+                isWarning: messages.isWarning,
                             action: function() {
                                 performAction({
                                     id: id
@@ -395,35 +395,35 @@
             uiActions.standard($detailView, args, {
                 noRefresh: true,
                 complete: function(args, args2) {
-                	if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
-	                    if (isMultiple && $detailView.is(':visible')) {
-	                        $detailView.find('.refresh').click(); // Reload tab
-	                    } else {
-	                        var $browser = $('#browser .container');
-	                        var $panel = $detailView.closest('.panel');
-
-	                        if ($detailView.is(':visible')) {
-	                            $browser.cloudBrowser('selectPanel', {
-	                                panel: $panel.prev()
-	                            });
-	                        }
-
-	                        if ($detailView.data("list-view-row") != null) {
-	                            var $row = $detailView.data('list-view-row');
-	                            var $tbody = $row.closest('tbody');
-
-	                            $row.remove();
-	                            if (!$tbody.find('tr').size()) {
-	                                $("<tr>").addClass('empty').append(
-	                                    $("<td>").html(_l('label.no.data'))
-	                                ).appendTo($tbody);
-	                            }
-	                            $tbody.closest('table').dataTable('refresh');
-	                        }
-	                    }
-                	}  else {
-                		$detailView.find('.refresh').click(); // Reload tab
-                	}
+                    if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
+                        if (isMultiple && $detailView.is(':visible')) {
+                            $detailView.find('.refresh').click(); // Reload tab
+                        } else {
+                            var $browser = $('#browser .container');
+                            var $panel = $detailView.closest('.panel');
+
+                            if ($detailView.is(':visible')) {
+                                $browser.cloudBrowser('selectPanel', {
+                                    panel: $panel.prev()
+                                });
+                            }
+
+                            if ($detailView.data("list-view-row") != null) {
+                                var $row = $detailView.data('list-view-row');
+                                var $tbody = $row.closest('tbody');
+
+                                $row.remove();
+                                if (!$tbody.find('tr').size()) {
+                                    $("<tr>").addClass('empty').append(
+                                        $("<td>").html(_l('label.no.data'))
+                                    ).appendTo($tbody);
+                                }
+                                $tbody.closest('table').dataTable('refresh');
+                            }
+                        }
+                    }  else {
+                        $detailView.find('.refresh').click(); // Reload tab
+                    }
                 }
             });
         },
@@ -1062,19 +1062,19 @@
 
                 //???
                 /*
-				 if("pollAgainIfValueIsIn" in value) {
-				 if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) {
-				 //poll again
-				 var intervalKey = setInterval(function() {
-				 var toClearInterval = value.pollAgainFn(context);
-				 if(toClearInterval == true) {
-				 clearInterval(intervalKey);
-				 $('.detail-view .toolbar .button.refresh').click();	 //click Refresh button to refresh detailView
-				 }
-				 }, 2000);
-				 }
-				 }
-				 */
+                 if("pollAgainIfValueIsIn" in value) {
+                 if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) {
+                 //poll again
+                 var intervalKey = setInterval(function() {
+                 var toClearInterval = value.pollAgainFn(context);
+                 if(toClearInterval == true) {
+                 clearInterval(intervalKey);
+                 $('.detail-view .toolbar .button.refresh').click();     //click Refresh button to refresh detailView
+                 }
+                 }, 2000);
+                 }
+                 }
+                 */
 
                 $name.html(_l(value.label));
                 $value.html(_s(content));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 81b5185..f4d071b 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -20,9 +20,9 @@
 (function($, cloudStack, _l, _s) {
     var uiActions = {
         standard: function($instanceRow, args, additional) {
-        	var isAddAction = args.action.isAdd;
+            var isAddAction = args.action.isAdd;
 
-        	var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
+            var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
             var notification = args.action.notification ? args.action.notification : {};
             var messages = args.action ? args.action.messages : {};
             var preAction = args.action ? args.action.preAction : {};
@@ -275,7 +275,7 @@
                                                         });
                                                     } else {
                                                         $newRow = replaceItem($instanceRow,
-                                                    	    args.data, //$.extend($instanceRow.data('json-obj'), args.data), /* $.extend($instanceRow.data('json-obj'), args.data) causes CLOUDSTACK-4687 */
+                                                            args.data, //$.extend($instanceRow.data('json-obj'), args.data), /* $.extend($instanceRow.data('json-obj'), args.data) causes CLOUDSTACK-4687 */
                                                             actionFilter);
                                                     }
                                                 } else {
@@ -1208,15 +1208,15 @@
                                 rowActions[actionName]($tr);
                                 var map1 = {};
                                 $tr.closest('tbody').find('tr').each(function() {
-                                	/*
-                                	 * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
-                                	 * e.g. An Template/ISO of multiple zones have the same UUID.
-                                	 */
-                                	var objId = $(this).data('json-obj').id;
-                                	if(!(objId in map1)) {
+                                    /*
+                                     * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
+                                     * e.g. An Template/ISO of multiple zones have the same UUID.
+                                     */
+                                    var objId = $(this).data('json-obj').id;
+                                    if(!(objId in map1)) {
                                     sort($(this), action);
-                                		map1[objId] = 1;
-                                	}
+                                        map1[objId] = 1;
+                                    }
                                 });
                                 $tr.closest('.data-table').dataTable('selectRow', $tr.index());
 
@@ -1238,15 +1238,15 @@
                             rowActions._std($tr, function() {});
                             var map1 = {};
                             $tr.closest('tbody').find('tr').each(function() {
-                            	/*
-                            	 * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
-                            	 * e.g. An Template/ISO of multiple zones have the same UUID.
-                            	 */
-                            	var objId = $(this).data('json-obj').id;
-                            	if(!(objId in map1)) {
+                                /*
+                                 * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
+                                 * e.g. An Template/ISO of multiple zones have the same UUID.
+                                 */
+                                var objId = $(this).data('json-obj').id;
+                                if(!(objId in map1)) {
                                 sort($(this), reorder.moveDrag);
-                            	    map1[objId] = 1;
-                            	}
+                                    map1[objId] = 1;
+                                }
                             });
                         }
                     });

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/471a02d6/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 4bd26f7..0cbb741 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -730,7 +730,7 @@
 
                 var itemIp = multiRule._itemIp ? item[multiRule._itemIp] : null;
                 if (itemIp != null) {
-                	 var $itemIp = $('<span>').html(_s(itemIp));
+                     var $itemIp = $('<span>').html(_s(itemIp));
                      $tr.append($('<td>').addClass('state').appendTo($tr).append($itemIp));
                 }
 


Mime
View raw message