summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-04-04 18:00:47 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-04-04 18:00:47 +0200
commitb99e22e2f180a8b3f0b3b0963874a96c93070690 (patch)
treeca10f3377569469f4ce40c359fda0ef18a0a2582
parenta79cf1bd000da84111ac839cfada1f8d867211fd (diff)
downloadchatroom-b99e22e2f180a8b3f0b3b0963874a96c93070690.tar.gz
chatroom-b99e22e2f180a8b3f0b3b0963874a96c93070690.tar.bz2
chatroom-b99e22e2f180a8b3f0b3b0963874a96c93070690.zip
Updated 5 files, deleted 40 files and renamed client/fragments/settings/about.html (automated)
-rw-r--r--.gitignore1
-rw-r--r--client/assets/icons2/about.svg1
-rw-r--r--client/assets/icons2/appearance.svg1
-rw-r--r--client/assets/icons2/back.svg1
-rw-r--r--client/assets/icons2/blocker.svg1
-rw-r--r--client/assets/icons2/chat.svg1
-rw-r--r--client/assets/icons2/dismiss.svg1
-rw-r--r--client/assets/icons2/experiments.svg1
-rw-r--r--client/assets/icons2/forward.svg1
-rw-r--r--client/assets/icons2/games.svg1
-rw-r--r--client/assets/icons2/home.svg1
-rw-r--r--client/assets/icons2/new.svg1
-rw-r--r--client/assets/icons2/newtab.svg1
-rw-r--r--client/assets/icons2/placeholder.svg1
-rw-r--r--client/assets/icons2/platform.svg1
-rw-r--r--client/assets/icons2/questions.svg1
-rw-r--r--client/assets/icons2/reload.svg1
-rw-r--r--client/assets/icons2/search.svg1
-rw-r--r--client/assets/icons2/security.svg1
-rw-r--r--client/assets/icons2/settings.svg1
-rw-r--r--client/assets/icons2/shield-off.svg1
-rw-r--r--client/assets/icons2/shield-on.svg1
-rw-r--r--client/assets/icons2/soon.svg1
-rw-r--r--client/assets/icons2/spyglass.svg1
-rw-r--r--client/assets/icons2/stop.svg1
-rw-r--r--client/assets/icons2/system.svg1
-rw-r--r--client/assets/icons2/vpn-off.svg1
-rw-r--r--client/assets/icons2/vpn-on.svg1
-rw-r--r--client/dom/index.html29
-rw-r--r--client/dom/new.html490
-rw-r--r--client/fragments/about.html (renamed from client/fragments/settings/about.html)18
-rw-r--r--client/fragments/home.html23
-rw-r--r--client/fragments/questions.html57
-rw-r--r--client/fragments/settings.html151
-rw-r--r--client/fragments/settings/appearance.html20
-rw-r--r--client/fragments/settings/blocking.html20
-rw-r--r--client/fragments/settings/experiments.html102
-rw-r--r--client/fragments/settings/platform.html20
-rw-r--r--client/fragments/settings/search.html20
-rw-r--r--client/fragments/settings/security.html20
-rw-r--r--client/fragments/settings/spyglass.html20
-rw-r--r--client/fragments/settings/system.html20
-rw-r--r--client/fragments/soon.html69
-rwxr-xr-xclient/main.js67
-rw-r--r--client/src/spyglass.js12
-rw-r--r--server/platforms.js75
46 files changed, 82 insertions, 1179 deletions
diff --git a/.gitignore b/.gitignore
index 59fcf91..6e0f567 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,3 @@ bot/tokens.json
vpn/keys.json
vpn/requests.json
server/data
-server/secrets.json
diff --git a/client/assets/icons2/about.svg b/client/assets/icons2/about.svg
deleted file mode 100644
index 05606f4..0000000
--- a/client/assets/icons2/about.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/appearance.svg b/client/assets/icons2/appearance.svg
deleted file mode 100644
index 315fc5c..0000000
--- a/client/assets/icons2/appearance.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 32.5-156t88-127Q256-817 330-848.5T488-880q80 0 151 27.5t124.5 76q53.5 48.5 85 115T880-518q0 115-70 176.5T640-280h-74q-9 0-12.5 5t-3.5 11q0 12 15 34.5t15 51.5q0 50-27.5 74T480-80Zm0-400Zm-220 40q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm120-160q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm200 0q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm120 160q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17ZM480-160q9 0 14.5-5t5.5-13q0-14-15-33t-15-57q0-42 29-67t71-25h70q66 0 113-38.5T800-518q0-121-92.5-201.5T488-800q-136 0-232 93t-96 227q0 133 93.5 226.5T480-160Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/back.svg b/client/assets/icons2/back.svg
deleted file mode 100644
index cba0c8b..0000000
--- a/client/assets/icons2/back.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/blocker.svg b/client/assets/icons2/blocker.svg
deleted file mode 100644
index 20e9889..0000000
--- a/client/assets/icons2/blocker.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q54 0 104-17.5t92-50.5L228-676q-33 42-50.5 92T160-480q0 134 93 227t227 93Zm252-124q33-42 50.5-92T800-480q0-134-93-227t-227-93q-54 0-104 17.5T284-732l448 448Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/chat.svg b/client/assets/icons2/chat.svg
deleted file mode 100644
index 4d910a8..0000000
--- a/client/assets/icons2/chat.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-400h320v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/dismiss.svg b/client/assets/icons2/dismiss.svg
deleted file mode 100644
index 5a60c58..0000000
--- a/client/assets/icons2/dismiss.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/experiments.svg b/client/assets/icons2/experiments.svg
deleted file mode 100644
index 8ef5c55..0000000
--- a/client/assets/icons2/experiments.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-240 80-480l240-240 57 57-184 184 183 183-56 56Zm320 0-57-57 184-184-183-183 56-56 240 240-240 240Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/forward.svg b/client/assets/icons2/forward.svg
deleted file mode 100644
index 99a89fd..0000000
--- a/client/assets/icons2/forward.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/games.svg b/client/assets/icons2/games.svg
deleted file mode 100644
index 17aa118..0000000
--- a/client/assets/icons2/games.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M300-240q25 0 42.5-17.5T360-300q0-25-17.5-42.5T300-360q-25 0-42.5 17.5T240-300q0 25 17.5 42.5T300-240Zm0-360q25 0 42.5-17.5T360-660q0-25-17.5-42.5T300-720q-25 0-42.5 17.5T240-660q0 25 17.5 42.5T300-600Zm180 180q25 0 42.5-17.5T540-480q0-25-17.5-42.5T480-540q-25 0-42.5 17.5T420-480q0 25 17.5 42.5T480-420Zm180 180q25 0 42.5-17.5T720-300q0-25-17.5-42.5T660-360q-25 0-42.5 17.5T600-300q0 25 17.5 42.5T660-240Zm0-360q25 0 42.5-17.5T720-660q0-25-17.5-42.5T660-720q-25 0-42.5 17.5T600-660q0 25 17.5 42.5T660-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/home.svg b/client/assets/icons2/home.svg
deleted file mode 100644
index d700dde..0000000
--- a/client/assets/icons2/home.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/new.svg b/client/assets/icons2/new.svg
deleted file mode 100644
index f8bc930..0000000
--- a/client/assets/icons2/new.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/newtab.svg b/client/assets/icons2/newtab.svg
deleted file mode 100644
index d700dde..0000000
--- a/client/assets/icons2/newtab.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/placeholder.svg b/client/assets/icons2/placeholder.svg
deleted file mode 100644
index 3af2272..0000000
--- a/client/assets/icons2/placeholder.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q83 0 155.5 31.5t127 86q54.5 54.5 86 127T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Zm0-82q26-36 45-75t31-83H404q12 44 31 83t45 75Zm-104-16q-18-33-31.5-68.5T322-320H204q29 50 72.5 87t99.5 55Zm208 0q56-18 99.5-55t72.5-87H638q-9 38-22.5 73.5T584-178ZM170-400h136q-3-20-4.5-39.5T300-480q0-21 1.5-40.5T306-560H170q-5 20-7.5 39.5T160-480q0 21 2.5 40.5T170-400Zm216 0h188q3-20 4.5-39.5T580-480q0-21-1.5-40.5T574-560H386q-3 20-4.5 39.5T380-480q0 21 1.5 40.5T386-400Zm268 0h136q5-20 7.5-39.5T800-480q0-21-2.5-40.5T790-560H654q3 20 4.5 39.5T660-480q0 21-1.5 40.5T654-400Zm-16-240h118q-29-50-72.5-87T584-782q18 33 31.5 68.5T638-640Zm-234 0h152q-12-44-31-83t-45-75q-26 36-45 75t-31 83Zm-200 0h118q9-38 22.5-73.5T376-782q-56 18-99.5 55T204-640Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/platform.svg b/client/assets/icons2/platform.svg
deleted file mode 100644
index 14e3462..0000000
--- a/client/assets/icons2/platform.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-120 200-272v-240L40-600l440-240 440 240v320h-80v-276l-80 44v240L480-120Zm0-332 274-148-274-148-274 148 274 148Zm0 241 200-108v-151L480-360 280-470v151l200 108Zm0-241Zm0 90Zm0 0Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/questions.svg b/client/assets/icons2/questions.svg
deleted file mode 100644
index ebe64e3..0000000
--- a/client/assets/icons2/questions.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M80-40v-80h800v80H80Zm80-120v-240q-33-54-51-114.5T91-638q0-61 15.5-120T143-874q8-21 26-33.5t40-12.5q31 0 53 21t18 50l-11 91q-6 48 8.5 91t43.5 75.5q29 32.5 70 52t89 19.5q60 0 120.5 12.5T706-472q45 23 69.5 58.5T800-326v166H160Zm80-80h480v-86q0-24-12-42.5T674-398q-41-20-95-31t-99-11q-66 0-122.5-27t-96-72.5Q222-585 202-644.5T190-768q-10 30-14.5 64t-4.5 66q0 58 20.5 111.5T240-422v182Zm240-320q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47Zm0-80q33 0 56.5-23.5T560-720q0-33-23.5-56.5T480-800q-33 0-56.5 23.5T400-720q0 33 23.5 56.5T480-640ZM320-160v-37q0-67 46.5-115T480-360h160v80H480q-34 0-57 24.5T400-197v37h-80Zm160-80Zm0-480Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/reload.svg b/client/assets/icons2/reload.svg
deleted file mode 100644
index a7a6bc8..0000000
--- a/client/assets/icons2/reload.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/search.svg b/client/assets/icons2/search.svg
deleted file mode 100644
index ef0d052..0000000
--- a/client/assets/icons2/search.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/security.svg b/client/assets/icons2/security.svg
deleted file mode 100644
index 20b9e39..0000000
--- a/client/assets/icons2/security.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/settings.svg b/client/assets/icons2/settings.svg
deleted file mode 100644
index 817c782..0000000
--- a/client/assets/icons2/settings.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/shield-off.svg b/client/assets/icons2/shield-off.svg
deleted file mode 100644
index 035e3f0..0000000
--- a/client/assets/icons2/shield-off.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m754-318-60-62q12-32 19-66.5t7-69.5v-189l-240-90-146 55-62-62 208-78 320 120v244q0 51-11.5 101T754-318Zm38 262L662-186q-38 39-84.5 65.5T480-80q-139-35-229.5-159.5T160-516v-172L56-792l56-56 736 736-56 56ZM423-425Zm91-135Zm-34 396q35-11 67-31t59-47L240-608v92q0 121 68 220t172 132Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/shield-on.svg b/client/assets/icons2/shield-on.svg
deleted file mode 100644
index e313e5a..0000000
--- a/client/assets/icons2/shield-on.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/soon.svg b/client/assets/icons2/soon.svg
deleted file mode 100644
index a57a454..0000000
--- a/client/assets/icons2/soon.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m344-60-76-128-144-32 14-148-98-112 98-112-14-148 144-32 76-128 136 58 136-58 76 128 144 32-14 148 98 112-98 112 14 148-144 32-76 128-136-58-136 58Zm34-102 102-44 104 44 56-96 110-26-10-112 74-84-74-86 10-112-110-24-58-96-102 44-104-44-56 96-110 24 10 112-74 86 74 84-10 114 110 24 58 96Zm102-318Zm-42 142 226-226-56-58-170 170-86-84-56 56 142 142Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/spyglass.svg b/client/assets/icons2/spyglass.svg
deleted file mode 100644
index 5f40f96..0000000
--- a/client/assets/icons2/spyglass.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880h40v331q18 11 29 28.5t11 40.5q0 33-23.5 56.5T480-400q-33 0-56.5-23.5T400-480q0-23 11-41t29-28v-86q-52 14-86 56.5T320-480q0 66 47 113t113 47q66 0 113-47t47-113q0-36-14.5-66.5T586-600l57-57q35 33 56 78.5t21 98.5q0 100-70 170t-170 70q-100 0-170-70t-70-170q0-90 57-156.5T440-717v-81q-119 15-199.5 105T160-480q0 134 93 227t227 93q134 0 227-93t93-227q0-69-27-129t-74-104l57-57q57 55 90.5 129.5T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/stop.svg b/client/assets/icons2/stop.svg
deleted file mode 100644
index 5a60c58..0000000
--- a/client/assets/icons2/stop.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/system.svg b/client/assets/icons2/system.svg
deleted file mode 100644
index b21bc6f..0000000
--- a/client/assets/icons2/system.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M686-132 444-376q-20 8-40.5 12t-43.5 4q-100 0-170-70t-70-170q0-36 10-68.5t28-61.5l146 146 72-72-146-146q29-18 61.5-28t68.5-10q100 0 170 70t70 170q0 23-4 43.5T584-516l244 242q12 12 12 29t-12 29l-84 84q-12 12-29 12t-29-12Zm29-85 27-27-256-256q18-20 26-46.5t8-53.5q0-60-38.5-104.5T386-758l74 74q12 12 12 28t-12 28L332-500q-12 12-28 12t-28-12l-74-74q9 57 53.5 95.5T360-440q26 0 52-8t47-25l256 256ZM472-488Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/vpn-off.svg b/client/assets/icons2/vpn-off.svg
deleted file mode 100644
index 824c70b..0000000
--- a/client/assets/icons2/vpn-off.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-640h360v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85h-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640Zm0 480h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM240-160v-400 400Z"/></svg> \ No newline at end of file
diff --git a/client/assets/icons2/vpn-on.svg b/client/assets/icons2/vpn-on.svg
deleted file mode 100644
index 20b9e39..0000000
--- a/client/assets/icons2/vpn-on.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z"/></svg> \ No newline at end of file
diff --git a/client/dom/index.html b/client/dom/index.html
index e0a9f5a..a1ddcc6 100644
--- a/client/dom/index.html
+++ b/client/dom/index.html
@@ -1,13 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <script>
- if (localStorage.getItem("cr3-trial-m3uiredesign") === "true") {
- location.href = "./new.html";
- }
-
- require('electron').ipcRenderer.send("new-ui-off");
- </script>
<meta charset="UTF-8">
<title>Chatroom Workspace</title>
<link href="../assets/bootstrap/bs.css" rel="stylesheet">
@@ -181,8 +174,6 @@
<a class="nav-link" aria-current="page" href="#" onclick="openHome();"><img alt="" src="../assets/icons/new.svg"></a>
</li></span><span><li class="nav-item" style="width: max-content; display: inline-block;">
<a class="nav-link" aria-current="page" href="#" onclick="toggleProtection();"><img id="ad-protection-img" alt="" src="../assets/icons/${window.protectionEnabled ? 'shield-on' : 'shield-off'}.svg"></a>
- </li><li class="nav-item" style="width: max-content; display: inline-block;">
- <a class="nav-link" aria-current="page" href="#" onclick="openAbout();"><img alt="" src="../assets/icons/about.svg"></a>
</li></span></div>`;
if (tabs[window.activeTab]) document.title = tabs[window.activeTab].name + " · Chatroom Workspace";
@@ -192,10 +183,6 @@
let lastTabHeightUpdateCount = tabs.length;
- function openAbout() {
- if (!sgc()) return;
- ipcRenderer.send("about");
- }
function secureTabHeight(force) {
if (!sgc()) return;
@@ -287,7 +274,7 @@
}
}
- function openTab(url, focusSearchBar, pinned) {
+ function openTab(url, focusSearchBar, pinned/* # M3 backport # */, unisolated/* # */) {
if (!sgc()) return;
let container = document.createElement("div");
let webview = document.createElement("webview");
@@ -332,7 +319,12 @@
webview.id = "wv-item-" + tab.id + "-inner";
container.id = "wv-item-" + tab.id;
container.classList.add("wv-container");
- webview.setAttribute("allowpopups", ""); // # M3 backport #
+ // # M3 backport #
+ webview.setAttribute("allowpopups", "");
+ if (unisolated) webview.setAttribute("nodeintegration", "");
+ if (unisolated) webview.setAttribute("nodeintegrationinsubframes", "");
+ if (unisolated) webview.setAttribute("webpreferences", "contextIsolation=false");
+ // # ----------- #
webview.addEventListener('devtools-open-url', (e) => {
openTab(e.url);
});
@@ -504,7 +496,8 @@
window.addEventListener('load', () => {
if (!sgc()) return;
- openTab("https://school.equestria.dev");
+ openTab("https://school.equestria.dev", false, true);
+ openTab("../fragments/about.html", false, true, true);
openHome();
tabs[0].fixed = false;
@@ -534,6 +527,10 @@
function focusAddressBar() {
window.tabs[window.activeTab].webview.querySelector('[id$="-bar-address"]').focus();
}
+
+ function focusAbout() {
+ switchToTab(1);
+ }
</script>
<div id="loading-modal" class="modal modal-lg" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
diff --git a/client/dom/new.html b/client/dom/new.html
deleted file mode 100644
index 76d478c..0000000
--- a/client/dom/new.html
+++ /dev/null
@@ -1,490 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <script>
- if (localStorage.getItem("cr3-trial-m3uiredesign") !== "true") {
- location.href = "./index.html";
- }
-
- require('electron').ipcRenderer.send("new-ui-on");
- </script>
- <meta charset="UTF-8">
- <title>Chatroom</title>
- <script src="../src/spyglass.js"></script>
- <script src="../src/platforms.js"></script>
- <style>
- html, body {
- margin: 0;
- background-color: #fff;
- }
-
- .address-bar-outer.active .address-bar-display {
- display: none;
- }
-
- .address-bar-outer.active .address-bar-text {
- display: block !important;
- }
-
- .address-bar-outer.active {
- box-shadow: 0 0 0 5px rgba(0, 134, 175, .5);
- }
-
- * {
- -webkit-user-drag: none;
- user-select: none;
- font-family: -apple-system, system-ui, '.AppleSystemUIFont', sans-serif;
- }
-
- .wv-container {
- display: none;
- }
-
- .wv-container.open {
- height: 100%;
- width: 100%;
- display: block;
- }
-
- .wv-container.open webview {
- display: flex;
- width: calc(100% - 42px);
- height: 100%;
- margin-left: 42px;
- }
-
- .wv-container.no-bar .bar * {
- display: none !important;
- }
-
- html, body, #windows {
- height: calc(100% - 14px);
- }
-
- .nav-item, .nav-item * {
- -webkit-app-region: no-drag;
- }
-
- .nav-item {
- width: 38px;
- height: 38px;
- margin: 2px !important;
- display: block;
- border-radius: 5px;
- }
-
- .nav-item:hover {
- background-color: rgba(0, 0, 0, .05);
- }
-
- .nav-item:active, .nav-item:has(.nav-link.active) {
- background-color: rgba(0, 0, 0, .1);
- }
-
- .nav-link {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 38px;
- height: 38px;
- }
-
- .nav-link img {
- width: 24px !important;
- height: 24px !important;
- }
-
- .bar {
- background-color: #eee;
- height: 42px !important;
- }
- </style>
-</head>
-<body style="overflow: hidden;">
- <div style="position: fixed; top: 0; left: 42px; width: 1px; height: 42px; background-color: #eee; z-index: 999;"></div>
- <ul id="tabs" class="nav nav-tabs" style="border-right: 1px solid rgba(0, 0, 0, .1); margin: 0 !important; padding: 0 !important; background-color: #eee; -webkit-app-region: drag; position: fixed; top: 0; bottom: 0; left: 0; width: 42px;"></ul>
- <script>
- document.getElementById("tabs").style.paddingTop = "43px";
- </script>
- <div id="windows" style="display: flex;"></div>
-
- <script>
- const ipcRenderer = require('electron').ipcRenderer;
-
- window.tabs = [];
- window.activeTab = -1;
- window.protectionEnabled = localStorage.getItem("protection-status") !== "false";
- refreshInternalProtection();
-
- function toggleProtection() {
- window.protectionEnabled = !window.protectionEnabled;
- localStorage.setItem("protection-status", JSON.stringify(window.protectionEnabled));
- refreshInternalProtection();
- refreshTabBar();
- }
-
- function refreshInternalProtection() {
- if (window.protectionEnabled) {
- ipcRenderer.send("enable-protection");
- } else {
- ipcRenderer.send("disable-protection");
- }
- }
-
- function refreshTabBar() {
- let id = window.activeTab;
-
- if (id > -1) {
- Array.from(document.getElementById("windows").children).map((i) => {
- i.classList.remove("open");
- });
-
- tabs[id].webview.classList.add("open");
- }
-
- document.getElementById("tabs").innerHTML = `<div style="display: grid; grid-template-rows: 1fr max-content; height: 100%;"><span>` + window.tabs.map((i, j) => { i['_i'] = j; return i; }).filter(i => i.small).map((i) => `
- <li class="nav-item pinned" title="${i['name'].replaceAll("&", "&amp;").replaceAll('"', '&quot;')}">
- <a class="nav-link ${i['_i'] === window.activeTab ? 'active' : ''}" aria-current="page" href="#" onclick="if (event.target.classList.contains('nav-link')) switchToTab(${i['_i']});"><img onerror="event.target.src = '../assets/icons2/placeholder.svg';" style="width: 24px; height: 24px; pointer-events: none;" alt="" src="${i.icon}"></a>
- </li>
- `).join("") + `<div style="border-bottom: 1px solid rgba(0, 0, 0, .1);"></div>` + window.tabs.map((i, j) => { i['_i'] = j; return i; }).filter(i => !i.small).map((i) => `
- <li class="nav-item" title="${i['name'].replaceAll("&", "&amp;").replaceAll('"', '&quot;')}">
- <a class="nav-link ${i['_i'] === window.activeTab ? 'active' : ''}" aria-current="page" href="#" onclick="if (event.target.classList.contains('nav-link')) switchToTab(${i['_i']});"><img onerror="event.target.src = '../assets/icons2/placeholder.svg';" style="width: 24px; height: 24px; pointer-events: none;" alt="" src="${i.icon}"><span class="tab-close" style="position: absolute; display: none;" onclick="event.preventDefault(); closeTab(${i['_i']});"><img alt="" src="../assets/icons2/dismiss.svg"></span></a>
- </li>
- `).join("") + `<li class="nav-item" title="New tab">
- <a class="nav-link" aria-current="page" href="#" onclick="openHome();"><img alt="" src="../assets/icons2/new.svg"></a>
- </li></span><span><li class="nav-item" title="Toggle ad and tracking protection">
- <a class="nav-link" aria-current="page" href="#" onclick="toggleProtection();"><img id="ad-protection-img" alt="" src="../assets/icons2/${window.protectionEnabled ? 'shield-on' : 'shield-off'}.svg"></a>
- </li><li class="nav-item" title="About Chatroom">
- <a class="nav-link" aria-current="page" href="#" onclick="openAbout();"><img alt="" src="../assets/icons2/about.svg"></a>
- </li></span></div>`;
-
- if (tabs[window.activeTab]) document.title = tabs[window.activeTab].name + " · Chatroom";
-
- secureTabHeight();
- }
-
- function openAbout() {
- let tab = tabs.find(i => i.fixed && i.url.endsWith("/settings.html"));
- switchToTab(window.tabs.indexOf(tab));
- tab.webview.children[1].executeJavaScript("location.hash = '#about';");
- }
-
- function secureTabHeight(force) {}
-
- window.onresize = () => {
- secureTabHeight(true);
- }
-
- function reloadWebview(force) {
- if (force) {
- tabs[activeTab].webview.children[1].reloadIgnoringCache();
- } else {
- tabs[activeTab].webview.children[1].reload();
- }
- }
-
- function loadURL(id) {
- let query = document.getElementById("wv-item-" + id + "-bar-address").value;
-
- try {
- new URL(query);
- document.getElementById("wv-item-" + id + "-inner").loadURL(query);
- } catch (e) {
- document.getElementById("wv-item-" + id + "-inner").loadURL("https://duckduckgo.com/?q=" + encodeURIComponent(query));
- }
- }
-
- function resetURL(id) {
- if (document.getElementById("wv-item-" + id + "-inner").getURL().startsWith("file://") && document.getElementById("wv-item-" + id + "-inner").getURL().endsWith("/fragments/home.html")) {
- document.getElementById("wv-item-" + id + "-bar-address").value = "";
- } else {
- document.getElementById("wv-item-" + id + "-bar-address").value = document.getElementById("wv-item-" + id + "-inner").getURL();
- }
- }
-
- function openTab(url, focusSearchBar, pinned, ignoreRefresh, unisolated) {
- let container = document.createElement("div");
- let webview = document.createElement("webview");
-
- let tab = {
- icon: "../assets/icons2/placeholder.svg",
- name: "Home",
- url,
- fixed: null,
- webview: container,
- id: crypto.randomUUID(),
- small: url.includes("school.equestria.dev") || pinned
- }
-
- if (url.includes("school.equestria.dev") || pinned) {
- container.classList.add("no-bar");
- }
-
- let bar = document.createElement("div");
- bar.id = "wv-item-" + tab.id + "-bar";
- bar.style.height = "47px";
- bar.style.borderBottom = "1px solid rgba(0, 0, 0, .1)";
- bar.style.paddingLeft = bar.style.paddingRight = "3vw";
- bar.style.display = "grid";
- bar.style.webkitAppRegion = "drag";
- bar.style.gridTemplateColumns = "1fr max-content 1fr";
- bar.classList.add("bar");
- bar.innerHTML = `
- <div style="${process.platform === 'darwin' ? 'margin-left: 86px;' : ''}">
- <a style="-webkit-app-region: no-drag;"><img id="wv-item-${tab.id}-bar-back" src="../assets/icons2/back.svg" alt="Back" title="Back" style="-webkit-app-region: no-drag; width: 24px; height: 24px; margin: 12px; cursor: pointer;" onclick="goBack('${tab.id}');"></a>
- <a style="-webkit-app-region: no-drag;"><img id="wv-item-${tab.id}-bar-forward" src="../assets/icons2/forward.svg" alt="Forward" title="Forward" style="-webkit-app-region: no-drag; width: 24px; height: 24px; margin: 12px; cursor: pointer;" onclick="goForward('${tab.id}');"></a>
- <a style="-webkit-app-region: no-drag;"><img id="wv-item-${tab.id}-bar-reload" src="../assets/icons2/reload.svg" alt="Refresh" title="Refresh" style="-webkit-app-region: no-drag; width: 24px; height: 24px; margin: 12px; cursor: pointer;" onclick="reloadTab('${tab.id}');"></a>
- </div>
- <div>
- <div onclick="focusBar('${tab.id}');" id="wv-item-${tab.id}-bar-outer" class="address-bar-outer" style="-webkit-app-region: no-drag; margin-top: 10px; width: 100vw; max-width: 500px; background-color: #fff; border: 1px solid rgba(0, 0, 0, .1); border-radius: 5px; padding: 2px 5px;">
- <input onblur="unfocusBar('${tab.id}');" class="address-bar-text" onchange="resetURL('${tab.id}');" id="wv-item-${tab.id}-bar-address" type="text" class="form-control" style="position: relative; top: -1px; font-size: 14px; padding: 0; height: 18px; display: none; background: none; border: none; width: 100%; outline: none;" placeholder="Search with DuckDuckGo or enter address">
- <div style="white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis; height: 18px; text-align: center; cursor: text;font-size: 14px;" class="address-bar-display" id="wv-item-${tab.id}-bar-display"><span style="opacity: .5;">Search with DuckDuckGo or enter address</span></div>
- </div>
- </div>
- <div style="text-align: right;${process.platform === 'win32' ? 'margin-right: 140px;' : ''}"></div>
- `.replaceAll("\n", "");
- container.append(bar);
-
- webview.src = url;
- webview.preload = "../src/plugin.js";
- webview.id = "wv-item-" + tab.id + "-inner";
- container.id = "wv-item-" + tab.id;
- container.classList.add("wv-container");
- webview.setAttribute("allowpopups", "");
- if (unisolated) webview.setAttribute("nodeintegration", "");
- if (unisolated) webview.setAttribute("nodeintegrationinsubframes", "");
- if (unisolated) webview.setAttribute("webpreferences", "contextIsolation=false");
- webview.addEventListener('devtools-open-url', (e) => {
- openTab(e.url);
- });
- webview.addEventListener('close', () => {
- closeTab(tabs.map((i, j) => [i, j]).filter(i => i[0].id === tab.id)[0][1]);
- });
- webview.addEventListener('page-title-updated', (e) => {
- if (webview.getURL().startsWith("https://school.equestria.dev/")) {
- tab.name = "Chat";
- } else {
- tab.name = e.title;
- }
-
- refreshTabBar();
- });
- webview.addEventListener('context-menu', (e) => {
- ipcRenderer.send('menu', e.params);
- });
- webview.addEventListener('page-favicon-updated', (e) => {
- if (webview.getURL().startsWith("https://school.equestria.dev/")) {
- tab.icon = "../assets/icons2/chat.svg";
- } else {
- tab.icon = e.favicons[0] ?? "../assets/icons2/placeholder.svg";
- }
-
- refreshTabBar();
- });
- webview.addEventListener('will-navigate', (e) => {
- document.getElementById("wv-item-" + tab.id + "-bar-address").value = e.url;
- document.getElementById("wv-item-" + tab.id + "-bar-display").innerHTML = fancyValue(e.url);
- document.getElementById("wv-item-" + tab.id + "-bar-reload").src = "../assets/icons2/stop.svg";
- });
- webview.addEventListener('did-navigate', (e) => {
- document.getElementById("wv-item-" + tab.id + "-bar-display").innerHTML = fancyValue(e.url);
- document.getElementById("wv-item-" + tab.id + "-bar-reload").src = "../assets/icons2/reload.svg";
- resetURL(tab.id);
- });
- webview.addEventListener('did-navigate-in-page', () => {
- resetURL(tab.id);
- });
- webview.addEventListener('did-finish-load', () => {
- resetURL(tab.id);
- });
- webview.addEventListener('did-fail-load', () => {
- resetURL(tab.id);
- });
-
- container.append(webview);
- document.getElementById("windows").insertAdjacentElement("beforeend", container);
-
- document.getElementById('wv-item-' + tab.id + '-bar-address').onkeydown = (e) => {
- if (e.code === "Return" || e.code === "Enter") {
- loadURL(tab.id);
- unfocusBar(tab.id);
- }
- }
-
- tabs.push(tab);
- console.log(tabs);
-
- if (!ignoreRefresh) refreshTabBar();
- switchToTab(tabs.length - 1);
-
- if (focusSearchBar) {
- focusBar(tab.id);
- }
- }
-
- function switchToTab(id) {
- try {
- tabs.find(i => i.fixed && i.url.endsWith("/settings.html")).webview.children[1].executeJavaScript("location.hash = '#search';");
- } catch (e) {}
-
- window.activeTab = id;
- refreshTabBar();
-
- if (!tabs[id].fixed && tabs[id].small) {
- tabs[id].webview.children[1].style.height = "0";
-
- setTimeout(() => {
- tabs[id].webview.children[1].style.height = "100%";
- }, 100);
-
- tabs[id].fixed = true;
- }
- }
-
- function reloadTab(id) {
- if (document.getElementById("wv-item-" + id + "-bar-reload").src.endsWith("/stop.svg")) {
- document.getElementById("wv-item-" + id + "-inner").stop();
- } else {
- document.getElementById("wv-item-" + id + "-inner").loadURL(document.getElementById("wv-item-" + id + "-inner").getURL());
- }
- }
-
- function goBack(id) {
- document.getElementById("wv-item-" + id + "-inner").goBack();
- }
-
- function goForward(id) {
- document.getElementById("wv-item-" + id + "-inner").goForward();
- }
-
- function openHome(ignoreRefresh) {
- openTab("../fragments/home.html", true, false, false, ignoreRefresh);
- }
-
- function closeTab(id) {
- if (tabs[id]['small']) return;
-
- if (id === window.activeTab) {
- closeCurrentTab();
- return;
- } else if (window.activeTab > id) {
- window.activeTab--;
- }
-
- document.getElementById("wv-item-" + tabs[id].id).outerHTML = "";
- console.log("AAA");
- window.tabs = tabs.filter((i, j) => j !== id);
-
- refreshTabBar();
- }
-
- function closeCurrentTab() {
- if (tabs[window.activeTab]['small']) return;
-
- let oldActiveTab = window.activeTab;
- let newActiveTab = window.activeTab;
-
- if (tabs.length === 1) {
- window.close();
- return;
- } else if (newActiveTab === tabs.length - 1) {
- newActiveTab--;
- }
-
- document.getElementById("wv-item-" + tabs[oldActiveTab].id).outerHTML = "";
- console.log("BBBB");
- window.tabs = tabs.filter((i, j) => j !== oldActiveTab);
-
- switchToTab(newActiveTab);
- }
-
- function switchRight() {
- if (tabs[window.activeTab + 1]) {
- switchToTab(window.activeTab + 1);
- } else {
- switchToTab(0);
- }
- }
-
- function switchLeft() {
- if (tabs[window.activeTab - 1]) {
- switchToTab(window.activeTab - 1);
- } else {
- switchToTab(tabs.length - 1);
- }
- }
-
- function openDevTools() {
- if (tabs[window.activeTab].webview.children[1].isDevToolsOpened()) {
- tabs[window.activeTab].webview.children[1].closeDevTools();
- } else {
- tabs[window.activeTab].webview.children[1].openDevTools();
- }
- }
-
- window.addEventListener('load', () => {
- openTab("../fragments/settings.html", false, true, false, true);
- openTab("https://school.equestria.dev");
- openTab("../fragments/questions.html", false, true, false, true);
-
- openHome();
- tabs[0].fixed = false;
-
- if (localStorage.getItem("experiments-temp")) {
- localStorage.removeItem("experiments-temp");
- switchToTab(1);
- }
-
- window.isNewUI = true;
- if (startSpyglass) startSpyglass();
- startPlatforms();
- });
-
- async function getToken() {
- let token;
-
- try {
- token = await tabs.filter(i => i.small)[1].webview.children[1].executeJavaScript("matrixChat.stores.client.http.opts.accessToken");
- } catch (e) {
- token = null;
- }
-
- ipcRenderer.send("3pid-token", token);
- return token;
- }
-
- function focusAddressBar() {
- window.tabs[window.activeTab].webview.querySelector('[id$="-bar-address"]').focus();
- focusBar(window.tabs[window.activeTab].id);
- }
-
- function focusBar(id) {
- document.getElementById("wv-item-" + id + "-bar-outer").classList.add("active");
- document.getElementById("wv-item-" + id + "-bar-address").focus();
- document.getElementById("wv-item-" + id + "-bar-address").select();
- }
-
- function unfocusBar(id) {
- document.getElementById("wv-item-" + id + "-bar-outer").classList.remove("active");
- document.getElementById("wv-item-" + id + "-bar-address").blur();
- }
-
- function fancyValue(url) {
- if (url.endsWith("home.html") && new URL(url).protocol === "file:") {
- return `<span style="opacity: .5;">Search with DuckDuckGo or enter address</span>`;
- } else if (new URL(url).protocol === "http:") {
- return `<span style="color: rgba(155,58,58,0.75);">Not secure</span> — ${new URL(url).host}`;
- } else if (new URL(url).protocol === "file:") {
- return `<span style="color: rgba(74,162,74,0.75);">Local</span> — ${decodeURI(new URL(url).pathname)}`;
- } else if (new URL(url).hostname === "equestria.dev"
- || new URL(url).hostname.endsWith(".equestria.dev")
- || new URL(url).hostname === "pone.eu.org"
- || new URL(url).hostname.endsWith(".pone.eu.org")) {
- return `<span style="color: rgba(61,90,203,0.75);">Equestria.dev</span> — ${new URL(url).host}`;
- }
-
- return new URL(url).host;
- }
- </script>
-</body>
-</html>
diff --git a/client/fragments/settings/about.html b/client/fragments/about.html
index 1e104a3..156beb0 100644
--- a/client/fragments/settings/about.html
+++ b/client/fragments/about.html
@@ -9,17 +9,29 @@
user-select: none;
-webkit-user-drag: none;
}
+
+ @media (prefers-color-scheme: dark) {
+ main {
+ filter: invert(1) hue-rotate(180deg);
+ background-color: #ddd !important;
+ }
+
+ img {
+ filter: invert(1) hue-rotate(180deg);
+ }
+ }
</style>
+ <link rel="icon" href="../assets/icons/about.svg">
</head>
<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
+<main style="background-color: #fff; position: fixed; inset: 0; padding: 20px; overflow: auto;">
<h4 style="margin-top: 0; margin-bottom: 10px;">About Chatroom</h4>
<div style="display: grid; grid-template-columns: 38px 1fr; grid-gap: 10px;">
- <img src="../../assets/icon.png" alt="" style="width: 38px; height: 38px;">
+ <img src="../assets/icon.png" alt="" style="width: 38px; height: 38px;">
<div style="display: flex; align-items: center;">
<div>
- <div><b>Chatroom 3</b> "Heeler"</div>
+ <div><b>Chatroom 2</b> "Blep"</div>
<div style="opacity: .5;">Version <span id="version"></span> (<span id="platform"></span>, <span id="arch"></span>)</div>
</div>
</div>
diff --git a/client/fragments/home.html b/client/fragments/home.html
index 7941d68..160ba1d 100644
--- a/client/fragments/home.html
+++ b/client/fragments/home.html
@@ -41,10 +41,13 @@
<div class="container" style="margin-top: 50px; margin-bottom: 50px;">
<hr style="margin-bottom: 30px;">
+ <h3>Chatroom is being shut down in June 2024</h3>
+ <p>Starting in June 2024, we will discontinue and shut down all the Chatroom services. If you have important data or messages you need to export or backup, please use the corresponding Chatroom features before June 2024 to ensure you keep access to your data. <b>Equestria.dev makes no guarantee whatsoever that data will remain accessible past this date.</b></p>
+
<h3>What's new in Chatroom?</h3>
<div id="m3-changelog" style="display: none;">
- <h5>Chatroom Codename "Heeler" (Developer Preview 3)</h5>
+ <h5>Chatroom Codename "Heeler" (Developer Preview 3, Developer Preview 3 Revision 1)</h5>
<p>Welcome to the third Developer Preview release of Chatroom 3. We are slowly bringing new features as we initially planned.</p>
<ul>
<li>The new UI gets a new "Questions" tab, where you can use the power of online knowledge to instantly ask any questions and get verified answers. Powered by Wolfram Alpha.</li>
@@ -63,11 +66,19 @@
<li>The <code>Chatroom3PID</code> API is now deprecated (replaced with <code>chatroom.thirdPartyAuth</code>) and will be removed on release (the <code>removelegacyapis</code> experiment removes them now).</li>
</ul>
</div>
- <script>
- if (localStorage.getItem("cr3-trial-experimentschangelog") === "true") {
- document.getElementById("m3-changelog").style.display = "";
- }
- </script>
+
+ <h5>Chatroom 2.9.4 "Blep"</h5>
+ <p>Chatroom 3 has now been abandoned. We will bring a few features from Chatroom 3 to Chatroom 2, but Chatroom 3 is now unavailable.</p>
+ <ul>
+ <li>
+ <b>2.9.4</b>
+ <ul>
+ <li>Removal of all the Chatroom 3 feature flags</li>
+ <li>The Spyglass loading dialog is now hidden all the time</li>
+ <li>The about screen from Chatroom 3 is now in Chatroom 2</li>
+ </ul>
+ </li>
+ </ul>
<h5>Chatroom 2.8.3 (Long Term Support)</h5>
<p>Chatroom 3 (Codename "Heeler") is now under development (it can be enabled with a few secret options)! While regular Chatroom features will continue to function normally, select people will be able to test new features. Contact your administrator for details. This does mean that Chatroom 2.8 is the last version of Chatroom 2 before the release of Chatroom 3. This old version of Chatroom will only contain bug fixes and no new features will be added.</p>
diff --git a/client/fragments/questions.html b/client/fragments/questions.html
deleted file mode 100644
index 84285ef..0000000
--- a/client/fragments/questions.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Questions</title>
- <link rel="icon" href="../assets/icons2/questions.svg">
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
- <main style="background-color: #fff; position: fixed; inset: 20px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px;">
- <div>
- <h4 style="margin-top: 0; margin-bottom: 10px;">Chatroom Questions</h4>
- <p>Ask any question here, and get an instant, reliable and trustworthy answer from the internet.</p>
-
- <form id="form">
- <input type="text" id="question" placeholder="Enter your question here" autofocus autocomplete="false" style="width: 100%; max-width: 256px;">
- </form>
- </div>
- <div id="response" style="overflow: hidden;">
- <div id="response-empty" style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;">Enter a question and press Enter to see an answer here.</div>
- <div id="response-loader" style="display: none; width: 100%; height: 100%; align-items: center; justify-content: center;">Generating answer, please wait...</div>
- <img id="response-image" style="width: 100%;">
- </div>
- </main>
-
- <script>
- document.getElementById("form").onsubmit = async (e) => {
- e.preventDefault();
- document.getElementById("question").disabled = true;
- let prompt = document.getElementById("question").value.trim();
-
- document.getElementById("response").style.overflow = "hidden";
- document.getElementById("response-empty").style.display = "none";
- document.getElementById("response-image").style.display = "none";
- document.getElementById("response-loader").style.display = "flex";
-
- let response = await chatroom.executePlatformsRequest({ method: "wolfram", query: prompt });
- document.getElementById("response-image").src = "data:image/jpg;base64," + response.data;
-
- document.getElementById("response").style.overflow = "auto";
- document.getElementById("response-image").style.display = "";
- document.getElementById("response-loader").style.display = "none";
- document.getElementById("response-empty").style.display = "none";
-
- document.getElementById("question").value = "";
- document.getElementById("question").disabled = false;
- document.getElementById("question").focus();
- }
- </script>
-</body>
-</html>
diff --git a/client/fragments/settings.html b/client/fragments/settings.html
deleted file mode 100644
index 897e0f7..0000000
--- a/client/fragments/settings.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Settings</title>
- <link rel="icon" href="../assets/icons2/settings.svg">
- <style>
- .settings-item {
- display: grid;
- grid-template-columns: 32px 1fr;
- border-top-left-radius: 5px;
- border-bottom-left-radius: 5px;
- padding: 5px 10px;
- }
-
- .settings-item:hover {
- background-color: rgba(0, 0, 0, .05);
- }
-
- .settings-item:active, .settings-item.active {
- background-color: rgba(0, 0, 0, .1);
- }
-
- .settings-item.active {
- pointer-events: none;
- }
-
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
-
- .settings-item-text-inner {
- white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;
- }
-
- .settings-item-text {
- align-items: center; display: flex;
- }
-
- .settings-item-icon {
- width: 24px; height: 24px;
- }
-
- .settings-item-inner {
- width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
- <main style="background-color: #fff; position: fixed; inset: 20px; overflow: hidden;">
- <div style="width: 100%; height: 100%; overflow: hidden; display: grid; grid-template-columns: 1fr 3fr;">
- <div style="border-right: 1px solid rgba(0, 0, 0, .25); overflow: auto;">
- <div class="settings-item active" id="settings-item-search" onclick="openPage('search');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/search.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Search and predictions</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-security" onclick="openPage('security');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/security.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Security</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-blocking" onclick="openPage('blocking');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/blocker.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Content blocking</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-appearance" onclick="openPage('appearance');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/appearance.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Appearance</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-platform" onclick="openPage('platform');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/platform.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Chatroom Platform</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-spyglass" onclick="openPage('spyglass');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/spyglass.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Spyglass</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-system" onclick="openPage('system');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/system.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">System</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-experiments" style="display: none;" onclick="openPage('experiments');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/experiments.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">Developer</span>
- </div>
- </div>
- <div class="settings-item" id="settings-item-about" onclick="openPage('about');">
- <div class="settings-item-inner">
- <img class="settings-item-icon" alt="" src="../assets/icons2/about.svg">
- </div>
- <div class="settings-item-text">
- <span class="settings-item-text-inner">About Chatroom</span>
- </div>
- </div>
- </div>
- <iframe id="frame" style="border: none; width: 100%; height: 100%;"></iframe>
- </div>
- </main>
-
- <script>
- if (localStorage.getItem("cr3-trial-experiments") === "true") {
- document.getElementById("settings-item-experiments").style.display = "";
- }
-
- function openPage(id) {
- Array.from(document.getElementsByClassName('active')).map(i => i.classList.remove("active"));
- document.getElementById("settings-item-" + id).classList.add("active");
- document.getElementById("frame").src = "./settings/" + id + ".html";
- location.hash = id;
- }
-
- window.onhashchange = () => {
- openPage(location.hash.substring(1));
- }
-
- openPage("search");
- </script>
-</body>
-</html>
diff --git a/client/fragments/settings/appearance.html b/client/fragments/settings/appearance.html
deleted file mode 100644
index 859e024..0000000
--- a/client/fragments/settings/appearance.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Appearance</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/blocking.html b/client/fragments/settings/blocking.html
deleted file mode 100644
index b3e9301..0000000
--- a/client/fragments/settings/blocking.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Content blocking</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/experiments.html b/client/fragments/settings/experiments.html
deleted file mode 100644
index e5dcb02..0000000
--- a/client/fragments/settings/experiments.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Experiments</title>
- <link rel="icon" href="../../assets/icons2/experiments.svg">
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
- <main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Developer</h4>
-
- <p><b style="color: red;">WARNING: EXPERIMENTAL FEATURES AHEAD!</b> By enabling these features, you could lose browser data or compromise your security or privacy. If you are an enterprise admin you should not be using these flags in production.</p>
- <p>The browser will need to reload to apply the new features. This will destroy all children, meaning you might lose unsaved data. For your safety, close all the open tabs before continuing.</p>
-
- <table style="border-collapse: collapse; width: 100%;">
- <tbody id="list"></tbody>
- </table>
- </main>
-
- <script>
- window.list = [
- {
- name: "forcespyglass",
- treatments: {
- "false": "Not Eligible",
- "true": "Treatment 1: Enabled"
- }
- },
- {
- name: "removelegacyapis",
- treatments: {
- "false": "Not Eligible",
- "true": "Treatment 1: Enabled"
- }
- },
- {
- name: "experiments",
- treatments: {
- "false": "Not Eligible",
- "true": "Treatment 1: Enabled"
- }
- },
- {
- name: "m3uiredesign",
- treatments: {
- "false": "Not Eligible",
- "true": "Treatment 1: Enabled"
- }
- },
- {
- name: "m2spyglassdialogbehavior2",
- treatments: {
- "false": "Treatment 1: Display Spyglass dialog in M2",
- "true": "Treatment 2: Hide Spyglass dialog in M2"
- }
- },
- {
- name: "experimentschangelog",
- treatments: {
- "false": "Not Eligible",
- "true": "Treatment 1: Enabled"
- }
- }
- ];
-
- document.getElementById("list").innerHTML = window.list.sort((a, b) => {
- return a.name.localeCompare(b.name);
- }).map(i => `
- <tr style="border: 1px solid black;">
- <td style="padding: 5px;">
- <b style="${Object.entries(i.treatments).find((j, k) => localStorage.getItem("cr3-trial-" + i.name) === j[0] && k !== 0) ? 'color: blue;' : ''}">${i.name}</b>
- </td>
- <td style="text-align: right; padding: 5px;">
- <select class="flag-select" id="${i.name}" onchange="updateFlags();" disabled>
- ${Object.entries(i.treatments).map(j => `
- <option value="${j[0]}" ${localStorage.getItem("cr3-trial-" + i.name) === j[0] ? "selected" : ""}>${j[1]}</option>
- `).join("")}
- </select>
- </td>
- </tr>
- `).join("");
-
- Array.from(document.getElementsByClassName("flag-select")).map(i => i.disabled = false);
-
- function updateFlags() {
- for (let item of window.list) {
- localStorage.setItem("cr3-trial-" + item.name, document.getElementById(item.name).value);
- }
-
- localStorage.setItem("experiments-temp", "true");
- window.parent.chatroom.reloadHost();
- }
- </script>
-</body>
-</html>
diff --git a/client/fragments/settings/platform.html b/client/fragments/settings/platform.html
deleted file mode 100644
index cfa8d70..0000000
--- a/client/fragments/settings/platform.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Chatroom Platform</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/search.html b/client/fragments/settings/search.html
deleted file mode 100644
index 81d60dc..0000000
--- a/client/fragments/settings/search.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Search and predictions</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/security.html b/client/fragments/settings/security.html
deleted file mode 100644
index a411441..0000000
--- a/client/fragments/settings/security.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Security</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/spyglass.html b/client/fragments/settings/spyglass.html
deleted file mode 100644
index 60ae4ec..0000000
--- a/client/fragments/settings/spyglass.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">Spyglass</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/settings/system.html b/client/fragments/settings/system.html
deleted file mode 100644
index 4b49fdc..0000000
--- a/client/fragments/settings/system.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title></title>
- <style>
- * {
- font-family: system-ui, -apple-system, sans-serif;
- user-select: none;
- -webkit-user-drag: none;
- }
- </style>
-</head>
-<body style="background-color: #fff;">
-<main style="background-color: #fff; position: fixed; inset: 20px; overflow: auto;">
- <h4 style="margin-top: 0; margin-bottom: 10px;">System</h4>
- <p>TODO</p>
-</main>
-</body>
-</html>
diff --git a/client/fragments/soon.html b/client/fragments/soon.html
deleted file mode 100644
index b665341..0000000
--- a/client/fragments/soon.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Coming soon in Chatroom</title>
- <link rel="icon" href="../assets/icons/soon.svg">
- <link href="../assets/bootstrap/bs.css" rel="stylesheet">
- <script src="../assets/bootstrap/bs.js"></script>
- <style>
- @media (prefers-color-scheme: dark) {
- main {
- filter: invert(1) hue-rotate(180deg);
- background-color: #ddd !important;
- }
-
- #scrambled-eggs {
- filter: invert(1) hue-rotate(180deg);
- }
-
- #scrambled {
- opacity: .5;
- }
- }
-
- @keyframes hue {
- 0% {
- filter: hue-rotate(0deg);
- }
-
- 100% {
- filter: hue-rotate(360deg);
- }
- }
- </style>
-</head>
-<body>
- <main style="background-color: #eee; position: fixed; inset: 0; overflow: auto;">
- <div class="container" style="margin-top: 50px; margin-bottom: 50px;">
- <h1>Coming soon in Chatroom</h1>
- </div>
-
- <div id="scrambled-eggs">
- <div style="animation-name: hue; animation-duration: 20s; animation-iteration-count: infinite; animation-timing-function: linear;">
- <div id="scrambled" style=' display: grid; grid-template-columns: repeat(20, 1fr); word-break: break-all; filter: brightness(150%) saturate(50%);'>Chatroom 2.8.0 (or future versions) is getting a bunch of new features. Expect to see a lot from the Chatroom team, including perhaps a settings page, a new (actually working) VPN, a UI redesign, favorites, support for other search engines, AI, and much more. Watch out for changes in this message, and hope you're ready!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>.
- </div>
- </div>
- </main>
-
- <script>
- document.getElementById("scrambled").innerHTML = btoa(document.getElementById("scrambled").innerText).split("").map(i => `
- <div data-last-change="0" class="scramble" style="text-align: center; line-height: calc(100vw / 20 - 4px); font-size: calc(100vw / 20 - 4px); color: transparent; background-color: red;">${i}</div>
- `).join("");
-
- setInterval(() => {
- for (let item of Array.from(document.getElementsByClassName("scramble"))) {
- let lastChange = new Date(parseInt(item.getAttribute("data-last-change")));
- item.style.opacity = Math.abs(1 - (Math.min(new Date() - lastChange, 1500) / 1500));
- }
- }, 1);
-
- setInterval(() => {
- let a = Array.from(document.getElementsByClassName("scramble"));
- let i = a[Math.floor(Math.random() * a.length)];
- //i.style.backgroundColor = `#${(Math.random().toString(16).split(".")[1] + Math.random().toString(16).split(".")[1]).substring(0, 6)}`;
- i.setAttribute("data-last-change", new Date().getTime().toString());
- }, 10);
- </script>
-</body>
-</html>
diff --git a/client/main.js b/client/main.js
index 77d67f5..cf83ec9 100755
--- a/client/main.js
+++ b/client/main.js
@@ -2,9 +2,7 @@
const buildNumber = "main";
// --- >FINAL< @BUILDNUMBER@ >FINAL< --- //
-const version_stable = "2.8.3-LTS";
-const version_beta = "3.0.0-DP.3";
-let version = version_stable;
+let version = "2.9.4";
const { desktopCapturer, protocol, app, BrowserWindow, webContents, globalShortcut, nativeTheme, ipcMain, session, dialog, Menu } = require('electron');
const os = require("os");
@@ -89,19 +87,6 @@ ipcMain.on('disable-protection', () => {
global.baseUserAgent = session.defaultSession.getUserAgent();
-function updateAppVersions() {
- session.defaultSession.setUserAgent(baseUserAgent.replace(/(.*)( Electron\/(.*) )/gm, "$1 ").replace(/(.*)( Chatroom\/([^ ]*) )/gm, "$1 ") + " Chatroom/" + version);
- app.setName("Chatroom");
- app.setAboutPanelOptions({
- applicationName: "Chatroom",
- applicationVersion: version,
- copyright: "Copyright © 2023-" + new Date().getFullYear() + " Equestria.dev. Released under the MIT License.",
- version: buildNumber
- });
-}
-
-updateAppVersions();
-
let localchatDataRoot = (os.platform() === "win32" ? os.homedir() + "/AppData/Roaming" : (os.platform() === "darwin" ? os.homedir() + "/Library/Application Support" : os.homedir())) + (os.platform() === "darwin" ? "/ChatroomWorkspace" : "/.chatroom-workspace");
console.log(localchatDataRoot);
@@ -138,7 +123,7 @@ const createWindow = () => {
} : {
color: "#eeeeee",
symbolColor: "#222222",
- height: 43
+ height: 42
},
backgroundColor: nativeTheme.shouldUseDarkColors ? "#111111" : "#eeeeee",
trafficLightPosition: {
@@ -184,6 +169,40 @@ const createWindow = () => {
...(process.platform === "darwin" ? [
{
role: "appMenu",
+ type: "submenu",
+ label: "Chatroom",
+ submenu: [
+ {
+ label: "About Chatroom",
+ click: (_, win) => {
+ try { win.webContents.executeJavaScript('window.focusAbout();') } catch (e) { console.error(e); }
+ }
+ },
+ {
+ type: "separator"
+ },
+ {
+ role: "services"
+ },
+ {
+ type: "separator"
+ },
+ {
+ role: "hide"
+ },
+ {
+ role: "hideOthers"
+ },
+ {
+ role: "unhide"
+ },
+ {
+ type: "separator"
+ },
+ {
+ role: "quit"
+ },
+ ]
}
] : []),
{
@@ -351,20 +370,6 @@ app.on('window-all-closed', () => {
app.quit();
});
-ipcMain.on('about', () => {
- app.showAboutPanel();
-});
-
-ipcMain.on('new-ui-on', () => {
- version = version_beta;
- updateAppVersions();
-});
-
-ipcMain.on('new-ui-off', () => {
- version = version_stable;
- updateAppVersions();
-});
-
ipcMain.handle('3pid', (_, origin) => {
return new Promise(async (res) => {
if (!global.mainWindow) res(null);
diff --git a/client/src/spyglass.js b/client/src/spyglass.js
index e719d44..f270f91 100644
--- a/client/src/spyglass.js
+++ b/client/src/spyglass.js
@@ -36,16 +36,7 @@ if ((process.env.USERDNSDOMAIN && process.env.USERDNSDOMAIN.endsWith(".AC-ORLEAN
}
function startSpyglass() {
- SPYGLASS_INITIALIZED = true;
-
- if (localStorage.getItem("cr3-trial-m2spyglassdialogbehavior2") === "true") {
- SPYGLASS_INITIALIZED = false;
- }
-
- if (window.bootstrap) {
- if (!modal) modal = new bootstrap.Modal(document.getElementById("loading-modal"));
- if (localStorage.getItem("cr3-trial-m2spyglassdialogbehavior2") !== "true") modal.show();
- }
+ SPYGLASS_INITIALIZED = false;
SPYGLASS_SOCKET = new WebSocket(SPYGLASS_SERVER);
@@ -96,7 +87,6 @@ if ((process.env.USERDNSDOMAIN && process.env.USERDNSDOMAIN.endsWith(".AC-ORLEAN
case "AUTHENTICATION_OK":
SPYGLASS_STATE = true;
- if (window.bootstrap) modal.hide();
sendProfile();
window.spyglassInterval = setInterval(() => {
diff --git a/server/platforms.js b/server/platforms.js
deleted file mode 100644
index 01773ed..0000000
--- a/server/platforms.js
+++ /dev/null
@@ -1,75 +0,0 @@
-const secrets = require('./secrets.json');
-const WebSocketServer = require('ws').WebSocketServer;
-const wss = new WebSocketServer({ port: 19219 });
-
-async function processRequest(ws, data) {
- if (data.method === "wolfram") {
- let query = "https://api.wolframalpha.com/v1/simple?appid=" + secrets.wolfram + "&i=" + encodeURIComponent(data.query ?? "");
-
- ws.send({
- state: "REQUEST_RESPONSE",
- data: {
- _id: data._id ?? null,
- data: Buffer.from(await (await fetch(query)).arrayBuffer()).toString("base64")
- }
- });
-
- return;
- }
-
- ws.send({
- state: "REQUEST_RESPONSE",
- data: null
- });
-}
-
-wss.on('connection', function connection(ws) {
- ws.authenticated = false;
- ws.token = null;
- ws.auth = null;
-
- ws._send = ws.send;
- ws.send = (d) => {
- return ws._send(JSON.stringify(d));
- }
-
- ws.on('error', console.error);
-
- ws.on('message', async (_data) => {
- try {
- let data = JSON.parse(_data);
-
- if (data.state) {
- switch (data.state) {
- case "AUTHENTICATION_RESPONSE":
- if (data.token) {
- let userInfo = (await (await fetch("https://school.equestria.dev/_matrix/client/v3/account/whoami", { headers: { 'Authorization': 'Bearer ' + data.token } })).json());
- console.log(userInfo);
-
- if (userInfo['user_id']) {
- ws.auth = userInfo;
- ws.token = data.token;
- ws.authenticated = true;
-
- ws.send({
- state: "AUTHENTICATION_OK"
- });
- } else {
- ws.close();
- }
- }
- break;
- }
- }
-
- if (!ws.authenticated) ws.close();
- if (!data.state || data.state !== "AUTHENTICATION_RESPONSE") processRequest(ws, data);
- } catch (e) {
- console.error(e);
- }
- });
-
- ws.send({
- state: "NEEDS_AUTHENTICATION"
- });
-});