Merge branch 'develop' into automatic_scoring
This commit is contained in:
commit
e9a1a3aa04
|
@ -17,6 +17,9 @@ window.TrivabbleConf = {
|
|||
// To tweak only if your webserver is shared with other conflicting resources at / (e.g. Yunohost integration)
|
||||
APP_PATH: "",
|
||||
|
||||
// The API entry point. Default value: APP_PATH + '/:trivabble'
|
||||
API_ENTRY_POINT: "/:trivabble",
|
||||
|
||||
// The color of the flash light when double clicking on a cell
|
||||
FLASH_LIGHT_COLOR: "#EE6633",
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
setConf("FLASH_LIGHT_DURATIONS", [800, 1600, 3200]);
|
||||
setConf("FLASH_LIGHT_DURATION", middle("FLASH_LIGHT_DURATIONS"));
|
||||
setConf("FLASH_LIGHT_COLOR", "#ee6633");
|
||||
setConf("API_ENTRY_POINT", Conf.APP_PATH + "/:trivabble");
|
||||
setConf("PREMIUM_SEVEN_TILES", 50);
|
||||
|
||||
function getSetting(key) {
|
||||
|
@ -195,11 +196,6 @@
|
|||
|
||||
let serverVersion = 0;
|
||||
|
||||
// HTTP path url prefix for any socket (xhr,ess or ws) from browser to server access
|
||||
function getApiEntryPoint() {
|
||||
return Conf.APP_PATH + "/:trivabble";
|
||||
}
|
||||
|
||||
function mouseDown(ele, fun, stop) {
|
||||
const meth = stop ? "removeEventListener" : "addEventListener";
|
||||
ele[meth]("mousedown", fun, false);
|
||||
|
@ -1308,7 +1304,7 @@
|
|||
closeConnections();
|
||||
pollingServer = true;
|
||||
|
||||
eventSource = new EventSource(getApiEntryPoint() + "/sse/" + JSON.stringify(cmdsWithContext()));
|
||||
eventSource = new EventSource(getSetting("API_ENTRY_POINT") + "/sse/" + JSON.stringify(cmdsWithContext()));
|
||||
bindConnectionEvents(eventSource);
|
||||
return;
|
||||
}
|
||||
|
@ -1324,7 +1320,7 @@
|
|||
webSocket = new WebSocket(
|
||||
(window.location.protocol === "http:" ? "ws://" : "wss://") +
|
||||
window.location.host +
|
||||
getApiEntryPoint() + "/ws/" +
|
||||
Conf.API_ENTRY_POINT + "/ws/" +
|
||||
JSON.stringify(cmdsWithContext())
|
||||
);
|
||||
|
||||
|
@ -1338,7 +1334,7 @@
|
|||
function xhrRequest(data, onreadystatechange) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open("POST", getApiEntryPoint(), true);
|
||||
xhr.open("POST", Conf.API_ENTRY_POINT, true);
|
||||
xhr.setRequestHeader("Content-Type", "text/plain");
|
||||
xhr.send(JSON.stringify(data));
|
||||
|
||||
|
|
Loading…
Reference in New Issue