diff --git a/code/modules/json/json_writer.dm b/code/modules/json/json_writer.dm index b8309221e7f..0428c2d0d99 100644 --- a/code/modules/json/json_writer.dm +++ b/code/modules/json/json_writer.dm @@ -1,17 +1,8 @@ #define LIST_FLAT 0 #define LIST_NESTED 1 -#define LIST_OBJECT 2 //object in this case means json object, orther wise known as an associative list +#define LIST_OBJECT 2 // Object in this case means json object, ortherwise known as an associative list or array. json_writer/var/use_cache = 0 -json_writer/proc/WriteObject(list/L) - if(use_cache && L["__json_cache"]) - return L["__json_cache"] - . = list() - for(var/k in L) - . += "\"[k]\":[write(L[k])]" - - . = "{[list2text(., ",")]}" - json_writer/proc/write(val) if(isnum(val)) @@ -25,10 +16,19 @@ json_writer/proc/write(val) if (LIST_NESTED) . = write_array(val) if (LIST_OBJECT) - . = WriteObject(val) + . = write_object(val) else . = write_string("[val]") +json_writer/proc/write_object(list/L) + if(use_cache && L["__json_cache"]) + return L["__json_cache"] + . = list() + for(var/k in L) + . += "\"[k]\":[write(L[k])]" + + . = "{[list2text(., ",")]}" + json_writer/proc/write_flat_array(list/L) . = "\[[list2text(L, ",")]]" @@ -53,15 +53,15 @@ json_writer/proc/write_string(txt) return {""[txt]""} json_writer/proc/listtype(list/L) - . = LIST_FLAT + . = LIST_FLAT for(var/key in L) if (. == LIST_FLAT && istype(key, /list)) . = LIST_NESTED - if (!isnum(key) && !isnull(L[key]) && !istype(key, /list)) + if (!isnum(key) && !istype(key, /list)) . = LIST_OBJECT - break // if it's an object, we can just stop now - - + break // If it's an object, we can just stop now. + + #undef LIST_FLAT #undef LIST_NESTED -#undef LIST_OBJECT +#undef LIST_OBJECT diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 0710232e2b2..43a6dadbb8a 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -114,7 +114,9 @@ add_script("nano_base_callbacks.js") // Nano Base Helpers: Template helpers common across all NanoUIs. add_script("nano_base_helpers.js") - // Common style elements + // CSS reset. + add_stylesheet("normalize.css") + // Common style elements. add_stylesheet("shared.css") // Icons. add_stylesheet("icons.css") @@ -184,9 +186,9 @@ **/ /datum/nanoui/proc/get_config_data() var/list/config_data = list( - "title" = sanitize(title), + "title" = title, "srcObject" = list( - "name" = sanitize(src_object.name) + "name" = src_object.name ), "stateKey" = state_key, "status" = status, @@ -368,6 +370,7 @@
+