svn commit: r388 - trunk/mapbender/http/javascripts/mod_help.php

uli at osgeo.org uli at osgeo.org
Wed Jun 7 09:26:24 EDT 2006


Author: uli
Date: 2006-06-07 13:26:23+0000
New Revision: 388

Modified:
   trunk/mapbender/http/javascripts/mod_help.php

Log:
highlighting of elements with available help url included

Modified: trunk/mapbender/http/javascripts/mod_help.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_help.php?view=diff&rev=388&p1=trunk/mapbender/http/javascripts/mod_help.php&p2=trunk/mapbender/http/javascripts/mod_help.php&r1=387&r2=388
==============================================================================
--- trunk/mapbender/http/javascripts/mod_help.php	(original)
+++ trunk/mapbender/http/javascripts/mod_help.php	2006-06-07 13:26:23+0000
@@ -31,8 +31,12 @@
    $e_src = $row["e_src"];
    $cnt++;
 }
+$e_id_css = 'help';
+include("../include/dyn_js.php");
 if($cnt > 1){ echo "alert('help: ID not unique!');";}
 ?>
+try{if(mod_help_color){}}catch(e){mod_help_color = '#cc33cc';}
+try{if(mod_help_thickness){}}catch(e){mod_help_color = 3;}
 var mod_help_elName = "help";
 var mod_halp_str = "";
 var mod_help_img_on = new Image(); mod_help_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
@@ -52,6 +56,7 @@
 function mod_help_click(){
 	if(document.getElementById('mod_help_load')){
 		document.getElementById('mod_help_img').innerHTML = mod_help_str;
+		mod_help_draw();
 	}
 	else{
 		var t = mod_help_set();
@@ -61,6 +66,7 @@
 	document.getElementById('mod_help_img').innerHTML = '';
 	document.getElementById('mod_help_img').style.width = '0px';
 	document.getElementById('mod_help_img').style.height = '0px';
+	document.getElementById('mod_help_draw').innerHTML = '';
 	mb_disableThisButton(mod_help_elName);
 }
 function mod_help_set(){
@@ -79,20 +85,35 @@
 	tmp.style.zIndex = '1000';
 	tmp.style.top = '0px';
 	tmp.style.left = '0px';
-	tmp.style.width = '1000px';
-	tmp.style.height='1000px';
+	tmp.style.width = '1px';
+	tmp.style.height='1px';
+	
+	var helpdraw = document.createElement('div');
+	var tmp = document.body.appendChild(helpdraw);
+	tmp.id = 'mod_help_draw';
+	tmp.style.position = 'absolute';
+	tmp.style.zIndex = '999';
+	tmp.style.top = '0px';
+	tmp.style.left = '0px';
+	tmp.style.width = '0px';
+	tmp.style.height='0px';
+	
 	return true;
 }
 function mod_help_set_str(str){
 	mod_help_str = str;
 	document.getElementById('mod_help_img').innerHTML = mod_help_str;
+	mod_help_draw();
 }
-function mod_help_highlight(obj,v){
-	if(v){
-			
-	}
-	else{
-		
-	}
+function mod_help_draw(){
+	var canvas = new jsGraphics('mod_help_draw');
+	canvas.setStroke(parseInt(mod_help_thickness));
+	canvas.setColor(mod_help_color);
+	var my = document.getElementsByName("mod_help_imagemap")[0];
+	for(var i=0; i<my.areas.length; i++){
+		var myc = my.areas[i].coords.split(",");
+		canvas.drawRect(parseInt(myc[0]),parseInt(myc[1]),parseInt(myc[2]) - parseInt(myc[0]),parseInt(myc[3]) - parseInt(myc[1]));
+		canvas.paint();		
+	}	
 }
 




More information about the Mapbender_commits mailing list