Mercurial > hg > batmud > maputils
changeset 2565:d55944cb90a4
Remove useless code (mainly moved to citymap.js now).
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 27 Jan 2024 05:29:44 +0200 |
parents | 68ca64b6e369 |
children | 033454f36982 |
files | src/tooltip.js |
diffstat | 1 files changed, 2 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tooltip.js Sat Jan 27 05:07:31 2024 +0200 +++ b/src/tooltip.js Sat Jan 27 05:29:44 2024 +0200 @@ -1,5 +1,5 @@ // -// Tooltip and other utility functions in JavaScript for BatMUD maps +// Tooltip functions in JavaScript for BatMUD maps // Programmed by Matti 'ccr' Hamalainen <ccr@tnsp.org> // (C) Copyright 2006-2021 Tecnic Software productions (TNSP) // @@ -37,52 +37,6 @@ } -// Add or remove given CSS class to specified element -function mapSetStyle(uid, ustyle, uset) -{ - var uelem = document.getElementById(uid); - if (uelem) - { - if (uset) - uelem.classList.add(ustyle); - else - uelem.classList.remove(ustyle); - } -} - - -// Set or unset active element style -function mapSetActive(uid, uset) -{ - mapSetStyle('maploc'+uid, "locactive", uset); - mapSetStyle('listloc'+uid, "locactive", uset); -} - - -// Hilite map and list elements of given id -function qh(uid) -{ - if (mapTipPrev != null) mapSetActive(mapTipPrev, false); - mapSetActive(uid, true); - mapTipPrev = uid; -} - - -function qn() -{ - if (mapTipPrev != null) mapSetActive(mapTipPrev, false); - mapTipPrev = null; - htt(); -} - - -function sttq(uid) -{ - qh(uid); - stt(uid); -} - - // Update the tooltip box function mapUpdateTooltip(ev) { @@ -135,17 +89,7 @@ } -// Highlight one location (by index number) during page load function mapOnLoad() { - document.onmousemove = mapUpdateTooltip; - - var hstr = window.location.href; - if (hstr.indexOf("?") >= 0) - { - var uid = unescape(hstr.substr(hstr.indexOf("?") + 1).toLowerCase()); - - mapSetStyle('maploc'+uid, "lochilite", true); - mapSetStyle('listloc'+uid, "lochilite", true); - } + document.addEventListener("mousemove", mapUpdateTooltip); }