[MIRROR] Statpanel styles (#9325)

Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-10-26 16:23:55 -07:00
committed by GitHub
parent 0533702085
commit c1a87d7299
8 changed files with 312 additions and 198 deletions

View File

@@ -33,7 +33,6 @@ var turfname = "";
var imageRetryDelay = 500;
var imageRetryLimit = 50;
var menu = document.getElementById('menu');
var under_menu = document.getElementById('under_menu');
var statcontentdiv = document.getElementById('statcontent');
var storedimages = [];
var split_admin_tabs = false;
@@ -59,26 +58,25 @@ function createStatusTab(name) {
if (!verb_tabs.includes(name) && !permanent_tabs.includes(name)) {
return;
}
var B = document.createElement("BUTTON");
B.onclick = function () {
var button = document.createElement("DIV");
button.onclick = function () {
tab_change(name);
this.blur();
};
B.id = name;
B.textContent = name;
B.className = "button";
button.id = name;
button.textContent = name;
button.className = "button";
//ORDERING ALPHABETICALLY
B.style.order = name.charCodeAt(0);
button.style.order = name.charCodeAt(0);
if (name == "Status" || name == "MC") {
B.style.order = name == "Status" ? 1 : 2;
button.style.order = name == "Status" ? 1 : 2;
}
if (name == "Tickets") {
B.style.order = 3;
button.style.order = 3;
}
//END ORDERING
menu.appendChild(B);
menu.appendChild(button);
SendTabToByond(name);
under_menu.style.height = menu.clientHeight + 'px';
}
function removeStatusTab(name) {
@@ -92,7 +90,6 @@ function removeStatusTab(name) {
}
menu.removeChild(document.getElementById(name));
TakeTabFromByond(name);
under_menu.style.height = menu.clientHeight + 'px';
}
function sortVerbs() {
@@ -108,10 +105,6 @@ function sortVerbs() {
})
}
window.onresize = function () {
under_menu.style.height = menu.clientHeight + 'px';
}
function addPermanentTab(name) {
if (!permanent_tabs.includes(name)) {
permanent_tabs.push(name);
@@ -383,6 +376,7 @@ function draw_status() {
} else {
var div = document.createElement("div");
div.textContent = status_tab_parts[i];
div.className = "status-info";
document.getElementById("statcontent").appendChild(div);
}
}
@@ -777,6 +771,23 @@ function set_theme(which) {
}
}
function set_font_size(size) {
document.body.style.setProperty('font-size', size);
}
function set_tabs_style(style) {
if (style == "default") {
menu.classList.add('menu-wrap');
menu.classList.remove('tabs-classic');
} else if (style == "classic") {
menu.classList.add('menu-wrap');
menu.classList.add('tabs-classic');
} else if (style == "scrollable") {
menu.classList.remove('menu-wrap');
menu.classList.remove('tabs-classic');
}
}
function set_style_sheet(sheet) {
if (document.getElementById("goonStyle")) {
var currentSheet = document.getElementById("goonStyle");