[Mapbender-commits] r3214 - in branches/beck_dev_25/http: css extensions javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Nov 11 05:50:09 EST 2008


Author: beck
Date: 2008-11-11 05:50:08 -0500 (Tue, 11 Nov 2008)
New Revision: 3214

Modified:
   branches/beck_dev_25/http/css/popup.css
   branches/beck_dev_25/http/extensions/ext_featureInfoTunnel.php
   branches/beck_dev_25/http/javascripts/popup.js
Log:


Modified: branches/beck_dev_25/http/css/popup.css
===================================================================
--- branches/beck_dev_25/http/css/popup.css	2008-11-11 10:46:18 UTC (rev 3213)
+++ branches/beck_dev_25/http/css/popup.css	2008-11-11 10:50:08 UTC (rev 3214)
@@ -1,7 +1,7 @@
 @CHARSET "UTF-8";
 /*fixes*/
-div.jqmNotice iframe {width:100%;height:100%;}
-div.jqmNotice div.scrollDiv {position:relative;top:0px;left:0px;right:0px;bottom:0px;width:100%;height:100%;}
+div.mbPopup iframe {width:100%;height:100%;border:none;}
+div.mbPopup div.scrollDiv {position:relative;top:0px;left:0px;right:0px;bottom:0px;width:100%;height:100%;}
 
 div.scrollDiv {
  overflow: auto;
@@ -9,55 +9,99 @@
 
 /* exploder V6 only */
 * html div.scrollDiv {
- overflow-y: scroll;
+ overflow-y: auto;
 }
 
 /* exploder V7 only */
 *+html div.scrollDiv {
- overflow-y: scroll;
+ overflow-y: auto;
 }
 
-div.jqmNotice {
+div.mbPopup {
     display: none;
     overflow:hidden;
     position: absolute;
     
-/*styles that can change*/
-    background:#EEEEEE url(../img/info_on.gif) 5px 5px no-repeat;
+	/*styles that can change*/
+    background:#EEEEEE url(../img/info_on.gif) 8px 8px no-repeat;
     border: 1px solid #000;
-    padding: 0;
-    padding-bottom:30px;
+    -moz-border-radius:10px;
+    -webkit-border-radius: 10px;
+    
+    /*border to client area (top right bottom left)*/
+    padding: 30px 10px 10px 10px;
 }
 
-div.jqmNotice .jqResize {
+div.mbPopup .Resize {
 	position: absolute; 
-	right: 2px; 
-	bottom: 2px;
+	right: 5px; 
+	bottom: 5px;
 	width:16px;
 	height:16px;
 	background:url(../img/resize.gif);
 }
 
-.jqmnTitle{margin: 0 25px;}
+div.mbPopup .Title{
+	position:absolute;
+	left:35px;
+	right:25px;
+	top:9px;
+	margin:0pt;
+	padding:0pt;
+}
   
-.jqmnTitle h1{
-  margin: 5px 0;
-  padding-left:5px;
-  width: 100%;
-  font-size:12px;
-  color:#EEEEEE;
-  background-color:#505050;
+div.mbPopup .Title h1{
+	background-color:#505050;
+	color:#EEEEEE;
+	font-size:12px;
+	margin:0pt;
+	width:100%;
+	text-align:center;
 }
 
-div.jqmNotice .jqmClose {
+div.mbPopup .Close {
   position: absolute;
   cursor: pointer;
-  right: 4px;
-  top: 6px;
+  right: 8px;
+  top: 10px;
 }
 
-.jqmnContent{
-  border-top:1px;
-  color:#000;
-  padding:0 20px 5px;
-}
\ No newline at end of file
+div.mbPopup .Content{
+}
+
+.balloonTL{
+	position:absolute;
+	background-image:url("../img/balloon_ul.png");
+	width:100px;
+	height:80px;
+}
+*html .balloonTL{
+	background-image:url("../img/balloon_ul.gif");
+}
+.balloonTR{
+	position:absolute;
+	background-image:url("../img/balloon_ur.png");
+	width:100px;
+	height:80px;
+}
+*html .balloonTR{
+	background-image:url("../img/balloon_ur.gif");
+}
+.balloonBR{
+	position:absolute;
+	background-image:url("../img/balloon_lr.png");
+	width:100px;
+	height:80px;
+}
+*html .balloonBR{
+	background-image:url("../img/balloon_lr.gif");
+}
+.balloonBL{
+	position:absolute;
+	background-image:url("../img/balloon_ll.png");
+	width:100px;
+	height:80px;
+}
+*html .balloonBL{
+	background-image:url("../img/balloon_ll.gif");
+}

Modified: branches/beck_dev_25/http/extensions/ext_featureInfoTunnel.php
===================================================================
--- branches/beck_dev_25/http/extensions/ext_featureInfoTunnel.php	2008-11-11 10:46:18 UTC (rev 3213)
+++ branches/beck_dev_25/http/extensions/ext_featureInfoTunnel.php	2008-11-11 10:50:08 UTC (rev 3214)
@@ -33,7 +33,22 @@
 		echo "";
 	} 
 	else {
-		echo $x->file;
+		echo toUTF8($x->file);
 	}	
 }
+
+function toUTF8($str){
+	//check if we have an encoding meta tag
+	if(preg_match('/<meta.*charset=([^"\'\s]*).*[\'"]*>/',$str, $charset)){
+		//if so convert encoding to UTF-8
+		$ret = mb_convert_encoding($str, "UTF-8", $charset[1]);
+		
+		//return with changed meta encoding tag
+		$meta = str_replace($charset[1], "UTF-8", $charset[0]);
+		return str_replace($charset[0], $meta, $ret);
+	}
+	
+	//we don't have an defnied encoding so send unchanged
+	return $str;
+}
 ?>
\ No newline at end of file

Modified: branches/beck_dev_25/http/javascripts/popup.js
===================================================================
--- branches/beck_dev_25/http/javascripts/popup.js	2008-11-11 10:46:18 UTC (rev 3213)
+++ branches/beck_dev_25/http/javascripts/popup.js	2008-11-11 10:50:08 UTC (rev 3214)
@@ -18,22 +18,25 @@
  *  width: popup width
  *  height: popup height
  *  title: popup title
- *  frameName: name of the popups iframe if it loads a frame
- *  opacity: opacity of the frame
- *  moveOpacity: opacity while the user moves or resizes the frame
+ *  frameName: name of the popups iframe if it loads a frame  (recommended to set destroy to false)
+ *  opacity: opacity of the frame default:1
+ *  moveOpacity: opacity while the user moves or resizes the frame default:0.8
  *  html:content html of the frame (not parsed if url not false)
  *  url:content url of the frame
  *  minWidth: minimum width of the popup if the user resizes it
  *  maxWidth: maximum width of the popup if the user resizes it
  *  minHeight: minimum height of the popup if the user resizes it
  *  maxHeight: maximum height of the popup if the user resizes it
- *  minTop: minimum top position if the user moves the popup
- *  minLeft: minimum left position if the user moves the popup 
- *  maxRight: maximum right position if the user moves/resizes the popup
+ *  minTop: minimum top position if the user moves the popup default:"document"
+ *  minLeft: minimum left position if the user moves the popup default:"document"
+ *  maxRight: maximum right position if the user moves/resizes the popup 
  *  maxBottom: maximum bottom position if the user moves/resized the popup
- * 	style: additional styles for the popup
- *  destroy: remove dom of popup if user closes it (don't use it for iframes with framename)
+ * 	style: additional styles for the popup window
+ *  destroy: remove dom of popup if user closes it (don't use it for iframes with framename) default:true
  *  closeCallback: function that is called if the user closes the window
+ *  resizeable: allow user to change the size default:true
+ *  dragable: allow user to move the window default:true
+ *  balloon: balloon popup from top, left (disables resizeable and dragable)
  * 
  * @param {String} html the "body" of the popup, can also be "url:http://foo.de" to display a website
  * @param {Number} width width of the popup
@@ -46,23 +49,23 @@
 	//get first free place
 	var create_pos=popup_count;
 	for(var i = 0; i < popup_count;i++)
-//		if(!document.getElementById("popup"+String(i))){
-//			create_pos=i;
-//			break;
-//		}
+		if(!document.getElementById("popup"+String(i))){
+			create_pos=i;
+			break;
+		}
 
-	this.id="popup"+String(create_pos);
-//	this.id="popup"+String(popup_top);
-	
+	this.id="popup"+String(++popup_top);
+		
 	//Set defaults
 	defaults = {
 		left:25*create_pos,
 		top:25*create_pos,
 		width:300,height:250,
 		title:"Title",
-		frameName:this.id
-	}
-		
+		frameName:this.id,
+		id:this.id
+	};
+
 	if(typeof(title)!='object'){
 		this.options = defaults;
 		
@@ -84,6 +87,8 @@
 	else
 		this.options=$.extend(defaults, title);
 
+	this.id = this.options.id;
+	
 	popup_count++;
 	
 	//create dom popup
@@ -109,6 +114,7 @@
  */
 mb_popup.prototype.hide = function(){	
 	$("#"+this.id).hide();
+	$("#balloon_"+this.id).hide();
 }
 
 /**
@@ -116,6 +122,7 @@
  */
 mb_popup.prototype.destroy = function(){	
 	$("#"+this.id).remove();
+	$("#balloon_"+this.id).remove();
 }
 
 /**
@@ -185,10 +192,43 @@
 mb_popup.prototype.setHtml = function(htmll){
 	this.options.url=null;
 	this.options.html=htmll;
-	$("#"+this.id+" .jqmnContent").html(htmll);
+	$("#"+this.id+" .Content").html('<div class="scrollDiv">'+htmll+'</div>');
 }
+/**
+ * behaves like document.open(); (clear popup)
+ */
+mb_popup.prototype.open = function(){
+	oDoc = this.getDocument();
+	if(oDoc!=null){
+		return oDoc.open();
+	}
+	this.setHtml("");
+}
 
 /**
+ * behaves like document.write(); (appends content to the popup)
+ * 
+ * @param {String} text or html to write into the document
+ */
+mb_popup.prototype.write = function(str){
+	oDoc = this.getDocument();
+	if(oDoc!=null){
+		return oDoc.write(str);
+	}
+	this.setHtml(this.options.html+str);
+}
+
+/**
+ * behaves like document.close(); (finish loading state if popup is an iframe)
+ */
+mb_popup.prototype.close = function(){
+	oDoc = this.getDocument();
+	if(oDoc!=null){
+		return oDoc.close();
+	}
+}
+
+/**
  * sets the url of the content
  *
  * @param {String} url new url of the popup  
@@ -196,14 +236,24 @@
 mb_popup.prototype.setUrl = function(url){
 	this.options.url=url;
 	this.options.html=null;
-	try{
-		eval("window.frames."+this.options.frameName+".location = \""+url+"\"");
-	}catch(e){
-		$("#"+this.id+" .jqmnContent").html('<iframe src="'+url+'"></iframe>');
+	
+	oDoc = this.getDocument();
+	if(oDoc){
+		oDoc.location.href = url;
 	}
+	else{
+		$("#"+this.id+" .Content").html('<iframe src="'+url+'"></iframe>');
+	}
 }
 
 /**
+ * reposition
+ */
+mb_popup.prototype.reposition =function(){
+//TODO	
+}
+
+/**
  * gets the visible state of the popup window
  * @return visible state of the popup
  * @type Boolean
@@ -213,6 +263,34 @@
 }
 
 /**
+ * (re) set Some Options of the popup Window and rerender it
+ * @param options object that contains the new options
+ */
+mb_popup.prototype.set = function(options){
+	this.destroy();
+	this.options=$.extend(this.options, options);
+	this.show();
+}
+
+/**
+ * get the DOM document of the client iframe
+ * @return DOM document or null if the popup doesn't contain an iframe
+ */
+mb_popup.prototype.getDocument = function(){
+	iFrame = $("#"+this.id+" iframe")[0];
+	try{
+		//try to load contentWindow first since not every browser 
+		//supports contentDocument (or gives the window instead)
+		oDoc = iFrame.contentWindow || iFrame.contentDocument;
+		if (oDoc.document) {
+	        oDoc = oDoc.document;
+    	}
+    	return oDoc;
+	}
+	catch(e){return null;}
+}
+
+/**
  * get Scroll position
  */
 function getScrollPos() {  
@@ -230,118 +308,158 @@
 		//IE6 standards compliant mode  
 		scrOf.Y = document.documentElement.scrollTop;  
 		scrOf.X = document.documentElement.scrollLeft;  
-	}  
+	}
 	return scrOf;  
 }
 
+
+
 (function($){
 	$.fn.mbPopup = function(options){
 		//default settings
 		defaults = {
-			left:0,top:0,
-			width:300,height:250,
+			left:0,top:0,width:300,height:250,
 			title:"",frameName:"",
 			opacity:1.0,moveOpacity:0.8,html:false,url:false,
 			minWidth:false,maxWidth:false,
 			minHeight:false,maxHeight:false,
 			minTop:"document",minLeft:"document",
 			maxRight:false,maxBottom:false,
+			dragable:true,resizeable:true,balloon:false,
 			style:null,destroy:true,
 			closeCallback:null
 		};
 		//override defaults
 		settings=$.extend(defaults,options)
+		this.settings = settings;
 		
 		//add Styles
-		this.addClass("jqmNotice");
+		this.addClass("mbPopup");
 		
-		this.css({top:settings.top,
-			left:settings.left,
-			width:settings.width,
-			height:settings.height,
+		//append additions styles
+		if(settings.style)
+			this.css(settings.style);
+		
+		//automated settings for balloon popup
+		if(settings.balloon){
+			$("body").append("<div id='balloon_"+settings.id+"' class='balloonBL' style='visibility:hidden;'>");
+			settings.resizeable = false;
+			settings.dragable = false;
+		}
+
+		//calculate positioning (mainly needed for balloon style)
+		pos = $.mbPopupFn.calcPositioning(settings, this);
+
+		//set balloon arm position
+		if(settings.balloon){
+			$("#balloon_"+settings.id).attr("class", "balloon"+(pos.position>=2?"B":"T")+(pos.position%2?"R":"L"))
+				.css({"z-index":(popup_top++),visibility:"visible",left:pos.bX,top:pos.bY});
+			settings.left = pos.pX;
+			settings.top = pos.pY;
+		}
+		
+		//fix IE width and height by adding the padding values
+		if($.browser.msie){
+			settings.width = pos.pW;
+			settings.height = pos.pH;
+		}
+		
+		//Set dimensions
+		this.css({top:settings.top+"px",
+			left:settings.left+"px",
+			width:settings.width+"px",
+			height:settings.height+"px",
 			opacity:settings.opacity
 			});
 		
-		if(settings.style)
-			this.css(settings.style);
-		
 		//Insert content
 		if(settings.url)
 			html = ('<iframe name="'+settings.frameName+'" src="'+settings.url+'"></iframe>');
 		else
 			html = ('<div class="scrollDiv">'+settings.html+'</div>');
 	
-		this.html('<div class="jqmnTitle jqDrag"><h1>'+settings.title+'</h1></div><div class="jqmnContent">'+html+'</div><img src="../img/close_icon.png" class="jqmClose" alt="close" /><div class="jqResize" />');
+		this.html('<div class="Title Drag"><h1>'+settings.title+'</h1></div><div class="Content">'+html+'</div><img src="../img/close_icon.png" class="Close" alt="close" />'+(settings.resizeable?'<div class="Resize" />':''));
 	
 		var data = {El:this,fY:settings.minTop,fX:settings.minLeft,tX:settings.maxRight,tY:settings.maxBottom,
 			fW:settings.minWidth,tW:settings.maxWidth,fH:settings.minHeight,tH:settings.maxHeight,
 			destroy:settings.destroy,opacity:settings.opacity,moveOpacity:settings.moveOpacity,close:settings.closeCallback}
 
 		//Make window Dragable
-		$(".jqDrag", this).bind('mousedown',data,function(event){
-			//set to top
-			event.data.El.css("z-index",popup_top++);
-			event.data.El.css('opacity',event.data.moveOpacity)
-			//create helper div to steal mouse events
-			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
-			$("iframe", event.data.El).hide();
-						
-			//Parse setiings of min and max position
-			var data = $.mbPopupFn.parseDimensions(event);
-			
-			//bind mouse events to popup
-			$().bind("mousemove",data,$.mbPopupFn.drag).bind('mouseup',event.data,$.mbPopupFn.stopdrag);
-		});
+		if(settings.dragable)
+			$(".Drag", this).bind('mousedown',data,function(event){
+				//set to top
+				event.data.El.css("z-index",popup_top++);
+				event.data.El.css('opacity',event.data.moveOpacity)
+				//create helper div to steal mouse events
+				$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
+				$("iframe", event.data.El).hide();
+							
+				//Parse setiings of min and max position
+				var data = $.mbPopupFn.parseDimensions(event);
+				
+				//bind mouse events to popup
+				$().bind("mousemove",$.extend(data,{drag:true}),$.mbPopupFn.move).bind('mouseup',event.data,$.mbPopupFn.stop);
+			});
 		
 		//Make Window resizable
-		$(".jqResize", this).bind('mousedown',data,function(event){
-			//set to top
-			event.data.El.css("z-index",popup_top++);
-			event.data.El.css('opacity',0.8)
-			//create helper div to steal mouse events
-			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
-			$("iframe", event.data.El).hide();
-
-			//Parse setiings of min and max position
-			var data = $.mbPopupFn.parseDimensions(event);
-			
-			//bind mouse events to popup
-			$().bind("mousemove",data,$.mbPopupFn.resize).bind('mouseup',event.data,$.mbPopupFn.stopresize);
-		});
+		if(settings.resizeable)
+			$(".Resize", this).bind('mousedown',data,function(event){
+				//set to top
+				event.data.El.css("z-index",popup_top++);
+				event.data.El.css('opacity',event.data.moveOpacity)
+				//create helper div to steal mouse events
+				$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
+				$("iframe", event.data.El).hide();
+	
+				//Parse setiings of min and max position
+				var data = $.mbPopupFn.parseDimensions(event);
+				
+				//bind mouse events to popup
+				$().bind("mousemove",$.extend(data,{drag:false}),$.mbPopupFn.move).bind('mouseup',event.data,$.mbPopupFn.stop);
+			});
 		
 		//closeButton
-		$(".jqmClose", this).bind('click',data, function(event){
+		$(".Close", this).bind('click',data, function(event){
 			if(event.data.close)
 				event.data.close();
-			if(event.data.destroy)
+			if(event.data.destroy){
 				event.data.El.slideUp('slow', function(){$(this).remove();});
-			else
+				$("#balloon_"+event.data.El.attr("id")).remove();
+			}
+			else{
 				event.data.El.slideUp('slow');
+				$("#balloon_"+event.data.El.attr("id")).fadeOut();
+			}
 		});
 		
 		//raise on click
-		this.click(function(){this.style.zIndex=popup_top++});
+		this.click(function(){this.style.zIndex=popup_top++;$("#balloon_"+this.id).css("z-index", popup_top++);});
+		$("#balloon_"+settings.id).click(function(){$("#"+this.id.substr(8)).css("z-index", popup_top++);this.style.zIndex=popup_top++;});
+		
+		//raise top postition
+		popup_top++;
 	};
 	//helper functions
 	$.mbPopupFn = {
-		//on drag
-		drag:function(event){
-			//console.log("tesddt");			
-			var newPos = {X:event.data.X+event.pageX-event.data.pX,
-				Y:event.data.Y+event.pageY-event.data.pY};
-			if(event.data.fX!==false&&newPos.X<event.data.fX)
-				newPos.X=event.data.fX;
-			if(event.data.fY!==false&&newPos.Y<event.data.fY)
-				newPos.Y=event.data.fY;
-			if(event.data.tX!==false&&newPos.X>event.data.tX-event.data.W)
-				newPos.X=event.data.tX-event.data.W;
-			if(event.data.tY!==false&&newPos.Y>event.data.tY-event.data.H)
-				newPos.Y=event.data.tY-event.data.H;
-			
-			event.data.El.css({left:newPos.X,top:newPos.Y});
-		},
-		//on resize
-		resize:function(event){
+		//on mouse action
+		move:function(event){
+			//drag
+			if(event.data.drag){
+				var newPos = {X:event.data.X+event.pageX-event.data.pX,
+					Y:event.data.Y+event.pageY-event.data.pY};
+				if(event.data.fX!==false&&newPos.X<event.data.fX)
+					newPos.X=event.data.fX;
+				if(event.data.fY!==false&&newPos.Y<event.data.fY)
+					newPos.Y=event.data.fY;
+				if(event.data.tX!==false&&newPos.X>event.data.tX-event.data.W)
+					newPos.X=event.data.tX-event.data.W;
+				if(event.data.tY!==false&&newPos.Y>event.data.tY-event.data.H)
+					newPos.Y=event.data.tY-event.data.H;
+				
+				event.data.El.css({left:newPos.X,top:newPos.Y});
+				return;
+			}
+			//resize
 			var newDim = {W:Math.max(event.pageX-event.data.pX+event.data.W,0),
 				H:Math.max(event.pageY-event.data.pY+event.data.H,0)};
 			if(event.data.fW!==false&&newDim.W<event.data.fW)
@@ -358,23 +476,20 @@
 				newDim.H=event.data.tY-event.data.Y;	
 						
 			event.data.El.css({width:newDim.W,height:newDim.H});
+			
 		},
-		stopdrag:function(event){
+		stop:function(event){
 			event.data.El.css('opacity',event.data.opacity)
 			$("iframe", event.data.El).show();
-			$().unbind('mousemove',$.mbPopupFn.drag).unbind('mouseup',$.mbPopupFn.stopdrag);
+			$().unbind('mousemove',$.mbPopupFn.move).unbind('mouseup',$.mbPopupFn.stop);
 			$("#mouse_catcher").remove();
 		},
-		stopresize:function(event){
-			event.data.El.css('opacity',event.data.opacity)
-			$("iframe", event.data.El).show();
-			$().unbind('mousemove',$.mbPopupFn.resize).unbind('mouseup',$.mbPopupFn.stopresize);
-			$("#mouse_catcher").remove();
-		},
 		//parse move and resize dimensions
 		parseDimensions:function(d){
 			var dim = getScrollPos();
-			return {El:d.data.El,
+			var bd = {X:parseInt($(d.data.El).css("border-left-width"))+parseInt($(d.data.El).css("border-right-width")),
+				Y:parseInt($(d.data.El).css("border-top-width"))+parseInt($(d.data.El).css("border-bottom-width"))};
+			ret = {El:d.data.El,
 				fX:(d.data.fX=="window"?dim.X:(d.data.fX=="document"?0:(d.data.fX<0?dim.dW-d.data.fX:d.data.fX))),
 				fY:(d.data.fX=="window"?dim.Y:(d.data.fY=="document"?0:(d.data.fY<0?dim.dH-d.data.fY:d.data.fY))),
 				tX:(d.data.tX=="window"?dim.X+dim.wW:(d.data.tX=="document"?dim.dW:(d.data.tX<0?dim.dW-d.data.tX:d.data.tX))),
@@ -389,6 +504,45 @@
 				H:parseInt(d.data.El.css("height")),
 				pX:d.pageX,pY:d.pageY
 			};
+			if(ret.tX)ret.tX-=bd.X;
+			if(ret.tY)ret.tY-=bd.Y;
+			return ret;	
+		},
+		calcPositioning:function(settings, el){
+			var dim = getScrollPos();
+			
+			pos = {};
+			pos.pH = settings.height + (parseInt(el.css("padding-top"))+parseInt(el.css("padding-bottom")));
+			pos.pW = settings.width + (parseInt(el.css("padding-left"))+parseInt(el.css("padding-right")));
+			if(settings.balloon){
+				pos.bH = $("#balloon_"+settings.id).height();
+				pos.bW = $("#balloon_"+settings.id).width();
+	
+				pos.position = 0;
+				
+				if(settings.top-pos.pH-pos.bH-parseInt(el.css("border-top-width"))<dim.Y){
+					//bubble on top
+					pos.pY = settings.top+pos.bH-parseInt(el.css("border-top-width"));
+				}
+				else{
+					//bubble on bottom
+					pos.pY = settings.top-pos.pH-pos.bH+($.browser.msie?parseInt(el.css("border-bottom-width")):-parseInt(el.css("border-top-width")));
+					pos.position+=2;
+				}
+				if(settings.left+pos.pW+parseInt(el.css("border-left-width"))+parseInt(el.css("border-right-width"))>(dim.X+dim.wW)){
+					//bubble on right
+					pos.pX = settings.left-parseInt(el.css("border-left-width"))-parseInt(el.css("border-right-width"))-pos.pW;
+					pos.position++;
+				}
+				else{
+					//bubble on left
+					pos.pX = settings.left-parseInt(el.css("border-left-width"));
+				}
+				
+				pos.bX=(settings.left-(pos.position%2?pos.bW:0));
+				pos.bY=(settings.top-(pos.position>=2?pos.bH:0));
+			}
+			return pos;
 		}
 	};
 	})



More information about the Mapbender_commits mailing list