all repos — felt @ 4435d1e1302ef9eb758daf0087cef705f62c8601

virtual tabletop for dungeons and dragons (and similar) using Go, MongoDB, and websockets

change label for aspect lock on token create form, adjust dice scroll logic
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmTK8bEACgkQO3+8IhRO
Y5hBcA/+JmYp+afBIo7AixEoNd11kq4YdfdtiGDBSrb1pQGQCg7V8iI9dAHL/udB
5KRcAN1/Sev6WPrGB7xHWL3/BryrFOJuoeb3e3L10PXT1s9OVZaUOhum8WgfJP58
OHWnfqJlm9kwrFZBIDiaUUBz9f3w5Rhd0wM01UbZDNdgN7vMWV/vc39NpHGvmb+U
3Ko8k/upDOYjX1hqgs9/qF4qubbhUUInoXtiMNLnkKda1YLfmHjYzCp92q7riGqX
AgUWZbj7SYgwWnrL0GhSw5HX+wLXZh4J1yMNS6wExMlYhN8FKc/Yqv35WQWvcQr0
hnqBu/nuihM4bAciZvcgF/LNG3YQfBDbm2ofvMMjAC3RE5V6fACegwoakEzn3AjE
FFa+ggQo0X+p1cw4EkRMB1EKT/7stEFrrC6oiGSmICsLkyt0e80Qv3GVMg7B8OU6
OrIje4tH6Kw6SixQ7Phutckw81Ssgo6Yzqj/7yn79FjYyeS1Qjm8UDdAU3L7oA9c
SVhMZhSjcI7/jAZgkw05SwsUudGYRsxd+I6FDQSZhxjWf6d2cZQ1R00Jyx5tqGCj
rx+rktwchE8xIYz2L3KF/Y2qyyYhOJsrIqnWRwm8FJJeydDXnSPx4+MXCkAT3H5F
pryo1nraAkmdFkOu/IYijAyMDty4WmKZuxKkl+8rnO+o1cnDCBg=
=evdP
-----END PGP SIGNATURE-----
commit

4435d1e1302ef9eb758daf0087cef705f62c8601

parent

76c217511d1cff22d16c8c29d615579a830fd796

M static/admin.jsstatic/admin.js

@@ -98,7 +98,7 @@

function toggleAspectLock() { try { const locked = $("token_aspect_lock").checked; - $("aspect_lock_label").innerHTML = locked ? "🔒" : "🔓" + $("aspect_lock_label").innerHTML = locked ? "w:h locked" : "w:h free" } catch {} }

@@ -339,7 +339,7 @@ });

