diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 1df551e53e7..3877ac213c5 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -63,3 +63,4 @@ #define AREACOORD(src) "[src ? "[get_area_name(src, TRUE)] [COORD(src)]" : "nonexistent location" ]" #define ADMIN_COORDJMP(src) "[src ? "[COORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]" #define ADMIN_VERBOSEJMP(src) "[src ? "[AREACOORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]" +#define ADMIN_SHOWDETAILS(mask, content) "[mask]" \ No newline at end of file diff --git a/code/game/machinery/telecomms/ntsl2.dm b/code/game/machinery/telecomms/ntsl2.dm index fefd1ba1aee..ee9fabd272a 100644 --- a/code/game/machinery/telecomms/ntsl2.dm +++ b/code/game/machinery/telecomms/ntsl2.dm @@ -1,10 +1,10 @@ -GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) -// Custom Implementations for NTSL2 -/* NTSL2 Configuration Datum +GLOBAL_DATUM_INIT(nttc_config, /datum/nttc_configuration, new()) +// Custom Implementations for NTTC +/* NTTC Configuration Datum * This is an abstract handler for the configuration loadout. It's set up like this both for ease of transfering in and out of the UI * as well as allowing users to save and load configurations. */ -/datum/ntsl2_configuration +/datum/nttc_configuration /* Simple Toggles */ var/toggle_activated = TRUE var/toggle_jobs = FALSE @@ -61,7 +61,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) // Used to determine what languages are allowable for conversion. Generated during runtime. var/list/valid_languages = list("--DISABLE--") -/datum/ntsl2_configuration/proc/reset() +/datum/nttc_configuration/proc/reset() /* Simple Toggles */ toggle_activated = initial(toggle_activated) toggle_jobs = initial(toggle_jobs) @@ -80,7 +80,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) firewall = list() -/datum/ntsl2_configuration/proc/update_languages() +/datum/nttc_configuration/proc/update_languages() for(var/language in GLOB.all_languages) var/datum/language/L = GLOB.all_languages[language] if(L.flags & HIVEMIND) @@ -88,7 +88,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) valid_languages[language] = TRUE // I'd use serialize() but it's used by another system. This converts the configuration into a JSON string. -/datum/ntsl2_configuration/proc/ntsl_serialize() +/datum/nttc_configuration/proc/nttc_serialize() . = list() for(var/variable in to_serialize) .[variable] = vars[variable] @@ -96,7 +96,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) // This loads a configuration from a JSON string. // Fucking broken as shit, someone help me fix this. -/datum/ntsl2_configuration/proc/ntsl_deserialize(text, obj/machinery/computer/telecomms/traffic/source) +/datum/nttc_configuration/proc/nttc_deserialize(text, obj/machinery/computer/telecomms/traffic/source) var/list/var_list = json_decode(text) for(var/variable in var_list) if(variable in to_serialize) // Don't just accept any random vars jesus christ! @@ -104,12 +104,12 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) continue var/sanitize_method = serialize_sanitize[variable] var/variable_value = var_list[variable] - variable_value = sanitize(variable_value, sanitize_method) - if(variable_value) + variable_value = nttc_sanitize(variable_value, sanitize_method) + if(variable_value != null) vars[variable] = variable_value // Sanitizing user input. Don't blindly trust the JSON. -/datum/ntsl2_configuration/proc/sanitize(variable, sanitize_method) +/datum/nttc_configuration/proc/nttc_sanitize(variable, sanitize_method) if(!sanitize_method) return null @@ -120,14 +120,17 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) if(!islist(variable)) return list() // Insert html filtering for the regexes here if you're boring - return sanitize(variable) + var/newlist = json_decode(html_decode(json_encode(variable))) + if(!islist(newlist)) + return null + return newlist if("string") return "[variable]" return variable // Primary signal modification. This is where all of the variables behavior are actually implemented. -/datum/ntsl2_configuration/proc/modify_signal(datum/signal/signal) +/datum/nttc_configuration/proc/modify_signal(datum/signal/signal) // Servers are deliberately turned off. Mark every signal as rejected. if(!toggle_activated) signal.data["reject"] = TRUE @@ -163,7 +166,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) var/honklength = split.len var/new_message = "" for(var/i in 1 to honklength) - new_message += pick("HoNK!", "HONK", "HOOOoONK", "HONKHONK!", "HoNnnkKK!!!", "HOOOOOOOOOOONK!!!!11!", "henk!") + new_message += pick("HoNK!", "HONK", "HOOOoONK", "HONKHONK!", "HoNnnkKK!!!", "HOOOOOOOOOOONK!!!!11!", "henk!") + " " signal.data["message"] = new_message @@ -180,15 +183,15 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) var/new_message = original for(var/reg in regex) var/replacePattern = pencode_to_html(regex[reg]) - var/regex/start = new(reg, "gi") - new_message = start.Replace(original, replacePattern) + var/regex/start = regex(reg, "gi") + new_message = start.Replace(new_message, replacePattern) signal.data["message"] = new_message // Make sure the message is valid after we tinkered with it, otherwise reject it if(signal.data["message"] == "" || !signal.data["message"]) signal.data["reject"] = 1 -/datum/ntsl2_configuration/Topic(mob/user, href_list, window_id, obj/machinery/computer/telecomms/traffic/source) +/datum/nttc_configuration/Topic(mob/user, href_list, window_id, obj/machinery/computer/telecomms/traffic/source) // Toggles if(href_list["toggle"]) var/var_to_toggle = href_list["toggle"] @@ -197,7 +200,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) if(!(var_to_toggle in to_serialize)) return vars[var_to_toggle] = !vars[var_to_toggle] - log_action(user, "toggled NTSL2 variable [var_to_toggle] [vars[var_to_toggle] ? "on" : "off"]") + log_action(user, "toggled NTTC variable [var_to_toggle] [vars[var_to_toggle] ? "on" : "off"]") // Strings if(href_list["setting_language"]) @@ -211,7 +214,7 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) setting_language = new_language to_chat(user, "Messages will now be converted to [new_language].") - log_action(user, new_language == "--DISABLE--" ? "disabled NTSL2 language conversion" : "set NTSL2 language conversion to [new_language]", TRUE) + log_action(user, new_language == "--DISABLE--" ? "disabled NTTC language conversion" : "set NTTC language conversion to [new_language]", TRUE) // Tables if(href_list["create_row"]) @@ -262,50 +265,50 @@ GLOBAL_DATUM_INIT(ntsl2_config, /datum/ntsl2_configuration, new()) // Spit out the serialized config to the user if(href_list["save_config"]) - user << browse(ntsl_serialize(), "window=save_ntsl2") + user << browse(nttc_serialize(), "window=save_nttc") if(href_list["load_config"]) - var/json = input(user, "Provide configuration JSON below.", "Load Config", ntsl_serialize()) as message - ntsl_deserialize(json, source) - log_action(user, "has uploaded a NTSL2 JSON configuration: [json]", TRUE) + var/json = input(user, "Provide configuration JSON below.", "Load Config", nttc_serialize()) as message + nttc_deserialize(json, source) + log_action(user, "has uploaded a NTTC JSON configuration: [ADMIN_SHOWDETAILS("Show", json)]", TRUE) - user << output(list2params(list(ntsl_serialize())), "[window_id].browser:updateConfig") + user << output(list2params(list(nttc_serialize())), "[window_id].browser:updateConfig") -/datum/ntsl2_configuration/proc/log_action(user, msg, adminmsg = FALSE) - log_game("NTSL2: [key_name(user)] [msg]") +/datum/nttc_configuration/proc/log_action(user, msg, adminmsg = FALSE) + log_game("NTTC: [key_name(user)] [msg]") log_investigate("[key_name(user)] [msg]", "ntsl") if(adminmsg) message_admins("[key_name_admin(user)] [msg]") /* Asset datum for the UI */ -/datum/asset/simple/ntsl2 +/datum/asset/simple/nttc assets = list( - "bundle.css" = 'html/ntsl2/dist/bundle.css', - "bundle.js" = 'html/ntsl2/dist/bundle.js', - "tab_home.html" = 'html/ntsl2/dist/tab_home.html', - "tab_hack.html" = 'html/ntsl2/dist/tab_hack.html', - "tab_filtering.html" = 'html/ntsl2/dist/tab_filtering.html', - "tab_firewall.html" = 'html/ntsl2/dist/tab_firewall.html', - "tab_regex.html" = 'html/ntsl2/dist/tab_regex.html', - "uiTitleFluff.png" = 'html/ntsl2/dist/uiTitleFluff.png' + "bundle.css" = 'html/nttc/dist/bundle.css', + "bundle.js" = 'html/nttc/dist/bundle.js', + "tab_home.html" = 'html/nttc/dist/tab_home.html', + "tab_hack.html" = 'html/nttc/dist/tab_hack.html', + "tab_filtering.html" = 'html/nttc/dist/tab_filtering.html', + "tab_firewall.html" = 'html/nttc/dist/tab_firewall.html', + "tab_regex.html" = 'html/nttc/dist/tab_regex.html', + "uiTitleFluff.png" = 'html/nttc/dist/uiTitleFluff.png' ) /* Custom subtype of /datum/browser that behaves as we want for our project */ -/datum/browser/ntsl2 - var/initial_config // Initial NTSL2 configuration +/datum/browser/nttc + var/initial_config // Initial NTTC configuration -/datum/browser/ntsl2/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, ntsl2_config) +/datum/browser/nttc/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, nttc_config) . = ..() - initial_config = ntsl2_config + initial_config = nttc_config // Prevent all stylesheets from being added, we have our own CSS that's bundled with gulp -/datum/browser/ntsl2/add_stylesheet() +/datum/browser/nttc/add_stylesheet() return // No header, we're running a fully complete .html file -/datum/browser/ntsl2/get_header() +/datum/browser/nttc/get_header() return // We inject a little code at the bottom of the file, similar to NanoUI, but more limited. // This code is used for delivering live updates of config changes & allowing the UI to provide Topic data. -/datum/browser/ntsl2/get_footer() +/datum/browser/nttc/get_footer() var/byondSrc = "byond://?src=[ref.UID()];" var/dat = "" - var/datum/browser/ntsl2/nt_browser = new(user, name, "NTSL2", 720, 480, src, GLOB.ntsl2_config.ntsl_serialize()) + var/datum/browser/nttc/nt_browser = new(user, name, "NTTC", 720, 480, src, GLOB.nttc_config.nttc_serialize()) nt_browser.set_content(dat) nt_browser.open() window_id = nt_browser.window_id @@ -47,4 +47,4 @@ Reopen the UI to see the difference.") if(!istype(user) || !user.client) return 0 - GLOB.ntsl2_config.Topic(user, href_list, window_id, src) \ No newline at end of file + GLOB.nttc_config.Topic(user, href_list, window_id, src) \ No newline at end of file diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 0462076c016..2b187c0089f 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -3240,6 +3240,13 @@ ticker.mode.station_goals += G modify_goals() + else if(href_list["showdetails"]) + if(!check_rights(R_ADMIN)) + return + var/text = html_decode(href_list["showdetails"]) + usr << browse("Details[replacetext(text, "\n", "
")]
", + "window=show_details;size=500x200") + // Library stuff else if(href_list["library_book_id"]) var/isbn = sanitizeSQL(href_list["library_book_id"]) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index abb83b5b1ae..b50a64dfc4f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -937,19 +937,19 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/reset_all_tcs() set category = "Admin" - set name = "Reset NTSL2 Configuration" - set desc = "Resets NTSL2 to the default configuration." + set name = "Reset NTTC Configuration" + set desc = "Resets NTTC to the default configuration." if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "You sure you want to reset NTSL2?", "Confirm", "Yes", "No") + var/confirm = alert(src, "You sure you want to reset NTTC?", "Confirm", "Yes", "No") if(confirm != "Yes") return - GLOB.ntsl2_config.reset() - log_admin("[key_name(usr)] reset NTSL2 scripts.") - message_admins("[key_name_admin(usr)] reset NTSL2 scripts.") + GLOB.nttc_config.reset() + log_admin("[key_name(usr)] reset NTTC scripts.") + message_admins("[key_name_admin(usr)] reset NTTC scripts.") feedback_add_details("admin_verb","RAT2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/list_ssds() diff --git a/html/ntsl2/.gitignore b/html/nttc/.gitignore similarity index 100% rename from html/ntsl2/.gitignore rename to html/nttc/.gitignore diff --git a/html/ntsl2/dist/bundle.css b/html/nttc/dist/bundle.css similarity index 100% rename from html/ntsl2/dist/bundle.css rename to html/nttc/dist/bundle.css diff --git a/html/ntsl2/dist/bundle.js b/html/nttc/dist/bundle.js similarity index 100% rename from html/ntsl2/dist/bundle.js rename to html/nttc/dist/bundle.js diff --git a/html/ntsl2/dist/index.html b/html/nttc/dist/index.html similarity index 100% rename from html/ntsl2/dist/index.html rename to html/nttc/dist/index.html diff --git a/html/ntsl2/dist/tab_filtering.html b/html/nttc/dist/tab_filtering.html similarity index 100% rename from html/ntsl2/dist/tab_filtering.html rename to html/nttc/dist/tab_filtering.html diff --git a/html/ntsl2/dist/tab_firewall.html b/html/nttc/dist/tab_firewall.html similarity index 100% rename from html/ntsl2/dist/tab_firewall.html rename to html/nttc/dist/tab_firewall.html diff --git a/html/ntsl2/dist/tab_hack.html b/html/nttc/dist/tab_hack.html similarity index 100% rename from html/ntsl2/dist/tab_hack.html rename to html/nttc/dist/tab_hack.html diff --git a/html/ntsl2/dist/tab_home.html b/html/nttc/dist/tab_home.html similarity index 100% rename from html/ntsl2/dist/tab_home.html rename to html/nttc/dist/tab_home.html diff --git a/html/ntsl2/dist/tab_regex.html b/html/nttc/dist/tab_regex.html similarity index 100% rename from html/ntsl2/dist/tab_regex.html rename to html/nttc/dist/tab_regex.html diff --git a/html/ntsl2/dist/uiTitleFluff.png b/html/nttc/dist/uiTitleFluff.png similarity index 100% rename from html/ntsl2/dist/uiTitleFluff.png rename to html/nttc/dist/uiTitleFluff.png diff --git a/html/ntsl2/gulpfile.js b/html/nttc/gulpfile.js similarity index 100% rename from html/ntsl2/gulpfile.js rename to html/nttc/gulpfile.js diff --git a/html/ntsl2/package.json b/html/nttc/package.json similarity index 96% rename from html/ntsl2/package.json rename to html/nttc/package.json index 81d7627c93f..c1d547905c7 100644 --- a/html/ntsl2/package.json +++ b/html/nttc/package.json @@ -1,5 +1,5 @@ { - "name": "ntsl2", + "name": "nttc", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/html/ntsl2/reload.bat b/html/nttc/reload.bat similarity index 100% rename from html/ntsl2/reload.bat rename to html/nttc/reload.bat diff --git a/html/ntsl2/src/css/index.css b/html/nttc/src/css/index.css similarity index 100% rename from html/ntsl2/src/css/index.css rename to html/nttc/src/css/index.css diff --git a/html/ntsl2/src/html/index.html b/html/nttc/src/html/index.html similarity index 100% rename from html/ntsl2/src/html/index.html rename to html/nttc/src/html/index.html diff --git a/html/ntsl2/src/html/tabs/tab_filtering.html b/html/nttc/src/html/tabs/tab_filtering.html similarity index 100% rename from html/ntsl2/src/html/tabs/tab_filtering.html rename to html/nttc/src/html/tabs/tab_filtering.html diff --git a/html/ntsl2/src/html/tabs/tab_firewall.html b/html/nttc/src/html/tabs/tab_firewall.html similarity index 100% rename from html/ntsl2/src/html/tabs/tab_firewall.html rename to html/nttc/src/html/tabs/tab_firewall.html diff --git a/html/ntsl2/src/html/tabs/tab_hack.html b/html/nttc/src/html/tabs/tab_hack.html similarity index 100% rename from html/ntsl2/src/html/tabs/tab_hack.html rename to html/nttc/src/html/tabs/tab_hack.html diff --git a/html/ntsl2/src/html/tabs/tab_home.html b/html/nttc/src/html/tabs/tab_home.html similarity index 100% rename from html/ntsl2/src/html/tabs/tab_home.html rename to html/nttc/src/html/tabs/tab_home.html diff --git a/html/ntsl2/src/html/tabs/tab_regex.html b/html/nttc/src/html/tabs/tab_regex.html similarity index 100% rename from html/ntsl2/src/html/tabs/tab_regex.html rename to html/nttc/src/html/tabs/tab_regex.html diff --git a/html/ntsl2/src/img/uiTitleFluff.png b/html/nttc/src/img/uiTitleFluff.png similarity index 100% rename from html/ntsl2/src/img/uiTitleFluff.png rename to html/nttc/src/img/uiTitleFluff.png diff --git a/html/ntsl2/src/index.js b/html/nttc/src/index.js similarity index 100% rename from html/ntsl2/src/index.js rename to html/nttc/src/index.js diff --git a/html/ntsl2/src/js/link_loader.js b/html/nttc/src/js/link_loader.js similarity index 100% rename from html/ntsl2/src/js/link_loader.js rename to html/nttc/src/js/link_loader.js diff --git a/html/ntsl2/src/js/main.js b/html/nttc/src/js/main.js similarity index 100% rename from html/ntsl2/src/js/main.js rename to html/nttc/src/js/main.js diff --git a/html/ntsl2/src/js/templater.js b/html/nttc/src/js/templater.js similarity index 100% rename from html/ntsl2/src/js/templater.js rename to html/nttc/src/js/templater.js diff --git a/html/ntsl2/src/package.json b/html/nttc/src/package.json similarity index 92% rename from html/ntsl2/src/package.json rename to html/nttc/src/package.json index bbd3cea4d54..a40efa7ba1c 100644 --- a/html/ntsl2/src/package.json +++ b/html/nttc/src/package.json @@ -1,5 +1,5 @@ { - "name": "ntsl2-src", + "name": "nttc-src", "version": "1.0.0", "description": "", "main": "index.js",