adds scale queryparam to overlay
This commit is contained in:
parent
70f0cc99fc
commit
7f40d85022
@ -5,6 +5,7 @@ import jakarta.ws.rs.GET
|
||||
import jakarta.ws.rs.Path
|
||||
import jakarta.ws.rs.PathParam
|
||||
import jakarta.ws.rs.Produces
|
||||
import jakarta.ws.rs.QueryParam
|
||||
import jakarta.ws.rs.core.MediaType
|
||||
|
||||
@Path("overlay/{diceid}")
|
||||
@ -12,8 +13,8 @@ class OverlayResource {
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.TEXT_HTML)
|
||||
fun get(@PathParam("diceid") diceid: String): TemplateInstance {
|
||||
return Templates.overlay(diceid)
|
||||
fun get(@PathParam("diceid") diceid: String, @QueryParam("scale") scale: Int? = 7): TemplateInstance {
|
||||
return Templates.overlay(diceid, scale ?: 7)
|
||||
}
|
||||
|
||||
@GET
|
||||
|
@ -6,7 +6,7 @@ import io.quarkus.qute.TemplateInstance
|
||||
@CheckedTemplate
|
||||
object Templates {
|
||||
@JvmStatic
|
||||
external fun overlay(diceid: String): TemplateInstance
|
||||
external fun overlay(diceid: String, scale: Int): TemplateInstance
|
||||
@JvmStatic
|
||||
external fun results(room: String): TemplateInstance
|
||||
}
|
||||
|
@ -41,7 +41,6 @@
|
||||
}
|
||||
import DiceBox from "/vendor/dice-box/dice-box.es.js";
|
||||
const evtSource = new EventSource(url() + "/dice/{diceid??}/stream");
|
||||
|
||||
const diceBox = new DiceBox("#dice-box", {
|
||||
assetPath: "/vendor/assets/",
|
||||
theme: 'default',
|
||||
@ -56,7 +55,7 @@
|
||||
'smooth',
|
||||
'wooden'
|
||||
],
|
||||
scale: 7
|
||||
scale: {scale}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async() => {
|
||||
|
@ -89,7 +89,7 @@
|
||||
}
|
||||
function start(event) {
|
||||
if((!event || event.keyCode === 13) && document.getElementById('name').value.length > 0 && document.getElementById('room').value.length > 0) {
|
||||
document.getElementById('overlayId').value = url() + '/overlay/' + document.getElementById('room').value + ':' + localStorage.getItem('userId');
|
||||
document.getElementById('overlayId').value = url() + '/overlay/' + document.getElementById('room').value + ':' + localStorage.getItem('userId') + '?scale=7';
|
||||
document.getElementById('resultsId').value = url() + '/overlay/' + document.getElementById('room').value + '/results';
|
||||
document.getElementById('resultFrame').src = url() + '/overlay/' + document.getElementById('room').value + '/results';
|
||||
document.getElementById('roll').hidden = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user