add option to change the background image grid

This commit is contained in:
raphael
2020-05-22 15:45:11 +02:00
parent 4134c4130a
commit a33973eeb6
7 changed files with 18 additions and 2 deletions

View File

@@ -140,6 +140,7 @@ function initWhiteboard() {
//Load the whiteboard
whiteboardId: whiteboardId,
username: btoa(myUsername),
backgroundGridUrl: "./images/" + ConfigService.backgroundGridImage,
sendFunction: function (content) {
if (ReadOnlyService.readOnlyActive) return;
//ADD IN LATER THROUGH CONFIG

View File

@@ -48,6 +48,14 @@ class ConfigService {
return this.#drawBackgroundGrid;
}
/**
* @type {string}
*/
#backgroundGridImage = "bg_grid.png";
get backgroundGridImage() {
return this.#backgroundGridImage;
}
/**
* @type {{minDistDelta: number, minTimeDelta: number}}
*/
@@ -78,6 +86,7 @@ class ConfigService {
showSmallestScreenIndicator,
imageDownloadFormat,
drawBackgroundGrid,
backgroundGridImage,
performance,
} = common;
@@ -85,6 +94,7 @@ class ConfigService {
this.#showSmallestScreenIndicator = showSmallestScreenIndicator;
this.#imageDownloadFormat = imageDownloadFormat;
this.#drawBackgroundGrid = drawBackgroundGrid;
this.#backgroundGridImage = backgroundGridImage;
this.#refreshInfoInterval = 1000 / performance.refreshInfoFreq;
console.log("Whiteboard config from server:", configFromServer, "parsed:", this);

View File

@@ -4,7 +4,6 @@ import ReadOnlyService from "./services/ReadOnlyService";
import InfoService from "./services/InfoService";
import ThrottlingService from "./services/ThrottlingService";
import ConfigService from "./services/ConfigService";
import { fillTextMultiLine } from "./utils";
import html2canvas from "html2canvas";
const RAD_TO_DEG = 180.0 / Math.PI;
@@ -51,7 +50,7 @@ const whiteboard = {
whiteboardId: "0",
username: "unknown",
sendFunction: null,
backgroundGridUrl: "./images/KtEBa2.png",
backgroundGridUrl: "./images/gb_grid.png",
},
lastPointerSentTime: 0,
/**