aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Buttons.hx11
-rw-r--r--src/client/Main.hx6
-rw-r--r--src/client/MobileView.hx21
3 files changed, 22 insertions, 16 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 69928a5..51ba75d 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -172,19 +172,20 @@ class Buttons {
final exitBtn = ge("#exitBtn");
exitBtn.onclick = e -> {
- main.send({type: Logout});
+ if (main.isUser()) main.send({type: Logout});
+ else ge("#guestname").focus();
exitBtn.blur();
hideMenus();
}
final swapLayoutBtn = ge("#swapLayoutBtn");
swapLayoutBtn.onclick = e -> {
final p = ge("#main");
- p.insertBefore(p.children.item(2), p.children.item(0));
- p.insertBefore(p.children.item(2), p.children.item(1));
+ p.insertBefore(p.children[2], p.children[0]);
+ p.insertBefore(p.children[2], p.children[1]);
final p = ge("#controlsrow");
- p.insertBefore(p.children.item(1), p.children.item(0));
+ p.insertBefore(p.children[1], p.children[0]);
final p = ge("#playlistrow");
- p.insertBefore(p.children.item(1), p.children.item(0));
+ p.insertBefore(p.children[1], p.children[0]);
final swapped = ge("#main").firstElementChild == ge("#videowrap");
initSplit(swapped);
swapLayoutBtn.blur();
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 70cc270..bfcc877 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -98,6 +98,10 @@ class Main {
}
}
+ public inline function isUser():Bool {
+ return personal.isUser;
+ }
+
public inline function isLeader():Bool {
return personal.isLeader;
}
@@ -366,12 +370,14 @@ class Main {
function showGuestLoginPanel():Void {
ge("#guestlogin").style.display = "block";
ge("#chatline").style.display = "none";
+ ge("#exitBtn").textContent = Lang.get("login");
Browser.window.dispatchEvent(new Event("resize"));
}
function hideGuestLoginPanel():Void {
ge("#guestlogin").style.display = "none";
ge("#chatline").style.display = "block";
+ ge("#exitBtn").textContent = Lang.get("exit");
if (isAdmin()) ge("#clearchatbtn").style.display = "inline-block";
Browser.window.dispatchEvent(new Event("resize"));
}
diff --git a/src/client/MobileView.hx b/src/client/MobileView.hx
index ad788df..52d06f9 100644
--- a/src/client/MobileView.hx
+++ b/src/client/MobileView.hx
@@ -8,20 +8,19 @@ class MobileView {
public static function init():Void {
final mvbtn = ge("#mv_btn");
mvbtn.onclick = e -> {
- final mobileView = Utils.toggleFullScreen(document.documentElement);
- if (mobileView) {
- document.body.classList.add('mobile-view');
- mvbtn.classList.add('active');
- final vwrap = ge("#videowrap");
- if (vwrap.children[0] == ge("currenttitle")) {
+ final hasMobileView = Utils.toggleFullScreen(document.documentElement);
+ final vwrap = ge("#videowrap");
+ if (hasMobileView) {
+ document.body.classList.add("mobile-view");
+ mvbtn.classList.add("active");
+ if (vwrap.children[0].id == "currenttitle") {
vwrap.appendChild(vwrap.children[0]);
}
} else {
- document.body.classList.remove('mobile-view');
- mvbtn.classList.remove('active');
- final vwrap = ge("videowrap");
- if (vwrap.children[0] != ge("currenttitle")) {
- vwrap.insertBefore(vwrap.children[1],vwrap.children[0]);
+ document.body.classList.remove("mobile-view");
+ mvbtn.classList.remove("active");
+ if (vwrap.children[0].id != "currenttitle") {
+ vwrap.insertBefore(vwrap.children[1], vwrap.children[0]);
}
}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage