Compare commits

...

5 Commits

Author SHA1 Message Date
Bea 149254ba95 made toolbar sticky, moving with the page 2020-04-20 11:50:00 +02:00
Bea 40808bf104 ignored idea config files 2020-04-16 13:39:16 +02:00
Bea cecbdc425e started multi-page implementation 2020-04-16 13:29:39 +02:00
Bea a6d4577c46 cleaned up code (work in progress) 2020-04-16 13:29:39 +02:00
Bea 128b72948c removed debug logging 2020-04-16 13:29:39 +02:00
10 changed files with 16 additions and 57 deletions

3
.gitignore vendored
View File

@ -59,3 +59,6 @@ typings/
/public/uploads
/package-lock.json
# WebStorm config files
/.idea/

5
.idea/.gitignore vendored
View File

@ -1,5 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Whiteboard.iml" filepath="$PROJECT_DIR$/.idea/Whiteboard.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,7 +1,8 @@
body {
position: relative;
margin: 0px;
height: calc(var(--vh, 1vh) * 100);
/* height: calc(var(--vh, 1vh) * 100);*/
height: 10000px;
width: 100%;
overflow: scroll;
}

View File

@ -38,11 +38,8 @@
</head>
<body>
<!---Whiteboard container -!-->
<div id="whiteboardContainer"></div>
<!---Toolbar -!-->
<div id="toolbar" style="position: absolute; top: 10px; left: 10px;">
<div id="toolbar" style="position: -webkit-sticky; position: sticky; top: 10px; left: 10px; z-index: 1;">
<div class="btn-group">
<button id="whiteboardTrashBtn" title="Clear the whiteboard" type="button" class="whiteboardBtn">
<i class="fa fa-trash"></i>
@ -158,6 +155,11 @@
<i id="maxBtn" style="position:relative; left:-5px; display: none;" class="fas fa-angle-right"></i>
</button>
</div>
</div>
<!---Whiteboard container -!-->
<div id="whiteboardContainer" style="z-index: 0;"></div>
</body>
</html>

View File

@ -56,6 +56,11 @@ signaling_socket.on('connect', function () {
whiteboard.updateSmallestScreenResolution(widthHeight["w"], widthHeight["h"]);
});
signaling_socket.on('updateBiggestScreenResolution', function (widthHeight) {
//whiteboard.updateSmallestScreenResolution(widthHeight["w"], widthHeight["h"]);
// todo: implement biggest resolution check & update
});
signaling_socket.emit('joinWhiteboard', { wid: whiteboardId, at: accessToken, windowWidthHeight: { w: $(window).width(), h: $(window).height() } });
});

View File

@ -214,7 +214,6 @@ var whiteboard = {
return;
}
console.info("eoff: " + e.offsetY); console.info("else:" + (e.pageY - $(e.target).offset().top));
_this.sendFunction({
"t": "cursor",
"event": "move",
@ -250,8 +249,6 @@ var whiteboard = {
_this.ctx.globalCompositeOperation = _this.oldGCO;
var currX = (loc.offsetX || loc.pageX - $(e.target).offset().left);
var currY = (loc.offsetY || loc.pageY - $(e.target).offset().top);
var els = loc.pageY - $(e.target).offset().top;
console.info("eoff: " + loc.offsetY); console.info("else: " + els);
if (!currX || !currY) {
currX = _this.latestTouchCoods[0];
currY = _this.latestTouchCoods[1];
@ -430,19 +427,7 @@ var whiteboard = {
var currX = loc.offsetX || loc.pageX - $(e.target).offset().left;
var currY = loc.offsetY || loc.pageY - $(e.target).offset().top;
/*console.log("curr y:" + loc.currY);
console.log("offset y:" + loc.offsetY);
console.log("page y:" + loc.pageY);
console.log("current y: " + currY);*/
window.requestAnimationFrame(function () {
if ((!currX || !currY) && e.touches && e.touches[0]) {
var touche = e.touches[0];
currX = touche.clientX - $(_this.mouseOverlay).offset().left;
currY = touche.clientY - $(_this.mouseOverlay).offset().top;
//console.log("current y new: " + currY);
}
_this.latestTouchCoods = [currX, currY];
if (_this.drawFlag) {