aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/admin-register.html89
-rw-r--r--res/client.js2
-rw-r--r--res/css/setup.css48
-rw-r--r--res/img/welcome.webpbin0 -> 53258 bytes
-rw-r--r--res/index.html2
-rw-r--r--res/langs/en.json228
-rw-r--r--res/setup.html52
7 files changed, 270 insertions, 151 deletions
diff --git a/res/admin-register.html b/res/admin-register.html
new file mode 100644
index 0000000..4515cfd
--- /dev/null
+++ b/res/admin-register.html
@@ -0,0 +1,89 @@
+<!-- localization-template -->
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <meta name="mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <link rel="manifest" href="manifest.json">
+ <title>SyncTube</title>
+ <link rel="icon" href="img/favicon.svg" type="image/svg+xml">
+ <link id="usertheme" href="css/des.css" rel="stylesheet">
+ <link id="usertheme" href="css/setup.css" rel="stylesheet">
+ <link id="customcss" href="css/custom.css" rel="stylesheet">
+</head>
+
+<body>
+ <main class="setup">
+ <h1 class="setup-title">Admin Registration</h1>
+ <p>Enter the admin token to register your account</p>
+
+ <form id="admin-form" class="setup-form">
+ <input type="text" name="name" placeholder="Username">
+ <input type="password" name="password" placeholder="Password">
+ <input type="password" name="confirmation" placeholder="Repeat password">
+ <input type="password" name="token" placeholder="Admin Token">
+
+ <div id="form-errors" class="form-errors"></div>
+
+ <button type="submit">Register</button>
+ </form>
+ </main>
+
+ <script>
+ const formElement = document.getElementById("admin-form");
+ const errorsElement = document.getElementById("form-errors");
+
+ formElement.addEventListener("submit", function (e) {
+ e.preventDefault();
+ const { name, password, confirmation, token } = formElement.elements;
+
+ const payload = {
+ name: name.value,
+ password: password.value,
+ passwordConfirmation: confirmation.value,
+ token: token.value
+ };
+
+ fetch("/admin-register", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload)
+ })
+ .then(res => res.json())
+ .then(response => handleResponse(response))
+ .catch(() => handleResponse(null));
+ }, true);
+
+ function handleResponse(response) {
+ if (response && response.success === true) {
+ errorsElement.innerHTML = "";
+ const successEl = document.createElement("div");
+ successEl.innerText = "Admin account created! You can now log in.";
+ successEl.style.color = "green";
+ errorsElement.appendChild(successEl);
+
+ Array.from(formElement.elements).forEach(el => { el.disabled = true; });
+ return;
+ }
+
+ const message = (response && response.error) ? response.error : "Registration failed";
+ showErrors(errorsElement, [message]);
+ }
+
+ function showErrors(container, errors) {
+ container.innerHTML = "";
+
+ errors.forEach(function (message) {
+ const errorEl = document.createElement("div");
+ errorEl.innerText = message;
+ container.appendChild(errorEl);
+ });
+ }
+ </script>
+</body>
+
+</html> \ No newline at end of file
diff --git a/res/client.js b/res/client.js
index eeea7b3..faf13b4 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1392,7 +1392,7 @@ var client_Main = function() {
if(this.host == "") {
this.host = "localhost";
}
- client_Settings.init({ version : 6, uuid : null, name : "", hash : "", chatSize : 300, synchThreshold : 2, isSwapped : false, isUserListHidden : true, latestLinks : [], latestSubs : [], hotkeysEnabled : true, showHintList : true, checkboxes : [], checkedCache : []},$bind(this,this.settingsPatcher));
+ client_Settings.init({ version : 6, uuid : null, name : "", hash : "", chatSize : 300, synchThreshold : 1, isSwapped : false, isUserListHidden : true, latestLinks : [], latestSubs : [], hotkeysEnabled : true, showHintList : true, checkboxes : [], checkedCache : []},$bind(this,this.settingsPatcher));
this.settings = client_Settings.read();
this.initListeners();
this.onTimeGet = new haxe_Timer(this.settings.synchThreshold * 1000);
diff --git a/res/css/setup.css b/res/css/setup.css
index 9755ad3..b42f8a8 100644
--- a/res/css/setup.css
+++ b/res/css/setup.css
@@ -3,23 +3,42 @@ body {
height: 100vh;
align-items: center;
justify-content: center;
+ background-color: var(--background-video);
+ margin: 0;
}
.setup {
margin: auto;
- padding: 2rem;
- width: 320px;
+ padding: 2.5rem 2rem;
+ width: 360px;
display: flex;
flex-direction: column;
align-items: center;
-
- /* debug */
background-color: #1a1a1f;
+ color: var(--foreground);
+ border: 1px solid var(--border);
+ border-radius: 0.5rem;
+ gap: 1rem;
+}
+
+.welcome-image {
+ max-width: 200px;
+ width: 100%;
border-radius: 0.375rem;
+ margin-bottom: 0.5rem;
+}
- & h1 {
- font-size: 1.75rem;
- }
+.setup-title {
+ font-size: 1.75rem;
+ margin: 0;
+ text-align: center;
+}
+
+.setup p {
+ margin: 0;
+ text-align: center;
+ opacity: 0.7;
+ font-size: 0.95rem;
}
.setup-form {
@@ -27,13 +46,23 @@ body {
flex-direction: column;
gap: 1rem;
width: 100%;
+ margin-top: 0.5rem;
+
+ & input {
+ width: 100%;
+ box-sizing: border-box;
+ }
& button {
margin: 0;
- padding: .75rem .5rem;
+ padding: 0.75rem 0.5rem;
justify-content: center;
background-color: var(--accent);
color: #fff;
+ border: none;
+ border-radius: 0.375rem;
+ cursor: pointer;
+ font-size: 0.95rem;
&:hover {
filter: brightness(1.15);
@@ -46,4 +75,5 @@ body {
flex-direction: column;
gap: 0.5rem;
color: var(--error);
-}
+ font-size: 0.9rem;
+} \ No newline at end of file
diff --git a/res/img/welcome.webp b/res/img/welcome.webp
new file mode 100644
index 0000000..b53f48e
--- /dev/null
+++ b/res/img/welcome.webp
Binary files differ
diff --git a/res/index.html b/res/index.html
index 2f620c6..dbdde80 100644
--- a/res/index.html
+++ b/res/index.html
@@ -145,7 +145,7 @@
</section>
<!-- Footer -->
<footer id="footer">
- <p>Powered by <a href="https://github.com/RblSb/SyncTube" target="_blank" rel="noreferrer noopener">SyncTube</a>
+ <p>Dohee Cinema is powered by <a href="https://github.com/RblSb/SyncTube" target="_blank" rel="noreferrer noopener">SyncTube</a>
</p>
</footer>
</main>
diff --git a/res/langs/en.json b/res/langs/en.json
index a7ce267..02f91ea 100644
--- a/res/langs/en.json
+++ b/res/langs/en.json
@@ -1,119 +1,119 @@
{
- "connection": "Connection",
- "msgConnected": "Connected",
- "msgDisconnected": "Disconnected",
- "joined": "joined",
- "online": "online",
- "nothingPlaying": "Nothing Playing",
- "hintListStart": "Welcome to SyncTube! Here you can:",
- "hintListAddVideo": "$addVideos to watch together",
- "hintListRequestLeader": "$requestLeader to pause and rewind videos for everyone",
- "hintListRequestLeaderMouse": "(also use right mouse button for quick pause)",
- "hintListRequestLeaderTouch": "(also use long tap for quick pause)",
- "hintListOpenInApp": "$openInApp this server for better Android experience",
- "hintListHide": "$hideThisMessage and send <code>/help</code> in chat to see it again",
- "addVideos": "Add Videos",
- "requestLeader": "Request Leader",
- "openInApp": "Open in App",
- "hideThisMessage": "Hide this message",
- "usernameError": "Username length must be from 1 to $MAX characters and don't repeat another's. Characters &^<>'\" are not allowed.",
- "passwordError": "Password length must be from $MIN to $MAX characters.",
- "passwordsMismatchError": "Passwords do not match.",
- "passwordMatchError": "Wrong password.",
- "accessError": "Access error",
- "noPermission": "No '$PERMISSION' permission.",
- "totalVideoLimitError": "Playlist video limit has been reached.",
- "userVideoLimitError": "Playlist video limit per user has been reached.",
- "videoAlreadyExistsError": "The video already exists in playlist.",
- "addVideoError": "Failed to add video.",
- "adminsCannotBeBannedError": "Admins cannot be banned. Remove them first.",
- "caching": "Caching",
- "downloading": "Downloading",
- "uploading": "Uploading",
- "rawVideo": "Raw video",
- "videos": "videos",
- "addedBy": "Added by",
- "play": "Play",
- "setNext": "Next",
- "makePermanent": "Make Permanent",
- "makeTemporary": "Make Temporary",
- "delete": "Delete",
- "account": "Account",
- "exportSettings": "Export Settings",
- "importSettings": "Import Settings",
- "login": "Login",
- "exit": "Exit",
- "settings": "Settings",
- "synchThreshold": "Synch Threshold",
- "general": "General",
- "hotkeys": "Hotkeys",
- "video": "Video",
- "channel": "Channel",
- "layout": "Layout",
- "swapLayout": "Swap Layout",
- "chatOnly": "Chat Only",
- "setVideoUrl": "Set Video URL",
- "setVideoUrlPrompt": "New video URL:\n(Does not affect other users)",
- "selectLocalVideo": "Select Local Video",
- "removePlayer": "Remove Player",
- "restorePlayer": "Restore Player",
- "toggleUserList": "Show/Hide Userlist",
- "leaderDesc": "Request video control permissions",
- "mobileViewBtn": "Mobile View",
- "leader": "Leader",
- "enterAsGuest": "Enter As Guest:",
- "yourName": "Your Name",
- "enterUserPassword": "Enter User Password",
- "yourPassword": "Your Password",
- "emotes": "Emotes",
- "chat": "Chat",
- "kicked": "Kicked",
- "clearChat": "Clear Chat",
- "chatlinePlaceholder": "Send a message...",
- "leaderDisconnectedServerOnPause": "Leader was disconnected, server on pause.",
- "unpause": "Unpause",
- "addVideoFromUrl": "Add video from URL",
- "embedCustomFrame": "Embed a custom frame",
- "clearPlaylist": "Clear playlist",
- "shufflePlaylist": "Shuffle playlist",
- "playlist": "Playlist",
- "playlistOpen": "Playlist open",
- "playlistLocked": "Playlist locked",
- "expandPlayer": "Expand player",
- "toggleVideoSync": "Toggle video synchronization",
- "toggleSynchConfirm": "Are you sure you want to turn off video sync?",
- "refreshPlayer": "Refresh player",
- "fullscreenPlayer": "Fullscreen player",
- "retrievePlaylistLinks": "Retrieve playlist links",
- "voteForSkip": "Vote for skip",
- "addAsTemporary": "Add as temporary",
- "cacheOnServer": "Cache on server",
- "mediaUrl": "Media URL",
- "optionalTitle": "Title (optional)",
- "subtitlesUrlOptional": "Subtitles URL (optional)",
- "voiceOverAudioTrackUrlOptional": "Voice-over audio URL (optional)",
- "addTemplateUrl": "Add template URL",
- "queueNext": "Queue next",
- "queueLast": "Queue last",
- "and": "and",
- "or": "or",
- "to": "to",
- "pasteEmbedCodeAndClick": "Paste the embed code here",
- "acceptableEmbedCodesAre": "Acceptable embed codes are",
- "customEmbedsCannotBeSynchronized": "CUSTOM EMBEDS CANNOT BE SYNCHRONIZED",
- "save": "Save",
- "skipItemConfirm": "Are you sure you want to skip current video?",
- "clearPlaylistConfirm": "Are you sure you want to clear the playlist?",
- "shufflePlaylistConfirm": "Are you sure you want to shuffle the playlist?",
- "lockPlaylistConfirm": "Are you sure you want to lock the playlist?",
+ "connection": "Connection",
+ "msgConnected": "Connected",
+ "msgDisconnected": "Disconnected",
+ "joined": "joined",
+ "online": "online",
+ "nothingPlaying": "Nothing Playing",
+ "hintListStart": "Welcome to Dohee Cinema! Here you can:",
+ "hintListAddVideo": "$addVideos to watch together (press the + button)",
+ "hintListRequestLeader": "$requestLeader to pause and rewind videos for everyone",
+ "hintListRequestLeaderMouse": "(also use right mouse button for quick pause)",
+ "hintListRequestLeaderTouch": "(also use long tap for quick pause)",
+ "hintListOpenInApp": "$openInApp this server for better Android experience",
+ "hintListHide": "$hideThisMessage and send <code>/help</code> in chat to see it again",
+ "addVideos": "Add Videos",
+ "requestLeader": "Request Leader",
+ "openInApp": "Open in App",
+ "hideThisMessage": "Hide this message",
+ "usernameError": "Username length must be from 1 to $MAX characters and don't repeat another's. Characters &^<>'\" are not allowed.",
+ "passwordError": "Password length must be from $MIN to $MAX characters.",
+ "passwordsMismatchError": "Passwords do not match.",
+ "passwordMatchError": "Wrong password.",
+ "accessError": "Access error",
+ "noPermission": "No '$PERMISSION' permission.",
+ "totalVideoLimitError": "Playlist video limit has been reached.",
+ "userVideoLimitError": "Playlist video limit per user has been reached.",
+ "videoAlreadyExistsError": "The video already exists in playlist.",
+ "addVideoError": "Failed to add video.",
+ "adminsCannotBeBannedError": "Admins cannot be banned. Remove them first.",
+ "caching": "Caching",
+ "downloading": "Downloading",
+ "uploading": "Uploading",
+ "rawVideo": "Raw video",
+ "videos": "videos",
+ "addedBy": "Added by",
+ "play": "Play",
+ "setNext": "Next",
+ "makePermanent": "Make Permanent",
+ "makeTemporary": "Make Temporary",
+ "delete": "Delete",
+ "account": "Account",
+ "exportSettings": "Export Settings",
+ "importSettings": "Import Settings",
+ "login": "Login",
+ "exit": "Logout",
+ "settings": "Settings",
+ "synchThreshold": "Sync Threshold",
+ "general": "General",
+ "hotkeys": "Hotkeys",
+ "video": "Video",
+ "channel": "Channel",
+ "layout": "Layout",
+ "swapLayout": "Swap Layout",
+ "chatOnly": "Chat Only",
+ "setVideoUrl": "Set Video URL",
+ "setVideoUrlPrompt": "New video URL:\n(Does not affect other users)",
+ "selectLocalVideo": "Select Local Video",
+ "removePlayer": "Remove Player",
+ "restorePlayer": "Restore Player",
+ "toggleUserList": "Show/Hide Userlist",
+ "leaderDesc": "Request video control permissions",
+ "mobileViewBtn": "Mobile View",
+ "leader": "Leader",
+ "enterAsGuest": "Login/Register",
+ "yourName": "Username",
+ "enterUserPassword": "Welcome back! Enter Password",
+ "yourPassword": "Your Password",
+ "emotes": "Emotes",
+ "chat": "Chat",
+ "kicked": "Kicked",
+ "clearChat": "Clear Chat",
+ "chatlinePlaceholder": "Send a message...",
+ "leaderDisconnectedServerOnPause": "Leader was disconnected, server on pause.",
+ "unpause": "Unpause",
+ "addVideoFromUrl": "Add video from URL",
+ "embedCustomFrame": "Embed a custom frame",
+ "clearPlaylist": "Clear playlist",
+ "shufflePlaylist": "Shuffle playlist",
+ "playlist": "Playlist",
+ "playlistOpen": "Playlist open",
+ "playlistLocked": "Playlist locked",
+ "expandPlayer": "Expand player",
+ "toggleVideoSync": "Toggle video synchronization",
+ "toggleSynchConfirm": "Are you sure you want to turn off video sync?",
+ "refreshPlayer": "Refresh player",
+ "fullscreenPlayer": "Fullscreen player",
+ "retrievePlaylistLinks": "Retrieve playlist links",
+ "voteForSkip": "Vote for skip",
+ "addAsTemporary": "Add as temporary",
+ "cacheOnServer": "Cache on server",
+ "mediaUrl": "Media URL",
+ "optionalTitle": "Title (optional)",
+ "subtitlesUrlOptional": "Subtitles URL (optional)",
+ "voiceOverAudioTrackUrlOptional": "Voice-over audio URL (optional)",
+ "addTemplateUrl": "Add template URL",
+ "queueNext": "Queue next",
+ "queueLast": "Queue last",
+ "and": "and",
+ "or": "or",
+ "to": "to",
+ "pasteEmbedCodeAndClick": "Paste the embed code here",
+ "acceptableEmbedCodesAre": "Acceptable embed codes are",
+ "customEmbedsCannotBeSynchronized": "CUSTOM EMBEDS CANNOT BE SYNCHRONIZED",
+ "save": "Save",
+ "skipItemConfirm": "Are you sure you want to skip current video?",
+ "clearPlaylistConfirm": "Are you sure you want to clear the playlist?",
+ "shufflePlaylistConfirm": "Are you sure you want to shuffle the playlist?",
+ "lockPlaylistConfirm": "Are you sure you want to lock the playlist?",
- "yes": "Yes",
- "no": "No",
- "on": "On",
- "off": "Off",
+ "yes": "Yes",
+ "no": "No",
+ "on": "On",
+ "off": "Off",
- "areYouSure": "Are you sure?",
- "dataWillBeLost": "The data will be lost.",
+ "areYouSure": "Are you sure?",
+ "dataWillBeLost": "The data will be lost.",
- "setupTitle": "Welcome to SyncTube!"
+ "setupTitle": "Welcome to Dohee Cinema!"
}
diff --git a/res/setup.html b/res/setup.html
index 8068a9d..d7a044e 100644
--- a/res/setup.html
+++ b/res/setup.html
@@ -19,17 +19,16 @@
<body>
<main class="setup">
- <h1 class="setup-title">SyncTube</h1>
- <p>Create your admin account</p>
+ <img class="welcome-image" src="img/welcome.webp" alt="Welcome to Dohee Cinema">
+ <h1 class="setup-title">Welcome to the Dohee Cinema</h1>
+ <p>put in the password for entry</p>
- <form id="setup-form" class="setup-form" action="/setup" method="POST">
- <input type="text" name="name" placeholder="Name">
+ <form id="setup-form" class="setup-form">
<input type="password" name="password" placeholder="Password">
- <input type="password" name="confirmation" placeholder="Repeat password">
<div id="form-errors" class="form-errors"></div>
- <button type="submit">Create</button>
+ <button type="submit">Enter</button>
</form>
</main>
@@ -37,33 +36,34 @@
const formElement = document.getElementById("setup-form");
const errorsElement = document.getElementById("form-errors");
+ function submitPassword(pw) {
+ const payload = { password: pw };
+ return fetch("/gate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) })
+ .then(res => res.json())
+ .then(response => handleResponse(response, pw))
+ .catch(() => handleResponse(null, pw));
+ }
+
formElement.addEventListener("submit", function (e) {
e.preventDefault();
-
- const { name, password, confirmation } = formElement.elements;
- const payload = {
- name: name.value,
- password: password.value,
- passwordConfirmation: confirmation.value,
- }
-
- fetch("/setup", { method: "POST", body: JSON.stringify(payload) })
- .then(res => res.json())
- .then(response => handleResponse(response))
- .catch(() => handleResponse(null));
+ const { password } = formElement.elements;
+ submitPassword(password.value);
}, true);
+ const savedPassword = localStorage.getItem("gate_password");
+ if (savedPassword) {
+ submitPassword(savedPassword);
+ }
- function handleResponse(response) {
- if (response.success) {
- return window.location.reload();
+ function handleResponse(response, pw) {
+ if (response && response.success === true) {
+ localStorage.setItem("gate_password", pw);
+ window.location.href = "/";
+ return;
}
- const errors = !response
- ? ["Unknown error"]
- : (response.errors ?? []).map(item => item.error);
-
- showErrors(errorsElement, errors);
+ localStorage.removeItem("gate_password");
+ showErrors(errorsElement, ["Incorrect password. Not cool man"]);
}
function showErrors(container, errors) {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage