[Mapbender-commits] r2924 - branches/nimix_dev/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 11 10:33:48 EDT 2008


Author: nimix
Date: 2008-09-11 10:33:48 -0400 (Thu, 11 Sep 2008)
New Revision: 2924

Modified:
   branches/nimix_dev/http/javascripts/tooltip_wms.php
Log:


Modified: branches/nimix_dev/http/javascripts/tooltip_wms.php
===================================================================
--- branches/nimix_dev/http/javascripts/tooltip_wms.php	2008-09-10 14:50:28 UTC (rev 2923)
+++ branches/nimix_dev/http/javascripts/tooltip_wms.php	2008-09-11 14:33:48 UTC (rev 2924)
@@ -36,17 +36,26 @@
 //tolerance when we ask wfs
 var mb_wfs_tolerance = 8;
 
+//initialize Element Vars
+
 //destination frame for the request (creates Popup if empty)
-var destFrameName = "";
-var tooltipTime = 1000;
-
-var no_result_text = ["Kein Ergebnis.",'<body onLoad="javascript:window.close()">'];
+if(typeof(tooltip_destinationFrame)==='undefined')
+	var tooltip_destinationFrame = "";
+if(typeof(tooltip_timeDelay)==='undefined')
+	var tooltip_timeDelay = 1000;
+if(typeof(tooltip_styles)==='undefined')
+	var tooltip_styles = "";
+try{
+	var no_result_text = eval(tooltip_noResultArray);
+}catch(e){
+	var no_result_text = ["Kein Ergebnis.",'<body onLoad="javascript:window.close()">'];
+}
 var mouseMoves=0;
 var tooltipWin=null;
 var point;
 var tooltipWfsRequestCount = 0;
 var numberOfFinishedWfsRequests = 0;
-var TooltipMsg = {'title':"Informationen"};
+var TooltipMsg = {'title':"<?php echo _mb("Informations");?>"};
 
 //buttonWfs_toDigitize_on ="0";
 
@@ -55,13 +64,20 @@
 		mod_tooltip_run();
 		mb_getMousePos(event,tooltipTarget);
 	}).mouseout(function(){mouseMoves=0;});
+
+	var styleObj = new StyleTag();
+	styleObj.addClass("dlist_even", tooltip_wfsStyleEven);
+	styleObj.addClass("glist_even", tooltip_wfsStyleEven);
+	styleObj.addClass("dlist_uneven", tooltip_wfsStyleUneven);
+	styleObj.addClass("glist_uneven", tooltip_wfsStyleUneven);
+	alert(tooltip_wfsStyleUneven);
 }
 
 eventInit.register(mod_tooltipInit);
 
 function mod_tooltip_run(){
 	mouseMoves++;
-	setTimeout("if(mouseMoves=="+mouseMoves+")fireRequests();",tooltipTime);
+	setTimeout("if(mouseMoves=="+mouseMoves+")fireRequests();",tooltip_timeDelay);
 }
 
 function fireRequests(){
@@ -96,9 +112,13 @@
 
 function checkFeatureInfoResults(js_code,status){
 	//check if there are results
+	if(js_code == "")
+		return;
+	
 	for(var k=0;k < no_result_text.length;k++){
-		if(js_code.indexOf(no_result_text[k])!==-1)
+		if(js_code.indexOf(no_result_text[k])!==-1){
 			return;
+		}
 	}
 
 	//output code
@@ -123,11 +143,11 @@
 
 function displayResultDoc(html){
 	//test if we have a fixed destination and create popup otherwise
-	if(destFrameName=="")
+	if(tooltip_destinationFrame=="")
 		return showBalloonFrame(html);
           	
 	//put the frame there
-	$("#"+destFrameName).each(function(){
+	$("#"+tooltip_destinationFrame).each(function(){
 	    var oDoc = this.contentWindow || this.contentDocument;
 	    if (oDoc.document) {
 	        oDoc = oDoc.document;
@@ -219,11 +239,13 @@
 function createWfsResultHtml(_geomArray){
 	var geometryIndex = 0;
 	wfsConf = get_complete_wfs_conf();
-	var html = "<table style='background-color:#EEEEEE;'>\n";
+	var html = '<html><head><style type="text/css">';
+	html += tooltip_styles;
+	html += "</style></head><body><table>\n";
 	if(_geomArray.count()>1){
 		for (var i = 0 ; i < _geomArray.count(); i ++) {
 			if (_geomArray.get(i).get(-1).isComplete()) {
-				html += "\t<tr>\n\t\t<td style = 'color:blue;font-size:12px;cursor:pointer;'\n";
+				html += "\t<tr class='glist_"+(i%2?"uneven":"even")+"'>\n\t\t<td \n";
 //				html += "\t\t\t onmouseover='mb_wfs_perform(\"over\",_geomArray.get("+i+"));' ";
 //				html += " onmouseout='mb_wfs_perform(\"out\",_geomArray.get("+i+"))' ";
 //				html += " onclick='mb_wfs_perform(\"click\",_geomArray.get("+i+"));' ";
@@ -239,7 +261,7 @@
 		for (var i = 0 ; i <currentWfsConf.element.length; i ++) {
 		    if(currentWfsConf.element[i].f_show_detail==1){
 		    	if( _geomArray.get(geometryIndex).e.getElementValueByName(currentWfsConf.element[i].element_name)!=false){
-					html +="<tr><td>\n"; 
+					html +="<tr class='dlist_"+(i%2?"uneven":"even")+"'><td>\n"; 
 					html += currentWfsConf.element[i].f_label;
 					html +="</td>\n"; 
 					html += "<td>\n";
@@ -252,10 +274,7 @@
 						else{
 							var newLink = setUrl;
 						}
-/*						if(openLinkFromSearch=='1'){
-							window.open(elementVal, elementVal,"width=500, height=400,left=100,top=100,scrollbars=yes");
-						}		
-*/						html +=  newLink;
+						html +=  newLink;
 					}
 					else{
 						html += elementVal;
@@ -265,7 +284,7 @@
 			}
 		}
 	}
-	html += "</table>\n";
+	html += "</table></body>\n";
 	return html;
 }
 



More information about the Mapbender_commits mailing list