From b1a06039401da1197d599782b9bfe5c4203f2d4d Mon Sep 17 00:00:00 2001 From: maaa Date: Mon, 24 Jun 2024 21:42:46 +0200 Subject: [PATCH] remove mobile support --- static/js/main.js | 84 ----------------------------------------------- 1 file changed, 84 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 73e3fe5..aa0b7ef 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -72,90 +72,6 @@ let indiv = false let mobile = false let selectLatestNote = false -if (/Android|iPhone|iPod/i.test(navigator.userAgent)) { - mobile = true - noteBoxDiv.classList.add("mobile"); - noteBoxDiv.style.width = "0px"; - notesBar.style.width = "85%" - noteBoxDiv.readOnly = true - noteBox.style.fontSize = "18px" - noteBoxDiv.classList.add("hidden") - - - let touchstartX, touchstartY, touchendX, touchendY - - notesBar.addEventListener("touchstart", function (event) { - touchstartX = event.changedTouches[0].screenX; - touchstartY = event.changedTouches[0].screenY; - }, false); - - notesBar.addEventListener("touchend", function (event) { - touchendX = event.changedTouches[0].screenX; - touchendY = event.changedTouches[0].screenY; - if (touchendX < touchstartX - 75) { - handleGesture(); - } - }, false); - - noteBox.addEventListener("touchstart", function (event) { - touchstartX = event.changedTouches[0].screenX; - touchstartY = event.changedTouches[0].screenY; - }, false); - - noteBox.addEventListener("touchend", function (event) { - touchendX = event.changedTouches[0].screenX; - touchendY = event.changedTouches[0].screenY; - if (touchendX > touchstartX + 75) { - handleGesture(); - } else if (touchendX < touchstartX - 75) { - enableMarkdown(); - } - }, false); - - markdown.addEventListener("touchstart", function (event) { - touchstartX = event.changedTouches[0].screenX; - touchstartY = event.changedTouches[0].screenY; - }, false); - - markdown.addEventListener("touchend", function (event) { - touchendX = event.changedTouches[0].screenX; - touchendY = event.changedTouches[0].screenY; - if (touchendX > touchstartX + 75) { - disableMarkdown(); - } else if (touchendX < touchstartX - 75) { - disableMarkdown(); - } - }, false); -} - -function handleGesture() { - if (indiv) { - indiv = false - notesBar.style.width = "85%" - noteBoxDiv.style.width = "0px" - if (selectedNote !== 0) { - noteBoxDiv.readOnly = true - } - notesDiv.classList.remove("hidden") - noteBoxDiv.classList.add("hidden") - burgerButton.classList.remove("hidden") - backButton.classList.add("hidden") - newNote.classList.remove("hidden") - } else { - indiv = true - noteBoxDiv.style.width = "100%"; - notesBar.style.width = "0px" - if (selectedNote !== 0) { - noteBoxDiv.readOnly = false - } - notesDiv.classList.add("hidden") - noteBoxDiv.classList.remove("hidden") - burgerButton.classList.add("hidden") - backButton.classList.remove("hidden") - newNote.classList.add("hidden") - } -} - noteBox.value = "" noteBox.readOnly = true