SVN: toys/stbr/index.php

sparky sparky at pld-linux.org
Thu May 17 01:51:11 CEST 2007


Author: sparky
Date: Thu May 17 01:51:10 2007
New Revision: 8578

Modified:
   toys/stbr/index.php
Log:
- let's try different popup


Modified: toys/stbr/index.php
==============================================================================
--- toys/stbr/index.php	(original)
+++ toys/stbr/index.php	Thu May 17 01:51:10 2007
@@ -48,8 +48,137 @@
 div#logoPLD {
 	text-align: right;
 }
+#Popup {
+	display: none;
+	position: absolute;
+	padding: 2px;
+	border: 2px solid #c0c0c0;
+	background-color: #ebebe4;
+	color: #000;
+	z-index: 1000;
+	right: auto;
+	bottom: auto;
+	width: auto;
+	max-width: 490px;
+	height: auto;
+	left: 10px;
+	top: 10px;
+}
+.ok { color: green; }
+.fail { color: red; }
+
 </style>
 
+<script type="text/javascript">
+/*<![CDATA[*/
+/* popup by sparky, GPLv2 ! */
+
+function tohtml( txt ) {
+    return txt .replace(/\[/g, '<') .replace(/\]/g, '>')
+        .replace(/<</g, '[') .replace(/>>/g, ']')
+	.replace(/`/g, "'")
+	.replace(/OK/g, '<b class="ok">OK</b>')
+	.replace(/\?/g, '<b class="dunno">?</b>')
+	.replace(/FAIL/g, '<b class="fail">FAIL</b>');
+}
+
+popup = null;
+popupS = null;
+function O(e, t, txt) {
+    popupS.left = "10px";
+    popupS.display = "block";
+    popup.innerHTML = tohtml( txt );
+    if (popup.offsetWidth > 500) popupS.width = "500px";
+	t.onmouseout = hideOver;
+    if (window.onmousemove)
+	window.onmousemove = moveOver;
+    else
+	document.onmousemove = moveOver;
+
+    moveOver(e);
+}
+
+function getScrollTop() {
+    if (window.pageYOffset) {
+        return window.pageYOffset;
+    } else {
+        /* for IE */
+        return document.getElementsByTagName('html')[0].scrollTop;
+    }
+    return 0;
+}
+function getScrollLeft() {
+    if (window.pageXOffset) {
+        return window.pageXOffset;
+    } else {
+        /* for IE */
+        return document.getElementsByTagName('html')[0].scrollLeft;
+    }
+    return 0;
+}
+
+var lastEvent = null;
+function getEvent(e) {
+    if (!(e)) {
+	try {
+	    if (event)
+		e = event;
+	    else
+		return lastEvent;
+	} catch (err) {
+	    return lastEvent;
+	}
+    }
+    if (lastEvent)
+	delete lastEvent;
+	lastEvent = new Number();
+    if (e.pageX) {
+	lastEvent.pageX = e.pageX;
+	lastEvent.pageY = e.pageY;
+    }
+    lastEvent.clientX = e.clientX;
+    lastEvent.clientY = e.clientY;
+    return lastEvent;
+}
+
+
+function moveOver(e) {
+    if (popupS.display == "none") return;
+    e = getEvent(e)
+    var x = 16, y = 16;
+    if (e.pageX) {
+        x += e.pageX;
+        y += e.pageY;
+    } else {
+        x += e.clientX + getScrollLeft();
+        y += e.clientY + getScrollTop();
+    }
+
+    var maxX = - popup.offsetWidth - 20 + getScrollLeft();
+    var maxY = - popup.offsetHeight - 20 + getScrollTop();
+    if (window.pageYOffset != null) {
+        maxX += self.innerWidth;
+        maxY += self.innerHeight;
+    } else {
+        var b = self.document.body;
+        maxX += b.clientWidth;
+        maxY += b.clientHeight;
+    }
+
+    popupS.left = (x < maxX ? x : maxX) + "px";
+    popupS.top = (y < maxY ? y : y - popup.offsetHeight * 2 - 1) + "px";
+}
+function hideOver() {
+    popupS.display = "none";
+    popupS.width = "auto";
+    if (window.onmousemove)
+        window.onmousemove = null;
+    else
+        document.onmousemove = null;
+}
+
+</script>
+
 </head>
 <body>
 
@@ -149,7 +278,7 @@
 		$info = $filled['requester'] . '/' . $filled['date'] . '/' . $filled['flags'];
 		foreach($filled['builder'] as $key => $value)
 		{
-			$title .= "$value @ $key\n";
+			$title .= "$value @ $key[br/]";
 		}
 //		$title = rtrim($title, ',');
 	}
@@ -158,7 +287,7 @@
 		$info = "not filled";
 	}
 ?>
-<tr class="application" title='<?=$title?>'>
+<tr class="application" onmouseover="O(event, this, '<?=$title?>')">
 <td colspan="2"></td>
 <td class="spec"><a href="http://cvs.pld-linux.org/cgi-bin/cvsweb/SPECS/<?=$q['aspec']?>"><?=$q['aspec']?></a>:<?=$q['abranch']?></td>
 <td class="recip"><a class="mailto"><?=$q['arecipient']?></a></td>
@@ -190,6 +319,8 @@
 <img src="http://pl.docs.pld-linux.org/zrzuty_ekr/logo_03.png" alt="PLD" />
 </div>
 
+<div id="Popup">EMPTY</div>
+
 <script type="text/javascript">
 /*<![CDATA[*/
 /* fill href of As with class="mailto" */
@@ -202,6 +333,9 @@
 			as[i].href = "mailto:" + as[i].innerHTML + "@" + "pld-linux.org";
 	}
 }) ();
+
+popup = document.getElementById("Popup");
+popupS = popup.style;
 /*]]>*/
 </script>
 


More information about the pld-cvs-commit mailing list