[Mapbender-commits] r5538 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Feb 20 05:59:10 EST 2010


Author: christoph
Date: 2010-02-20 05:59:09 -0500 (Sat, 20 Feb 2010)
New Revision: 5538

Modified:
   trunk/mapbender/http/plugins/mb_twitter_update.js
Log:


Modified: trunk/mapbender/http/plugins/mb_twitter_update.js
===================================================================
--- trunk/mapbender/http/plugins/mb_twitter_update.js	2010-02-20 10:51:52 UTC (rev 5537)
+++ trunk/mapbender/http/plugins/mb_twitter_update.js	2010-02-20 10:59:09 UTC (rev 5538)
@@ -40,25 +40,40 @@
 	 			.mousedown(function (e) {
 					mb_disableThisButton(options.id);
 					var map = $(this).mapbender();
+					var height = map.getHeight();
+					var width = map.getWidth();
+					var offset = 10;
+					
 					var pix = map.getMousePosition(e);
 					var p = map.convertPixelToReal(pix);
-					
+/*					
+					if (pix.y > height/2) {
+						// display twitter in bottom half
+						pix.y = height/2;
+					}
+					else {
+						// display in top half
+						pix.y = height/2;
+					}
+
+					* 
+					*/ 
 					var m = new Mapbender.Marker(p, map);
 
-					var $twitterStatus = $("<div class='ui-corner-all ui-widget-content' " + 
-						"style='position:absolute;top:" + 
+					var $twitterStatus = $("<div style='z-index:999;position:absolute;top:" + 
 						(pix.y + parseInt(this.style.top, 10)) + "px;" + 
-						"left:" + (pix.x + parseInt(this.style.left, 10)) + "px;" + 
-						"border:1px solid black;z-index:999;padding:8px;display:none'>" + 
-						"<div>What's happening?<span style='float:right'>140</span></div>" + 
+						"left:" + (offset + parseInt(this.style.left, 10)) + "px;width:"+(width-2*offset)+"px;display:none'>" + 
+						"<div style='width:100%;height:10px;background-position:" + (pix.x-offset-10) + "px 0px;background-image:url(http://s.twimg.com/a/1266605807/images/arr2.gif);background-repeat:no-repeat;'/>" + 
+						"<div style='background-color:#fff;padding:8px;'>" + 
+						"<div>What's happening?<span class='chars-left' style='float:right'>140</span></div>" + 
 						"<textarea rows='2' cols='70'></textarea>" + 
 						"<br><span style='float:right;margin:10px;'>" + 
 						"<span id='twitter_update' style='cursor:pointer;margin:5px;padding:5px;' " + 
 						"class='ui-state-default ui-corner-all'>update</span>" + 
 						"<a id='twitter_cancel' href='#'>cancel</a></span>" + 
-						"</div>").appendTo("body").show("slow");
-					var $charsLeft = $("span", $twitterStatus);
-					var $textarea = $twitterStatus.children("textarea");
+						"</div></div>").appendTo("body").show("slow");
+					var $charsLeft = $("span.chars-left", $twitterStatus);
+					var $textarea = $("textarea", $twitterStatus);
 					$textarea.focus().keypress(function () {
 						var chars = $textarea.val().length;
 						var avail = 140 - chars;
@@ -91,3 +106,13 @@
 		}
 	});
 });
+
+/*
+.content-bubble-arrow {twitter.css (line 2)
+background-image:url(http://s.twimg.com/a/1266605807/images/arr2.gif);
+background-position:25px 0pt;
+background-repeat:no-repeat;
+margin-top:1em;
+padding-top:11px;
+}
+*/
\ No newline at end of file



More information about the Mapbender_commits mailing list