Fixed a bug in removing old blinking arrows. Added functional room names. Tweaked the font size of room names. Made the page switch to the right floor-plan for a given room.

- Legacy-Id: 11586
This commit is contained in:
Henrik Levkowetz 2016-07-09 21:23:58 +00:00
parent 769c6f6137
commit cd857c3602
2 changed files with 28 additions and 7 deletions

View file

@ -61,6 +61,13 @@ function roomcoords(nm)
function setarrow(nm)
// Place an arrow at the center of a given room name (or list of room names separated by "/").
{
for (var f = 0; f < floorlist.length; f++) {
floor = floorlist[f];
for (var i = 0; i < arrowsuffixlist.length; i++) {
removearrow(arrowsuffixlist[i], floor);
}
}
for (var i = 0; i < arguments.length; i+=2) {
nm = roommap(arguments[i]);
if (verbose) alert("nm=" + nm);
@ -75,9 +82,6 @@ function setarrow(nm)
if (verbose) alert("left=" + left + ", top=" + top + ", right=" + right + ", bottom=" + bottom + ", floor=" + floor + ", width=" + width);
//alert("left=" + left + ", top=" + top + ", right=" + right + ", bottom=" + bottom);
// calculate arrow position
for (var i = 0; i < arrowsuffixlist.length; i++) {
removearrow(arrowsuffixlist[i], floor);
}
arrow_left = (left + (right - left) / 2 );
arrow_top = (top + (bottom - top) / 2 );
// scale the coordinates to match image scaling
@ -92,6 +96,7 @@ function setarrow(nm)
adiv.style.left = arrow_left + offsetleft + "px";
adiv.style.top = arrow_top + offsettop + "px";
adiv.style.visibility = "visible";
window.location.hash = floor;
}
}
}

View file

@ -22,8 +22,13 @@
padding: 0;
}
.rooms a {
text-decoration: underline;
}
hr.slim {
margin-top: 1.3ex;
margin-bottom: 1ex;
}
{% endblock %}
{% block bodyAttrs %}onload="automaticarrow(); checkParams();" data-spy="scroll" data-target="#affix"{% endblock %}
@ -53,9 +58,19 @@
<div id="{{floor.name|slugify}}-arrowdiv2" style="position: absolute; left: 0; top: 67.5px; visibility: hidden;"><img id="arrow" src="{% static 'ietf/images/arrow-ani.gif' %}"></div>
<div id="{{floor.name|slugify}}-arrowdiv3" style="position: absolute; left: 0; top: 67.5px; visibility: hidden;"><img id="arrow" src="{% static 'ietf/images/arrow-ani.gif' %}"></div>
</div>
<div class="rooms">
{% for room in floor.room_set.all %}
<a href="javascript: setarrow('{{room.name|slugify}}')">{{ room.name|nbsp }}</a>
<div class="rooms small">
{% for f in floors %}
{% for room in f.room_set.all %}
<a href="javascript: setarrow('{{room.name|slugify}}')">{{ room.name|nbsp }}</a>&ensp;
{% endfor %}
{% endfor %}
<hr class="slim">
{% for f in floors %}
{% for room in f.room_set.all %}
{% if room.functional_display_name %}
<a href="javascript: setarrow('{{room.name|slugify}}')">{{ room.functional_display_name|nbsp }}</a>&ensp;
{% endif %}
{% endfor %}
{% endfor %}
</div>
<div class="row"></div>
@ -76,7 +91,8 @@
<script src="{% static 'ietf/js/room_params.js' %}"></script>
<script>
// These must match the 'arrowdiv' divs above
var arrowsuffixlist = [ '', '1', '2', '3' ];
var arrowsuffixlist = [ '0', '1', '2', '3' ];
var floorlist = [{% for floor in floors %}{% if not forloop.first %}, {%endif%}'{{floor.name|slugify}}'{% endfor %}];
function roommap(nm)
{