From ec8a26032f0039c63a60fed8e45235d2895e5f07 Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:00:19 -0700
Subject: [PATCH 1/7] Update index.html
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 64b92ea..9842b5a 100644
--- a/index.html
+++ b/index.html
@@ -74,7 +74,7 @@
From 45702897e091ab4312d1fe22821772d4cacb3c1a Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:01:18 -0700
Subject: [PATCH 2/7] Update script.js
---
js/draw2/script.js | 608 ++++++++++++++++++++++++---------------------
1 file changed, 331 insertions(+), 277 deletions(-)
diff --git a/js/draw2/script.js b/js/draw2/script.js
index 669f48b..ba0d054 100644
--- a/js/draw2/script.js
+++ b/js/draw2/script.js
@@ -1,279 +1,333 @@
document.addEventListener('DOMContentLoaded', function() {
- 'use strict';
-
- let canvas = document.getElementsByClassName("whiteboard")[0];
- let context = canvas.getContext("2d");
- let ws = new WebSocket("wss://" + "draw2.bzmb.eu" + "/ws");
- let pick = document.getElementsByClassName("colorpicker3")[0];
- let eraserButton = document.getElementById('eraser'); // Eraser
- let wipeButton = document.getElementById('wipe'); // Wipe
- var current = { color: 'black' };
-
- var drawing = false;
-
- let eraserState = 'grey'; // Initial state (off)
- let isErasing = false;
-
- // Eraser button (if toggle)
- eraserButton.onclick = function() {
- isErasing = !isErasing;
- if (isErasing) {
- eraserButton.style.backgroundColor = 'black';
- eraserState = 'black'; // Eraser mode on
- console.log("%c Erase Mode is on", "color: lightgreen");
- context.globalCompositeOperation = 'destination-out';
- } else {
- eraserButton.style.backgroundColor = 'grey';
- eraserState = 'grey'; // Eraser mode off
- console.log("%c Erase Mode is off", "color: lightgreen");
- context.globalCompositeOperation = 'source-over';
- }
- };
-
- // Clear whiteboard on client side
- wipeButton.onclick = function() {
- context.clearRect(0, 0, canvas.width, canvas.height);
- };
-
- // Function to generate a random color
- function getRandomColor() {
- return "#" + Math.random().toString(16).slice(2, 8).padStart(6, "0");
- }
-
- // Function to set background-color
- function setColor(element, color) {
- element.style.backgroundColor = color;
- }
-
- // Function to set a cookie
- function setCookie(name, value, days) {
- const date = new Date();
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); // Convert days to milliseconds
- const expires = "expires=" + date.toUTCString();
- document.cookie = name + "=" + value + ";" + expires + ";path=/";
- }
-
- // Function to get a cookie by name
- function getCookie(name) {
- const cookies = document.cookie.split(";"); // Split cookies into an array
- for (let i = 0; i < cookies.length; i++) {
- let cookie = cookies[i].trim(); // Trim whitespace
- if (cookie.startsWith(name + "=")) {
- return cookie.substring((name + "=").length); // Return the value of the cookie
- }
- }
- return null; // Return null if the cookie is not found
- }
-
- // Check if a color is stored in cookies
- let userColor = getCookie("color");
- if (!userColor) {
- // Generate a random color if no cookie exists
- userColor = getRandomColor();
- setCookie("color", userColor); // Store the color in a cookie
- }
-
- // Apply the stored or newly generated color
- setColor(pick, userColor); // Remember last saved color
- current.color = userColor; // Change stroke to last saved color
-
- // Add click event listener to change the color
- pick.onclick = function () {
- const newColor = getRandomColor(); // Generate a new random color
- setCookie("color", newColor, 365); // Update the cookie with the new color
- setColor(pick, newColor); // Apply the new color
- current.color = newColor; // Change stroke to new color
- console.log(`New Color: ${newColor}`);
- };
-
- // Drawing event websocket
- ws.addEventListener('message', function(event) {
- const data = JSON.parse(event.data);
- if (data.type === 'drawing') {
- onDrawingEvent(data);
- }
- });
-
- // make the canvas fill its parent
- function onResize() {
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
- }
-
- window.addEventListener('resize', onResize, false);
- onResize();
-
- // limit the number of events per second
- function throttle(callback, delay) {
- var previousCall = new Date().getTime();
- return function() {
- var time = new Date().getTime();
- if ((time - previousCall) >= delay) {
- previousCall = time;
- callback.apply(null, arguments);
- }
- };
- }
-
- function onColorUpdate(e){
- current.color = e.target.className.split(' ')[1];
- }
-
- // Mouse support for desktop devices
- canvas.addEventListener('mousedown', onMouseDown, false);
- canvas.addEventListener('mouseup', onMouseUp, false);
- canvas.addEventListener('mouseout', onMouseUp, false);
- canvas.addEventListener('mousemove', throttle(onMouseMove, 10), false);
-
- // Touch support for mobile devices
- canvas.addEventListener('touchstart', onMouseDown, false);
- canvas.addEventListener('touchend', onMouseUp, false);
- canvas.addEventListener('touchcancel', onMouseUp, false);
- canvas.addEventListener('touchmove', throttle(onMouseMove, 10), false);
-
- function onMouseDown(e){
- drawing = true;
- current.x = e.clientX||e.touches[0].clientX;
- current.y = e.clientY||e.touches[0].clientY;
- }
-
- function onMouseUp(e){
- if (!drawing) { return; }
- drawing = false;
- drawLine(current.x, current.y, e.clientX||e.touches[0].clientX, e.clientY||e.touches[0].clientY, current.color, true, isErasing);
- }
-
- function onMouseMove(e){
- if (!drawing) { return; }
- drawLine(current.x, current.y, e.clientX||e.touches[0].clientX, e.clientY||e.touches[0].clientY, current.color, true, isErasing);
- current.x = e.clientX||e.touches[0].clientX;
- current.y = e.clientY||e.touches[0].clientY;
- }
-
- function onDrawingEvent(data){
- var w = canvas.width;
- var h = canvas.height;
- drawLine(data.x0 * w, data.y0 * h, data.x1 * w, data.y1 * h, data.color, isErasing);
- }
-
- function drawLine(x0, y0, x1, y1, color, broadcast, isErasing){
- context.beginPath();
- context.moveTo(x0, y0);
- context.lineTo(x1, y1);
- context.strokeStyle = color;
- if (isErasing) {
- context.globalCompositeOperation = 'destination-out';
- context.lineWidth = 20; // Thicker line for eraser
- } else {
- context.globalCompositeOperation = 'source-over';
- context.lineWidth = 2; // Thinner line for drawing
- }
- context.stroke();
- context.closePath();
-
- if (broadcast) {
- var w = canvas.width;
- var h = canvas.height;
-
- ws.send(JSON.stringify({
- type: isErasing ? 'erase' : 'drawing',
- x0: x0 / w,
- y0: y0 / h,
- x1: x1 / w,
- y1: y1 / h,
- color: color
- }));
- }
- }
-
- // Check if the browser supports WebSocket
- if (window["WebSocket"]) {
- function establishConnection() {
- // Establish a WebSocket connection to the server
- ws = new WebSocket("wss://" + "draw2.bzmb.eu" + "/ws");
-
- // Event handler when open
- ws.onopen = function(evt) {
- console.log("%c Connection established", "color: red");
- };
-
- // Event handler for when the WebSocket connection is closed
- ws.onclose = function(evt) {
- console.log("%c Connection closed, reconnecting...", "color: red");
- setTimeout(reconnect, 2000); // Reconnect after a delay
- };
-
- let drawingQueue = [];
- let isProcessing = false;
-
- var w = canvas.width;
- var h = canvas.height;
-
- function processDrawingQueue() {
- if (isProcessing || drawingQueue.length === 0) return;
-
- isProcessing = true;
- const batchSize = 200; // Adjust this value based on performance
-
- function processPoints() {
- const ctx = canvas.getContext('2d');
- ctx.beginPath();
-
- for (let i = 0; i < batchSize && drawingQueue.length > 0; i++) {
- const point = drawingQueue.shift();
- ctx.moveTo(point.x0 * w, point.y0 * h);
- ctx.lineTo(point.x1 * w, point.y1 * h);
- ctx.strokeStyle = point.color;
- ctx.lineWidth = point.type === 'erase' ? 20 : 2;
- ctx.globalCompositeOperation = point.type === 'erase' ? 'destination-out' : 'source-over';
- }
-
- ctx.stroke();
-
- if (drawingQueue.length > 0) {
- requestAnimationFrame(processPoints);
- } else {
- isProcessing = false;
- }
- }
-
- requestAnimationFrame(processPoints);
- }
-
- // Drawing event websocket
- ws.onmessage = function(evt) {
- // Event handler for when a message is received from the server
- const data = JSON.parse(evt.data);
-
- // Log raw data for debugging
- console.log("Raw data received:", evt.data);
-
- if (data.type === 'initialDrawing') {
- drawingQueue = drawingQueue.concat(data.points);
- } else if (data.type === 'drawing' || data.type === 'erase') {
- drawingQueue.push(data);
- }
-
- processDrawingQueue();
-
- if (data.type === 'drawing') {
- onDrawingEvent(data);
- }
- }
- }
-
- // Function to reconnect
- function reconnect() {
- console.log('Reconnecting...');
- establishConnection(); // Attempt to reconnect
- }
-
- // Establish the initial connection
- establishConnection();
- } else {
- // If WebSockets are not supported by the browser, display an error message
- var item = document.createElement("div");
- item.innerHTML = "Your browser does not support WebSockets."; // Bold error message
- appendLog(item); // Append the error message to the log
- }
+ 'use strict';
+
+ let canvas = document.getElementsByClassName("whiteboard")[0];
+ let context = canvas.getContext("2d");
+ let ws = new WebSocket("wss://" + draw2.bzmb.eu + "/ws");
+ let pick = document.getElementsByClassName("colorpicker")[0];
+ //let eraserButton = document.getElementById('eraser'); // Eraser
+ let wipeButton = document.getElementById('wipe'); // Wipe
+ var current = { color: 'black' };
+
+ var drawing = false;
+ let eraserState = 'grey'; // Initial state (off)
+ let isErasing = false;
+
+ // Eraser button (if toggle)
+ /*eraserButton.onclick = function() {
+ isErasing = !isErasing;
+ if (isErasing) {
+ eraserButton.style.backgroundColor = 'black';
+ eraserState = 'black'; // Eraser mode on
+ console.log("%c Erase Mode is on", "color: lightgreen");
+ context.globalCompositeOperation = 'destination-out';
+ } else {
+ eraserButton.style.backgroundColor = 'grey';
+ eraserState = 'grey'; // Eraser mode off
+ console.log("%c Erase Mode is off", "color: lightgreen");
+ context.globalCompositeOperation = 'source-over';
+ }
+ };*/
+
+ // Clear whiteboard on client side
+ wipeButton.onclick = function() {
+ context.clearRect(0, 0, canvas.width, canvas.height);
+ };
+
+ // Function to generate a random color
+ function getRandomColor() {
+ return "#" + Math.random().toString(16).slice(2, 8).padStart(6, "0");
+ }
+
+ // Function to set background-color
+ function setColor(element, color) {
+ element.style.backgroundColor = color;
+ }
+
+ // Function to set a cookie
+ function setCookie(name, value, days) {
+ const date = new Date();
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); // Convert days to milliseconds
+ const expires = "expires=" + date.toUTCString();
+ document.cookie = name + "=" + value + ";" + expires + ";path=/";
+ }
+
+ // Function to get a cookie by name
+ function getCookie(name) {
+ const cookies = document.cookie.split(";"); // Split cookies into an array
+ for (let i = 0; i < cookies.length; i++) {
+ let cookie = cookies[i].trim(); // Trim whitespace
+ if (cookie.startsWith(name + "=")) {
+ return cookie.substring((name + "=").length); // Return the value of the cookie
+ }
+ }
+ return null; // Return null if the cookie is not found
+ }
+
+ // Check if a color is stored in cookies
+ let userColor = getCookie("color");
+ if (!userColor) {
+ // Generate a random color if no cookie exists
+ userColor = getRandomColor();
+ setCookie("color", userColor); // Store the color in a cookie
+ }
+
+ // Apply the stored or newly generated color
+ setColor(pick, userColor); // Remember last saved color
+ current.color = userColor; // Change stroke to last saved color
+
+ // Add click event listener to change the color
+ pick.onclick = function () {
+ const newColor = getRandomColor(); // Generate a new random color
+ setCookie("color", newColor, 365); // Update the cookie with the new color
+ setColor(pick, newColor); // Apply the new color
+ current.color = newColor; // Change stroke to new color
+ //console.log(`New Color: ${newColor}`);
+ };
+
+ // Drawing event websocket
+ ws.addEventListener('message', function(event) {
+ const data = JSON.parse(event.data);
+ if (data.type === 'drawing') {
+ onDrawingEvent(data);
+ }
+ });
+
+ // make the canvas fill its parent
+ function onResize() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+ }
+ onResize();
+
+ //window.addEventListener('resize', onResize, false);
+
+ // limit the number of events per second
+ function throttle(callback, delay) {
+ var previousCall = new Date().getTime();
+ return function() {
+ var time = new Date().getTime();
+ if ((time - previousCall) >= delay) {
+ previousCall = time;
+ callback.apply(null, arguments);
+ }
+ };
+ }
+
+ function onColorUpdate(e){
+ current.color = e.target.className.split(' ')[1];
+ }
+
+ // Mouse support for desktop devices
+ canvas.addEventListener('mousedown', onMouseDown, false);
+ canvas.addEventListener('mouseup', onMouseUp, false);
+ canvas.addEventListener('mouseout', onMouseUp, false);
+ canvas.addEventListener('mousemove', throttle(onMouseMove, 10), false);
+
+ // Touch support for mobile devices
+ canvas.addEventListener('touchstart', onMouseDown, false);
+ canvas.addEventListener('touchend', onMouseUp, false);
+ canvas.addEventListener('touchcancel', onMouseUp, false);
+ canvas.addEventListener('touchmove', throttle(onMouseMove, 10), false);
+
+ function onMouseDown(e){
+ drawing = true;
+ current.x = e.clientX||e.touches[0].clientX;
+ current.y = e.clientY||e.touches[0].clientY;
+ }
+
+ function onMouseUp(e){
+ if (!drawing) { return; }
+ drawing = false;
+ drawLine(current.x, current.y, e.clientX||e.touches[0].clientX, e.clientY||e.touches[0].clientY, current.color, true, isErasing);
+ }
+
+ function onMouseMove(e){
+ if (!drawing) { return; }
+ drawLine(current.x, current.y, e.clientX||e.touches[0].clientX, e.clientY||e.touches[0].clientY, current.color, true, isErasing);
+ current.x = e.clientX||e.touches[0].clientX;
+ current.y = e.clientY||e.touches[0].clientY;
+ }
+
+ function onDrawingEvent(data){
+ var w = canvas.width;
+ var h = canvas.height;
+ drawLine(data.x0 * w, data.y0 * h, data.x1 * w, data.y1 * h, data.color, isErasing);
+ }
+
+ function generateUniqueId() {
+ var max = "999999";
+ return Math.floor(Math.random() * max);
+ }
+
+ function drawLine(x0, y0, x1, y1, color, broadcast, isErasing){
+ context.beginPath();
+ context.lineCap = 'round';
+ context.lineJoin = 'round';
+ context.moveTo(x0, y0);
+ context.lineTo(x1, y1);
+ context.strokeStyle = color;
+
+ // Glowing effect
+ context.lineWidth = 5; // Line thickness
+ context.shadowBlur = 20; // Amount of glow
+ context.shadowColor = color; // Glow color
+ //
+
+ if (isErasing) {
+ context.globalCompositeOperation = 'destination-out';
+ context.lineWidth = 20; // Thicker line for eraser
+ } else {
+ context.globalCompositeOperation = 'source-over';
+ context.lineWidth = 2; // Thinner line for drawing
+ }
+ context.stroke();
+ context.closePath();
+
+ if (broadcast) {
+ var w = canvas.width;
+ var h = canvas.height;
+
+ //console.log(clientId); // Know what your generated clientId is to the server
+
+ ws.send(JSON.stringify({
+ type: isErasing ? 'erase' : 'drawing',
+ x0: x0 / w,
+ y0: y0 / h,
+ x1: x1 / w,
+ y1: y1 / h,
+ color: color,
+ clientId: clientId
+ }));
+ }
+ }
+
+ const clientId = generateUniqueId(); // Assign once per session
+
+ // Check if the browser supports WebSocket
+ if (window["WebSocket"]) {
+ function establishConnection(ws) {
+ // Event handler when open
+ ws.onopen = function(evt) {
+ console.log("%c Connection established to whiteboard", "color: lightgreen");
+ };
+
+ // Event handler for when the WebSocket connection is closed
+ ws.onclose = function(evt) {
+ console.log("%c Connection closed, reconnecting...", "color: red");
+ setTimeout(reconnect, 2000); // Reconnect after a delay
+ };
+
+ function debounce(func, wait) {
+ let timeout;
+ return function(...args) {
+ clearTimeout(timeout);
+ timeout = setTimeout(() => func.apply(this, args), wait);
+ };
+ }
+
+ // Window resize to redraw
+ function handleResize() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+ //ws.send('requestRedraw'); // Ask server for drawing points
+ ws.send(JSON.stringify({ type: 'requestRedraw' })); // Ask server for drawing points
+ }
+
+ const debouncedResize = debounce(handleResize, 300);
+
+ /* window.addEventListener('resize', function() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+ //ws.send('requestRedraw'); // Ask server for drawing points
+ ws.send(JSON.stringify({ type: 'requestRedraw' })); // Ask server for drawing points
+ }); */
+
+ window.addEventListener('resize', debouncedResize);
+
+ let drawingQueue = [];
+ let isProcessing = false;
+
+
+ function processDrawingQueue() {
+ var w = canvas.width;
+ var h = canvas.height;
+
+ if (isProcessing || drawingQueue.length === 0) return;
+
+ isProcessing = true;
+
+ function processPoints(context) {
+ context.beginPath();
+
+ for (let i = 0; i <= drawingQueue.length; i++) {
+ const point = drawingQueue.shift();
+ context.lineCap = 'round';
+ context.lineJoin = 'round';
+ context.moveTo(point.x0 * w, point.y0 * h);
+ context.lineTo(point.x1 * w, point.y1 * h);
+ context.strokeStyle = point.color;
+
+ // Glowing effect
+ context.lineWidth = 5; // Line thickness
+ context.shadowBlur = 20; // Amount of glow
+ context.shadowColor = point.color; // Glow color
+ //
+
+ context.lineWidth = point.type === 'erase' ? 20 : 2;
+ context.globalCompositeOperation = point.type === 'erase' ? 'destination-out' : 'source-over';
+ }
+
+ context.stroke();
+
+ if (drawingQueue.length > 0) {
+ requestAnimationFrame(() => processPoints(context));
+ } else {
+ isProcessing = false;
+ }
+ }
+
+ requestAnimationFrame(() => processPoints(context));
+ }
+
+ // Drawing event websocket
+ ws.onmessage = function(evt) {
+ // Log raw data for debugging
+ // console.log("Raw data received:", evt.data);
+
+ // Event handler for when a message is received from the server
+ const data = JSON.parse(evt.data);
+
+ if (data.clientId !== clientId) {
+ if (data.type === 'initialDrawing') {
+ drawingQueue = drawingQueue.concat(data.points);
+ } else if (data.type === 'reloadDrawing') {
+ drawingQueue = drawingQueue.concat(data.points);
+ //console.log("Reloading");
+ processDrawingQueue();
+ } else if (data.type === 'drawing' || data.type === 'erase') {
+ drawingQueue.push(data);
+ }
+
+ processDrawingQueue();
+
+ if (data.type === 'drawing') {
+ onDrawingEvent(data);
+ }
+ }
+ }
+ }
+
+ // Function to reconnect
+ function reconnect() {
+ console.log('Reconnecting...');
+ establishConnection(ws); // Attempt to reconnect
+ }
+
+ // Establish the initial connection
+ establishConnection(ws);
+ } else {
+ // If WebSockets are not supported by the browser, show an error message in console log
+ console.error("%c Your browser does not support WebSockets.", "color: red");
+ }
});
From ade4c4e30bed1cc46db223c7dc3405c0054a5397 Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:02:49 -0700
Subject: [PATCH 3/7] Update script.js
---
js/chat2/script.js | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/js/chat2/script.js b/js/chat2/script.js
index b375fad..f3a1a24 100644
--- a/js/chat2/script.js
+++ b/js/chat2/script.js
@@ -66,7 +66,7 @@ window.onload = function() {
var newName = this.value;
setCookie("nme", newName); // Update the cookie with the new username
setName(nme, newName); // Apply the new username
- console.log(`New Name: ${newName}`);
+ //console.log(`New Name: ${newName}`);
});
// Check if a color is stored in cookies
@@ -85,7 +85,7 @@ window.onload = function() {
const newColor = getRandomColor(); // Generate a new random color
setCookie("color", newColor, 365); // Update the cookie with the new color
setColor(pick, newColor); // Apply the new color
- console.log(`New Color: ${newColor}`);
+ //console.log(`New Color: ${newColor}`);
};
// Function to append messages to the log
@@ -106,15 +106,15 @@ window.onload = function() {
return false;
}
- // Send username and message as JSON to the server
- const fullMessage = {
- username: nme.value,
- color: getComputedStyle(pick).backgroundColor,
- text: msg.value,
- };
+ // Send username and message as JSON to the server
+ const fullMessage = {
+ username: nme.value,
+ color: getComputedStyle(pick).backgroundColor,
+ text: msg.value,
+ };
- console.log("Sending message:", JSON.stringify(fullMessage));
- conn.send(JSON.stringify(fullMessage));
+ //console.log("Sending message:", JSON.stringify(fullMessage));
+ conn.send(JSON.stringify(fullMessage));
// Clear the message input field
msg.value = "";
@@ -140,13 +140,13 @@ window.onload = function() {
conn.onmessage = function(evt) {
try {
// Log raw data for debugging
- console.log("Raw data received:", evt.data);
+ //console.log("Raw data received:", evt.data);
// Parse the incoming JSON string into a JavaScript object
const data = JSON.parse(evt.data);
// Log parsed data for debugging
- console.log("Parsed data:", data);
+ //console.log("Parsed data:", data);
// Ensure `data` has both `username` and `text`
if (!data.username || !data.text) {
From 636fc839176eb0ec2e98d1496b8e4cd89f1d3848 Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:03:54 -0700
Subject: [PATCH 4/7] Update script.js
---
js/draw2/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/draw2/script.js b/js/draw2/script.js
index ba0d054..4607d2e 100644
--- a/js/draw2/script.js
+++ b/js/draw2/script.js
@@ -3,7 +3,7 @@ document.addEventListener('DOMContentLoaded', function() {
let canvas = document.getElementsByClassName("whiteboard")[0];
let context = canvas.getContext("2d");
- let ws = new WebSocket("wss://" + draw2.bzmb.eu + "/ws");
+ let ws = new WebSocket("wss://" + "draw2.bzmb.eu" + "/ws");
let pick = document.getElementsByClassName("colorpicker")[0];
//let eraserButton = document.getElementById('eraser'); // Eraser
let wipeButton = document.getElementById('wipe'); // Wipe
From 8021dd63befb965a1bfcc4bd0460c4666ec566fa Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:05:22 -0700
Subject: [PATCH 5/7] Update script.js
---
js/chat2/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/chat2/script.js b/js/chat2/script.js
index f3a1a24..97f4573 100644
--- a/js/chat2/script.js
+++ b/js/chat2/script.js
@@ -129,7 +129,7 @@ window.onload = function() {
// Event handler when open
conn.onopen = function(evt) {
- console.log("%c Connection established", "color: red");
+ console.log("%c Connection established", "color: lightgreen");
};
// Event handler for when the WebSocket connection is closed
conn.onclose = function(evt) {
From 80c3c88d3db649d58b8eaf312343ca033cbe67f4 Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:07:26 -0700
Subject: [PATCH 6/7] Update script.js
---
js/draw2/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/draw2/script.js b/js/draw2/script.js
index 4607d2e..6e2d7fe 100644
--- a/js/draw2/script.js
+++ b/js/draw2/script.js
@@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', function() {
let canvas = document.getElementsByClassName("whiteboard")[0];
let context = canvas.getContext("2d");
let ws = new WebSocket("wss://" + "draw2.bzmb.eu" + "/ws");
- let pick = document.getElementsByClassName("colorpicker")[0];
+ let pick = document.getElementsByClassName("colorpicker3")[0];
//let eraserButton = document.getElementById('eraser'); // Eraser
let wipeButton = document.getElementById('wipe'); // Wipe
var current = { color: 'black' };
From beba2d49da5300f64a078dedc083402a43abb1b5 Mon Sep 17 00:00:00 2001
From: script26 <97182340+script26@users.noreply.github.com>
Date: Tue, 6 May 2025 13:11:32 -0700
Subject: [PATCH 7/7] Update script.js
---
js/chat2/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/chat2/script.js b/js/chat2/script.js
index 97f4573..362dcfe 100644
--- a/js/chat2/script.js
+++ b/js/chat2/script.js
@@ -129,7 +129,7 @@ window.onload = function() {
// Event handler when open
conn.onopen = function(evt) {
- console.log("%c Connection established", "color: lightgreen");
+ console.log("%c Connection established to chat", "color: lightgreen");
};
// Event handler for when the WebSocket connection is closed
conn.onclose = function(evt) {