diff --git a/src/css/main.css b/src/css/main.css index 2b03121..78949fe 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -8,6 +8,8 @@ body { height: calc(var(--vh, 1vh) * 100); width: 100%; overflow: hidden; + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, + Arial, sans-serif; } #whiteboardContainer { @@ -132,3 +134,33 @@ button { .displayNone { display: none; } + +#shareWhiteboardDialog { + width: 100vw; + height: 100vh; + background-color: rgba(1, 1, 1, 0.35); + z-index: 10000000000000; + position: absolute; + top: 0; + left: 0; +} + +#shareWhiteboardDialogMessage { + background-color: lightgreen; + padding: 20px; + font-weight: bold; +} + +.shareWhiteboardDialogContent { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 100%; + height: 100%; +} + +.shareWhiteboardDialogItem { + padding: 5px; + margin: 5px; +} diff --git a/src/index.html b/src/index.html index d5b3bd3..4a7642e 100644 --- a/src/index.html +++ b/src/index.html @@ -258,5 +258,29 @@

# msg. sent to server: 0

# msg. received from server: 0

+ +
+
+ + + +

+
+
diff --git a/src/js/main.js b/src/js/main.js index efa6646..6d5bbb2 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -433,25 +433,56 @@ function initWhiteboard() { $("#myFile").click(); }); - $("#shareWhiteboardBtn").click(function () { - var url = window.location.href; - var s = url.indexOf("&username=") !== -1 ? "&username=" : "username="; //Remove username from url - var urlSlpit = url.split(s); - var urlStart = urlSlpit[0]; - if (urlSlpit.length > 1) { - var endSplit = urlSlpit[1].split("&"); - endSplit = endSplit.splice(1, 1); - urlStart += "&" + endSplit.join("&"); + $("#shareWhiteboardBtn").click(() => { + function urlToClipboard(whiteboardId = null) { + const { protocol, host, pathname, search } = window.location; + const basePath = `${protocol}//${host}${pathname}`; + const getParams = new URLSearchParams(search); + + // Clear ursername from get parameters + getParams.delete("username"); + + if (whiteboardId) { + // override whiteboardId value in URL + getParams.set("whiteboardid", whiteboardId); + } + + const url = `${basePath}?${getParams.toString()}`; + $("