if (res.ok) { loadAdmin(tableKey.name, tableKey.passcode); } else { - throw new Error("Something went wrong uploading the ${imgType} image..."); + throw new Error(`Something went wrong uploading the ${imgType} image...`); } } catch (err) { setErr(`${err.name}: ${err.message}`);
M static/index.htmlstatic/index.html

@@ -111,7 +111,7 @@ <form onsubmit="return false" id="token_creation_form" style="display:none;">

<label>Sprite<select id="sprite_dropdown" onchange="previewSprite(this)"></select></label><br/> <label>Name<input id="token_name"/></label><br/> - <label>Width<input type="number" id="token_width" min="1" max="9999" step="1" onchange="previewSprite(this)"/></label><label id="aspect_lock_label" for="token_aspect_lock">&#128274;</label><input type="checkbox" checked id="token_aspect_lock" onchange="toggleAspectLock()"/><br/> + <label>Width<input type="number" id="token_width" min="1" max="9999" step="1" onchange="previewSprite(this)"/></label><label id="aspect_lock_label" for="token_aspect_lock">w:h locked</label><input type="checkbox" checked id="token_aspect_lock" onchange="toggleAspectLock()"/><br/> <label>Height<input type="number" id="token_height" min="1" step="1" max="9999" onchange="previewSprite(this)"/></label><br/> <label>cX<input type="number" id="token_cx" min="0" max="9999" step="1" onchange="previewSprite(this)"/></label><br/> <label>cY<input type="number" id="token_cy" min="0" max="9999" step="1" onchange="previewSprite(this)"/></label><br/>

@@ -146,14 +146,14 @@ <button onclick="setTheme()">Apply</button><button onclick="resetTheme(defaultTheme)">Reset</button>

</form> </details> <div id="lag" style="display:none;">lag...</div> - <div class="ui_win" id="felt_info"><a href="https://hacklab.nilfm.cc/felt">felt v0.2.3</a> (<a href="https://hacklab.nilfm.cc/felt/raw/main/LICENSE">license</a>) | built with <a href="https://leafletjs.com">leaflet</a> (<a href="https://hacklab.nilfm.cc/felt/raw/main/LEAFLET_LICENSE">license</a>) </div> + <div class="ui_win" id="felt_info"><a href="https://hacklab.nilfm.cc/felt">felt v0.2.5</a> (<a href="https://hacklab.nilfm.cc/felt/raw/main/LICENSE">license</a>) | built with <a href="https://leafletjs.com">leaflet</a> (<a href="https://hacklab.nilfm.cc/felt/raw/main/LEAFLET_LICENSE">license</a>) </div> </nav> </body> <script>L_DISABLE_3D = window.location.hash.toLowerCase() === "#no3d";</script> <script src="./leaflet.js?v=1.9.4" type="text/javascript"></script> - <script src="./util.js?v=0.2.2" type="text/javascript"></script> - <script src="./map.js?v=0.2.2" type="text/javascript"></script> - <script src="./socket.js?v=0.2.2" type="text/javascript"></script> - <script src="./dice.js?v=0.2.2" type="text/javascript"></script> - <script src="./admin.js?v=0.2.2" type="text/javascript"></script> + <script src="./util.js?v=0.2.5" type="text/javascript"></script> + <script src="./map.js?v=0.2.5" type="text/javascript"></script> + <script src="./socket.js?v=0.2.5" type="text/javascript"></script> + <script src="./dice.js?v=0.2.5" type="text/javascript"></script> + <script src="./admin.js?v=0.2.5" type="text/javascript"></script> </html>
M static/socket.jsstatic/socket.js

@@ -193,7 +193,7 @@ for(const r of dice) {

try{ const p = formatDice(r); diceLog.append(p); - p.scrollIntoView(); + diceLog.scrollTop = diceLog.scrollHeight; } catch{} } }
M static/style.cssstatic/style.css

@@ -202,6 +202,10 @@ .leaflet-container {

background: transparent; } +#aspect_lock_label { + color: var(--main_color); +} + #token_aspect_lock { display: none; }
M static/util.jsstatic/util.js

@@ -53,7 +53,7 @@ diceWin.addEventListener("toggle", e => {

if (diceWin.open) { const diceLog = $("dice_log"); if (diceLog && diceLog.children.length > 0) { - diceLog.children[diceLog.children.length - 1].scrollIntoView(); + diceLog.scrollTop = diceLog.scrollHeight; } } });
M templates/error.htmltemplates/error.html

@@ -15,6 +15,6 @@ <p class="error">{{ $params.ErrorMessage }}</p>

<p><a href="/table">Get back to gaming...</a></p> </main> </body> -<script src="./util.js?v=0.2.1" type="text/javascript"></script> +<script src="./util.js?v=0.2.5" type="text/javascript"></script> </html> <html>
M templates/register.htmltemplates/register.html

@@ -23,5 +23,5 @@ <span class="error">The registration token you provided is invalid;<br/> obtain a new one.</span>

{{end}} </main> </body> -<script src="/table/util.js?v=0.2.2" type="text/javascript"></script> +<script src="/table/util.js?v=0.2.5" type="text/javascript"></script> </html>
M templates/registered.htmltemplates/registered.html

@@ -19,5 +19,5 @@ <span class="error">Something went wrong; please try a different username or obtain a new registration code.</span>

{{end}} </main> </body> -<script src="/table/util.js?v=0.2.1" type="text/javascript"></script> +<script src="/table/util.js?v=0.2.5" type="text/javascript"></script> </html>