[Mapbender-commits] r1176 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 2 13:06:26 EST 2007


Author: christoph
Date: 2007-03-02 13:06:26 -0500 (Fri, 02 Mar 2007)
New Revision: 1176

Modified:
   trunk/mapbender/http/javascripts/map.php
Log:
some refactoring

Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php	2007-03-02 18:04:46 UTC (rev 1175)
+++ trunk/mapbender/http/javascripts/map.php	2007-03-02 18:06:26 UTC (rev 1176)
@@ -78,7 +78,7 @@
 		mb_ajaxWrap_post('../php/mb_js_exception.php', {text:message});
 	}
 	catch(e) {
-		alert(e);
+		alert(message);
 	}
 }
 
@@ -1270,7 +1270,7 @@
 
 function DivTag (aTagName, aFrameName, aStyle) {
 	this.exists = function () { 
-		return (rootNode.getElementById(tagName))?true:false;
+		return (rootNode.getElementById(tagName)) ? true : false;
 	};
 	
 	var determineRootNode = function () {
@@ -1282,7 +1282,7 @@
 		return node;	
 	};
 	
-	var reformatJavaStyle = function(aString) {
+	var toCamelCase = function(aString) {
 		var newString = "";
 		for (var i = 0; i < aString.length; i++) {
 			if (aString.substr(i,1) != "-") {
@@ -1303,7 +1303,7 @@
 			
 			for (var attr in tagStyle) {
 				if (typeof(tagStyle[attr] != "function") && typeof(tagStyle[attr] != "object")) {
-					var evalString = "node.style."+reformatJavaStyle(attr)+" = \"" + tagStyle[attr] + "\";"; 
+					var evalString = "node.style."+toCamelCase(attr)+" = \"" + tagStyle[attr] + "\";"; 
 					eval(evalString);				
 				}
 			}



More information about the Mapbender_commits mailing list