diff options
| author | root <root@frank.tg14.gathering.org> | 2014-04-14 11:16:14 +0200 | 
|---|---|---|
| committer | root <root@frank.tg14.gathering.org> | 2014-04-14 11:21:19 +0200 | 
| commit | 2fda9c1497db4c15036110d0ee4ab193763c5069 (patch) | |
| tree | 3bf0478fbecee8678e58776f64c973ff8f9a9a8c /web | |
| parent | c6c6e02a6466994329a65fbd31cb3d8305e13181 (diff) | |
Small fixes to the ping display and drag.
Diffstat (limited to 'web')
| -rw-r--r-- | web/nms.gathering.org/ping.html | 12 | ||||
| -rw-r--r-- | web/nms.gathering.org/ping.js | 14 | 
2 files changed, 22 insertions, 4 deletions
| diff --git a/web/nms.gathering.org/ping.html b/web/nms.gathering.org/ping.html index 423c73e..1b4e728 100644 --- a/web/nms.gathering.org/ping.html +++ b/web/nms.gathering.org/ping.html @@ -1,5 +1,17 @@  <html>    <body> +    <style> +.switchname { +	-webkit-transform: rotate(-90deg); +	-webkit-transform-origin: 0% 0%; +	transform: rotate(-90deg); +	transform-origin: 0% 0%; +	position: absolute; +	bottom: -14px; +	font-family: sans-serif; +	font-size: small; +} +</style>      <p id="playground"><img src="tg14-salkart.png" alt="" id="map" /></p>      <script type="text/javascript" src="ping.js"></script>    </body> diff --git a/web/nms.gathering.org/ping.js b/web/nms.gathering.org/ping.js index c0f6b46..1299567 100644 --- a/web/nms.gathering.org/ping.js +++ b/web/nms.gathering.org/ping.js @@ -82,12 +82,18 @@ function create_switch(switchnum, sysname, x, y, width, height) {  	s.style.height = height + 'px';  	s.style.backgroundColor = '#0000ff';  	s.style.border = '1px solid black'; +	s.style.padding = "0";  	switches[switchnum] = s; +	var span = document.createElement("div"); +	span.className = "switchname"; +	span.style.border = "0"; +	span.style.padding = "0"; +	s.appendChild(span); +  	var text = document.createTextNode(sysname); -	s.appendChild(text); +	span.appendChild(text); -	//var attr = document.createAttribute("data-switchnum", switchnum);  	s.setAttribute("data-switchnum", switchnum);  	document.body.appendChild(s); @@ -118,8 +124,8 @@ document.onmouseup = function(e) {  	if (dragging_switch === null) {  		return;  	} -	var x = e.clientX + delta_x; -	var y = e.clientY + delta_y; +	var x = e.clientX + delta_x - map.getBoundingClientRect().top; +	var y = e.clientY + delta_y - map.getBoundingClientRect().left;  	var request = new XMLHttpRequest();  	request.open('POST', '/change-switch-pos.pl', true); | 
