Merge branch 'master' into matbgn-endlessBoard

This commit is contained in:
Raphael 2022-12-08 14:00:13 +01:00
commit 866ce4b31e
3 changed files with 3631 additions and 6320 deletions

9921
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
"html2canvas": "^1.4.1",
"jquery-ui-rotatable": "^1.1.0",
"js-yaml": "3.13.1",
"jsdom": "^14.0.0",
"jsdom": "^16.5.0",
"jsprim": "^1.4.2",
"socket.io": "^4.4.1",
"signature_pad": "^4.0.1",
@ -65,7 +65,7 @@
"husky": "^4.2.5",
"jest": "^27.4.7",
"jquery": "^3.6.0",
"jquery-ui": "^1.13.1",
"jquery-ui": "^1.13.2",
"keymage": "^1.1.3",
"pdfjs-dist": "^2.12.313",
"prettier": "^2.5.1",

View File

@ -333,7 +333,18 @@ function initWhiteboard() {
.off("click")
.click(function () {
if (ReadOnlyService.readOnlyActive) return;
showBasicAlert("Please drag the image into the browser.");
showBasicAlert(`Please drag the image into the browser.<br>
Or upload here: <input type="file" id="manualFileUpload" name="myfile" />`);
document.getElementById("manualFileUpload").addEventListener(
"change",
function (e) {
$(".basicalert").remove();
if (ReadOnlyService.readOnlyActive) return;
e.originalEvent = { dataTransfer: { files: e.target.files } };
handleFileUploadEvent(e);
},
false
);
});
// save image as imgae
@ -621,10 +632,8 @@ function initWhiteboard() {
}
});
$("#whiteboardContainer").on("drop", function (e) {
//Handle drop
if (ReadOnlyService.readOnlyActive) return;
function handleFileUploadEvent(e) {
console.log(e);
if (e.originalEvent.dataTransfer) {
if (e.originalEvent.dataTransfer.files.length) {
//File from harddisc
@ -766,6 +775,13 @@ function initWhiteboard() {
});
}
}
}
$("#whiteboardContainer").on("drop", function (e) {
//Handle drop
if (ReadOnlyService.readOnlyActive) return;
handleFileUploadEvent(e);
dragCounter = 0;
whiteboard.dropIndicator.hide();
});