[pve-devel] r6264 - pve-manager/pve2/www/manager

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 8 10:39:59 CEST 2011


Author: dietmar
Date: 2011-07-08 10:39:59 +0200 (Fri, 08 Jul 2011)
New Revision: 6264

Modified:
   pve-manager/pve2/www/manager/StateProvider.js
Log:
make lint happy


Modified: pve-manager/pve2/www/manager/StateProvider.js
===================================================================
--- pve-manager/pve2/www/manager/StateProvider.js	2011-07-08 08:24:38 UTC (rev 6263)
+++ pve-manager/pve2/www/manager/StateProvider.js	2011-07-08 08:39:59 UTC (rev 6264)
@@ -17,15 +17,16 @@
 	var me = this;
 
 	var changes = false;
- 	var oldtext = Ext.encode(me.UIState[name]);
- 	var newtext = Ext.encode(newvalue);
+	var oldtext = Ext.encode(me.UIState[name]);
+	var newtext = Ext.encode(newvalue);
 	if (newtext != oldtext) {
 	    changes = true;
- 	    me.UIState[name] = newvalue;
+	    me.UIState[name] = newvalue;
 	    //console.log("changed old " + name + " " + oldtext);
 	    //console.log("changed new " + name + " " + newtext);
-	    if (fireEvents)
+	    if (fireEvents) {
 		me.fireEvent("statechange", me, name, { value: newvalue });
+	    }
 	}
 	return changes;
     },
@@ -84,22 +85,23 @@
 	var items = token.split(':');
 	var prefix = items.shift();
 
-	if (prefix != me.hprefix)
+	if (prefix != me.hprefix) {
 	    return me.decodeHToken();
-	    
+	}
+
 	Ext.Array.each(me.hslist, function(rec) {
 	    var value = items.shift();
-	    if (value === '') {
-		// do nothing
-	    } else if (value[0] === '=') {
-		value = decodeURIComponent(value.slice(1));
-	    } else {
-		Ext.Object.each(me.compDict, function(key, cv) {
-		    if (value == cv) {
-			value = key;
-			return false;
-		    }
-		});
+	    if (value) {
+		if (value[0] === '=') {
+		    value = decodeURIComponent(value.slice(1));
+		} else {
+		    Ext.Object.each(me.compDict, function(key, cv) {
+			if (value == cv) {
+			    value = key;
+			    return false;
+			}
+		    });
+		}
 	    }
 	    state[rec[0]] = value;
 	});
@@ -115,17 +117,19 @@
 	var ctoken = me.hprefix;
 	Ext.Array.each(me.hslist, function(rec) {
 	    var value = state[rec[0]];
-	    if (!Ext.isDefined(value))
+	    if (!Ext.isDefined(value)) {
 		value = rec[1];
+	    }
 	    value = encodeURIComponent(value);
 	    if (!value) {
 		ctoken += ':';
 	    } else {
 		var comp = me.compDict[value];
-		if (Ext.isDefined(comp))
+		if (Ext.isDefined(comp)) {
 		    ctoken += ":" + comp;
-		else
+		} else {
 		    ctoken += ":=" + value;
+		}
 	    }
 	});
 
@@ -142,7 +146,7 @@
 	var history_change_cb = function(token) {
 	    //console.log("HC " + token);
 	    if (!token) {
-		var res = confirm('Are you sure you want to navigate away from this page?');
+		var res = window.confirm('Are you sure you want to navigate away from this page?');
 		if (res){
 		    // process text value and close...
 		    Ext.History.back();
@@ -154,8 +158,9 @@
 
 	    var newstate = me.decodeHToken(token);
 	    Ext.Array.each(me.hslist, function(rec) {
-		if (typeof newstate[rec[0]] == "undefined")
+		if (typeof newstate[rec[0]] == "undefined") {
 		    return;
+		}
 		me.setHV(rec[0], newstate[rec[0]], true);
 	    });
 	};
@@ -206,7 +211,7 @@
 		Ext.History.add(htext);
 	    }
 	} else {
- 	    me.callParent(arguments);
- 	}
+	    me.callParent(arguments);
+	}
     }
 });
\ No newline at end of file



More information about the pve-devel mailing list