aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Main.hx
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-07-02 22:17:17 -0700
committerPinapelz <yukais@pinapelz.com>2026-07-02 22:17:17 -0700
commit04eb44d685ba677a444b73c7cfc2427d2740497f (patch)
tree94b35f31d59b2268e40a054304191be38848a7f6 /src/client/Main.hx
parentece9cf2749ac592299a34a2cf0f24672eedbd19e (diff)
implement better leader, queue, and upload management
- Majority vote skip management (Admins and the original video queuer overrides this behavior) - Leader request now requires the current leader to give up the role (via `/giveup <new-leader>`) - Overhauled default CSS and improved mobile view - Caching and uploading files is limited to Admin users only Signed-off-by: Pinapelz <yukais@pinapelz.com>
Diffstat (limited to 'src/client/Main.hx')
-rw-r--r--src/client/Main.hx20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 42aec3e..bea6b6b 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -356,7 +356,8 @@ class Main {
final checkboxTemp:InputElement = getEl("#addfromurl .add-temp");
final isTemp = checkboxTemp.checked;
final checkboxCache:InputElement = getEl("#cache-on-server");
- final doCache = checkboxCache.checked
+ final doCache = isAdmin()
+ && checkboxCache.checked
&& checkboxCache.parentElement.style.display != "none";
final url = mediaUrl.value;
final subs = subsUrl.value;
@@ -905,6 +906,13 @@ class Main {
final adminMenu = getEl("#adminMenu");
if (isAdmin()) adminMenu.style.display = "";
else adminMenu.style.display = "none";
+
+ final uploadBtn = getEl("#mediaurl-upload");
+ uploadBtn.style.display = isAdmin() ? "" : "none";
+
+ final checkboxCache:InputElement = getEl("#cache-on-server");
+ checkboxCache.checked = isAdmin() && checkboxCache.checked;
+ checkboxCache.parentElement.style.display = isAdmin() ? "" : "none";
}
public function guestLogin(name:String):Void {
@@ -1377,6 +1385,16 @@ class Main {
case "clear":
send({type: ClearChat});
return true;
+ case "giveup":
+ mergeRedundantArgs(args, 0, 1);
+ final name = args[0] ?? "";
+ send({
+ type: SetLeader,
+ setLeader: {
+ clientName: name
+ }
+ });
+ return true;
case "flashback", "fb":
send({type: Flashback});
return false;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage