[MIRROR] adds spoiler function to statpanel (#10515)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-03-23 07:10:55 -07:00
committed by GitHub
parent b737759f85
commit f95f69638e
14 changed files with 118 additions and 18 deletions

View File

@@ -283,7 +283,19 @@ function draw_examine() {
var div_content = document.createElement("div");
for (var i = 0; i < examine.length; i++) {
var parameter = document.createElement('p');
parameter.innerHTML = examine[i];
var textList = examine[i].split("||");
if(textList.length > 1) {
for(var j = 0; j < textList.length; j++) {
var spoilerText = document.createElement('span');
if(j % 2) {
spoilerText.className = "spoiler";
}
spoilerText.innerHTML = textList[j];
parameter.appendChild(spoilerText);
}
} else {
parameter.innerHTML = examine[i];
}
div_content.appendChild(parameter);
}
var images = div_content.querySelectorAll("img");
@@ -1051,8 +1063,8 @@ Byond.subscribeTo('add_admin_tabs', function (ht) {
addPermanentTab("Tickets");
});
Byond.subscribeTo('update_examine', function (S) {
examine = S;
Byond.subscribeTo('update_examine', function (payload) {
examine = payload.EX;
if (examine.length > 0 && !verb_tabs.includes("Examine")) {
verb_tabs.push("Examine");
addPermanentTab("Examine")
@@ -1060,7 +1072,9 @@ Byond.subscribeTo('update_examine', function (S) {
if (current_tab == "Examine") {
draw_examine();
}
//tab_change("Examine"); //This is handled by DM code and a pref setting already
if(payload.UPD) {
tab_change("Examine");
}
})
Byond.subscribeTo('update_sdql2', function (S) {