diff --git a/baystation12.dme b/baystation12.dme index d4467e60a81..26ed9cc94b9 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1184,6 +1184,7 @@ #include "code\modules\nano\JSON Writer.dm" #include "code\modules\nano\nanoexternal.dm" #include "code\modules\nano\nanomanager.dm" +#include "code\modules\nano\nanomapgen.dm" #include "code\modules\nano\nanoui.dm" #include "code\modules\organs\blood.dm" #include "code\modules\organs\organ.dm" diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 7bc9f9e9a1c..e17d42c8bc7 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -354,3 +354,49 @@ proc/listclearnulls(list/list) var/list/out = insertion_sort_numeric_list_ascending(L) //world.log << " output: [out.len]" return reverselist(out) + +// List of lists, sorts by element[key] - for things like crew monitoring computer sorting records by name. +/proc/sortByKey(var/list/L, var/key) + if(L.len < 2) + return L + var/middle = L.len / 2 + 1 + return mergeKeyedLists(sortByKey(L.Copy(0, middle), key), sortByKey(L.Copy(middle), key), key) + +/proc/mergeKeyedLists(var/list/L, var/list/R, var/key) + var/Li=1 + var/Ri=1 + var/list/result = new() + while(Li <= L.len && Ri <= R.len) + if(sorttext(L[Li][key], R[Ri][key]) < 1) + // Works around list += list2 merging lists; it's not pretty but it works + result += "temp item" + result[result.len] = R[Ri++] + else + result += "temp item" + result[result.len] = L[Li++] + + if(Li <= L.len) + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) + + +//Mergesort: any value in a list, preserves key=value structure +/proc/sortAssoc(var/list/L) + if(L.len < 2) + return L + var/middle = L.len / 2 + 1 // Copy is first,second-1 + return mergeAssoc(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle))) //second parameter null = to end of list + +/proc/mergeAssoc(var/list/L, var/list/R) + var/Li=1 + var/Ri=1 + var/list/result = new() + while(Li <= L.len && Ri <= R.len) + if(sorttext(L[Li], R[Ri]) < 1) + result += R&R[Ri++] + else + result += L&L[Li++] + + if(Li <= L.len) + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) \ No newline at end of file diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 24d6425b814..091d4a9f7c5 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -6,27 +6,29 @@ idle_power_usage = 250 active_power_usage = 500 circuit = "/obj/item/weapon/circuitboard/crew" + var/list/tracked = list( ) var/track_special_role - var/list/tracked -/obj/machinery/computer/crew/Destroy() - if(tracked) - tracked = null +/obj/machinery/computer/crew/New() + tracked = list() ..() + /obj/machinery/computer/crew/attack_ai(mob/user) - src.add_hiddenprint(user) attack_hand(user) - interact(user) + ui_interact(user) + /obj/machinery/computer/crew/attack_hand(mob/user) add_fingerprint(user) if(stat & (BROKEN|NOPOWER)) return - interact(user) + ui_interact(user) + /obj/machinery/computer/crew/update_icon() + if(stat & BROKEN) icon_state = "crewb" else @@ -37,40 +39,37 @@ icon_state = initial(icon_state) stat &= ~NOPOWER + /obj/machinery/computer/crew/Topic(href, href_list) if(..()) return if (src.z > 6) usr << "\red Unable to establish a connection: \black You're too far away from the station!" - return + return 0 if( href_list["close"] ) - usr << browse(null, "window=crewcomp") + var/mob/user = usr + var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main") usr.unset_machine() - return + ui.close() + return 0 if(href_list["update"]) src.updateDialog() - return + return 1 /obj/machinery/computer/crew/interact(mob/user) + ui_interact(user) + +/obj/machinery/computer/crew/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) if(stat & (BROKEN|NOPOWER)) return - if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1) - user.unset_machine() - user << browse(null, "window=powcomp") - return user.set_machine(src) - var/t = "Crew Monitoring
" + src.scan() + + var/data[0] + var/list/crewmembers = list() + + for(var/obj/item/clothing/under/C in src.tracked) - // AUTOFIXED BY fix_string_idiocy.py - // C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\computer\crew.dm:67: t += "
Refresh " - t += {"
Refresh - Close
- "} - // END AUTOFIX - var/list/logs = list() - scan() - for(var/obj/item/clothing/under/C in tracked) - var/log = "" var/turf/pos = get_turf(C) if((C) && (C.has_sensor) && (pos) && (pos.z == src.z) && C.sensor_mode) @@ -78,39 +77,55 @@ var/mob/living/carbon/human/H = C.loc - var/dam1 = round(H.getOxyLoss(),1) - var/dam2 = round(H.getToxLoss(),1) - var/dam3 = round(H.getFireLoss(),1) - var/dam4 = round(H.getBruteLoss(),1) + var/list/crewmemberData = list() - var/life_status = "[H.stat > 1 ? "Deceased" : "Living"]" - var/damage_report = "([dam1]/[dam2]/[dam3]/[dam4])" + crewmemberData["sensor_type"] = C.sensor_mode + crewmemberData["dead"] = H.stat > 1 + crewmemberData["oxy"] = round(H.getOxyLoss(), 1) + crewmemberData["tox"] = round(H.getToxLoss(), 1) + crewmemberData["fire"] = round(H.getFireLoss(), 1) + crewmemberData["brute"] = round(H.getBruteLoss(), 1) - if(H.wear_id) - log += "" - else - log += "" + crewmemberData["name"] = "Unknown" + crewmemberData["rank"] = "Unknown" + if(H.wear_id && istype(H.wear_id, /obj/item/weapon/card/id) ) + var/obj/item/weapon/card/id/I = H.wear_id + crewmemberData["name"] = I.name + crewmemberData["rank"] = I.rank + else if(H.wear_id && istype(H.wear_id, /obj/item/device/pda) ) + var/obj/item/device/pda/P = H.wear_id + crewmemberData["name"] = (P.id ? P.id.name : "Unknown") + crewmemberData["rank"] = (P.id ? P.id.rank : "Unknown") - switch(C.sensor_mode) - if(1) - log += "" - if(2) - log += "" - if(3) - var/area/player_area = get_area(H) - log += "" - logs += log - logs = sortList(logs) - for(var/log in logs) - t += log + crewmemberData["area"] = get_area(H) + crewmemberData["x"] = pos.x + crewmemberData["y"] = pos.y - // AUTOFIXED BY fix_string_idiocy.py - // C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\computer\crew.dm:104: t += "
NameVitalsPosition
[H.wear_id.name]
Unknown[life_status]Not Available
[life_status] [damage_report]Not Available
[life_status] [damage_report][player_area.name] ([pos.x-WORLD_X_OFFSET], [pos.y-WORLD_Y_OFFSET])
" - t += {" -
"} - // END AUTOFIX - user << browse(t, "window=crewcomp;size=900x600") - onclose(user, "crewcomp") + // Works around list += list2 merging lists; it's not pretty but it works + crewmembers += "temporary item" + crewmembers[crewmembers.len] = crewmemberData + + crewmembers = sortByKey(crewmembers, "name") + + data["crewmembers"] = crewmembers + + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if(!ui) + ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800) + + // adding a template with the key "mapContent" enables the map ui functionality + ui.add_template("mapContent", "crew_monitor_map_content.tmpl") + // adding a template with the key "mapHeader" replaces the map header content + ui.add_template("mapHeader", "crew_monitor_map_header.tmpl") + + // we want to show the map by default + ui.set_show_map(1) + + ui.set_initial_data(data) + ui.open() + + // should make the UI auto-update; doesn't seem to? + ui.set_auto_update(1) /obj/machinery/computer/crew/proc/is_scannable(const/obj/item/clothing/under/C, const/mob/living/carbon/human/H) if(!istype(H)) @@ -122,12 +137,10 @@ return H.mind.special_role == track_special_role /obj/machinery/computer/crew/proc/scan() - tracked = new - for(var/mob/living/carbon/human/H in mob_list) if(istype(H.w_uniform, /obj/item/clothing/under)) - var/obj/item/clothing/under/U = H.w_uniform - - if(is_scannable(U, H)) - if(!(U in tracked)) - tracked += U + var/obj/item/clothing/under/C = H.w_uniform + if (C.has_sensor) + if(is_scannable(C, H)) + tracked |= C + return 1 \ No newline at end of file diff --git a/code/modules/mining/surprise.dm b/code/modules/mining/surprise.dm index 1db84ed3be9..f8e2492ccc2 100644 --- a/code/modules/mining/surprise.dm +++ b/code/modules/mining/surprise.dm @@ -54,8 +54,10 @@ var/global/list/mining_surprises = typesof(/mining_surprise)-/mining_surprise proc/UpdateTurf(var/turf/T, var/no_adjacent=0) // List types in this turf. var/surprise_turf_info/sti = GetTurfInfo(T) - - sti.types=0 + if(!istype(sti.types) || isnull(sti.types)) + sti.types = new/list() + else + sti.types.len = 0 for(var/atom/A in T.contents) sti.types |= A.type diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index 2331debd9be..1b9f1335471 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -1,5 +1,5 @@ - // This file contains all Nano procs/definitions for external classes/objects - + // This file contains all Nano procs/definitions for external classes/objects + /** * Called when a Nano UI window is closed * This is how Nano handles closed windows @@ -15,7 +15,7 @@ if (istype(ui)) ui.close() - + if(ui.ref) var/href = "close=1" src.Topic(href, params2list(href), ui.ref) // this will direct to the atom's Topic() proc via client.Topic() @@ -31,13 +31,14 @@ * ui_interact is currently defined for /atom/movable * * @param user /mob The mob who is interacting with this ui - * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") + * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") * @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui + * @param force_open boolean Force the UI to (re)open, even if it's already open * * @return nothing */ -/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) +/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) return - + // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob /mob/var/list/open_uis = list() diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index 76ca4df9d4b..3fd9ef825a7 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -1,23 +1,20 @@ // This is the window/UI manager for Nano UI // There should only ever be one (global) instance of nanomanger /datum/nanomanager - // A list of current open /nanoui UIs, grouped by src_object and ui_key. + // a list of current open /nanoui UIs, grouped by src_object and ui_key var/open_uis[0] - - // A list of current open /nanoui UIs, not grouped, for use in processing. + // a list of current open /nanoui UIs, not grouped, for use in processing var/list/processing_uis = list() - - // A list of asset filenames which are to be sent to the client on user logon. + // a list of asset filenames which are to be sent to the client on user logon var/list/asset_files = list() /** * Create a new nanomanager instance. + * This proc generates a list of assets which are to be sent to each client on connect * * @return /nanomanager new nanomanager object */ /datum/nanomanager/New() - . = ..() - var/list/nano_asset_dirs = list(\ "nano/css/",\ "nano/images/",\ @@ -25,14 +22,14 @@ "nano/templates/"\ ) - var/list/filenames - - for(var/path in nano_asset_dirs) + var/list/filenames = null + for (var/path in nano_asset_dirs) filenames = flist(path) - for(var/filename in filenames) - if(copytext(filename, length(filename)) != "/") // Filenames which end in "/" are actually directories, which we want to ignore. - asset_files += file(path + filename) // Add this file to asset_files for sending to clients when they connect. + if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore + asset_files.Add(file(path + filename)) // add this file to asset_files for sending to clients when they connect + + return /** * Get an open /nanoui ui for the current user, src_object and ui_key and try to update it with data @@ -42,19 +39,23 @@ * @param ui_key string A string key used for the ui * @param ui /datum/nanoui An existing instance of the ui (can be null) * @param data list The data to be passed to the ui, if it exists + * @param force_open boolean The ui is being forced to (re)open, so close ui if it exists (instead of updating) * * @return /nanoui Returns the found ui, for null if none exists */ -/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data) +/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0) if (isnull(ui)) // no ui has been passed, so we'll search for one { ui = get_open_ui(user, src_object, ui_key) } if (!isnull(ui)) - // The UI is already open so push the data to it - ui.push_data(data) - return ui - + // The UI is already open + if (!force_open) + ui.push_data(data) + return ui + else + //testing("nanomanager/try_update_ui mob [user.name] [src_object:name] [ui_key] [force_open] - forcing opening of ui") + ui.close() return null /** @@ -69,14 +70,17 @@ /datum/nanomanager/proc/get_open_ui(var/mob/user, src_object, ui_key) var/src_object_key = "\ref[src_object]" if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list)) + //testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open") return null else if (isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list)) + //testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open for this object") return null for (var/datum/nanoui/ui in open_uis[src_object_key][ui_key]) if (ui.user == user) return ui + //testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - ui not found") return null /** @@ -131,6 +135,7 @@ */ /datum/nanomanager/proc/close_user_uis(var/mob/user, src_object = null, ui_key = null) if (isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0) + //testing("nanomanager/close_user_uis mob [user.name] has no open uis") return 0 // has no open uis var/close_count = 0 @@ -139,6 +144,8 @@ ui.close() close_count++ + //testing("nanomanager/close_user_uis mob [user.name] closed [open_uis.len] of [close_count] uis") + return close_count /** @@ -160,6 +167,7 @@ var/list/uis = open_uis[src_object_key][ui.ui_key] uis.Add(ui) processing_uis.Add(ui) + //testing("nanomanager/ui_opened mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]") /** * Remove a /nanoui ui from the list of open uis @@ -179,7 +187,11 @@ processing_uis.Remove(ui) ui.user.open_uis.Remove(ui) var/list/uis = open_uis[src_object_key][ui.ui_key] - return uis.Remove(ui) + uis.Remove(ui) + + //testing("nanomanager/ui_closed mob [ui.user.name] [ui.src_object:name] [ui.ui_key] - user.open_uis [ui.user.open_uis.len] | uis [uis.len] | processing_uis [processing_uis.len]") + + return 1 /** * This is called on user logout @@ -192,6 +204,7 @@ // /datum/nanomanager/proc/user_logout(var/mob/user) + //testing("nanomanager/user_logout user [user.name]") return close_user_uis(user) /** @@ -204,7 +217,9 @@ * @return nothing */ /datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob) - if (!oldMob || isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0) + //testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]") + if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0) + //testing("nanomanager/user_transferred mob [oldMob.name] has no open uis") return 0 // has no open uis if (isnull(newMob.open_uis) || !istype(newMob.open_uis, /list)) @@ -226,6 +241,8 @@ * * @return nothing */ -/datum/nanomanager/proc/send_resources(const/client) + +/datum/nanomanager/proc/send_resources(client) for(var/file in asset_files) - client << browse_rsc(file) // Send the file to the client. + client << browse_rsc(file) // send the file to the client + diff --git a/code/modules/nano/nanomapgen.dm b/code/modules/nano/nanomapgen.dm new file mode 100644 index 00000000000..9b2793c435a --- /dev/null +++ b/code/modules/nano/nanomapgen.dm @@ -0,0 +1,80 @@ +// This file is a modified version of https://raw2.github.com/Baystation12/OldCode-BS12/master/code/TakePicture.dm + +#define NANOMAP_ICON_SIZE 4 +#define NANOMAP_MAX_ICON_DIMENSION 1024 + +#define NANOMAP_TILES_PER_IMAGE (NANOMAP_MAX_ICON_DIMENSION / NANOMAP_ICON_SIZE) + +#define NANOMAP_TERMINALERR 5 +#define NANOMAP_INPROGRESS 2 +#define NANOMAP_BADOUTPUT 2 +#define NANOMAP_SUCCESS 1 +#define NANOMAP_WATCHDOGSUCCESS 4 +#define NANOMAP_WATCHDOGTERMINATE 3 + + +//Call these procs to dump your world to a series of image files (!!) +//NOTE: Does not explicitly support non 32x32 icons or stuff with large pixel_* values, so don't blame me if it doesn't work perfectly + +/mob/verb/nanomapgen_DumpImage() + set category = "Server" + set name = "Generate NanoUI Map" + + if(!src.client.holder) + src << "Only administrators may use this command." + return + nanomapgen_DumpTile() + +/mob/proc/nanomapgen_DumpTile(var/startX = 1, var/startY = 1, var/currentZ = 1, var/endX = -1, var/endY = -1) + + if (endX < 0 || endX > world.maxx) + endX = world.maxx + + if (endY < 0 || endY > world.maxy) + endY = world.maxy + + if (startX > endX) + world.log << "NanoMapGen: ERROR: startX ([startX]) cannot be greater than endX ([endX])" + sleep(3) + return NANOMAP_TERMINALERR + + if (startY > endX) + world.log << "NanoMapGen: ERROR: startY ([startY]) cannot be greater than endY ([endY])" + sleep(3) + return NANOMAP_TERMINALERR + + var/icon/Tile = icon(file("nano/mapbase1024.png")) + if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) + world.log << "NanoMapGen: ERROR: BASE IMAGE DIMENSIONS ARE NOT [NANOMAP_MAX_ICON_DIMENSION]x[NANOMAP_MAX_ICON_DIMENSION]" + sleep(3) + return NANOMAP_TERMINALERR + + world.log << "NanoMapGen: GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])" + + var/count = 0; + for(var/WorldX = startX, WorldX <= endX, WorldX++) + for(var/WorldY = startY, WorldY <= endY, WorldY++) + + var/atom/Turf = locate(WorldX, WorldY, currentZ) + + var/icon/TurfIcon = new(Turf.icon, Turf.icon_state, Turf.dir, 1, 0) + TurfIcon.Scale(NANOMAP_ICON_SIZE, NANOMAP_ICON_SIZE) + + Tile.Blend(TurfIcon, ICON_OVERLAY, ((WorldX - 1) * NANOMAP_ICON_SIZE), ((WorldY - 1) * NANOMAP_ICON_SIZE)) + + count++ + + if (count % 1024 == 0) + world.log << "NanoMapGen: [count] tiles done" + sleep(5) + + world.log << "NanoMapGen: sending nanoMap.png to client" + + usr << browse(Tile, "window=picture;file=nanoMap.png;display=0") + + world.log << "NanoMapGen: Done." + + if (Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) + return NANOMAP_BADOUTPUT + + return NANOMAP_SUCCESS \ No newline at end of file diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 50f5c5b0710..bb027cd9359 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -8,8 +8,8 @@ nanoui is used to open and update nano browser uis #define STATUS_INTERACTIVE 2 // GREEN Visability -#define STATUS_UPDATE 1 // ORANGE Visability -#define STATUS_DISABLED 0 // RED Visability +#define STATUS_UPDATE 1 // ORANGE Visability +#define STATUS_DISABLED 0 // RED Visability /datum/nanoui // the user who opened this ui @@ -18,8 +18,6 @@ nanoui is used to open and update nano browser uis var/atom/movable/src_object // the title of this ui var/title - // /vg/ - Whether to write debug information to nano/debug.html - var/writeDebug=TRUE // the key of this ui, this is to allow multiple (different) uis for each src_object var/ui_key // window_id is used as the window name/identifier for browse and onclose @@ -38,11 +36,18 @@ nanoui is used to open and update nano browser uis var/list/stylesheets = list() // the list of javascript scripts to use for this ui var/list/scripts = list() - // the list of templates to use with this ui (usually just one) + // a list of templates which can be used with this ui var/templates[0] - // the body content for this ui, do not change unless you know what you're doing - // the #mainTemplate div will contain the compiled "main" template html - var/content = "
" + // the layout key for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing) + var/layout_key = "default" + // this sets whether to re-render the ui layout with each update (default 0, turning on will break the map ui if it's in use) + var/auto_update_layout = 0 + // this sets whether to re-render the ui content with each update (default 1) + var/auto_update_content = 1 + // the default state to use for this ui (this is used on the frontend, leave it as "default" unless you know what you're doing) + var/state_key = "default" + // show the map ui, this is used by the default layout + var/show_map = 0 // initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on) var/list/initial_data[0] // set to 1 to update the ui automatically every master_controller tick @@ -59,7 +64,7 @@ nanoui is used to open and update nano browser uis * @param nuser /mob The mob who has opened/owns this ui * @param nsrc_object /obj|/mob The obj or mob which this ui belongs to * @param nui_key string A string key to use for this ui. Allows for multiple unique uis on one src_oject - * @param ntemplate string The name of the template file from /nano/templates (e.g. "my_template.tmpl") + * @param ntemplate string The filename of the template file from /nano/templates (e.g. "my_template.tmpl") * @param ntitle string The title of this ui * @param nwidth int the width of the ui window * @param nheight int the height of the ui window @@ -67,14 +72,14 @@ nanoui is used to open and update nano browser uis * * @return /nanoui new nanoui object */ -/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null) +/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null) user = nuser src_object = nsrc_object ui_key = nui_key window_id = "[ui_key]\ref[src_object]" - // Add the passed template as the 'main' template, this is required - add_template("main", ntemplate) + // add the passed template filename as the "main" template, this is required + add_template("main", ntemplate_filename) if (ntitle) title = ntitle @@ -88,21 +93,19 @@ nanoui is used to open and update nano browser uis add_common_assets() /** - * Use this proc to add assets which are common to all nano uis + * Use this proc to add assets which are common to (and required by) all nano uis * * @return nothing */ /datum/nanoui/proc/add_common_assets() - add_script("libraries.min.js") // The jQuery library - - // /vg/ - //add_script("1-jquery.js") - //add_script("2-jsrender.js") - //add_script("3-jquery.timers.js") - - add_script("nano_config.js") // The NanoConfig JS, this is used to store configuration values. - add_script("nano_update.js") // The NanoUpdate JS, this is used to receive updates and apply them. - add_script("nano_base_helpers.js") // The NanoBaseHelpers JS, this is used to set up template helpers which are common to all templates + add_script("libraries.min.js") // A JS file comprising of jQuery, doT.js and jQuery Timer libraries (compressed together) + add_script("nano_utility.js") // The NanoUtility JS, this is used to store utility functions. + add_script("nano_template.js") // The NanoTemplate JS, this is used to render templates. + add_script("nano_state_manager.js") // The NanoStateManager JS, it handles updates from the server and passes data to the current state + add_script("nano_state.js") // The NanoState JS, this is the base state which all states must inherit from + add_script("nano_state_default.js") // The NanoStateDefault JS, this is the "default" state (used by all UIs by default), which inherits from NanoState + add_script("nano_base_callbacks.js") // The NanoBaseCallbacks JS, this is used to set up (before and after update) callbacks which are common to all UIs + add_script("nano_base_helpers.js") // The NanoBaseHelpers JS, this is used to set up template helpers which are common to all UIs add_stylesheet("shared.css") // this CSS sheet is common to all UIs add_stylesheet("icons.css") // this CSS sheet is common to all UIs @@ -115,12 +118,15 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/set_status(state, push_update) - if (state != status) - status = state - if (push_update || !status) - push_data(list(), 1) // Update the UI, force the update in case the status is 0 - else - status = state + if (state != status) // Only update if it is different + if (status == STATUS_DISABLED) + status = state + if (push_update) + update() + else + status = state + if (push_update || status == 0) + push_data(null, 1) // Update the UI, force the update in case the status is 0, data is null so that previous data is used /** * Update the status (visibility) of this ui based on the user's status @@ -129,7 +135,7 @@ nanoui is used to open and update nano browser uis * * @return nothing */ -/datum/nanoui/proc/update_status(push_update = 0) +/datum/nanoui/proc/update_status(var/push_update = 0) if (istype(user, /mob/living/silicon/ai)) set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility) else if (istype(user, /mob/living/silicon/robot)) @@ -166,8 +172,8 @@ nanoui is used to open and update nano browser uis * * @return nothing */ -/datum/nanoui/proc/set_auto_update(state = 1) - is_auto_updating = state +/datum/nanoui/proc/set_auto_update(nstate = 1) + is_auto_updating = nstate /** * Set the initial data for the ui. This is vital as the data structure set here cannot be changed when pushing new updates. @@ -177,21 +183,42 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/set_initial_data(list/data) - initial_data = add_default_data(data) + initial_data = data /** - * Add default data to the data being sent to the ui. + * Get config data to sent to the ui. * - * @param data /list The list of data to be modified - * - * @return /list modified data + * @return /list config data */ -/datum/nanoui/proc/add_default_data(list/data) - data["ui"] = list( +/datum/nanoui/proc/get_config_data() + var/list/config_data = list( + "title" = title, + "srcObject" = list("name" = src_object.name), + "stateKey" = state_key, "status" = status, + "autoUpdateLayout" = auto_update_layout, + "autoUpdateContent" = auto_update_content, + "showMap" = show_map, "user" = list("name" = user.name) ) - return data + return config_data + + /** + * Get data to sent to the ui. + * + * @param data /list The list of general data for this ui (can be null to use previous data sent) + * + * @return /list data to send to the ui + */ +/datum/nanoui/proc/get_send_data(var/list/data) + var/list/config_data = get_config_data() + + var/list/send_data = list("config" = config_data) + + if (!isnull(data)) + send_data["data"] = data + + return send_data /** * Set the browser window options for this ui @@ -205,6 +232,7 @@ nanoui is used to open and update nano browser uis /** * Add a CSS stylesheet to this UI + * These must be added before the UI has been opened, adding after that will have no effect * * @param file string The name of the CSS file from /nano/css (e.g. "my_style.css") * @@ -215,6 +243,7 @@ nanoui is used to open and update nano browser uis /** * Add a JavsScript script to this UI + * These must be added before the UI has been opened, adding after that will have no effect * * @param file string The name of the JavaScript file from /nano/js (e.g. "my_script.js") * @@ -224,30 +253,71 @@ nanoui is used to open and update nano browser uis scripts.Add(file) /** - * Add a template to this UI + * Add a template for this UI * Templates are combined with the data sent to the UI to create the rendered view - * Each template needs a div in ui.content to contain the rendered content. - * The div format is '
' where is replaced with the templater's key. - * All UIs are set up by default to use a 'main' template, so only use this proc if you want to add advanced functionality. + * These must be added before the UI has been opened, adding after that will have no effect * - * @param key string The key name for this template, used to identify the div to render this template into ('
') - * @param file string The name of the template file from /nano/templates (e.g. "my_template.tmpl") + * @param key string The key which is used to reference this template in the frontend + * @param filename string The name of the template file from /nano/templates (e.g. "my_template.tmpl") * * @return nothing */ -/datum/nanoui/proc/add_template(key, file) - templates[key] = file +/datum/nanoui/proc/add_template(key, filename) + templates[key] = filename /** - * Set the HTML content of the UI - * This should only really be used to add more template divs (see the add_template() proc) + * Set the layout key for use in the frontend Javascript + * The layout key is the basic layout key for the page + * Two files are loaded on the client based on the layout key varable: + * -> a template in /nano/templates with the filename "layout_.tmpl + * -> a CSS stylesheet in /nano/css with the filename "layout_.css * - * @param ncontent string The new HTML content for this UI + * @param nlayout string The layout key to use * * @return nothing */ -/datum/nanoui/proc/set_content(ncontent) - content = ncontent +/datum/nanoui/proc/set_layout_key(nlayout_key) + layout_key = lowertext(nlayout_key) + + /** + * Set the ui to update the layout (re-render it) on each update, turning this on will break the map ui (if it's being used) + * + * @param state int (bool) Set update to 1 or 0 (true/false) (default 0) + * + * @return nothing + */ +/datum/nanoui/proc/set_auto_update_layout(nstate) + auto_update_layout = nstate + + /** + * Set the ui to update the main content (re-render it) on each update + * + * @param state int (bool) Set update to 1 or 0 (true/false) (default 1) + * + * @return nothing + */ +/datum/nanoui/proc/set_auto_update_content(nstate) + auto_update_content = nstate + + /** + * Set the state key for use in the frontend Javascript + * + * @param nstate_key string The key of the state to use + * + * @return nothing + */ +/datum/nanoui/proc/set_state_key(nstate_key) + state_key = nstate_key + + /** + * Toggle showing the map ui + * + * @param nstate_key boolean 1 to show map, 0 to hide (default is 0) + * + * @return nothing + */ +/datum/nanoui/proc/set_show_map(nstate) + show_map = nstate /** * Set whether or not to use the "old" on close logic (mainly unset_machine()) @@ -260,11 +330,16 @@ nanoui is used to open and update nano browser uis on_close_logic = state /** - * Return the HTML header content for this UI + * Return the HTML for this UI * - * @return string HTML header content + * @return string HTML for the UI */ -/datum/nanoui/proc/get_header() +/datum/nanoui/proc/get_html() + + // before the UI opens, add the layout files based on the layout key + add_stylesheet("layout_[layout_key].css") + add_template("layout", "layout_[layout_key].tmpl") + var/head_content = "" for (var/filename in scripts) @@ -273,67 +348,45 @@ nanoui is used to open and update nano browser uis for (var/filename in stylesheets) head_content += " " - var/templatel_data[0] - for (var/key in templates) - templatel_data[key] = templates[key]; - var/template_data_json = "{}" // An empty JSON object - if (templatel_data.len > 0) - template_data_json = list2json(templatel_data) + if (templates.len > 0) + template_data_json = list2json(templates) - var/initial_data_json = "{}" // An empty JSON object - if (initial_data.len > 0) - initial_data_json = list2json(initial_data) + var/list/send_data = get_send_data(initial_data) + var/initial_data_json = list2json(send_data) var/url_parameters_json = list2json(list("src" = "\ref[src]")) - return {" + return {" + [head_content] - -
- [title ? "
[title]
" : ""] -
-
Initiating...
- "} - - /** - * Return the HTML footer content for this UI - * - * @return string HTML footer content - */ -/datum/nanoui/proc/get_footer() - - return {" -
+ +
+ -"} - - /** - * Return the HTML for this UI - * - * @return string HTML for the UI - */ -/datum/nanoui/proc/get_html() - return {" - [get_header()] - [content] - [get_footer()] + "} /** @@ -342,16 +395,12 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/open() + var/window_size = "" if (width && height) window_size = "size=[width]x[height];" update_status(0) - var/html=get_html() - if(src.writeDebug) - var/f = file("nano/debug.html") - fdel(f) - f << html - user << browse(html, "window=[window_id];[window_size][window_options]") + user << browse(get_html(), "window=[window_id];[window_size][window_options]") winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map on_close_winset() //onclose(user, window_id) @@ -390,9 +439,10 @@ nanoui is used to open and update nano browser uis if (status == STATUS_DISABLED && !force_push) return // Cannot update UI, no visibility - data = add_default_data(data) + var/list/send_data = get_send_data(data) + //user << list2json(data) // used for debugging - user << output(list2params(list(list2json(data))),"[window_id].browser:receiveUpdateData") + user << output(list2params(list(list2json(send_data))),"[window_id].browser:receiveUpdateData") /** * This Topic() proc is called whenever a user clicks on a link within a Nano UI @@ -406,7 +456,13 @@ nanoui is used to open and update nano browser uis if (status != STATUS_INTERACTIVE || user != usr) // If UI is not interactive or usr calling Topic is not the UI user return - if (src_object && src_object.Topic(href, href_list)) + // This is used to toggle the nano map ui + var/show_map_updated = 0 + if(href_list["showMap"]) + set_show_map(text2num(href_list["showMap"])) + show_map_updated = 1 + + if ((src_object && src_object.Topic(href, href_list)) || show_map_updated) nanomanager.update_uis(src_object) // update all UIs attached to src_object /** @@ -423,7 +479,15 @@ nanoui is used to open and update nano browser uis return if (status && (update || is_auto_updating)) - src_object.ui_interact(user, ui_key, src) // Update the UI (update_status() is called whenever a UI is updated) + update() // Update the UI (update_status() is called whenever a UI is updated) else update_status(1) // Not updating UI, so lets check here if status has changed + /** + * Update the UI + * + * @return nothing + */ +/datum/nanoui/proc/update(var/force_open = 0) + src_object.ui_interact(user, ui_key, src, force_open) + diff --git a/html/changelog.html b/html/changelog.html index 21f1b12cb2d..3d46f4bdf1f 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -74,6 +74,14 @@ should be listed in the changelog upon commit though. Thanks. --> +
+

2014.07.19

+

Pomf123 updated:

+
    +
  • Imported bay12 NanoUI fixes and updates.
  • +
  • Crew monitor now uses NanoUI and contains a map to easily locate people with their sensors on.
  • +
+

2014.07.18

N3X15 updated:

diff --git a/nano/css/icons.css b/nano/css/icons.css index e20af950536..f3e207e63e5 100644 --- a/nano/css/icons.css +++ b/nano/css/icons.css @@ -225,4 +225,86 @@ .uiIcon16.icon-grip-solid-vertical { background-position: -32px -224px; } .uiIcon16.icon-grip-solid-horizontal { background-position: -48px -224px; } .uiIcon16.icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.uiIcon16.icon-grip-diagonal-se { background-position: -80px -224px; } \ No newline at end of file +.uiIcon16.icon-grip-diagonal-se { background-position: -80px -224px; } + +.mapIcon16 { + position: absolute; + width: 16px; + height: 16px; + margin: -8px 0 0 -8px; + background-image: url(uiIcons16Green.png); + background-position: -144px -96px; + background-repeat: no-repeat; + zoom: 0.125; +} +.mapIcon16.dead { + background-image: url(uiIcons16Red.png); +} + +/* Command Positions */ +.mapIcon16.rank-captain { + background-position: -224px -112px; +} +.mapIcon16.rank-headofpersonnel { + background-position: -112px -96px; +} +.mapIcon16.rank-headofsecurity { + background-position: -112px -128px; +} +.mapIcon16.rank-chiefengineer { + background-position: -176px -112px; +} +.mapIcon16.rank-researchdirector { + background-position: -128px -128px; +} +.mapIcon16.rank-chiefmedicalofficer { + background-position: -32px -128px; +} + +/* Engineering Positions */ +.mapIcon16.rank-stationengineer { + background-position: -176px -112px; +} +.mapIcon16.rank-atmospherictechnician { + background-position: -176px -112px; +} + +/* Medical Positions */ +.mapIcon16.rank-medicaldoctor { + background-position: -32px -128px; +} +.mapIcon16.rank-geneticist { + background-position: -32px -128px; +} +.mapIcon16.rank-psychiatrist { + background-position: -32px -128px; +} +.mapIcon16.rank-chemist { + background-position: -32px -128px; +} + +/* Science Positions */ +.mapIcon16.rank-scientist { + background-position: -128px -128px; +} +.mapIcon16.rank-geneticist { + background-position: -128px -128px; +} +.mapIcon16.rank-roboticist { + background-position: -128px -128px; +} +.mapIcon16.rank-xenobiologist { + background-position: -128px -128px; +} + +/* Security Positions */ +.mapIcon16.rank-warden { + background-position: -112px -128px; +} +.mapIcon16.rank-detective { + background-position: -112px -128px; +} +.mapIcon16.rank-securityofficer { + background-position: -112px -128px; +} + diff --git a/nano/css/layout_basic.css b/nano/css/layout_basic.css new file mode 100644 index 00000000000..30a75490f39 --- /dev/null +++ b/nano/css/layout_basic.css @@ -0,0 +1,21 @@ +body { + background: #272727 url(uiBasicBackground.png) 50% 0 repeat-x; +} + +#uiContent { + clear: both; + padding: 8px; +} + +#uiLoadingNotice { + position: relative; + background: url(uiNoticeBackground.jpg) 50% 50%; + color: #000000; + font-size: 14px; + font-style: italic; + font-weight: bold; + padding: 3px 4px 3px 4px; + margin: 4px 0 4px 0; +} + + diff --git a/nano/css/layout_default.css b/nano/css/layout_default.css new file mode 100644 index 00000000000..eae4d398586 --- /dev/null +++ b/nano/css/layout_default.css @@ -0,0 +1,126 @@ +body { + background: #272727 url(uiBackground.png) 50% 0 repeat-x; +} + +#uiWrapper { + width: 100%; + height: 100%; + -ms-user-select: none; + user-select: none; +} + +#uiTitleWrapper { + position: relative; + height: 30px; +} + +#uiTitleText { + position: absolute; + top: 6px; + left: 44px; + width: 66%; + overflow: hidden; + color: #E9C183; + font-size: 16px; +} + +#uiTitle.icon { + padding: 6px 8px 6px 42px; + background-position: 2px 50%; + background-repeat: no-repeat; +} + +#uiTitleFluff { + position: absolute; + top: 4px; + right: 12px; + width: 42px; + height: 24px; + background: url(uiTitleFluff.png) 50% 50% no-repeat; +} + +#uiStatusIcon { + position: absolute; + top: 4px; + left: 12px; + width: 24px; + height: 24px; +} + +#uiMapWrapper { + clear: both; + padding: 8px; +} + +#uiMapHeader { + position: relative; + clear: both; +} + +#uiMapContainer { + position: relative; + width: 100%; + height: 600px; + overflow: hidden; + border: 1px solid #40628a; + background: url(nanomapBackground.png); +} + +#uiMap { + position: absolute; + top: 50%; + left: 50%; + margin: -512px 0 0 -512px; + width: 256px; + height: 256px; + overflow: hidden; + zoom: 4; +} + +#uiMapImage { + position: absolute; + bottom: 2px; + left: -6px; +} + +#uiMapContent { + position: absolute; + bottom: 0px; + left: 0px; + width: 256px; + height: 256px; +} + +#uiMapFooter { + position: relative; + clear: both; +} + +#uiContent { + clear: both; + padding: 8px; +} + +#uiMapTooltip { + position: absolute; + right: 10px; + top: 10px; + border: 1px solid #40628a; + background-color: #272727; + padding: 8px; + display: none; + z-index: 9999; +} + +#uiLoadingNotice { + position: relative; + background: url(uiNoticeBackground.jpg) 50% 50%; + color: #000000; + font-size: 14px; + font-style: italic; + font-weight: bold; + padding: 3px 4px 3px 4px; + margin: 4px 0 4px 0; +} + + diff --git a/nano/css/nlayout_default.css b/nano/css/nlayout_default.css new file mode 100644 index 00000000000..89141aecb4c --- /dev/null +++ b/nano/css/nlayout_default.css @@ -0,0 +1,126 @@ +body { + background: #272727 url(uiBackground.png) 50% 0 repeat-x; +} + +#uiWrapper { + width: 100%; + height: 100%; + -ms-user-select: none; + user-select: none; +} + +#uiTitleWrapper { + position: relative; + height: 30px; +} + +#uiTitleText { + position: absolute; + top: 6px; + left: 44px; + width: 66%; + overflow: hidden; + color: #E9C183; + font-size: 16px; +} + +#uiTitle.icon { + padding: 6px 8px 6px 42px; + background-position: 2px 50%; + background-repeat: no-repeat; +} + +#uiTitleFluff { + position: absolute; + top: 4px; + right: 12px; + width: 42px; + height: 24px; + background: url(uiTitleFluff.png) 50% 50% no-repeat; +} + +#uiStatusIcon { + position: absolute; + top: 4px; + left: 12px; + width: 24px; + height: 24px; +} + +#uiMapWrapper { + clear: both; + padding: 8px; +} + +#uiMapHeader { + position: relative; + clear: both; +} + +#uiMapContainer { + position: relative; + width: 100%; + height: 600px; + overflow: hidden; + border: 1px solid #40628a; + background: url(nanomapBackground.png); +} + +#uiMap { + position: absolute; + top: 50%; + left: 50%; + margin: -1024px 0 0 -1024px; + width: 2048px; + height: 2048px; +} + +#uiMapImage { + position: absolute; + top: 0px; + left: 0px; + width: 2048px; + height: 2048px; +} + +#uiMapContent { + position: absolute; + top: 0px; + left: 0px; + width: 2048px; + height: 2048px; +} + +#uiMapFooter { + position: relative; + clear: both; + +} + +#uiContent { + clear: both; + padding: 8px; +} + ++#uiMapTooltip { + position: absolute; + right: 10px; + top: 10px; + border: 1px solid #40628a; + background-color: #272727; + padding: 8px; + display: none; +} + +#uiLoadingNotice { + position: relative; + background: url(uiNoticeBackground.jpg) 50% 50%; + color: #000000; + font-size: 14px; + font-style: italic; + font-weight: bold; + padding: 3px 4px 3px 4px; + margin: 4px 0 4px 0; +} + + diff --git a/nano/css/shared.css b/nano/css/shared.css index caa854b1540..632e76b6996 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -1,530 +1,548 @@ body { - padding: 0; - margin: 0; - font-size: 12px; - color: #ffffff; - line-height: 170%; - font-family: Verdana, Geneva, sans-serif; - background: #272727 url(uiBackground.png) 50% 0 repeat-x; + padding: 0; + margin: 0; + font-size: 12px; + color: #ffffff; + line-height: 170%; + font-family: Verdana, Geneva, sans-serif; + background: #272727; } + +#uiNoScript { + position: fixed; + top: 50%; + left: 50%; + margin: -60px 0 0 -150px; + width: 280px; + height: 120px; + background: #ffffff; + border: 2px solid #ff0000; + color: #000000; + font-size: 10px; + font-weight: bold; + z-index: 9999; + padding: 0px 10px; + text-align: center; +} + hr { - background-color: #40628a; - height: 1px; + background-color: #40628a; + height: 1px; } + .link, .linkOn, .linkOff, .selected, .disabled { - float: left; - min-width: 40px; - height: 16px; - text-align: center; - color: #ffffff; - text-decoration: none; - background: #40628a; - border: 1px solid #161616; - padding: 0px 4px 4px 4px; - margin: 0 2px 2px 0; - cursor:default; - white-space: nowrap; + float: left; + min-width: 15px; + height: 16px; + text-align: center; + color: #ffffff; + text-decoration: none; + background: #40628a; + border: 1px solid #161616; + padding: 0px 4px 4px 4px; + margin: 0 2px 2px 0; + cursor: default; + white-space: nowrap; } .hasIcon { - padding: 0px 4px 4px 0px; + padding: 0px 4px 4px 0px; } -a:hover, .linkActive:hover { - background: #507aac; +a:hover, .zoomLink:hover, .linkActive:hover { + background: #507aac; } + .linkPending, .linkPending:hover { - color: #ffffff; - background: #507aac; + color: #ffffff; + background: #507aac; } + a.white, a.white:link, a.white:visited, a.white:active { - color: #40628a; - text-decoration: none; - background: #ffffff; - border: 1px solid #161616; - padding: 1px 4px 1px 4px; - margin: 0 2px 0 0; - cursor:default; + color: #40628a; + text-decoration: none; + background: #ffffff; + border: 1px solid #161616; + padding: 1px 4px 1px 4px; + margin: 0 2px 0 0; + cursor: default; } + a.white:hover { - color: #ffffff; - background: #40628a; + color: #ffffff; + background: #40628a; } + +.hidden { + display: none; +} + .linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover, .selected, a.selected:link, a.selected:visited, a.selected:active, a.selected:hover { - color: #ffffff; - background: #2f943c; + color: #ffffff; + background: #2f943c; } + .linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover, .disabled, a.disabled:link, a.disabled:visited, a.disabled:active, a.disabled:hover { - color: #ffffff; - background: #999999; - border-color: #666666; + color: #ffffff; + background: #999999; + border-color: #666666; } + a.icon, .linkOn.icon, .linkOff.icon, .selected.icon, .disabled.icon { - position: relative; - padding: 1px 4px 2px 20px; -} -a.icon img, .linkOn.icon img, .linkOff.icon img, .selected.icon img, .disabled.icon img { - position: absolute; - top: 0; - left: 0; - width: 18px; - height: 18px; -} -ul { - padding: 4px 0 0 10px; - margin: 0; - list-style-type: none; -} -li { - padding: 0 0 2px 0; -} -img, a img { - border-style:none; -} -h1, h2, h3, h4, h5, h6 { - margin: 0; - padding: 12px 0 6px 0; - color: #517087; - clear: both; -} -h1 { - font-size: 18px; -} -h2 { - font-size: 16px; -} -h3 { - font-size: 14px; -} -h4 { - font-size: 12px; -} -#uiWrapper { - width: 100%; - height: 100%; -} -#uiTitleWrapper { - position: relative; - height: 30px; -} -#uiTitle { - position: absolute; - top: 6px; - left: 44px; - width: 66%; - overflow: hidden; - color: #E9C183; - font-size: 16px; -} -#uiTitle.icon { - padding: 6px 8px 6px 42px; - background-position: 2px 50%; - background-repeat: no-repeat; -} -#uiTitleFluff { - position: absolute; - top: 4px; - right: 12px; - width: 42px; - height: 24px; - background: url(uiTitleFluff.png) 50% 50% no-repeat; -} -#uiStatusIcon { - position: absolute; - top: 4px; - left: 12px; - width: 24px; - height: 24px; -} -#uiContent { - clear: both; - padding: 8px; -} -#uiNoJavaScript { position: relative; - background: url(uiNoticeBackground.jpg) 50% 50%; - color: #000000; + padding: 1px 4px 2px 20px; +} + +a.icon img, .linkOn.icon img, .linkOff.icon img, .selected.icon img, .disabled.icon img { + position: absolute; + top: 0; + left: 0; + width: 18px; + height: 18px; +} + +.linkDanger, a.linkDanger:link, a.linkDanger:visited, a.linkDanger:active { + color: #ffffff; + background-color: #ff0000; + border-color: #aa0000; +} + +.linkDanger:hover { + background-color: #ff6666; +} + +ul { + padding: 4px 0 0 10px; + margin: 0; + list-style-type: none; +} + +li { + padding: 0 0 2px 0; +} + +img, a img { + border-style: none; +} + +h1, h2, h3, h4, h5, h6 { + margin: 0; + padding: 12px 0 6px 0; + color: #517087; + clear: both; +} + +h1 { + font-size: 18px; +} + +h2 { + font-size: 16px; +} + +h3 { font-size: 14px; +} + +h4 { + font-size: 12px; +} + +.white { + color: white; + font-weight: bold; +} + +.good { + color: #4f7529; + font-weight: bold; +} + +.average { + color: #cd6500; + font-weight: bold; +} + +.bad { + color: #ee0000; + font-weight: bold; +} + +.idle { + color: #272727; + font-weight: bold; +} + +.redBackground { + background: #ea0000; +} + +.yellowBackground { + background: #cacc00; +} + +.highlight { + color: #8BA5C4; +} + +.dark { + color: #272727; +} + +.noticePlaceholder { + position: relative; + font-size: 12px; font-style: italic; font-weight: bold; padding: 3px 4px 3px 4px; margin: 4px 0 4px 0; } -.white { - color: white; - font-weight: bold; -} - -.good { - color: #79B33F; /*#4f7529;*/ - font-weight: bold; -} -.average { - color: #cd6500; - font-weight: bold; -} -.bad { - color: #ee0000; - font-weight: bold; -} -.highlight { - color: #8BA5C4; -} -.dark { - color: #272727; -} .notice { - position: relative; - background: url(uiNoticeBackground.jpg) 50% 50%; + position: relative; + background: url(uiNoticeBackground.jpg) 50% 50%; color: #000000; - font-size: 12px; - font-style: italic; - font-weight: bold; - padding: 3px 4px 3px 4px; - margin: 4px 0 4px 0; -} -.notice.icon { - padding: 2px 4px 0 20px; -} -.notice img { - position: absolute; - top: 0; - left: 0; - width: 16px; - height: 16px; + font-size: 12px; + font-style: italic; + font-weight: bold; + padding: 3px 4px 3px 4px; + margin: 4px 0 4px 0; } +.notice.icon { + padding: 2px 4px 0 20px; +} + +.notice img { + position: absolute; + top: 0; + left: 0; + width: 16px; + height: 16px; +} div.notice { - clear: both; -} -.itemGroup { - border: 1px solid #e9c183; - background: #2c2c2c; - padding: 4px; - clear: both; -} -.item { - width: 100%; - margin: 4px 0 0 0; - clear: both; + clear: both; } +.itemGroup { + border: 1px solid #e9c183; + background: #2c2c2c; + padding: 4px; + clear: both; +} + +.item { + width: 100%; + margin: 4px 0 0 0; + clear: both; +} .itemLabel { - float: left; - width: 30%; - color: #e9c183; -} -.itemContent { - float: left; - width: 69%; -} -.itemLabelNarrow { - float: left; - width: 20%; - color: #e9c183; -} -.itemLabelWide { - float: left; - width: 45%; - color: #e9c183; + float: left; + width: 30%; + color: #e9c183; } +.itemContent { + float: left; + width: 69%; +} + +.itemLabelNarrow { + float: left; + width: 20%; + color: #e9c183; +} + +.itemLabelWide { + float: left; + width: 45%; + color: #e9c183; +} .itemContentWide { - float: left; - width: 79%; + float: left; + width: 79%; } + .itemContentSmall { - float: left; - width: 33%; + float: left; + width: 33%; } + .itemContentMedium { - float: left; - width: 55%; + float: left; + width: 55%; } .statusDisplay { - background: #000000; - color: #ffffff; - border: 1px solid #40628a; - padding: 4px; - margin: 3px 0; -} -.statusDisplayRecords { - background: #000000; - color: #ffffff; - border: 1px solid #40628a; - padding: 4px; - margin: 3px 0; - overflow-x: hidden; - overflow-y: auto; + background: #000000; + color: #ffffff; + border: 1px solid #40628a; + padding: 4px; + margin: 3px 0; } +.statusDisplayRecords { + background: #000000; + color: #ffffff; + border: 1px solid #40628a; + padding: 4px; + margin: 3px 0; + overflow-x: hidden; + overflow-y: auto; +} .statusLabel { - width: 138px; - float: left; - overflow: hidden; - color: #98B0C3; + width: 138px; + float: left; + overflow: hidden; + color: #98B0C3; } + .statusValue { - float: left; + float: left; } + .block { - padding: 8px; - margin: 10px 4px 4px 4px; - border: 1px solid #40628a; - background-color: #202020; + padding: 8px; + margin: 10px 4px 4px 4px; + border: 1px solid #40628a; + background-color: #202020; } + .block h3 { - padding: 0; + padding: 0; } + .displayBar { - position: relative; - width: 236px; - height: 16px; - border: 1px solid #666666; - float: left; - margin: 0 5px 0 0; - overflow: hidden; - background: #000000; + position: relative; + width: 236px; + height: 16px; + border: 1px solid #666666; + float: left; + margin: 0 5px 0 0; + overflow: hidden; + background: #000000; } + .displayBarText { - position: absolute; - top: -2px; - left: 5px; - width: 100%; - height: 100%; - color: #ffffff; - font-weight: normal; + position: absolute; + top: -2px; + left: 5px; + width: 100%; + height: 100%; + color: #ffffff; + font-weight: normal; } + .displayBarFill { - width: 0%; - height: 100%; - background: #40628a; - overflow: hidden; - float: left; + width: 0%; + height: 100%; + background: #40628a; + overflow: hidden; + float: left; } + .displayBarFill.alignRight { - float: right; + float: right; } + .displayBarFill.good { - color: #ffffff; - background: #4f7529; + color: #ffffff; + background: #4f7529; } + .displayBarFill.average { - color: #ffffff; - background: #cd6500; + color: #ffffff; + background: #cd6500; } + .displayBarFill.bad { - color: #ffffff; - background: #ee0000; + color: #ffffff; + background: #ee0000; } + .displayBarFill.highlight { - color: #ffffff; - background: #8BA5C4; + color: #ffffff; + background: #8BA5C4; } + .clearBoth { - clear: both; + clear: both; } + .clearLeft { - clear: left; + clear: left; } + .clearRight { - clear: right; + clear: right; } + .line { - width: 100%; - clear: both; + width: 100%; + clear: both; } -.inactive, , a.inactive:link, a.inactive:visited, a.inactive:active, a.inactive:hover { - color: #ffffff; - background: #999999; - border-color: #666666; + +.inactive, a.inactive:link, a.inactive:visited, a.inactive:active, a.inactive:hover { + color: #ffffff; + background: #999999; + border-color: #666666; } + .fixedLeft { - width: 110px; - float: left; + width: 110px; + float: left; } + .fixedLeftWide { - width: 165px; - float: left; + width: 165px; + float: left; } -.fixedLeftWider{ - width: 220px; - float: left; +.fixedLeftWider { + width: 220px; + float: left; } -.fixedLeftWidest{ - width: 250px; - float: left; +.fixedLeftWidest { + width: 250px; + float: left; } .floatRight { - float: right; + float: right; } /* Used in PDA */ - -.wholeScreen -{ - position: absolute - color: #517087; - font-size: 16px; - font-weight: bold; - text-align:center; +.wholeScreen { + position: absolute; + color: #517087; + font-size: 16px; + font-weight: bold; + text-align: center; } -.pdalink -{ - float: left; - white-space:nowrap; +.pdalink { + float: left; + white-space: nowrap; } /* DNA Modifier UI (dna_modifier.tmpl) */ -.dnaBlock -{ - float: left; - width: 90px; - padding: 0 0 5px 0; +.dnaBlock { + float: left; + width: 90px; + padding: 0 0 5px 0; } -.dnaBlockNumber -{ - font-family: Fixed, monospace; - float: left; - color: #ffffff; - background: #363636; - min-width: 20px; - height: 20px; - padding: 0; - text-align: center; +.dnaBlockNumber { + font-family: Fixed, monospace; + float: left; + color: #ffffff; + background: #363636; + min-width: 20px; + height: 20px; + padding: 0; + text-align: center; } -.dnaSubBlock -{ - font-family: Fixed, monospace; - float: left; - padding: 0; - min-width: 16px; - height: 20px; - text-align: center; +.dnaSubBlock { + font-family: Fixed, monospace; + float: left; + padding: 0; + min-width: 16px; + height: 20px; + text-align: center; } -.mask -{ - position: fixed; - left: 0; - top: 0; - width: 100%; - height: 100%; - background: url(uiMaskBackground.png); +.mask { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: url(uiMaskBackground.png); } -.maskContent -{ - width: 100%; - height: 200px; - margin: 200px 0; - text-align: center; +.maskContent { + width: 100%; + height: 200px; + margin: 200px 0; + text-align: center; } -.link.red { - float: left; - min-width: 40px; - height: 16px; - text-align: center; - color: #ffffff; - text-decoration: none; - background: red; - border: 1px solid #161616; - padding: 0px 4px 4px 4px; - margin: 0 2px 2px 0; - cursor: default; -} -.link.red:HOVER { - color: #ffffff; - background: #FF6060; -} - /* Table stuffs for power monitor */ -table.pmon -{ -border:2px solid RoyalBlue; +table.pmon { + border: 2px solid RoyalBlue; } -table.pmon td, table.pmon th -{ -border-bottom:1px dotted black; -padding:0px 5px 0px 5px; +table.pmon td, table.pmon th { + border-bottom: 1px dotted black; + padding: 0px 5px 0px 5px; } - - /* Table Stuffs for manifest*/ -th.command -{ - background: #3333FF; - font-weight: bold; - color: #ffffff; +th.command { + background: #3333FF; + font-weight: bold; + color: #ffffff; } -th.sec -{ - background: #8e0000; - font-weight: bold; - color: #ffffff; -} -th.med -{ - background: #006600; - font-weight: bold; - color: #ffffff; -} -th.eng -{ - background: #b27300; - font-weight: bold; - color: #ffffff; -} -th.sci -{ - background: #a65ba6; - font-weight: bold; - color: #ffffff; -} -th.civ -{ - background: #a32800; - font-weight: bold; - color: #ffffff; -} -th.misc -{ - background: #666666; - font-weight: bold; - color: #ffffff; +th.sec { + background: #8e0000; + font-weight: bold; + color: #ffffff; } -.fixed { - float: none; - display: inline; /* inline-block */ - padding: 0px 3px 3px 0px; - line-height: 50%; - height: 16px; - vertical-align: middle; - margin: 0; +th.med { + background: #006600; + font-weight: bold; + color: #ffffff; } -.fixed .uiIcon16 { - float: none; - display: inline; /* inline-block */ - vertical-align: middle; +th.eng { + background: #b27300; + font-weight: bold; + color: #ffffff; +} + +th.sci { + background: #a65ba6; + font-weight: bold; + color: #ffffff; +} + +th.civ { + background: #a32800; + font-weight: bold; + color: #ffffff; +} + +th.misc { + background: #666666; + font-weight: bold; + color: #ffffff; +} + +/* Damage colors for crew monitoring computer */ + +.burn { + color: orange; +} + +.brute { + color: red; +} + +.toxin { + color: green; +} + +.oxyloss { + color: blue; } \ No newline at end of file diff --git a/nano/debug.html b/nano/debug.html new file mode 100644 index 00000000000..d34c9ceadd6 --- /dev/null +++ b/nano/debug.html @@ -0,0 +1,31 @@ + + + + + + + + + +
+
DNA Modifier Console
+
+
Initiating...
+ +
+ +
+
+ + + diff --git a/nano/images/nanomap.png b/nano/images/nanomap.png new file mode 100644 index 00000000000..2dc49050244 Binary files /dev/null and b/nano/images/nanomap.png differ diff --git a/nano/images/nanomapBackground.png b/nano/images/nanomapBackground.png new file mode 100644 index 00000000000..f3ead016196 Binary files /dev/null and b/nano/images/nanomapBackground.png differ diff --git a/nano/images/source/NTLogoRevised.fla b/nano/images/source/NTLogoRevised.fla new file mode 100644 index 00000000000..47ea8143449 Binary files /dev/null and b/nano/images/source/NTLogoRevised.fla differ diff --git a/nano/images/source/icon-eye.xcf b/nano/images/source/icon-eye.xcf new file mode 100644 index 00000000000..53ba7383726 Binary files /dev/null and b/nano/images/source/icon-eye.xcf differ diff --git a/nano/images/source/uiBackground-Syndicate.xcf b/nano/images/source/uiBackground-Syndicate.xcf new file mode 100644 index 00000000000..c86cea69d14 Binary files /dev/null and b/nano/images/source/uiBackground-Syndicate.xcf differ diff --git a/nano/images/source/uiBackground.fla b/nano/images/source/uiBackground.fla new file mode 100644 index 00000000000..60f9f1ee941 Binary files /dev/null and b/nano/images/source/uiBackground.fla differ diff --git a/nano/images/source/uiBackground.xcf b/nano/images/source/uiBackground.xcf new file mode 100644 index 00000000000..d20db24ff89 Binary files /dev/null and b/nano/images/source/uiBackground.xcf differ diff --git a/nano/images/source/uiBasicBackground.xcf b/nano/images/source/uiBasicBackground.xcf new file mode 100644 index 00000000000..56a31d7b2fc Binary files /dev/null and b/nano/images/source/uiBasicBackground.xcf differ diff --git a/nano/images/source/uiIcons16Green.xcf b/nano/images/source/uiIcons16Green.xcf new file mode 100644 index 00000000000..a7027a28734 Binary files /dev/null and b/nano/images/source/uiIcons16Green.xcf differ diff --git a/nano/images/source/uiIcons16Red.xcf b/nano/images/source/uiIcons16Red.xcf new file mode 100644 index 00000000000..c07e4f64c7b Binary files /dev/null and b/nano/images/source/uiIcons16Red.xcf differ diff --git a/nano/images/source/uiIcons24.xcf b/nano/images/source/uiIcons24.xcf new file mode 100644 index 00000000000..5dcd8fd216a Binary files /dev/null and b/nano/images/source/uiIcons24.xcf differ diff --git a/nano/images/source/uiNoticeBackground.xcf b/nano/images/source/uiNoticeBackground.xcf new file mode 100644 index 00000000000..d1f074f1025 Binary files /dev/null and b/nano/images/source/uiNoticeBackground.xcf differ diff --git a/nano/images/source/uiTitleBackground.xcf b/nano/images/source/uiTitleBackground.xcf new file mode 100644 index 00000000000..7de149075fd Binary files /dev/null and b/nano/images/source/uiTitleBackground.xcf differ diff --git a/nano/images/uiBasicBackground.png b/nano/images/uiBasicBackground.png new file mode 100644 index 00000000000..03131d1e94c Binary files /dev/null and b/nano/images/uiBasicBackground.png differ diff --git a/nano/images/uiIcons16Green.png b/nano/images/uiIcons16Green.png new file mode 100644 index 00000000000..de0e33db1c7 Binary files /dev/null and b/nano/images/uiIcons16Green.png differ diff --git a/nano/images/uiIcons16Red.png b/nano/images/uiIcons16Red.png new file mode 100644 index 00000000000..1c72dfe1430 Binary files /dev/null and b/nano/images/uiIcons16Red.png differ diff --git a/nano/js/libraries.min.js b/nano/js/libraries.min.js index 11c9ffb9182..7b19cd3a5d1 100644 --- a/nano/js/libraries.min.js +++ b/nano/js/libraries.min.js @@ -1 +1 @@ -(function(e,t){function H(e){var t=e.length,n=w.type(e);if(w.isWindow(e)){return false}if(e.nodeType===1&&t){return true}return n==="array"||n!=="function"&&(t===0||typeof t==="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};w.each(e.match(S)||[],function(e,n){t[n]=true});return t}function q(e,n,r,i){if(!w.acceptData(e)){return}var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n==="string"){return}if(!l){if(a){l=e[u]=c.pop()||w.guid++}else{l=u}}if(!f[l]){f[l]=a?{}:{toJSON:w.noop}}if(typeof n==="object"||typeof n==="function"){if(i){f[l]=w.extend(f[l],n)}else{f[l].data=w.extend(f[l].data,n)}}o=f[l];if(!i){if(!o.data){o.data={}}o=o.data}if(r!==t){o[w.camelCase(n)]=r}if(typeof n==="string"){s=o[n];if(s==null){s=o[w.camelCase(n)]}}else{s=o}return s}function R(e,t,n){if(!w.acceptData(e)){return}var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u]){return}if(t){r=n?o[u]:o[u].data;if(r){if(!w.isArray(t)){if(t in r){t=[t]}else{t=w.camelCase(t);if(t in r){t=[t]}else{t=t.split(" ")}}}else{t=t.concat(w.map(t,w.camelCase))}i=t.length;while(i--){delete r[t[i]]}if(n?!z(r):!w.isEmptyObject(r)){return}}}if(!n){delete o[u].data;if(!z(o[u])){return}}if(s){w.cleanData([e],true)}else if(w.support.deleteExpando||o!=o.window){delete o[u]}else{o[u]=null}}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r==="string"){try{r=r==="true"?true:r==="false"?false:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else{r=t}}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t])){continue}if(t!=="toJSON"){return false}}return true}function it(){return true}function st(){return false}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do{e=e[t]}while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t)){return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n})}if(t.nodeType){return w.grep(e,function(e){return e===t!==n})}if(typeof t==="string"){if(ut.test(t)){return w.filter(t,e,n)}t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement){while(t.length){n.createElement(t.pop())}}return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){e.type=(w.find.attr(e,"type")!==null)+"/"+e.type;return e}function Dt(e){var t=Ct.exec(e.type);if(t){e.type=t[1]}else{e.removeAttribute("type")}return e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++){w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e)){return}var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle;o.events={};for(n in u){for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement);t=(It[0].contentWindow||It[0].contentDocument).document;t.write("");t.close();n=fn(e,t);It.detach()}Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");n.remove();return r}function vn(e,t,n,r){var i;if(w.isArray(t)){w.each(t,function(t,i){if(n||cn.test(e)){r(e,i)}else{vn(e+"["+(typeof i==="object"?t:"")+"]",i,n,r)}})}else if(!n&&w.type(t)==="object"){for(i in t){vn(e+"["+i+"]",t[i],n,r)}}else{r(e,t)}}function _n(e){return function(t,n){if(typeof t!=="string"){n=t;t="*"}var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n)){while(r=s[i++]){if(r[0]==="+"){r=r.slice(1)||"*";(e[r]=e[r]||[]).unshift(n)}else{(e[r]=e[r]||[]).push(n)}}}}}function Dn(e,t,n,r){function o(u){var a;i[u]=true;w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f==="string"&&!s&&!i[f]){t.dataTypes.unshift(f);o(f);return false}else if(s){return!(a=f)}});return a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n){if(n[i]!==t){(s[i]?e:r||(r={}))[i]=n[i]}}if(r){w.extend(true,e,r)}return e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*"){f.shift();if(s===t){s=e.mimeType||n.getResponseHeader("Content-Type")}}if(s){for(u in a){if(a[u]&&a[u].test(s)){f.unshift(u);break}}}if(f[0]in r){o=f[0]}else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}if(!i){i=u}}o=o||i}if(o){if(o!==f[0]){f.unshift(o)}return r[o]}}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1]){for(o in e.converters){f[o.toLowerCase()]=e.converters[o]}}s=l.shift();while(s){if(e.responseFields[s]){n[e.responseFields[s]]=t}if(!a&&r&&e.dataFilter){t=e.dataFilter(t,e.dataType)}a=s;s=l.shift();if(s){if(s==="*"){s=a}else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o){for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){if(o===true){o=f[i]}else if(f[i]!==true){s=u[0];l.unshift(u[1])}break}}}}if(o!==true){if(o&&e["throws"]){t=o(t)}else{try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){setTimeout(function(){Xn=t});return Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s)[^>]*|#([\w-]*))$/,N=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,C=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,L=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,O=/^-ms-/,M=/-([\da-z])/gi,_=function(e,t){return t.toUpperCase()},D=function(e){if(o.addEventListener||e.type==="load"||o.readyState==="complete"){P();w.ready()}},P=function(){if(o.addEventListener){o.removeEventListener("DOMContentLoaded",D,false);e.removeEventListener("load",D,false)}else{o.detachEvent("onreadystatechange",D);e.detachEvent("onload",D)}};w.fn=w.prototype={jquery:h,constructor:w,init:function(e,n,r){var i,s;if(!e){return this}if(typeof e==="string"){if(e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3){i=[null,e,null]}else{i=T.exec(e)}if(i&&(i[1]||!n)){if(i[1]){n=n instanceof w?n[0]:n;w.merge(this,w.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,true));if(N.test(i[1])&&w.isPlainObject(n)){for(i in n){if(w.isFunction(this[i])){this[i](n[i])}else{this.attr(i,n[i])}}}return this}else{s=o.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2]){return r.find(e)}this.length=1;this[0]=s}this.context=o;this.selector=e;return this}}else if(!n||n.jquery){return(n||r).find(e)}else{return this.constructor(n).find(e)}}else if(e.nodeType){this.context=this[0]=e;this.length=1;return this}else if(w.isFunction(e)){return r.ready(e)}if(e.selector!==t){this.selector=e.selector;this.context=e.context}return w.makeArray(e,this)},selector:"",length:0,toArray:function(){return v.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);t.prevObject=this;t.context=this.context;return t},each:function(e,t){return w.each(this,e,t)},ready:function(e){w.ready.promise().done(e);return this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0){return}n.resolveWith(o,[w]);if(w.fn.trigger){w(o).trigger("ready").off("ready")}},isFunction:function(e){return w.type(e)==="function"},isArray:Array.isArray||function(e){return w.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){if(e==null){return String(e)}return typeof e==="object"||typeof e==="function"?l[g.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||w.type(e)!=="object"||e.nodeType||w.isWindow(e)){return false}try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf")){return false}}catch(r){return false}if(w.support.ownLast){for(n in e){return y.call(e,n)}}for(n in e){}return n===t||y.call(e,n)},isEmptyObject:function(e){var t;for(t in e){return false}return true},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!=="string"){return null}if(typeof t==="boolean"){n=t;t=false}t=t||o;var r=N.exec(e),i=!n&&[];if(r){return[t.createElement(r[1])]}r=w.buildFragment([e],t,i);if(i){w(i).remove()}return w.merge([],r.childNodes)},parseJSON:function(t){if(e.JSON&&e.JSON.parse){return e.JSON.parse(t)}if(t===null){return t}if(typeof t==="string"){t=w.trim(t);if(t){if(C.test(t.replace(L,"@").replace(A,"]").replace(k,""))){return(new Function("return "+t))()}}}w.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!=="string"){return null}try{if(e.DOMParser){i=new DOMParser;r=i.parseFromString(n,"text/xml")}else{r=new ActiveXObject("Microsoft.XMLDOM");r.async="false";r.loadXML(n)}}catch(s){r=t}if(!r||!r.documentElement||r.getElementsByTagName("parsererror").length){w.error("Invalid XML: "+n)}return r},noop:function(){},globalEval:function(t){if(t&&w.trim(t)){(e.execScript||function(t){e["eval"].call(e,t)})(t)}},camelCase:function(e){return e.replace(O,"ms-").replace(M,_)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=H(e);if(n){if(o){for(;is.cacheLength){delete t[e.shift()]}return t[n]=r}var e=[];return t}function at(e){e[b]=true;return e}function ft(e){var t=h.createElement("div");try{return!!e(t)}catch(n){return false}finally{if(t.parentNode){t.parentNode.removeChild(t)}t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--){s.attrHandle[n[r]]=t}}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(r){return r}if(n){while(n=n.nextSibling){if(n===t){return-1}}}return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){t=+t;return at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--){if(n[i=s[o]]){n[i]=!(r[i]=n[i])}}})})}function vt(){}function mt(e,t){var n,r,i,o,u,a,f,l=N[e+" "];if(l){return t?0:l.slice(0)}u=e;a=[];f=s.preFilter;while(u){if(!n||(r=X.exec(u))){if(r){u=u.slice(r[0].length)||u}a.push(i=[])}n=false;if(r=V.exec(u)){n=r.shift();i.push({value:n,type:r[0].replace(W," ")});u=u.slice(n.length)}for(o in s.filter){if((r=G[o].exec(u))&&(!f[o]||(r=f[o](r)))){n=r.shift();i.push({value:n,type:o,matches:r});u=u.slice(n.length)}}if(!n){break}}return t?u.length:u?ot.error(e):N(e,a).slice(0)}function gt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--){if(!e[i](t,n,r)){return false}}return true}:e[0]}function wt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1){s[f]=!(o[f]=c)}}}}else{g=wt(g===o?g.splice(d,g.length):g);if(i){i(null,o,g,a)}else{H.apply(o,g)}}})}function St(e){var t,n,r,i=e.length,o=s.relative[e[0].type],u=o||s.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,true),c=yt(function(e){return j.call(t,e)>-1},u,true),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&bt(h),a>1&>(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(W,"$1"),n,a0,o=e.length>0,u=function(u,a,l,c,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,x=f,T=u||o&&s.find["TAG"]("*",p&&a.parentNode||a),N=S+=x==null?1:Math.random()||.1;if(E){f=a!==h&&a;i=n}for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++]){if(m(d,a,l)){c.push(d);break}}if(E){S=N;i=++n}}if(r){if(d=!m&&d){y--}if(u){w.push(d)}}}y+=b;if(r&&b!==y){v=0;while(m=t[v++]){m(w,g,a,l)}if(u){if(y>0){while(b--){if(!(w[b]||g[b])){g[b]=D.call(c)}}}g=wt(g)}H.apply(c,g);if(E&&!u&&g.length>0&&y+t.length>1){ot.uniqueSort(c)}}if(E){S=N;f=x}return w};return r?at(u):u}function Tt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&r.getById&&t.nodeType===9&&d&&s.relative[u[1].type]){t=(s.find["ID"](f.matches[0].replace(rt,it),t)||[])[0];if(!t){return n}e=e.slice(u.shift().value.length)}o=G["needsContext"].test(e)?0:u.length;while(o--){f=u[o];if(s.relative[l=f.type]){break}if(c=s.find[l]){if(i=c(f.matches[0].replace(rt,it),$.test(u[0].type)&&t.parentNode||t)){u.splice(o,1);e=i.length&>(u);if(!e){H.apply(n,i);return n}break}}}}}a(e,h)(i,t,!d,n,$.test(e));return n}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=false,L=function(e,t){if(e===t){k=true;return 0}return 0},A=typeof t,O=1<<31,M={}.hasOwnProperty,_=[],D=_.pop,P=_.push,H=_.push,B=_.slice,j=_.indexOf||function(e){var t=0,n=this.length;for(;t+~]|"+I+")"+I+"*"),$=new RegExp(I+"*[+~]"),J=new RegExp("="+I+"*([^\\]'\"]*)"+I+"*\\]","g"),K=new RegExp(z),Q=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=new RegExp("\\\\([\\da-f]{1,6}"+I+"?|("+I+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{H.apply(_=B.call(E.childNodes),E.childNodes);_[E.childNodes.length].nodeType}catch(st){H={apply:_.length?function(e,t){P.apply(e,B.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]){}e.length=n-1}}}u=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":false};r=ot.support={};c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:E,n=t.defaultView;if(t===h||t.nodeType!==9||!t.documentElement){return h}h=t;p=t.documentElement;d=!u(t);if(n&&n.attachEvent&&n!==n.top){n.attachEvent("onbeforeunload",function(){c()})}r.attributes=ft(function(e){e.className="i";return!e.getAttribute("className")});r.getElementsByTagName=ft(function(e){e.appendChild(t.createComment(""));return!e.getElementsByTagName("*").length});r.getElementsByClassName=ft(function(e){e.innerHTML="
";e.firstChild.className="i";return e.getElementsByClassName("i").length===2});r.getById=ft(function(e){p.appendChild(e).id=b;return!t.getElementsByName||!t.getElementsByName(b).length});if(r.getById){s.find["ID"]=function(e,t){if(typeof t.getElementById!==A&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}};s.filter["ID"]=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}}else{delete s.find["ID"];s.filter["ID"]=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}}s.find["TAG"]=r.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A){return t.getElementsByTagName(e)}}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++]){if(n.nodeType===1){r.push(n)}}return r}return s};s.find["CLASS"]=r.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d){return t.getElementsByClassName(e)}};m=[];v=[];if(r.qsa=Y.test(t.querySelectorAll)){ft(function(e){e.innerHTML="";if(!e.querySelectorAll("[selected]").length){v.push("\\["+I+"*(?:value|"+F+")")}if(!e.querySelectorAll(":checked").length){v.push(":checked")}});ft(function(e){var n=t.createElement("input");n.setAttribute("type","hidden");e.appendChild(n).setAttribute("t","");if(e.querySelectorAll("[t^='']").length){v.push("[*^$]="+I+"*(?:''|\"\")")}if(!e.querySelectorAll(":enabled").length){v.push(":enabled",":disabled")}e.querySelectorAll("*,:x");v.push(",.*:")})}if(r.matchesSelector=Y.test(g=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector)){ft(function(e){r.disconnectedMatch=g.call(e,"div");g.call(e,"[s!='']:x");m.push("!=",z)})}v=v.length&&new RegExp(v.join("|"));m=m.length&&new RegExp(m.join("|"));y=Y.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16))}:function(e,t){if(t){while(t=t.parentNode){if(t===e){return true}}}return false};L=p.compareDocumentPosition?function(e,n){if(e===n){k=true;return 0}var i=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);if(i){if(i&1||!r.sortDetached&&n.compareDocumentPosition(e)===i){if(e===t||y(E,e)){return-1}if(n===t||y(E,n)){return 1}return l?j.call(l,e)-j.call(l,n):0}return i&4?-1:1}return e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,s=e.parentNode,o=n.parentNode,u=[e],a=[n];if(e===n){k=true;return 0}else if(!s||!o){return e===t?-1:n===t?1:s?-1:o?1:l?j.call(l,e)-j.call(l,n):0}else if(s===o){return ct(e,n)}r=e;while(r=r.parentNode){u.unshift(r)}r=n;while(r=r.parentNode){a.unshift(r)}while(u[i]===a[i]){i++}return i?ct(u[i],a[i]):u[i]===E?-1:a[i]===E?1:0};return t};ot.matches=function(e,t){return ot(e,null,null,t)};ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h){c(e)}t=t.replace(J,"='$1']");if(r.matchesSelector&&d&&(!m||!m.test(t))&&(!v||!v.test(t))){try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&e.document.nodeType!==11){return n}}catch(i){}}return ot(t,h,null,[e]).length>0};ot.contains=function(e,t){if((e.ownerDocument||e)!==h){c(e)}return y(e,t)};ot.attr=function(e,n){if((e.ownerDocument||e)!==h){c(e)}var i=s.attrHandle[n.toLowerCase()],o=i&&M.call(s.attrHandle,n.toLowerCase())?i(e,n,!d):t;return o===t?r.attributes||!d?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o};ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};ot.uniqueSort=function(e){var t,n=[],i=0,s=0;k=!r.detectDuplicates;l=!r.sortStable&&e.slice(0);e.sort(L);if(k){while(t=e[s++]){if(t===e[s]){i=n.push(s)}}while(i--){e.splice(n[i],1)}}return e};o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i){for(;t=e[r];r++){n+=o(t)}}else if(i===1||i===9||i===11){if(typeof e.textContent==="string"){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){n+=o(e)}}}else if(i===3||i===4){return e.nodeValue}return n};s=ot.selectors={cacheLength:50,createPseudo:at,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(rt,it);e[3]=(e[4]||e[5]||"").replace(rt,it);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){ot.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+(e[7]+e[8]||e[3]==="odd")}else if(e[3]){ot.error(e[0])}return e},PSEUDO:function(e){var n,r=!e[5]&&e[2];if(G["CHILD"].test(e[0])){return null}if(e[3]&&e[4]!==t){e[2]=e[4]}else if(r&&K.test(r)&&(n=mt(r,true))&&(n=r.indexOf(")",r.length-n)-r.length)){e[0]=e[0].slice(0,n);e[2]=r.slice(0,n)}return e.slice(0,3)}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return e==="*"?function(){return true}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&T(e,function(e){return t.test(typeof e.className==="string"&&e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);if(i==null){return t==="!="}if(!t){return true}i+="";return t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":false}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v]){if(u?c.nodeName.toLowerCase()===g:c.nodeType===1){return false}}d=v=e==="only"&&!d&&"nextSibling"}return true}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[b]||(m[b]={});f=l[e]||[];p=f[0]===S&&f[1];h=f[0]===S&&f[2];c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}}else if(y&&(f=(t[b]||(t[b]={}))[e])&&f[0]===S){h=f[1]}else{while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){if(y){(c[b]||(c[b]={}))[e]=[S,h]}if(c===t){break}}}}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);if(r[b]){return r(t)}if(r.length>1){n=[e,e,"",t];return s.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,s=r(e,t),o=s.length;while(o--){i=j.call(e,s[o]);e[i]=!(n[i]=s[o])}}):function(e){return r(e,0,n)}}return r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--){if(s=o[u]){e[u]=!(t[u]=s)}}}):function(e,i,s){t[0]=e;r(t,null,s,n);return!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){if(!Q.test(e||"")){ot.error("unsupported lang: "+e)}e=e.replace(rt,it).toLowerCase();return function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang")){n=n.toLowerCase();return n===e||n.indexOf(e+"-")===0}}while((t=t.parentNode)&&t.nodeType===1);return false}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4){return false}}return true},parent:function(e){return!s.pseudos["empty"](e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n=0;){e.push(r)}return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input"){return e.defaultValue}})}if(!ft(function(e){return e.getAttribute("disabled")==null})){lt(F,function(e,t,n){var r;if(!n){return(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===true?t.toLowerCase():null}})}w.find=ot;w.expr=ot.selectors;w.expr[":"]=w.expr.pseudos;w.unique=ot.uniqueSort;w.text=ot.getText;w.isXMLDoc=ot.isXML;w.contains=ot.contains})(e);var B={};w.Callbacks=function(e){e=typeof e==="string"?B[e]||j(e):w.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){r=e.memory&&t;i=true;o=u||0;u=0;s=a.length;n=true;for(;a&&o-1){a.splice(r,1);if(n){if(r<=s){s--}if(r<=o){o--}}}})}return this},has:function(e){return e?w.inArray(e,a)>-1:!!(a&&a.length)},empty:function(){a=[];s=0;return this},disable:function(){a=f=r=t;return this},disabled:function(){return!a},lock:function(){f=t;if(!r){c.disable()}return this},locked:function(){return!f},fireWith:function(e,t){if(a&&(!i||f)){t=t||[];t=[e,t.slice?t.slice():t];if(n){f.push(t)}else{l(t)}}return this},fire:function(){c.fireWith(this,arguments);return this},fired:function(){return!!i}};return c};w.extend({Deferred:function(e){var t=[["resolve","done",w.Callbacks("once memory"),"resolved"],["reject","fail",w.Callbacks("once memory"),"rejected"],["notify","progress",w.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,s){var o=s[0],u=w.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);if(e&&w.isFunction(e.promise)){e.promise().done(n.resolve).fail(n.reject).progress(n.notify)}else{n[o+"With"](this===r?n.promise():this,u?[e]:arguments)}})});e=null}).promise()},promise:function(e){return e!=null?w.extend(e,r):r}},i={};r.pipe=r.then;w.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add;if(u){o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock)}i[s[0]]=function(){i[s[0]+"With"](this===i?r:this,arguments);return this};i[s[0]+"With"]=o.fireWith});r.promise(i);if(e){e.call(i,i)}return i},when:function(e){var t=0,n=v.call(arguments),r=n.length,i=r!==1||e&&w.isFunction(e.promise)?r:0,s=i===1?e:w.Deferred(),o=function(e,t,n){return function(r){t[e]=this;n[e]=arguments.length>1?v.call(arguments):r;if(n===u){s.notifyWith(t,n)}else if(!--i){s.resolveWith(t,n)}}},u,a,f;if(r>1){u=new Array(r);a=new Array(r);f=new Array(r);for(;t
a";n=p.getElementsByTagName("*")||[];r=p.getElementsByTagName("a")[0];if(!r||!r.style||!n.length){return t}u=o.createElement("select");f=u.appendChild(o.createElement("option"));s=p.getElementsByTagName("input")[0];r.style.cssText="top:1px;float:left;opacity:.5";t.getSetAttribute=p.className!=="t";t.leadingWhitespace=p.firstChild.nodeType===3;t.tbody=!p.getElementsByTagName("tbody").length;t.htmlSerialize=!!p.getElementsByTagName("link").length;t.style=/top/.test(r.getAttribute("style"));t.hrefNormalized=r.getAttribute("href")==="/a";t.opacity=/^0.5/.test(r.style.opacity);t.cssFloat=!!r.style.cssFloat;t.checkOn=!!s.value;t.optSelected=f.selected;t.enctype=!!o.createElement("form").enctype;t.html5Clone=o.createElement("nav").cloneNode(true).outerHTML!=="<:nav>";t.inlineBlockNeedsLayout=false;t.shrinkWrapBlocks=false;t.pixelPosition=false;t.deleteExpando=true;t.noCloneEvent=true;t.reliableMarginRight=true;t.boxSizingReliable=true;s.checked=true;t.noCloneChecked=s.cloneNode(true).checked;u.disabled=true;t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=false}s=o.createElement("input");s.setAttribute("value","");t.input=s.getAttribute("value")==="";s.value="t";s.setAttribute("type","radio");t.radioValue=s.value==="t";s.setAttribute("checked","t");s.setAttribute("name","t");a=o.createDocumentFragment();a.appendChild(s);t.appendChecked=s.checked;t.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;if(p.attachEvent){p.attachEvent("onclick",function(){t.noCloneEvent=false});p.cloneNode(true).click()}for(h in{submit:true,change:true,focusin:true}){p.setAttribute(l="on"+h,"t");t[h+"Bubbles"]=l in e||p.attributes[l].expando===false}p.style.backgroundClip="content-box";p.cloneNode(true).style.backgroundClip="";t.clearCloneStyle=p.style.backgroundClip==="content-box";for(h in w(t)){break}t.ownLast=h!=="0";w(function(){var n,r,s,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=o.getElementsByTagName("body")[0];if(!a){return}n=o.createElement("div");n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";a.appendChild(n).appendChild(p);p.innerHTML="
t
";s=p.getElementsByTagName("td");s[0].style.cssText="padding:0;margin:0;border:0;display:none";c=s[0].offsetHeight===0;s[0].style.display="";s[1].style.display="none";t.reliableHiddenOffsets=c&&s[0].offsetHeight===0;p.innerHTML="";p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";w.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){t.boxSizing=p.offsetWidth===4});if(e.getComputedStyle){t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%";t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px";r=p.appendChild(o.createElement("div"));r.style.cssText=p.style.cssText=u;r.style.marginRight=r.style.width="0";p.style.width="1px";t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)}if(typeof p.style.zoom!==i){p.innerHTML="";p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1";t.inlineBlockNeedsLayout=p.offsetWidth===3;p.style.display="block";p.innerHTML="
";p.firstChild.style.width="5px";t.shrinkWrapBlocks=p.offsetWidth!==3;if(t.inlineBlockNeedsLayout){a.style.zoom=1}}a.removeChild(n);n=p=s=r=null});n=u=a=f=r=s=null;return t}({});var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;w.extend({cache:{},noData:{applet:true,embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){e=e.nodeType?w.cache[e[w.expando]]:e[w.expando];return!!e&&!z(e)},data:function(e,t,n){return q(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return q(e,t,n,true)},_removeData:function(e,t){return R(e,t,true)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9){return false}var t=e.nodeName&&w.noData[e.nodeName.toLowerCase()];return!t||t!==true&&e.getAttribute("classid")===t}});w.fn.extend({data:function(e,n){var r,i,s=null,o=0,u=this[0];if(e===t){if(this.length){s=w.data(u);if(u.nodeType===1&&!w._data(u,"parsedAttrs")){r=u.attributes;for(;o1?this.each(function(){w.data(this,e,n)}):u?U(u,e,w.data(u,e)):null},removeData:function(e){return this.each(function(){w.removeData(this,e)})}});w.extend({queue:function(e,t,n){var r;if(e){t=(t||"fx")+"queue";r=w._data(e,t);if(n){if(!r||w.isArray(n)){r=w._data(e,t,w.makeArray(n))}else{r.push(n)}}return r||[]}},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),s=w._queueHooks(e,t),o=function(){w.dequeue(e,t)};if(i==="inprogress"){i=n.shift();r--}if(i){if(t==="fx"){n.unshift("inprogress")}delete s.stop;i.call(e,o,s)}if(!r&&s){s.empty.fire()}},_queueHooks:function(e,t){var n=t+"queueHooks";return w._data(e,n)||w._data(e,n,{empty:w.Callbacks("once memory").add(function(){w._removeData(e,t+"queue");w._removeData(e,n)})})}});w.fn.extend({queue:function(e,n){var r=2;if(typeof e!=="string"){n=e;e="fx";r--}if(arguments.length1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})},prop:function(e,t){return w.access(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){e=w.propFix[e]||e;return this.each(function(){try{this[e]=t;delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e==="string"&&e;if(w.isFunction(e)){return this.each(function(t){w(this).addClass(e.call(this,t,this.className))})}if(a){t=(e||"").match(S)||[];for(;o=0){r=r.replace(" "+i+" "," ")}}n.className=e?w.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e;if(typeof t==="boolean"&&n==="string"){return t?this.addClass(e):this.removeClass(e)}if(w.isFunction(e)){return this.each(function(n){w(this).toggleClass(e.call(this,n,this.className,t),t)})}return this.each(function(){if(n==="string"){var t,r=0,s=w(this),o=e.match(S)||[];while(t=o[r++]){if(s.hasClass(t)){s.removeClass(t)}else{s.addClass(t)}}}else if(n===i||n==="boolean"){if(this.className){w._data(this,"__className__",this.className)}this.className=this.className||e===false?"":w._data(this,"__className__")||""}})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0){return true}}return false},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s){r=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()];if(r&&"get"in r&&(n=r.get(s,"value"))!==t){return n}n=s.value;return typeof n==="string"?n.replace($,""):n==null?"":n}return}i=w.isFunction(e);return this.each(function(n){var s;if(this.nodeType!==1){return}if(i){s=e.call(this,n,w(this).val())}else{s=e}if(s==null){s=""}else if(typeof s==="number"){s+=""}else if(w.isArray(s)){s=w.map(s,function(e){return e==null?"":e+""})}r=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t){this.value=s}})}});w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return t!=null?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0){n=true}}if(!n){e.selectedIndex=-1}return s}}},attr:function(e,n,r){var s,o,u=e.nodeType;if(!e||u===3||u===8||u===2){return}if(typeof e.getAttribute===i){return w.prop(e,n,r)}if(u!==1||!w.isXMLDoc(e)){n=n.toLowerCase();s=w.attrHooks[n]||(w.expr.match.bool.test(n)?X:W)}if(r!==t){if(r===null){w.removeAttr(e,n)}else if(s&&"set"in s&&(o=s.set(e,r,n))!==t){return o}else{e.setAttribute(n,r+"");return r}}else if(s&&"get"in s&&(o=s.get(e,n))!==null){return o}else{o=w.find.attr(e,n);return o==null?t:o}},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(S);if(s&&e.nodeType===1){while(n=s[i++]){r=w.propFix[n]||n;if(w.expr.match.bool.test(n)){if(Y&&G||!Q.test(n)){e[r]=false}else{e[w.camelCase("default-"+n)]=e[r]=false}}else{w.attr(e,n,"")}e.removeAttribute(G?n:r)}}},attrHooks:{type:{set:function(e,t){if(!w.support.radioValue&&t==="radio"&&w.nodeName(e,"input")){var n=e.value;e.setAttribute("type",t);if(n){e.value=n}return t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2){return}o=u!==1||!w.isXMLDoc(e);if(o){n=w.propFix[n]||n;s=w.propHooks[n]}if(r!==t){return s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r}else{return s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]}},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):J.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:-1}}}});X={set:function(e,t,n){if(t===false){w.removeAttr(e,n)}else if(Y&&G||!Q.test(n)){e.setAttribute(!G&&w.propFix[n]||n,n)}else{e[w.camelCase("default-"+n)]=e[n]=true}return n}};w.each(w.expr.match.bool.source.match(/\w+/g),function(e,n){var r=w.expr.attrHandle[n]||w.find.attr;w.expr.attrHandle[n]=Y&&G||!Q.test(n)?function(e,n,i){var s=w.expr.attrHandle[n],o=i?t:(w.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;w.expr.attrHandle[n]=s;return o}:function(e,n,r){return r?t:e[w.camelCase("default-"+n)]?n.toLowerCase():null}});if(!Y||!G){w.attrHooks.value={set:function(e,t,n){if(w.nodeName(e,"input")){e.defaultValue=t}else{return W&&W.set(e,t,n)}}}}if(!G){W={set:function(e,n,r){var i=e.getAttributeNode(r);if(!i){e.setAttributeNode(i=e.ownerDocument.createAttribute(r))}i.value=n+="";return r==="value"||n===e.getAttribute(r)?n:t}};w.expr.attrHandle.id=w.expr.attrHandle.name=w.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.value!==""?i.value:null};w.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:W.set};w.attrHooks.contenteditable={set:function(e,t,n){W.set(e,t===""?false:t,n)}};w.each(["width","height"],function(e,t){w.attrHooks[t]={set:function(e,n){if(n===""){e.setAttribute(t,"auto");return n}}}})}if(!w.support.hrefNormalized){w.each(["href","src"],function(e,t){w.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})}if(!w.support.style){w.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}}if(!w.support.optSelected){w.propHooks.selected={get:function(e){var t=e.parentNode;if(t){t.selectedIndex;if(t.parentNode){t.parentNode.selectedIndex}}return null}}}w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});if(!w.support.enctype){w.propFix.enctype="encoding"}w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(w.isArray(t)){return e.checked=w.inArray(w(e).val(),t)>=0}}};if(!w.support.checkOn){w.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value}}});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;w.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=w._data(e);if(!y){return}if(r.handler){l=r;r=l.handler;o=l.selector}if(!r.guid){r.guid=w.guid++}if(!(a=y.events)){a=y.events={}}if(!(h=y.handle)){h=y.handle=function(e){return typeof w!==i&&(!e||w.event.triggered!==e.type)?w.event.dispatch.apply(h.elem,arguments):t};h.elem=e}n=(n||"").match(S)||[""];f=n.length;while(f--){u=rt.exec(n[f])||[];v=g=u[1];m=(u[2]||"").split(".").sort();if(!v){continue}c=w.event.special[v]||{};v=(o?c.delegateType:c.bindType)||v;c=w.event.special[v]||{};p=w.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&w.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[];d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===false){if(e.addEventListener){e.addEventListener(v,h,false)}else if(e.attachEvent){e.attachEvent("on"+v,h)}}}if(c.add){c.add.call(e,p);if(!p.handler.guid){p.handler.guid=r.guid}}if(o){d.splice(d.delegateCount++,0,p)}else{d.push(p)}w.event.global[v]=true}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=w.hasData(e)&&w._data(e);if(!m||!(l=m.events)){return}t=(t||"").match(S)||[""];f=t.length;while(f--){u=rt.exec(t[f])||[];p=v=u[1];d=(u[2]||"").split(".").sort();if(!p){for(p in l){w.event.remove(e,p+t[f],n,r,true)}continue}c=w.event.special[p]||{};p=(r?c.delegateType:c.bindType)||p;h=l[p]||[];u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)");a=s=h.length;while(s--){o=h[s];if((i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)){h.splice(s,1);if(o.selector){h.delegateCount--}if(c.remove){c.remove.call(e,o)}}}if(a&&!h.length){if(!c.teardown||c.teardown.call(e,d,m.handle)===false){w.removeEvent(e,p,m.handle)}delete l[p]}}if(w.isEmptyObject(l)){delete m.handle;w._removeData(e,"events")}},trigger:function(n,r,i,s){var u,a,f,l,c,h,p,d=[i||o],v=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||o;if(i.nodeType===3||i.nodeType===8){return}if(nt.test(v+w.event.triggered)){return}if(v.indexOf(".")>=0){m=v.split(".");v=m.shift();m.sort()}a=v.indexOf(":")<0&&"on"+v;n=n[w.expando]?n:new w.Event(v,typeof n==="object"&&n);n.isTrigger=s?2:3;n.namespace=m.join(".");n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;n.result=t;if(!n.target){n.target=i}r=r==null?[n]:w.makeArray(r,[n]);c=w.event.special[v]||{};if(!s&&c.trigger&&c.trigger.apply(i,r)===false){return}if(!s&&!c.noBubble&&!w.isWindow(i)){l=c.delegateType||v;if(!nt.test(l+v)){f=f.parentNode}for(;f;f=f.parentNode){d.push(f);h=f}if(h===(i.ownerDocument||o)){d.push(h.defaultView||h.parentWindow||e)}}p=0;while((f=d[p++])&&!n.isPropagationStopped()){n.type=p>1?l:c.bindType||v;u=(w._data(f,"events")||{})[n.type]&&w._data(f,"handle");if(u){u.apply(f,r)}u=a&&f[a];if(u&&w.acceptData(f)&&u.apply&&u.apply(f,r)===false){n.preventDefault()}}n.type=v;if(!s&&!n.isDefaultPrevented()){if((!c._default||c._default.apply(d.pop(),r)===false)&&w.acceptData(i)){if(a&&i[v]&&!w.isWindow(i)){h=i[a];if(h){i[a]=null}w.event.triggered=v;try{i[v]()}catch(g){}w.event.triggered=t;if(h){i[a]=h}}}}return n.result},dispatch:function(e){e=w.event.fix(e);var n,r,i,s,o,u=[],a=v.call(arguments),f=(w._data(this,"events")||{})[e.type]||[],l=w.event.special[e.type]||{};a[0]=e;e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===false){return}u=w.event.handlers.call(this,e,f);n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem;o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped()){if(!e.namespace_re||e.namespace_re.test(i.namespace)){e.handleObj=i;e.data=i.data;r=((w.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a);if(r!==t){if((e.result=r)===false){e.preventDefault();e.stopPropagation()}}}}}if(l.postDispatch){l.postDispatch.call(this,e)}return e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click")){for(;f!=this;f=f.parentNode||this){if(f.nodeType===1&&(f.disabled!==true||e.type!=="click")){s=[];for(o=0;o=0:w.find(r,this,null,[f]).length}if(s[r]){s.push(i)}}if(s.length){u.push({elem:f,handlers:s})}}}}if(a1?w.unique(n):n);n.selector=this.selector?this.selector+" "+e:e;return n},has:function(e){var t,n=w(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:n.nodeType===1&&w.find.matchesSelector(n,e))){n=s.push(n);break}}}return this.pushStack(s.length>1?w.unique(s):s)},index:function(e){if(!e){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof e==="string"){return w.inArray(this[0],w(e))}return w.inArray(e.jquery?e[0]:e,this)},add:function(e,t){var n=typeof e==="string"?w(e,t):w.makeArray(e&&e.nodeType?[e]:e),r=w.merge(this.get(),n);return this.pushStack(w.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});w.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return w.dir(e,"parentNode")},parentsUntil:function(e,t,n){return w.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return w.dir(e,"nextSibling")},prevAll:function(e){return w.dir(e,"previousSibling")},nextUntil:function(e,t,n){return w.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return w.dir(e,"previousSibling",n)},siblings:function(e){return w.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return w.sibling(e.firstChild)},contents:function(e){return w.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:w.merge([],e.childNodes)}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);if(e.slice(-5)!=="Until"){r=n}if(r&&typeof r==="string"){i=w.filter(r,i)}if(this.length>1){if(!lt[e]){i=w.unique(i)}if(at.test(e)){i=i.reverse()}}return this.pushStack(i)}});w.extend({filter:function(e,t,n){var r=t[0];if(n){e=":not("+e+")"}return t.length===1&&r.nodeType===1?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return e.nodeType===1}))},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!w(s).is(r))){if(s.nodeType===1){i.push(s)}s=s[n]}return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling){if(e.nodeType===1&&e!==t){n.push(e)}}return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/\s*$/g,Lt={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:w.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},At=pt(o),Ot=At.appendChild(o.createElement("div"));Lt.optgroup=Lt.option;Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead;Lt.th=Lt.td;w.fn.extend({text:function(e){return w.access(this,function(e){return e===t?w.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this)}})},after:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this.nextSibling)}})},remove:function(e,t){var n,r=e?w.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++){if(!t&&n.nodeType===1){w.cleanData(jt(n))}if(n.parentNode){if(t&&w.contains(n.ownerDocument,n)){Pt(jt(n,"script"))}n.parentNode.removeChild(n)}}return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){if(e.nodeType===1){w.cleanData(jt(e,false))}while(e.firstChild){e.removeChild(e.firstChild)}if(e.options&&w.nodeName(e,"select")){e.options.length=0}}return this},clone:function(e,t){e=e==null?false:e;t=t==null?e:t;return this.map(function(){return w.clone(this,e,t)})},html:function(e){return w.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t){return n.nodeType===1?n.innerHTML.replace(vt,""):t}if(typeof e==="string"&&!St.test(e)&&(w.support.htmlSerialize||!mt.test(e))&&(w.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1>");try{for(;r")){s=e.cloneNode(true)}else{Ot.innerHTML=e.outerHTML;Ot.removeChild(s=Ot.firstChild)}if((!w.support.noCloneEvent||!w.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!w.isXMLDoc(e)){r=jt(s);u=jt(e);for(o=0;(i=u[o])!=null;++o){if(r[o]){Bt(i,r[o])}}}if(t){if(n){u=u||jt(e);r=r||jt(s);for(o=0;(i=u[o])!=null;o++){Ht(i,r[o])}}else{Ht(e,s)}}r=jt(s,"script");if(r.length>0){Pt(r,!a&&jt(e,"script"))}r=u=i=null;return s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d")+l[2];i=l[0];while(i--){u=u.lastChild}if(!w.support.leadingWhitespace&>.test(s)){p.push(t.createTextNode(gt.exec(s)[0]))}if(!w.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]===""&&!wt.test(s)?u:0;i=s&&s.childNodes.length;while(i--){if(w.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length){s.removeChild(f)}}}w.merge(p,u.childNodes);u.textContent="";while(u.firstChild){u.removeChild(u.firstChild)}u=h.lastChild}}}if(u){h.removeChild(u)}if(!w.support.appendChecked){w.grep(jt(p,"input"),Ft)}d=0;while(s=p[d++]){if(r&&w.inArray(s,r)!==-1){continue}o=w.contains(s.ownerDocument,s);u=jt(h.appendChild(s),"script");if(o){Pt(u)}if(n){i=0;while(s=u[i++]){if(Nt.test(s.type||"")){n.push(s)}}}}u=null;return h},cleanData:function(e,t){var n,r,s,o,u=0,a=w.expando,f=w.cache,l=w.support.deleteExpando,h=w.event.special;for(;(n=e[u])!=null;u++){if(t||w.acceptData(n)){s=n[a];o=s&&f[s];if(o){if(o.events){for(r in o.events){if(h[r]){w.event.remove(n,r)}else{w.removeEvent(n,r,o.handle)}}}if(f[s]){delete f[s];if(l){delete n[a]}else if(typeof n.removeAttribute!==i){n.removeAttribute(a)}else{n[a]=null}c.push(s)}}}}},_evalUrl:function(e){return w.ajax({url:e,type:"GET",dataType:"script",async:false,global:false,"throws":true})}});w.fn.extend({wrapAll:function(e){if(w.isFunction(e)){return this.each(function(t){w(this).wrapAll(e.call(this,t))})}if(this[0]){var t=w(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){t.insertBefore(this[0])}t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1){e=e.firstChild}return e}).append(this)}return this},wrapInner:function(e){if(w.isFunction(e)){return this.each(function(t){w(this).wrapInner(e.call(this,t))})}return this.each(function(){var t=w(this),n=t.contents();if(n.length){n.wrapAll(e)}else{t.append(e)}})},wrap:function(e){var t=w.isFunction(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){if(!w.nodeName(this,"body")){w(this).replaceWith(this.childNodes)}}).end()}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+E+")(.*)$","i"),Jt=new RegExp("^("+E+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+E+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];w.fn.extend({css:function(e,n){return w.access(this,function(e,n,r){var i,s,o={},u=0;if(w.isArray(n)){s=qt(e);i=n.length;for(;u1)},show:function(){return rn(this,true)},hide:function(){return rn(this)},toggle:function(e){if(typeof e==="boolean"){return e?this.show():this.hide()}return this.each(function(){if(nn(this)){w(this).show()}else{w(this).hide()}})}});w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:true,fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return}var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a));u=w.cssHooks[n]||w.cssHooks[a];if(r!==t){o=typeof r;if(o==="string"&&(s=Kt.exec(r))){r=(s[1]+1)*s[2]+parseFloat(w.css(e,n));o="number"}if(r==null||o==="number"&&isNaN(r)){return}if(o==="number"&&!w.cssNumber[a]){r+="px"}if(!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0){f[n]="inherit"}if(!u||!("set"in u)||(r=u.set(e,r,i))!==t){try{f[n]=r}catch(l){}}}else{if(u&&"get"in u&&(s=u.get(e,false,i))!==t){return s}return f[n]}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a));u=w.cssHooks[n]||w.cssHooks[a];if(u&&"get"in u){o=u.get(e,true,r)}if(o===t){o=Rt(e,n,i)}if(o==="normal"&&n in Yt){o=Yt[n]}if(r===""||r){s=parseFloat(o);return r===true||w.isNumeric(s)?s||0:o}return o}});if(e.getComputedStyle){qt=function(t){return e.getComputedStyle(t,null)};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;if(u){if(a===""&&!w.contains(e.ownerDocument,e)){a=w.style(e,n)}if(Jt.test(a)&&Vt.test(n)){i=f.width;s=f.minWidth;o=f.maxWidth;f.minWidth=f.maxWidth=f.width=a;a=u.width;f.width=i;f.minWidth=s;f.maxWidth=o}}return a}}else if(o.documentElement.currentStyle){qt=function(e){return e.currentStyle};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;if(a==null&&f&&f[n]){a=f[n]}if(Jt.test(a)&&!Wt.test(n)){i=f.left;s=e.runtimeStyle;o=s&&s.left;if(o){s.left=e.currentStyle.left}f.left=n==="fontSize"?"1em":a;a=f.pixelLeft+"px";f.left=i;if(o){s.left=o}}return a===""?"auto":a}}w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n){return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)}},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",false,i)==="border-box",i):0)}}});if(!w.support.opacity){w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter){return}}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}}w(function(){if(!w.support.reliableMarginRight){w.cssHooks.marginRight={get:function(e,t){if(t){return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}}}if(!w.support.pixelPosition&&w.fn.position){w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n){n=Rt(e,t);return Jt.test(n)?w(e).position()[t]+"px":n}}}})}});if(w.expr&&w.expr.filters){w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"};w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}}w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n==="string"?n.split(" "):[n];for(;r<4;r++){i[e+Zt[r]+t]=s[r]||s[r-2]||s[0]}return i}};if(!Vt.test(e)){w.cssHooks[e+t].set=sn}});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}});w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t){n=w.ajaxSettings&&w.ajaxSettings.traditional}if(w.isArray(e)||e.jquery&&!w.isPlainObject(e)){w.each(e,function(){s(this.name,this.value)})}else{for(r in e){vn(r,e[r],n,s)}}return i.join("&").replace(ln,"+")};w.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a");gn.href="";gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[];w.fn.load=function(e,n,r){if(typeof e!=="string"&&kn){return kn.apply(this,arguments)}var i,s,o,u=this,a=e.indexOf(" ");if(a>=0){i=e.slice(a,e.length);e=e.slice(0,a)}if(w.isFunction(n)){r=n;n=t}else if(n&&typeof n==="object"){o="POST"}if(u.length>0){w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments;u.html(i?w("
").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])})}return this};w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}});w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2){return}b=2;if(u){clearTimeout(u)}f=t;o=i||"";x.readyState=e>0?4:0;l=e>=200&&e<300||e===304;if(r){E=Hn(c,x,r)}E=Bn(c,E,x,l);if(l){if(c.ifModified){S=x.getResponseHeader("Last-Modified");if(S){w.lastModified[s]=S}S=x.getResponseHeader("etag");if(S){w.etag[s]=S}}if(e===204||c.type==="HEAD"){T="nocontent"}else if(e===304){T="notmodified"}else{T=E.state;g=E.data;y=E.error;l=!y}}else{y=T;if(e||!T){T="error";if(e<0){e=0}}}x.status=e;x.statusText=(n||T)+"";if(l){d.resolveWith(h,[g,T,x])}else{d.rejectWith(h,[x,T,y])}x.statusCode(m);m=t;if(a){p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y])}v.fireWith(h,[x,T]);if(a){p.trigger("ajaxComplete",[x,c]);if(!--w.active){w.event.trigger("ajaxStop")}}}if(typeof e==="object"){n=e;e=t}n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o)){l[t[1].toLowerCase()]=t[2]}}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();if(!b){e=y[n]=y[n]||e;g[e]=t}return this},overrideMimeType:function(e){if(!b){c.mimeType=e}return this},statusCode:function(e){var t;if(e){if(b<2){for(t in e){m[t]=[m[t],e[t]]}}else{x.always(e[x.status])}}return this},abort:function(e){var t=e||E;if(f){f.abort(t)}N(0,t);return this}};d.promise(x).complete=v.add;x.success=x.done;x.error=x.fail;c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//");c.type=n.method||n.type||c.method||c.type;c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""];if(c.crossDomain==null){r=Cn.exec(c.url.toLowerCase());c.crossDomain=!!(r&&(r[1]!==mn[1]||r[2]!==mn[2]||(r[3]||(r[1]==="http:"?"80":"443"))!==(mn[3]||(mn[1]==="http:"?"80":"443"))))}if(c.data&&c.processData&&typeof c.data!=="string"){c.data=w.param(c.data,c.traditional)}Dn(Ln,c,n,x);if(b===2){return x}a=c.global;if(a&&w.active++===0){w.event.trigger("ajaxStart")}c.type=c.type.toUpperCase();c.hasContent=!Tn.test(c.type);s=c.url;if(!c.hasContent){if(c.data){s=c.url+=(bn.test(s)?"&":"?")+c.data;delete c.data}if(c.cache===false){c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++}}if(c.ifModified){if(w.lastModified[s]){x.setRequestHeader("If-Modified-Since",w.lastModified[s])}if(w.etag[s]){x.setRequestHeader("If-None-Match",w.etag[s])}}if(c.data&&c.hasContent&&c.contentType!==false||n.contentType){x.setRequestHeader("Content-Type",c.contentType)}x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers){x.setRequestHeader(i,c.headers[i])}if(c.beforeSend&&(c.beforeSend.call(h,x,c)===false||b===2)){return x.abort()}E="abort";for(i in{success:1,error:1,complete:1}){x[i](c[i])}f=Dn(An,c,n,x);if(!f){N(-1,"No Transport")}else{x.readyState=1;if(a){p.trigger("ajaxSend",[x,c])}if(c.async&&c.timeout>0){u=setTimeout(function(){x.abort("timeout")},c.timeout)}try{b=1;f.send(g,N)}catch(T){if(b<2){N(-1,T)}else{throw T}}}return x},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}});w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){if(w.isFunction(r)){s=s||i;i=r;r=t}return w.ajax({url:e,type:n,dataType:s,data:r,success:i})}});w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){w.globalEval(e);return e}}});w.ajaxPrefilter("script",function(e){if(e.cache===t){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script");n.async=true;if(e.scriptCharset){n.charset=e.scriptCharset}n.src=e.url;n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState)){n.onload=n.onreadystatechange=null;if(n.parentNode){n.parentNode.removeChild(n)}n=null;if(!t){i(200,"success")}}};r.insertBefore(n,r.firstChild)},abort:function(){if(n){n.onload(t,true)}}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;this[e]=true;return e}});w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==false&&(Fn.test(n.url)?"url":typeof n.data==="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp"){s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback;if(a){n[a]=n[a].replace(Fn,"$1"+s)}else if(n.jsonp!==false){n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s}n.converters["script json"]=function(){if(!u){w.error(s+" was not called")}return u[0]};n.dataTypes[0]="json";o=e[s];e[s]=function(){u=arguments};i.always(function(){e[s]=o;if(n[s]){n.jsonpCallback=r.jsonpCallback;jn.push(s)}if(u&&w.isFunction(o)){o(u[0])}u=o=t});return"script"}});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In){In[e](t,true)}};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn;qn=w.ajaxSettings.xhr();w.support.cors=!!qn&&"withCredentials"in qn;qn=w.support.ajax=!!qn;if(qn){w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();if(n.username){a.open(n.type,n.url,n.async,n.username,n.password)}else{a.open(n.type,n.url,n.async)}if(n.xhrFields){for(u in n.xhrFields){a[u]=n.xhrFields[u]}}if(n.mimeType&&a.overrideMimeType){a.overrideMimeType(n.mimeType)}if(!n.crossDomain&&!i["X-Requested-With"]){i["X-Requested-With"]="XMLHttpRequest"}try{for(u in i){a.setRequestHeader(u,i[u])}}catch(f){}a.send(n.hasContent&&n.data||null);r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t;if(o){a.onreadystatechange=w.noop;if(Un){delete In[o]}}if(i){if(a.readyState!==4){a.abort()}}else{c={};u=a.status;f=a.getAllResponseHeaders();if(typeof a.responseText==="string"){c.text=a.responseText}try{l=a.statusText}catch(h){l=""}if(!u&&n.isLocal&&!n.crossDomain){u=c.text?200:404}else if(u===1223){u=204}}}}catch(p){if(!i){s(-1,p)}}if(c){s(u,l,c,f)}};if(!n.async){r()}else if(a.readyState===4){setTimeout(r)}else{o=++Rn;if(Un){if(!In){In={};w(e).unload(Un)}In[o]=r}a.onreadystatechange=r}},abort:function(){if(r){r(t,true)}}}}})}var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3];i=i||[];o=+r||1;do{u=u||".5";o=o/u;w.style(n.elem,e,o+s)}while(u!==(u=n.cur()/r)&&u!==1&&--a)}if(i){o=n.start=+o||+r||0;n.unit=s;n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]}return n}]};w.Animation=w.extend(er,{tweener:function(e,t){if(w.isFunction(e)){t=e;e=["*"]}else{e=e.split(" ")}var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;if(a){l=i.position();c=l.top;h=l.left}else{c=parseFloat(o)||0;h=parseFloat(u)||0}if(w.isFunction(t)){t=t.call(e,n,s)}if(t.top!=null){f.top=t.top-s.top+c}if(t.left!=null){f.left=t.left-s.left+h}if("using"in t){t.using.call(e,f)}else{i.css(f)}}};w.fn.extend({position:function(){if(!this[0]){return}var e,t,n={top:0,left:0},r=this[0];if(w.css(r,"position")==="fixed"){t=r.getBoundingClientRect()}else{e=this.offsetParent();t=this.offset();if(!w.nodeName(e[0],"html")){n=e.offset()}n.top+=w.css(e[0],"borderTopWidth",true);n.left+=w.css(e[0],"borderLeftWidth",true)}return{top:t.top-n.top-w.css(r,"marginTop",true),left:t.left-n.left-w.css(r,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static"){e=e.offsetParent}return e||u})}});w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t){return o?n in o?o[n]:o.document.documentElement[i]:e[i]}if(o){o.scrollTo(!r?s:w(o).scrollLeft(),r?s:w(o).scrollTop())}else{e[i]=s}},e,i,arguments.length,null)}});w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!=="boolean"),u=r||(i===true||s===true?"margin":"border");return w.access(this,function(n,r,i){var s;if(w.isWindow(n)){return n.document.documentElement["client"+e]}if(n.nodeType===9){s=n.documentElement;return Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])}return i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})});w.fn.size=function(){return this.length};w.fn.andSelf=w.fn.addBack;if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=w}else{e.jQuery=e.$=w;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return w})}}})(window);(function(e,t,n){"use strict";function O(e,t){if(t&&t.onError){if(t.onError(e)===false){return}}this.name="JsRender Error";this.message=e||"JsRender error"}function M(e,t){var n;e=e||{};for(n in t){e[n]=t[n]}return e}function _(e,t,n){if(!it.rTag||e){a=e?e.charAt(0):a;f=e?e.charAt(1):f;l=t?t.charAt(0):l;c=t?t.charAt(1):c;h=n||h;e="\\"+a+"(\\"+h+")?\\"+f;t="\\"+l+"\\"+c;o="(?:(?:(\\w+(?=[\\/\\s\\"+l+"]))|(?:(\\w+)?(:)|(>)|!--((?:[^-]|-(?!-))*)--|(\\*)))"+"\\s*((?:[^\\"+l+"]|\\"+l+"(?!\\"+c+"))*?)";it.rTag=o+")";o=new RegExp(e+o+"(\\/)?|(?:\\/(\\w+)))"+t,"g");u=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t)}return[a,f,l,c,h]}function D(e,t){if(!t){t=e;e=n}var r,i,s,o,u=this,a=!t||t==="root";if(e){o=u.type===t?u:n;if(!o){r=u.views;if(u._.useKey){for(i in r){if(o=r[i].get(e,t)){break}}}else for(i=0,s=r.length;!o&&i0){try{h=n.nodeType>0?n:!u.test(n)&&t&&t(e.document).find(n)[0]}catch(i){}if(h){n=h.getAttribute(C);r=r||n;n=et[n];if(!n){r=r||"_"+x++;h.setAttribute(C,r);n=et[r]=z(r,h.innerHTML,s,o,a,f)}}return n}}var c,h;i=i||"";c=l(i);f=f||(i.markup?i:{});f.tmplName=r;if(s){f._parentTmpl=s}if(!c&&i.markup&&(c=l(i.markup))){if(c.fn&&(c.debug!==i.debug||c.allowCode!==i.allowCode)){c=c.markup}}if(c!==n){if(r&&!s){k[r]=function(){return i.render.apply(i,arguments)}}if(c.fn||i.fn){if(c.fn){if(r&&r!==c.tmplName){i=Y(f,c)}else{i=c}}}else{i=W(c,f);K(c.replace(g,"\\$&"),i)}R(f);return i}}function W(e,t){var n,r=st.wrapMap||{},s=M({markup:e,tmpls:[],links:{},tags:{},bnds:[],_is:"template",render:V},t);if(!t.htmlTag){n=w.exec(e);s.htmlTag=n?n[1].toLowerCase():""}n=r[s.htmlTag];if(n&&n!==r.div){s.markup=i.trim(s.markup)}return s}function X(e,t){function r(s,o,u){var a,f,l,c;if(s&&""+s!==s&&!s.nodeType&&!s.markup){for(l in s){r(l,s[l],o)}return A}if(o===n){o=s;s=n}if(s&&""+s!==s){u=o;o=s;s=n}c=u?u[i]=u[i]||{}:r;f=t.compile;if(a=it.onBeforeStoreItem){f=a(c,s,o,f)||f}if(!s){o=f(n,o)}else if(o===null){delete c[s]}else{c[s]=f?o=f(s,o,u,e,t):o}if(f&&o){o._is=e}if(a=it.onStoreItem){a(c,s,o,f)}return o}var i=e+"s";A[i]=r;L[e]=t}function V(e,t,r,s,o,u){var a,f,l,c,h,p,d,v,m,g,y,b,w,E=this,S=!E.attr||E.attr==="html",x="";if(s===true){d=true;s=0}if(E.tag){v=E;E=E.tag;g=E._;b=E.tagName;w=v.tmpl;t=Y(t,E.ctx);m=v.content;if(v.props.link===false){t=t||{};t.link=false}r=r||v.view;e=e===n?r:e}else{w=E.jquery&&(E[0]||$('Unknown template: "'+E.selector+'"'))||E}if(w){if(!r&&e&&e._is==="view"){r=e}if(r){m=m||r.content;u=u||r._.onRender;if(e===r){e=r.data;o=true}t=Y(t,r.ctx)}if(!r||r.data===n){(t=t||{}).root=e}if(!w.fn){w=et[w]||et(w)}if(w){u=(t&&t.link)!==false&&S&&u;y=u;if(u===true){y=n;u=r._.onRender}t=w.helpers?Y(w.helpers,t):t;if(i.isArray(e)&&!o){c=d?r:s!==n&&r||q(t,"array",r,e,w,s,m,u);for(a=0,f=e.length;a":u+o}if(_){L="prm"+i;_="try{var "+L+"=["+a+"][0];}catch(e){"+L+'="";}\n';a=L}}else{if(S){w=W(x,D);w.tmplName=b+"/"+o;Q(S,w);y.push(w)}if(!C){E=o;N=M;M=""}T=e[i+1];T=T&&T[0]==="else"}f+=",args:["+a+"]}";if(k&&g||u&&o!==">"){A=new Function("data,view,j,u"," // "+b+" "+O+" "+o+"\n"+_+"return {"+f+";");A.paths=g;A._ctxs=o;if(r){return A}d=1}M+=k?"\n"+(g?"":_)+(r?"return ":"ret+=")+(d?(d=0,p=true,'c("'+u+'",view,'+(g?(m[O-1]=A,O):"{"+f)+");"):o===">"?(c=true,"h("+a+");"):(h=true,"(v="+a+")!="+(r?"=":"")+'u?v:"";')):(l=true,"{view:view,tmpl:"+(S?y.length:"0")+","+f+",");if(E&&!T){M="["+M.slice(0,-1)+"]";if(r||g){M=new Function("data,view,j,u"," // "+b+" "+O+" "+E+"\nreturn "+M+";");if(g){(m[O-1]=M).paths=g}M._ctxs=o;if(r){return M}}M=N+'\nret+=t("'+E+'",view,this,'+(O||M)+");";g=0;E=0}}}}M="// "+b+"\nvar j=j||"+(t?"jQuery.":"js")+"views"+(h?",v":"")+(l?",t=j._tag":"")+(p?",c=j._cnvt":"")+(c?",h=j.converters.html":"")+(r?";\n":',ret="";\n')+(st.tryCatch?"try{\n":"")+(D.debug?"debugger;":"")+M+(r?"\n":"\nreturn ret;\n")+(st.tryCatch?"\n}catch(e){return j._err(e);}":"");try{M=new Function("data,view,j,u",M)}catch(H){J("Compiled template code:\n\n"+M,H)}if(n){n.fn=M}return M}function G(e,t,n){function r(r,d,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B){function F(e,n,r,u,a,f,l,c){if(r){if(t){if(i==="linkTo"){s=t._jsvto=t._jsvto||[];s.push(E)}if(!i||o){t.push(E.slice(n.length))}}if(r!=="."){var h=(u?'view.hlp("'+u+'")':a?"view":"data")+(c?(f?"."+f:u?"":a?"":"."+r)+(l||""):(c=u?"":a?f||"":r,""));h=h+(c?"."+c:"");return n+(h.slice(0,9)==="view.data"?h.slice(5):h)}}return e}var j;S=S||"";b=b||d||L;E=E||N;C=C||D||"";if(x){J(e)}else{if(t&&_&&!y&&!g){if(!i||o||s){j=v[m];if(B.length-1>H-j){j=B.slice(j,H+1);_=f+":"+j+l;_=u[_]=u[_]||K(a+_+c,n,true);if(!_.paths){G(j,_.paths=[],n)}(s||t).push({_jsvOb:_})}}}return y?(y=!A,y?r:'"'):g?(g=!O,g?r:'"'):(b?(m++,v[m]=H++,b):"")+(P?m?"":i?(i=o=s=false,"\b"):",":T?(m&&J(e),i=E,o=w,"\b"+E+":"):E?E.split("^").join(".").replace(p,F)+(C?(h[++m]=true,E.charAt(0)!=="."&&(v[m]=H),C):S):S?S:M?(h[m--]=false,M)+(C?(h[++m]=true,C):""):k?(h[m]||J(e),","):d?"":(y=A,g=O,'"'))}}var i,s,o,u=n.links,h={},v={0:-1},m=0,g=false,y=false;return(e+" ").replace(/\)\^/g,").").replace(d,r)}function Y(e,t){return e&&e!==t?t?M(M({},t),e):e:t&&M({},t)}function Z(e){return N[e]||(N[e]="&#"+e.charCodeAt(0)+";")}function ut(e){var t=this,r=t.tagCtx,s=!arguments.length,o="",u=s||0;if(!t.rendering.done){if(s){o=n}else if(e!==n){e=t.prep?t.prep(e):e;o+=r.render(e);u+=i.isArray(e)?e.length:1}if(t.rendering.done=u){t.selected=r.index}}return o}if(t&&t.views||e.jsviews){return}var r="v1.0.0-beta",i,s,o,u,a="{",f="{",l="}",c="}",h="^",p=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,d=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*\.|\s*\^|\s*$)|[)\]])([([]?))|(\s+)/g,v=/[ \t]*(\r\n|\n|\r)/g,m=/\\(['"])/g,g=/['"\\]/g,y=/\x08(~)?([^\x08]+)\x08/g,b=/^if\s/,w=/<(\w+)[>\s]/,E=/[\x00`><"'&]/g,S=E,x=0,T=0,N={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`"},C="data-jsv-tmpl",k={},L={template:{compile:z},tag:{compile:U},helper:{},converter:{}},A={jsviews:r,render:k,settings:{delimiters:_,debugMode:true,tryCatch:true},sub:{View:q,Error:O,tmplFn:K,parse:G,extend:M,error:$,syntaxError:J},_cnvt:j,_tag:I,_err:function(e){return st.debugMode?"Error: "+(e.message||e)+". ":""}};(O.prototype=new Error).constructor=O;P.depends=function(){return[this.get("item"),"index"]};H.depends=function(){return["index"]};for(s in L){X(s,L[s])}var et=A.templates,tt=A.converters,nt=A.helpers,rt=A.tags,it=A.sub,st=A.settings,ot="Error: #index in nested view: use #getIndex()";if(t){i=t;i.fn.render=V}else{i=e.jsviews={};i.isArray=Array&&Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}}i.render=k;i.views=A;i.templates=et=A.templates;rt({"else":function(){},"if":{render:function(e){var t=this,n=t.rendering.done||!e&&(arguments.length||!t.tagCtx.index)?"":(t.rendering.done=true,t.selected=t.tagCtx.index,t.tagCtx.render());return n},onUpdate:function(e,t,n){var r,i,s;for(r=0;(i=this.tagCtxs[r])&&i.args.length;r++){i=i.args[0];s=!i!==!n[r].args[0];if(!!i||s){return s}}return false},flow:true},"for":{render:ut,onArrayChange:function(e,t){var n,r=this,i=t.change;if(this.tagCtxs[1]&&(i==="insert"&&e.target.length===t.items.length||i==="remove"&&!e.target.length||i==="refresh"&&!t.oldItems.length!==!e.target.length)){this.refresh()}else{for(n in r._.arrVws){n=r._.arrVws[n];if(n.data===e.target){n._.onArrayChange.apply(n,arguments)}}}e.done=true},flow:true},props:{prep:function(e){var t,n=[];for(t in e){n.push({key:t,prop:e[t]})}return n},render:ut,flow:true},include:{flow:true},"*":{render:function(e){return e},flow:true}});tt({html:function(e){return e!=n?String(e).replace(S,Z):""},attr:function(e){return e!=n?String(e).replace(E,Z):e===null?e:""},url:function(e){return e!=n?encodeURI(String(e)):e===null?e:""}});_()})(this,this.jQuery);jQuery.fn.extend({everyTime:function(e,t,n,r){return this.each(function(){jQuery.timer.add(this,e,t,n,r)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(e==undefined||e==null)return null;var t=this.regex.exec(jQuery.trim(e.toString()));return t[2]?parseFloat(t[1])*(this.powers[t[2]]||1):e},add:function(e,t,n,r,i){var s=0;if(jQuery.isFunction(n)){i||(i=r);r=n;n=t}t=jQuery.timer.timeParse(t);if(!(typeof t!="number"||isNaN(t)||t<0)){if(typeof i!="number"||isNaN(i)||i<0)i=0;i=i||0;var o=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});o[n]||(o[n]={});r.timerID=r.timerID||this.guid++;var u=function(){if(++s>i&&i!==0||r.call(e,s)===false)jQuery.timer.remove(e,n,r)};u.timerID=r.timerID;o[n][r.timerID]||(o[n][r.timerID]=window.setInterval(u,t));this.global.push(e)}},remove:function(e,t,n){var r=jQuery.data(e,this.dataKey),i;if(r){if(t){if(r[t]){if(n){if(n.timerID){window.clearInterval(r[t][n.timerID]);delete r[t][n.timerID]}}else for(n in r[t]){window.clearInterval(r[t][n]);delete r[t][n]}for(i in r[t])break;if(!i){i=null;delete r[t]}}}else for(t in r)this.remove(e,t,n);for(i in r)break;i||jQuery.removeData(e,this.dataKey)}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(e,t){jQuery.timer.remove(t)})}) \ No newline at end of file +(function(e,t){function H(e){var t=e.length,n=w.type(e);if(w.isWindow(e)){return false}if(e.nodeType===1&&t){return true}return n==="array"||n!=="function"&&(t===0||typeof t==="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};w.each(e.match(S)||[],function(e,n){t[n]=true});return t}function q(e,n,r,i){if(!w.acceptData(e)){return}var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n==="string"){return}if(!l){if(a){l=e[u]=c.pop()||w.guid++}else{l=u}}if(!f[l]){f[l]=a?{}:{toJSON:w.noop}}if(typeof n==="object"||typeof n==="function"){if(i){f[l]=w.extend(f[l],n)}else{f[l].data=w.extend(f[l].data,n)}}o=f[l];if(!i){if(!o.data){o.data={}}o=o.data}if(r!==t){o[w.camelCase(n)]=r}if(typeof n==="string"){s=o[n];if(s==null){s=o[w.camelCase(n)]}}else{s=o}return s}function R(e,t,n){if(!w.acceptData(e)){return}var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u]){return}if(t){r=n?o[u]:o[u].data;if(r){if(!w.isArray(t)){if(t in r){t=[t]}else{t=w.camelCase(t);if(t in r){t=[t]}else{t=t.split(" ")}}}else{t=t.concat(w.map(t,w.camelCase))}i=t.length;while(i--){delete r[t[i]]}if(n?!z(r):!w.isEmptyObject(r)){return}}}if(!n){delete o[u].data;if(!z(o[u])){return}}if(s){w.cleanData([e],true)}else if(w.support.deleteExpando||o!=o.window){delete o[u]}else{o[u]=null}}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r==="string"){try{r=r==="true"?true:r==="false"?false:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else{r=t}}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t])){continue}if(t!=="toJSON"){return false}}return true}function it(){return true}function st(){return false}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do{e=e[t]}while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t)){return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n})}if(t.nodeType){return w.grep(e,function(e){return e===t!==n})}if(typeof t==="string"){if(ut.test(t)){return w.filter(t,e,n)}t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement){while(t.length){n.createElement(t.pop())}}return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){e.type=(w.find.attr(e,"type")!==null)+"/"+e.type;return e}function Dt(e){var t=Ct.exec(e.type);if(t){e.type=t[1]}else{e.removeAttribute("type")}return e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++){w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e)){return}var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle;o.events={};for(n in u){for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement);t=(It[0].contentWindow||It[0].contentDocument).document;t.write("");t.close();n=fn(e,t);It.detach()}Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");n.remove();return r}function vn(e,t,n,r){var i;if(w.isArray(t)){w.each(t,function(t,i){if(n||cn.test(e)){r(e,i)}else{vn(e+"["+(typeof i==="object"?t:"")+"]",i,n,r)}})}else if(!n&&w.type(t)==="object"){for(i in t){vn(e+"["+i+"]",t[i],n,r)}}else{r(e,t)}}function _n(e){return function(t,n){if(typeof t!=="string"){n=t;t="*"}var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n)){while(r=s[i++]){if(r[0]==="+"){r=r.slice(1)||"*";(e[r]=e[r]||[]).unshift(n)}else{(e[r]=e[r]||[]).push(n)}}}}}function Dn(e,t,n,r){function o(u){var a;i[u]=true;w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f==="string"&&!s&&!i[f]){t.dataTypes.unshift(f);o(f);return false}else if(s){return!(a=f)}});return a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n){if(n[i]!==t){(s[i]?e:r||(r={}))[i]=n[i]}}if(r){w.extend(true,e,r)}return e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*"){f.shift();if(s===t){s=e.mimeType||n.getResponseHeader("Content-Type")}}if(s){for(u in a){if(a[u]&&a[u].test(s)){f.unshift(u);break}}}if(f[0]in r){o=f[0]}else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}if(!i){i=u}}o=o||i}if(o){if(o!==f[0]){f.unshift(o)}return r[o]}}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1]){for(o in e.converters){f[o.toLowerCase()]=e.converters[o]}}s=l.shift();while(s){if(e.responseFields[s]){n[e.responseFields[s]]=t}if(!a&&r&&e.dataFilter){t=e.dataFilter(t,e.dataType)}a=s;s=l.shift();if(s){if(s==="*"){s=a}else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o){for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){if(o===true){o=f[i]}else if(f[i]!==true){s=u[0];l.unshift(u[1])}break}}}}if(o!==true){if(o&&e["throws"]){t=o(t)}else{try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){setTimeout(function(){Xn=t});return Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s)[^>]*|#([\w-]*))$/,N=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,C=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,L=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,O=/^-ms-/,M=/-([\da-z])/gi,_=function(e,t){return t.toUpperCase()},D=function(e){if(o.addEventListener||e.type==="load"||o.readyState==="complete"){P();w.ready()}},P=function(){if(o.addEventListener){o.removeEventListener("DOMContentLoaded",D,false);e.removeEventListener("load",D,false)}else{o.detachEvent("onreadystatechange",D);e.detachEvent("onload",D)}};w.fn=w.prototype={jquery:h,constructor:w,init:function(e,n,r){var i,s;if(!e){return this}if(typeof e==="string"){if(e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3){i=[null,e,null]}else{i=T.exec(e)}if(i&&(i[1]||!n)){if(i[1]){n=n instanceof w?n[0]:n;w.merge(this,w.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,true));if(N.test(i[1])&&w.isPlainObject(n)){for(i in n){if(w.isFunction(this[i])){this[i](n[i])}else{this.attr(i,n[i])}}}return this}else{s=o.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2]){return r.find(e)}this.length=1;this[0]=s}this.context=o;this.selector=e;return this}}else if(!n||n.jquery){return(n||r).find(e)}else{return this.constructor(n).find(e)}}else if(e.nodeType){this.context=this[0]=e;this.length=1;return this}else if(w.isFunction(e)){return r.ready(e)}if(e.selector!==t){this.selector=e.selector;this.context=e.context}return w.makeArray(e,this)},selector:"",length:0,toArray:function(){return v.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);t.prevObject=this;t.context=this.context;return t},each:function(e,t){return w.each(this,e,t)},ready:function(e){w.ready.promise().done(e);return this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0){return}n.resolveWith(o,[w]);if(w.fn.trigger){w(o).trigger("ready").off("ready")}},isFunction:function(e){return w.type(e)==="function"},isArray:Array.isArray||function(e){return w.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){if(e==null){return String(e)}return typeof e==="object"||typeof e==="function"?l[g.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||w.type(e)!=="object"||e.nodeType||w.isWindow(e)){return false}try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf")){return false}}catch(r){return false}if(w.support.ownLast){for(n in e){return y.call(e,n)}}for(n in e){}return n===t||y.call(e,n)},isEmptyObject:function(e){var t;for(t in e){return false}return true},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!=="string"){return null}if(typeof t==="boolean"){n=t;t=false}t=t||o;var r=N.exec(e),i=!n&&[];if(r){return[t.createElement(r[1])]}r=w.buildFragment([e],t,i);if(i){w(i).remove()}return w.merge([],r.childNodes)},parseJSON:function(t){if(e.JSON&&e.JSON.parse){return e.JSON.parse(t)}if(t===null){return t}if(typeof t==="string"){t=w.trim(t);if(t){if(C.test(t.replace(L,"@").replace(A,"]").replace(k,""))){return(new Function("return "+t))()}}}w.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!=="string"){return null}try{if(e.DOMParser){i=new DOMParser;r=i.parseFromString(n,"text/xml")}else{r=new ActiveXObject("Microsoft.XMLDOM");r.async="false";r.loadXML(n)}}catch(s){r=t}if(!r||!r.documentElement||r.getElementsByTagName("parsererror").length){w.error("Invalid XML: "+n)}return r},noop:function(){},globalEval:function(t){if(t&&w.trim(t)){(e.execScript||function(t){e["eval"].call(e,t)})(t)}},camelCase:function(e){return e.replace(O,"ms-").replace(M,_)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=H(e);if(n){if(o){for(;is.cacheLength){delete t[e.shift()]}return t[n]=r}var e=[];return t}function at(e){e[b]=true;return e}function ft(e){var t=h.createElement("div");try{return!!e(t)}catch(n){return false}finally{if(t.parentNode){t.parentNode.removeChild(t)}t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--){s.attrHandle[n[r]]=t}}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(r){return r}if(n){while(n=n.nextSibling){if(n===t){return-1}}}return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){t=+t;return at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--){if(n[i=s[o]]){n[i]=!(r[i]=n[i])}}})})}function vt(){}function mt(e,t){var n,r,i,o,u,a,f,l=N[e+" "];if(l){return t?0:l.slice(0)}u=e;a=[];f=s.preFilter;while(u){if(!n||(r=X.exec(u))){if(r){u=u.slice(r[0].length)||u}a.push(i=[])}n=false;if(r=V.exec(u)){n=r.shift();i.push({value:n,type:r[0].replace(W," ")});u=u.slice(n.length)}for(o in s.filter){if((r=G[o].exec(u))&&(!f[o]||(r=f[o](r)))){n=r.shift();i.push({value:n,type:o,matches:r});u=u.slice(n.length)}}if(!n){break}}return t?u.length:u?ot.error(e):N(e,a).slice(0)}function gt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--){if(!e[i](t,n,r)){return false}}return true}:e[0]}function wt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1){s[f]=!(o[f]=c)}}}}else{g=wt(g===o?g.splice(d,g.length):g);if(i){i(null,o,g,a)}else{H.apply(o,g)}}})}function St(e){var t,n,r,i=e.length,o=s.relative[e[0].type],u=o||s.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,true),c=yt(function(e){return j.call(t,e)>-1},u,true),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&bt(h),a>1&>(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(W,"$1"),n,a0,o=e.length>0,u=function(u,a,l,c,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,x=f,T=u||o&&s.find["TAG"]("*",p&&a.parentNode||a),N=S+=x==null?1:Math.random()||.1;if(E){f=a!==h&&a;i=n}for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++]){if(m(d,a,l)){c.push(d);break}}if(E){S=N;i=++n}}if(r){if(d=!m&&d){y--}if(u){w.push(d)}}}y+=b;if(r&&b!==y){v=0;while(m=t[v++]){m(w,g,a,l)}if(u){if(y>0){while(b--){if(!(w[b]||g[b])){g[b]=D.call(c)}}}g=wt(g)}H.apply(c,g);if(E&&!u&&g.length>0&&y+t.length>1){ot.uniqueSort(c)}}if(E){S=N;f=x}return w};return r?at(u):u}function Tt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&r.getById&&t.nodeType===9&&d&&s.relative[u[1].type]){t=(s.find["ID"](f.matches[0].replace(rt,it),t)||[])[0];if(!t){return n}e=e.slice(u.shift().value.length)}o=G["needsContext"].test(e)?0:u.length;while(o--){f=u[o];if(s.relative[l=f.type]){break}if(c=s.find[l]){if(i=c(f.matches[0].replace(rt,it),$.test(u[0].type)&&t.parentNode||t)){u.splice(o,1);e=i.length&>(u);if(!e){H.apply(n,i);return n}break}}}}}a(e,h)(i,t,!d,n,$.test(e));return n}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=false,L=function(e,t){if(e===t){k=true;return 0}return 0},A=typeof t,O=1<<31,M={}.hasOwnProperty,_=[],D=_.pop,P=_.push,H=_.push,B=_.slice,j=_.indexOf||function(e){var t=0,n=this.length;for(;t+~]|"+I+")"+I+"*"),$=new RegExp(I+"*[+~]"),J=new RegExp("="+I+"*([^\\]'\"]*)"+I+"*\\]","g"),K=new RegExp(z),Q=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=new RegExp("\\\\([\\da-f]{1,6}"+I+"?|("+I+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{H.apply(_=B.call(E.childNodes),E.childNodes);_[E.childNodes.length].nodeType}catch(st){H={apply:_.length?function(e,t){P.apply(e,B.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]){}e.length=n-1}}}u=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":false};r=ot.support={};c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:E,n=t.defaultView;if(t===h||t.nodeType!==9||!t.documentElement){return h}h=t;p=t.documentElement;d=!u(t);if(n&&n.attachEvent&&n!==n.top){n.attachEvent("onbeforeunload",function(){c()})}r.attributes=ft(function(e){e.className="i";return!e.getAttribute("className")});r.getElementsByTagName=ft(function(e){e.appendChild(t.createComment(""));return!e.getElementsByTagName("*").length});r.getElementsByClassName=ft(function(e){e.innerHTML="
";e.firstChild.className="i";return e.getElementsByClassName("i").length===2});r.getById=ft(function(e){p.appendChild(e).id=b;return!t.getElementsByName||!t.getElementsByName(b).length});if(r.getById){s.find["ID"]=function(e,t){if(typeof t.getElementById!==A&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}};s.filter["ID"]=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}}else{delete s.find["ID"];s.filter["ID"]=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}}s.find["TAG"]=r.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A){return t.getElementsByTagName(e)}}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++]){if(n.nodeType===1){r.push(n)}}return r}return s};s.find["CLASS"]=r.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d){return t.getElementsByClassName(e)}};m=[];v=[];if(r.qsa=Y.test(t.querySelectorAll)){ft(function(e){e.innerHTML="";if(!e.querySelectorAll("[selected]").length){v.push("\\["+I+"*(?:value|"+F+")")}if(!e.querySelectorAll(":checked").length){v.push(":checked")}});ft(function(e){var n=t.createElement("input");n.setAttribute("type","hidden");e.appendChild(n).setAttribute("t","");if(e.querySelectorAll("[t^='']").length){v.push("[*^$]="+I+"*(?:''|\"\")")}if(!e.querySelectorAll(":enabled").length){v.push(":enabled",":disabled")}e.querySelectorAll("*,:x");v.push(",.*:")})}if(r.matchesSelector=Y.test(g=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector)){ft(function(e){r.disconnectedMatch=g.call(e,"div");g.call(e,"[s!='']:x");m.push("!=",z)})}v=v.length&&new RegExp(v.join("|"));m=m.length&&new RegExp(m.join("|"));y=Y.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16))}:function(e,t){if(t){while(t=t.parentNode){if(t===e){return true}}}return false};L=p.compareDocumentPosition?function(e,n){if(e===n){k=true;return 0}var i=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);if(i){if(i&1||!r.sortDetached&&n.compareDocumentPosition(e)===i){if(e===t||y(E,e)){return-1}if(n===t||y(E,n)){return 1}return l?j.call(l,e)-j.call(l,n):0}return i&4?-1:1}return e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,s=e.parentNode,o=n.parentNode,u=[e],a=[n];if(e===n){k=true;return 0}else if(!s||!o){return e===t?-1:n===t?1:s?-1:o?1:l?j.call(l,e)-j.call(l,n):0}else if(s===o){return ct(e,n)}r=e;while(r=r.parentNode){u.unshift(r)}r=n;while(r=r.parentNode){a.unshift(r)}while(u[i]===a[i]){i++}return i?ct(u[i],a[i]):u[i]===E?-1:a[i]===E?1:0};return t};ot.matches=function(e,t){return ot(e,null,null,t)};ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h){c(e)}t=t.replace(J,"='$1']");if(r.matchesSelector&&d&&(!m||!m.test(t))&&(!v||!v.test(t))){try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&e.document.nodeType!==11){return n}}catch(i){}}return ot(t,h,null,[e]).length>0};ot.contains=function(e,t){if((e.ownerDocument||e)!==h){c(e)}return y(e,t)};ot.attr=function(e,n){if((e.ownerDocument||e)!==h){c(e)}var i=s.attrHandle[n.toLowerCase()],o=i&&M.call(s.attrHandle,n.toLowerCase())?i(e,n,!d):t;return o===t?r.attributes||!d?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o};ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};ot.uniqueSort=function(e){var t,n=[],i=0,s=0;k=!r.detectDuplicates;l=!r.sortStable&&e.slice(0);e.sort(L);if(k){while(t=e[s++]){if(t===e[s]){i=n.push(s)}}while(i--){e.splice(n[i],1)}}return e};o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i){for(;t=e[r];r++){n+=o(t)}}else if(i===1||i===9||i===11){if(typeof e.textContent==="string"){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){n+=o(e)}}}else if(i===3||i===4){return e.nodeValue}return n};s=ot.selectors={cacheLength:50,createPseudo:at,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(rt,it);e[3]=(e[4]||e[5]||"").replace(rt,it);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){ot.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+(e[7]+e[8]||e[3]==="odd")}else if(e[3]){ot.error(e[0])}return e},PSEUDO:function(e){var n,r=!e[5]&&e[2];if(G["CHILD"].test(e[0])){return null}if(e[3]&&e[4]!==t){e[2]=e[4]}else if(r&&K.test(r)&&(n=mt(r,true))&&(n=r.indexOf(")",r.length-n)-r.length)){e[0]=e[0].slice(0,n);e[2]=r.slice(0,n)}return e.slice(0,3)}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return e==="*"?function(){return true}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&T(e,function(e){return t.test(typeof e.className==="string"&&e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);if(i==null){return t==="!="}if(!t){return true}i+="";return t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":false}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v]){if(u?c.nodeName.toLowerCase()===g:c.nodeType===1){return false}}d=v=e==="only"&&!d&&"nextSibling"}return true}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[b]||(m[b]={});f=l[e]||[];p=f[0]===S&&f[1];h=f[0]===S&&f[2];c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}}else if(y&&(f=(t[b]||(t[b]={}))[e])&&f[0]===S){h=f[1]}else{while(c=++p&&c&&c[v]||(h=p=0)||d.pop()){if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){if(y){(c[b]||(c[b]={}))[e]=[S,h]}if(c===t){break}}}}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);if(r[b]){return r(t)}if(r.length>1){n=[e,e,"",t];return s.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,s=r(e,t),o=s.length;while(o--){i=j.call(e,s[o]);e[i]=!(n[i]=s[o])}}):function(e){return r(e,0,n)}}return r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--){if(s=o[u]){e[u]=!(t[u]=s)}}}):function(e,i,s){t[0]=e;r(t,null,s,n);return!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){if(!Q.test(e||"")){ot.error("unsupported lang: "+e)}e=e.replace(rt,it).toLowerCase();return function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang")){n=n.toLowerCase();return n===e||n.indexOf(e+"-")===0}}while((t=t.parentNode)&&t.nodeType===1);return false}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4){return false}}return true},parent:function(e){return!s.pseudos["empty"](e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n=0;){e.push(r)}return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input"){return e.defaultValue}})}if(!ft(function(e){return e.getAttribute("disabled")==null})){lt(F,function(e,t,n){var r;if(!n){return(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===true?t.toLowerCase():null}})}w.find=ot;w.expr=ot.selectors;w.expr[":"]=w.expr.pseudos;w.unique=ot.uniqueSort;w.text=ot.getText;w.isXMLDoc=ot.isXML;w.contains=ot.contains})(e);var B={};w.Callbacks=function(e){e=typeof e==="string"?B[e]||j(e):w.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){r=e.memory&&t;i=true;o=u||0;u=0;s=a.length;n=true;for(;a&&o-1){a.splice(r,1);if(n){if(r<=s){s--}if(r<=o){o--}}}})}return this},has:function(e){return e?w.inArray(e,a)>-1:!!(a&&a.length)},empty:function(){a=[];s=0;return this},disable:function(){a=f=r=t;return this},disabled:function(){return!a},lock:function(){f=t;if(!r){c.disable()}return this},locked:function(){return!f},fireWith:function(e,t){if(a&&(!i||f)){t=t||[];t=[e,t.slice?t.slice():t];if(n){f.push(t)}else{l(t)}}return this},fire:function(){c.fireWith(this,arguments);return this},fired:function(){return!!i}};return c};w.extend({Deferred:function(e){var t=[["resolve","done",w.Callbacks("once memory"),"resolved"],["reject","fail",w.Callbacks("once memory"),"rejected"],["notify","progress",w.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,s){var o=s[0],u=w.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);if(e&&w.isFunction(e.promise)){e.promise().done(n.resolve).fail(n.reject).progress(n.notify)}else{n[o+"With"](this===r?n.promise():this,u?[e]:arguments)}})});e=null}).promise()},promise:function(e){return e!=null?w.extend(e,r):r}},i={};r.pipe=r.then;w.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add;if(u){o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock)}i[s[0]]=function(){i[s[0]+"With"](this===i?r:this,arguments);return this};i[s[0]+"With"]=o.fireWith});r.promise(i);if(e){e.call(i,i)}return i},when:function(e){var t=0,n=v.call(arguments),r=n.length,i=r!==1||e&&w.isFunction(e.promise)?r:0,s=i===1?e:w.Deferred(),o=function(e,t,n){return function(r){t[e]=this;n[e]=arguments.length>1?v.call(arguments):r;if(n===u){s.notifyWith(t,n)}else if(!--i){s.resolveWith(t,n)}}},u,a,f;if(r>1){u=new Array(r);a=new Array(r);f=new Array(r);for(;t
a";n=p.getElementsByTagName("*")||[];r=p.getElementsByTagName("a")[0];if(!r||!r.style||!n.length){return t}u=o.createElement("select");f=u.appendChild(o.createElement("option"));s=p.getElementsByTagName("input")[0];r.style.cssText="top:1px;float:left;opacity:.5";t.getSetAttribute=p.className!=="t";t.leadingWhitespace=p.firstChild.nodeType===3;t.tbody=!p.getElementsByTagName("tbody").length;t.htmlSerialize=!!p.getElementsByTagName("link").length;t.style=/top/.test(r.getAttribute("style"));t.hrefNormalized=r.getAttribute("href")==="/a";t.opacity=/^0.5/.test(r.style.opacity);t.cssFloat=!!r.style.cssFloat;t.checkOn=!!s.value;t.optSelected=f.selected;t.enctype=!!o.createElement("form").enctype;t.html5Clone=o.createElement("nav").cloneNode(true).outerHTML!=="<:nav>";t.inlineBlockNeedsLayout=false;t.shrinkWrapBlocks=false;t.pixelPosition=false;t.deleteExpando=true;t.noCloneEvent=true;t.reliableMarginRight=true;t.boxSizingReliable=true;s.checked=true;t.noCloneChecked=s.cloneNode(true).checked;u.disabled=true;t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=false}s=o.createElement("input");s.setAttribute("value","");t.input=s.getAttribute("value")==="";s.value="t";s.setAttribute("type","radio");t.radioValue=s.value==="t";s.setAttribute("checked","t");s.setAttribute("name","t");a=o.createDocumentFragment();a.appendChild(s);t.appendChecked=s.checked;t.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;if(p.attachEvent){p.attachEvent("onclick",function(){t.noCloneEvent=false});p.cloneNode(true).click()}for(h in{submit:true,change:true,focusin:true}){p.setAttribute(l="on"+h,"t");t[h+"Bubbles"]=l in e||p.attributes[l].expando===false}p.style.backgroundClip="content-box";p.cloneNode(true).style.backgroundClip="";t.clearCloneStyle=p.style.backgroundClip==="content-box";for(h in w(t)){break}t.ownLast=h!=="0";w(function(){var n,r,s,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=o.getElementsByTagName("body")[0];if(!a){return}n=o.createElement("div");n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";a.appendChild(n).appendChild(p);p.innerHTML="
t
";s=p.getElementsByTagName("td");s[0].style.cssText="padding:0;margin:0;border:0;display:none";c=s[0].offsetHeight===0;s[0].style.display="";s[1].style.display="none";t.reliableHiddenOffsets=c&&s[0].offsetHeight===0;p.innerHTML="";p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";w.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){t.boxSizing=p.offsetWidth===4});if(e.getComputedStyle){t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%";t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px";r=p.appendChild(o.createElement("div"));r.style.cssText=p.style.cssText=u;r.style.marginRight=r.style.width="0";p.style.width="1px";t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)}if(typeof p.style.zoom!==i){p.innerHTML="";p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1";t.inlineBlockNeedsLayout=p.offsetWidth===3;p.style.display="block";p.innerHTML="
";p.firstChild.style.width="5px";t.shrinkWrapBlocks=p.offsetWidth!==3;if(t.inlineBlockNeedsLayout){a.style.zoom=1}}a.removeChild(n);n=p=s=r=null});n=u=a=f=r=s=null;return t}({});var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;w.extend({cache:{},noData:{applet:true,embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){e=e.nodeType?w.cache[e[w.expando]]:e[w.expando];return!!e&&!z(e)},data:function(e,t,n){return q(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return q(e,t,n,true)},_removeData:function(e,t){return R(e,t,true)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9){return false}var t=e.nodeName&&w.noData[e.nodeName.toLowerCase()];return!t||t!==true&&e.getAttribute("classid")===t}});w.fn.extend({data:function(e,n){var r,i,s=null,o=0,u=this[0];if(e===t){if(this.length){s=w.data(u);if(u.nodeType===1&&!w._data(u,"parsedAttrs")){r=u.attributes;for(;o1?this.each(function(){w.data(this,e,n)}):u?U(u,e,w.data(u,e)):null},removeData:function(e){return this.each(function(){w.removeData(this,e)})}});w.extend({queue:function(e,t,n){var r;if(e){t=(t||"fx")+"queue";r=w._data(e,t);if(n){if(!r||w.isArray(n)){r=w._data(e,t,w.makeArray(n))}else{r.push(n)}}return r||[]}},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),s=w._queueHooks(e,t),o=function(){w.dequeue(e,t)};if(i==="inprogress"){i=n.shift();r--}if(i){if(t==="fx"){n.unshift("inprogress")}delete s.stop;i.call(e,o,s)}if(!r&&s){s.empty.fire()}},_queueHooks:function(e,t){var n=t+"queueHooks";return w._data(e,n)||w._data(e,n,{empty:w.Callbacks("once memory").add(function(){w._removeData(e,t+"queue");w._removeData(e,n)})})}});w.fn.extend({queue:function(e,n){var r=2;if(typeof e!=="string"){n=e;e="fx";r--}if(arguments.length1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})},prop:function(e,t){return w.access(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){e=w.propFix[e]||e;return this.each(function(){try{this[e]=t;delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e==="string"&&e;if(w.isFunction(e)){return this.each(function(t){w(this).addClass(e.call(this,t,this.className))})}if(a){t=(e||"").match(S)||[];for(;o=0){r=r.replace(" "+i+" "," ")}}n.className=e?w.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e;if(typeof t==="boolean"&&n==="string"){return t?this.addClass(e):this.removeClass(e)}if(w.isFunction(e)){return this.each(function(n){w(this).toggleClass(e.call(this,n,this.className,t),t)})}return this.each(function(){if(n==="string"){var t,r=0,s=w(this),o=e.match(S)||[];while(t=o[r++]){if(s.hasClass(t)){s.removeClass(t)}else{s.addClass(t)}}}else if(n===i||n==="boolean"){if(this.className){w._data(this,"__className__",this.className)}this.className=this.className||e===false?"":w._data(this,"__className__")||""}})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0){return true}}return false},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s){r=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()];if(r&&"get"in r&&(n=r.get(s,"value"))!==t){return n}n=s.value;return typeof n==="string"?n.replace($,""):n==null?"":n}return}i=w.isFunction(e);return this.each(function(n){var s;if(this.nodeType!==1){return}if(i){s=e.call(this,n,w(this).val())}else{s=e}if(s==null){s=""}else if(typeof s==="number"){s+=""}else if(w.isArray(s)){s=w.map(s,function(e){return e==null?"":e+""})}r=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t){this.value=s}})}});w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return t!=null?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0){n=true}}if(!n){e.selectedIndex=-1}return s}}},attr:function(e,n,r){var s,o,u=e.nodeType;if(!e||u===3||u===8||u===2){return}if(typeof e.getAttribute===i){return w.prop(e,n,r)}if(u!==1||!w.isXMLDoc(e)){n=n.toLowerCase();s=w.attrHooks[n]||(w.expr.match.bool.test(n)?X:W)}if(r!==t){if(r===null){w.removeAttr(e,n)}else if(s&&"set"in s&&(o=s.set(e,r,n))!==t){return o}else{e.setAttribute(n,r+"");return r}}else if(s&&"get"in s&&(o=s.get(e,n))!==null){return o}else{o=w.find.attr(e,n);return o==null?t:o}},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(S);if(s&&e.nodeType===1){while(n=s[i++]){r=w.propFix[n]||n;if(w.expr.match.bool.test(n)){if(Y&&G||!Q.test(n)){e[r]=false}else{e[w.camelCase("default-"+n)]=e[r]=false}}else{w.attr(e,n,"")}e.removeAttribute(G?n:r)}}},attrHooks:{type:{set:function(e,t){if(!w.support.radioValue&&t==="radio"&&w.nodeName(e,"input")){var n=e.value;e.setAttribute("type",t);if(n){e.value=n}return t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2){return}o=u!==1||!w.isXMLDoc(e);if(o){n=w.propFix[n]||n;s=w.propHooks[n]}if(r!==t){return s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r}else{return s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]}},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):J.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:-1}}}});X={set:function(e,t,n){if(t===false){w.removeAttr(e,n)}else if(Y&&G||!Q.test(n)){e.setAttribute(!G&&w.propFix[n]||n,n)}else{e[w.camelCase("default-"+n)]=e[n]=true}return n}};w.each(w.expr.match.bool.source.match(/\w+/g),function(e,n){var r=w.expr.attrHandle[n]||w.find.attr;w.expr.attrHandle[n]=Y&&G||!Q.test(n)?function(e,n,i){var s=w.expr.attrHandle[n],o=i?t:(w.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;w.expr.attrHandle[n]=s;return o}:function(e,n,r){return r?t:e[w.camelCase("default-"+n)]?n.toLowerCase():null}});if(!Y||!G){w.attrHooks.value={set:function(e,t,n){if(w.nodeName(e,"input")){e.defaultValue=t}else{return W&&W.set(e,t,n)}}}}if(!G){W={set:function(e,n,r){var i=e.getAttributeNode(r);if(!i){e.setAttributeNode(i=e.ownerDocument.createAttribute(r))}i.value=n+="";return r==="value"||n===e.getAttribute(r)?n:t}};w.expr.attrHandle.id=w.expr.attrHandle.name=w.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.value!==""?i.value:null};w.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:W.set};w.attrHooks.contenteditable={set:function(e,t,n){W.set(e,t===""?false:t,n)}};w.each(["width","height"],function(e,t){w.attrHooks[t]={set:function(e,n){if(n===""){e.setAttribute(t,"auto");return n}}}})}if(!w.support.hrefNormalized){w.each(["href","src"],function(e,t){w.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})}if(!w.support.style){w.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}}if(!w.support.optSelected){w.propHooks.selected={get:function(e){var t=e.parentNode;if(t){t.selectedIndex;if(t.parentNode){t.parentNode.selectedIndex}}return null}}}w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});if(!w.support.enctype){w.propFix.enctype="encoding"}w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(w.isArray(t)){return e.checked=w.inArray(w(e).val(),t)>=0}}};if(!w.support.checkOn){w.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value}}});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;w.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=w._data(e);if(!y){return}if(r.handler){l=r;r=l.handler;o=l.selector}if(!r.guid){r.guid=w.guid++}if(!(a=y.events)){a=y.events={}}if(!(h=y.handle)){h=y.handle=function(e){return typeof w!==i&&(!e||w.event.triggered!==e.type)?w.event.dispatch.apply(h.elem,arguments):t};h.elem=e}n=(n||"").match(S)||[""];f=n.length;while(f--){u=rt.exec(n[f])||[];v=g=u[1];m=(u[2]||"").split(".").sort();if(!v){continue}c=w.event.special[v]||{};v=(o?c.delegateType:c.bindType)||v;c=w.event.special[v]||{};p=w.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&w.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[];d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===false){if(e.addEventListener){e.addEventListener(v,h,false)}else if(e.attachEvent){e.attachEvent("on"+v,h)}}}if(c.add){c.add.call(e,p);if(!p.handler.guid){p.handler.guid=r.guid}}if(o){d.splice(d.delegateCount++,0,p)}else{d.push(p)}w.event.global[v]=true}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=w.hasData(e)&&w._data(e);if(!m||!(l=m.events)){return}t=(t||"").match(S)||[""];f=t.length;while(f--){u=rt.exec(t[f])||[];p=v=u[1];d=(u[2]||"").split(".").sort();if(!p){for(p in l){w.event.remove(e,p+t[f],n,r,true)}continue}c=w.event.special[p]||{};p=(r?c.delegateType:c.bindType)||p;h=l[p]||[];u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)");a=s=h.length;while(s--){o=h[s];if((i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)){h.splice(s,1);if(o.selector){h.delegateCount--}if(c.remove){c.remove.call(e,o)}}}if(a&&!h.length){if(!c.teardown||c.teardown.call(e,d,m.handle)===false){w.removeEvent(e,p,m.handle)}delete l[p]}}if(w.isEmptyObject(l)){delete m.handle;w._removeData(e,"events")}},trigger:function(n,r,i,s){var u,a,f,l,c,h,p,d=[i||o],v=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||o;if(i.nodeType===3||i.nodeType===8){return}if(nt.test(v+w.event.triggered)){return}if(v.indexOf(".")>=0){m=v.split(".");v=m.shift();m.sort()}a=v.indexOf(":")<0&&"on"+v;n=n[w.expando]?n:new w.Event(v,typeof n==="object"&&n);n.isTrigger=s?2:3;n.namespace=m.join(".");n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;n.result=t;if(!n.target){n.target=i}r=r==null?[n]:w.makeArray(r,[n]);c=w.event.special[v]||{};if(!s&&c.trigger&&c.trigger.apply(i,r)===false){return}if(!s&&!c.noBubble&&!w.isWindow(i)){l=c.delegateType||v;if(!nt.test(l+v)){f=f.parentNode}for(;f;f=f.parentNode){d.push(f);h=f}if(h===(i.ownerDocument||o)){d.push(h.defaultView||h.parentWindow||e)}}p=0;while((f=d[p++])&&!n.isPropagationStopped()){n.type=p>1?l:c.bindType||v;u=(w._data(f,"events")||{})[n.type]&&w._data(f,"handle");if(u){u.apply(f,r)}u=a&&f[a];if(u&&w.acceptData(f)&&u.apply&&u.apply(f,r)===false){n.preventDefault()}}n.type=v;if(!s&&!n.isDefaultPrevented()){if((!c._default||c._default.apply(d.pop(),r)===false)&&w.acceptData(i)){if(a&&i[v]&&!w.isWindow(i)){h=i[a];if(h){i[a]=null}w.event.triggered=v;try{i[v]()}catch(g){}w.event.triggered=t;if(h){i[a]=h}}}}return n.result},dispatch:function(e){e=w.event.fix(e);var n,r,i,s,o,u=[],a=v.call(arguments),f=(w._data(this,"events")||{})[e.type]||[],l=w.event.special[e.type]||{};a[0]=e;e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===false){return}u=w.event.handlers.call(this,e,f);n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem;o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped()){if(!e.namespace_re||e.namespace_re.test(i.namespace)){e.handleObj=i;e.data=i.data;r=((w.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a);if(r!==t){if((e.result=r)===false){e.preventDefault();e.stopPropagation()}}}}}if(l.postDispatch){l.postDispatch.call(this,e)}return e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click")){for(;f!=this;f=f.parentNode||this){if(f.nodeType===1&&(f.disabled!==true||e.type!=="click")){s=[];for(o=0;o=0:w.find(r,this,null,[f]).length}if(s[r]){s.push(i)}}if(s.length){u.push({elem:f,handlers:s})}}}}if(a1?w.unique(n):n);n.selector=this.selector?this.selector+" "+e:e;return n},has:function(e){var t,n=w(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:n.nodeType===1&&w.find.matchesSelector(n,e))){n=s.push(n);break}}}return this.pushStack(s.length>1?w.unique(s):s)},index:function(e){if(!e){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof e==="string"){return w.inArray(this[0],w(e))}return w.inArray(e.jquery?e[0]:e,this)},add:function(e,t){var n=typeof e==="string"?w(e,t):w.makeArray(e&&e.nodeType?[e]:e),r=w.merge(this.get(),n);return this.pushStack(w.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});w.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return w.dir(e,"parentNode")},parentsUntil:function(e,t,n){return w.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return w.dir(e,"nextSibling")},prevAll:function(e){return w.dir(e,"previousSibling")},nextUntil:function(e,t,n){return w.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return w.dir(e,"previousSibling",n)},siblings:function(e){return w.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return w.sibling(e.firstChild)},contents:function(e){return w.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:w.merge([],e.childNodes)}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);if(e.slice(-5)!=="Until"){r=n}if(r&&typeof r==="string"){i=w.filter(r,i)}if(this.length>1){if(!lt[e]){i=w.unique(i)}if(at.test(e)){i=i.reverse()}}return this.pushStack(i)}});w.extend({filter:function(e,t,n){var r=t[0];if(n){e=":not("+e+")"}return t.length===1&&r.nodeType===1?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return e.nodeType===1}))},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!w(s).is(r))){if(s.nodeType===1){i.push(s)}s=s[n]}return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling){if(e.nodeType===1&&e!==t){n.push(e)}}return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/\s*$/g,Lt={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:w.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},At=pt(o),Ot=At.appendChild(o.createElement("div"));Lt.optgroup=Lt.option;Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead;Lt.th=Lt.td;w.fn.extend({text:function(e){return w.access(this,function(e){return e===t?w.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this)}})},after:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this.nextSibling)}})},remove:function(e,t){var n,r=e?w.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++){if(!t&&n.nodeType===1){w.cleanData(jt(n))}if(n.parentNode){if(t&&w.contains(n.ownerDocument,n)){Pt(jt(n,"script"))}n.parentNode.removeChild(n)}}return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){if(e.nodeType===1){w.cleanData(jt(e,false))}while(e.firstChild){e.removeChild(e.firstChild)}if(e.options&&w.nodeName(e,"select")){e.options.length=0}}return this},clone:function(e,t){e=e==null?false:e;t=t==null?e:t;return this.map(function(){return w.clone(this,e,t)})},html:function(e){return w.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t){return n.nodeType===1?n.innerHTML.replace(vt,""):t}if(typeof e==="string"&&!St.test(e)&&(w.support.htmlSerialize||!mt.test(e))&&(w.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1>");try{for(;r")){s=e.cloneNode(true)}else{Ot.innerHTML=e.outerHTML;Ot.removeChild(s=Ot.firstChild)}if((!w.support.noCloneEvent||!w.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!w.isXMLDoc(e)){r=jt(s);u=jt(e);for(o=0;(i=u[o])!=null;++o){if(r[o]){Bt(i,r[o])}}}if(t){if(n){u=u||jt(e);r=r||jt(s);for(o=0;(i=u[o])!=null;o++){Ht(i,r[o])}}else{Ht(e,s)}}r=jt(s,"script");if(r.length>0){Pt(r,!a&&jt(e,"script"))}r=u=i=null;return s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d")+l[2];i=l[0];while(i--){u=u.lastChild}if(!w.support.leadingWhitespace&>.test(s)){p.push(t.createTextNode(gt.exec(s)[0]))}if(!w.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]===""&&!wt.test(s)?u:0;i=s&&s.childNodes.length;while(i--){if(w.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length){s.removeChild(f)}}}w.merge(p,u.childNodes);u.textContent="";while(u.firstChild){u.removeChild(u.firstChild)}u=h.lastChild}}}if(u){h.removeChild(u)}if(!w.support.appendChecked){w.grep(jt(p,"input"),Ft)}d=0;while(s=p[d++]){if(r&&w.inArray(s,r)!==-1){continue}o=w.contains(s.ownerDocument,s);u=jt(h.appendChild(s),"script");if(o){Pt(u)}if(n){i=0;while(s=u[i++]){if(Nt.test(s.type||"")){n.push(s)}}}}u=null;return h},cleanData:function(e,t){var n,r,s,o,u=0,a=w.expando,f=w.cache,l=w.support.deleteExpando,h=w.event.special;for(;(n=e[u])!=null;u++){if(t||w.acceptData(n)){s=n[a];o=s&&f[s];if(o){if(o.events){for(r in o.events){if(h[r]){w.event.remove(n,r)}else{w.removeEvent(n,r,o.handle)}}}if(f[s]){delete f[s];if(l){delete n[a]}else if(typeof n.removeAttribute!==i){n.removeAttribute(a)}else{n[a]=null}c.push(s)}}}}},_evalUrl:function(e){return w.ajax({url:e,type:"GET",dataType:"script",async:false,global:false,"throws":true})}});w.fn.extend({wrapAll:function(e){if(w.isFunction(e)){return this.each(function(t){w(this).wrapAll(e.call(this,t))})}if(this[0]){var t=w(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){t.insertBefore(this[0])}t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1){e=e.firstChild}return e}).append(this)}return this},wrapInner:function(e){if(w.isFunction(e)){return this.each(function(t){w(this).wrapInner(e.call(this,t))})}return this.each(function(){var t=w(this),n=t.contents();if(n.length){n.wrapAll(e)}else{t.append(e)}})},wrap:function(e){var t=w.isFunction(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){if(!w.nodeName(this,"body")){w(this).replaceWith(this.childNodes)}}).end()}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+E+")(.*)$","i"),Jt=new RegExp("^("+E+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+E+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];w.fn.extend({css:function(e,n){return w.access(this,function(e,n,r){var i,s,o={},u=0;if(w.isArray(n)){s=qt(e);i=n.length;for(;u1)},show:function(){return rn(this,true)},hide:function(){return rn(this)},toggle:function(e){if(typeof e==="boolean"){return e?this.show():this.hide()}return this.each(function(){if(nn(this)){w(this).show()}else{w(this).hide()}})}});w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:true,fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return}var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a));u=w.cssHooks[n]||w.cssHooks[a];if(r!==t){o=typeof r;if(o==="string"&&(s=Kt.exec(r))){r=(s[1]+1)*s[2]+parseFloat(w.css(e,n));o="number"}if(r==null||o==="number"&&isNaN(r)){return}if(o==="number"&&!w.cssNumber[a]){r+="px"}if(!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0){f[n]="inherit"}if(!u||!("set"in u)||(r=u.set(e,r,i))!==t){try{f[n]=r}catch(l){}}}else{if(u&&"get"in u&&(s=u.get(e,false,i))!==t){return s}return f[n]}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a));u=w.cssHooks[n]||w.cssHooks[a];if(u&&"get"in u){o=u.get(e,true,r)}if(o===t){o=Rt(e,n,i)}if(o==="normal"&&n in Yt){o=Yt[n]}if(r===""||r){s=parseFloat(o);return r===true||w.isNumeric(s)?s||0:o}return o}});if(e.getComputedStyle){qt=function(t){return e.getComputedStyle(t,null)};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;if(u){if(a===""&&!w.contains(e.ownerDocument,e)){a=w.style(e,n)}if(Jt.test(a)&&Vt.test(n)){i=f.width;s=f.minWidth;o=f.maxWidth;f.minWidth=f.maxWidth=f.width=a;a=u.width;f.width=i;f.minWidth=s;f.maxWidth=o}}return a}}else if(o.documentElement.currentStyle){qt=function(e){return e.currentStyle};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;if(a==null&&f&&f[n]){a=f[n]}if(Jt.test(a)&&!Wt.test(n)){i=f.left;s=e.runtimeStyle;o=s&&s.left;if(o){s.left=e.currentStyle.left}f.left=n==="fontSize"?"1em":a;a=f.pixelLeft+"px";f.left=i;if(o){s.left=o}}return a===""?"auto":a}}w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n){return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)}},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",false,i)==="border-box",i):0)}}});if(!w.support.opacity){w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter){return}}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}}w(function(){if(!w.support.reliableMarginRight){w.cssHooks.marginRight={get:function(e,t){if(t){return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}}}if(!w.support.pixelPosition&&w.fn.position){w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n){n=Rt(e,t);return Jt.test(n)?w(e).position()[t]+"px":n}}}})}});if(w.expr&&w.expr.filters){w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"};w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}}w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n==="string"?n.split(" "):[n];for(;r<4;r++){i[e+Zt[r]+t]=s[r]||s[r-2]||s[0]}return i}};if(!Vt.test(e)){w.cssHooks[e+t].set=sn}});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}});w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t){n=w.ajaxSettings&&w.ajaxSettings.traditional}if(w.isArray(e)||e.jquery&&!w.isPlainObject(e)){w.each(e,function(){s(this.name,this.value)})}else{for(r in e){vn(r,e[r],n,s)}}return i.join("&").replace(ln,"+")};w.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a");gn.href="";gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[];w.fn.load=function(e,n,r){if(typeof e!=="string"&&kn){return kn.apply(this,arguments)}var i,s,o,u=this,a=e.indexOf(" ");if(a>=0){i=e.slice(a,e.length);e=e.slice(0,a)}if(w.isFunction(n)){r=n;n=t}else if(n&&typeof n==="object"){o="POST"}if(u.length>0){w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments;u.html(i?w("
").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])})}return this};w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}});w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2){return}b=2;if(u){clearTimeout(u)}f=t;o=i||"";x.readyState=e>0?4:0;l=e>=200&&e<300||e===304;if(r){E=Hn(c,x,r)}E=Bn(c,E,x,l);if(l){if(c.ifModified){S=x.getResponseHeader("Last-Modified");if(S){w.lastModified[s]=S}S=x.getResponseHeader("etag");if(S){w.etag[s]=S}}if(e===204||c.type==="HEAD"){T="nocontent"}else if(e===304){T="notmodified"}else{T=E.state;g=E.data;y=E.error;l=!y}}else{y=T;if(e||!T){T="error";if(e<0){e=0}}}x.status=e;x.statusText=(n||T)+"";if(l){d.resolveWith(h,[g,T,x])}else{d.rejectWith(h,[x,T,y])}x.statusCode(m);m=t;if(a){p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y])}v.fireWith(h,[x,T]);if(a){p.trigger("ajaxComplete",[x,c]);if(!--w.active){w.event.trigger("ajaxStop")}}}if(typeof e==="object"){n=e;e=t}n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o)){l[t[1].toLowerCase()]=t[2]}}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();if(!b){e=y[n]=y[n]||e;g[e]=t}return this},overrideMimeType:function(e){if(!b){c.mimeType=e}return this},statusCode:function(e){var t;if(e){if(b<2){for(t in e){m[t]=[m[t],e[t]]}}else{x.always(e[x.status])}}return this},abort:function(e){var t=e||E;if(f){f.abort(t)}N(0,t);return this}};d.promise(x).complete=v.add;x.success=x.done;x.error=x.fail;c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//");c.type=n.method||n.type||c.method||c.type;c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""];if(c.crossDomain==null){r=Cn.exec(c.url.toLowerCase());c.crossDomain=!!(r&&(r[1]!==mn[1]||r[2]!==mn[2]||(r[3]||(r[1]==="http:"?"80":"443"))!==(mn[3]||(mn[1]==="http:"?"80":"443"))))}if(c.data&&c.processData&&typeof c.data!=="string"){c.data=w.param(c.data,c.traditional)}Dn(Ln,c,n,x);if(b===2){return x}a=c.global;if(a&&w.active++===0){w.event.trigger("ajaxStart")}c.type=c.type.toUpperCase();c.hasContent=!Tn.test(c.type);s=c.url;if(!c.hasContent){if(c.data){s=c.url+=(bn.test(s)?"&":"?")+c.data;delete c.data}if(c.cache===false){c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++}}if(c.ifModified){if(w.lastModified[s]){x.setRequestHeader("If-Modified-Since",w.lastModified[s])}if(w.etag[s]){x.setRequestHeader("If-None-Match",w.etag[s])}}if(c.data&&c.hasContent&&c.contentType!==false||n.contentType){x.setRequestHeader("Content-Type",c.contentType)}x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers){x.setRequestHeader(i,c.headers[i])}if(c.beforeSend&&(c.beforeSend.call(h,x,c)===false||b===2)){return x.abort()}E="abort";for(i in{success:1,error:1,complete:1}){x[i](c[i])}f=Dn(An,c,n,x);if(!f){N(-1,"No Transport")}else{x.readyState=1;if(a){p.trigger("ajaxSend",[x,c])}if(c.async&&c.timeout>0){u=setTimeout(function(){x.abort("timeout")},c.timeout)}try{b=1;f.send(g,N)}catch(T){if(b<2){N(-1,T)}else{throw T}}}return x},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}});w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){if(w.isFunction(r)){s=s||i;i=r;r=t}return w.ajax({url:e,type:n,dataType:s,data:r,success:i})}});w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){w.globalEval(e);return e}}});w.ajaxPrefilter("script",function(e){if(e.cache===t){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script");n.async=true;if(e.scriptCharset){n.charset=e.scriptCharset}n.src=e.url;n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState)){n.onload=n.onreadystatechange=null;if(n.parentNode){n.parentNode.removeChild(n)}n=null;if(!t){i(200,"success")}}};r.insertBefore(n,r.firstChild)},abort:function(){if(n){n.onload(t,true)}}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;this[e]=true;return e}});w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==false&&(Fn.test(n.url)?"url":typeof n.data==="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp"){s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback;if(a){n[a]=n[a].replace(Fn,"$1"+s)}else if(n.jsonp!==false){n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s}n.converters["script json"]=function(){if(!u){w.error(s+" was not called")}return u[0]};n.dataTypes[0]="json";o=e[s];e[s]=function(){u=arguments};i.always(function(){e[s]=o;if(n[s]){n.jsonpCallback=r.jsonpCallback;jn.push(s)}if(u&&w.isFunction(o)){o(u[0])}u=o=t});return"script"}});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In){In[e](t,true)}};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn;qn=w.ajaxSettings.xhr();w.support.cors=!!qn&&"withCredentials"in qn;qn=w.support.ajax=!!qn;if(qn){w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();if(n.username){a.open(n.type,n.url,n.async,n.username,n.password)}else{a.open(n.type,n.url,n.async)}if(n.xhrFields){for(u in n.xhrFields){a[u]=n.xhrFields[u]}}if(n.mimeType&&a.overrideMimeType){a.overrideMimeType(n.mimeType)}if(!n.crossDomain&&!i["X-Requested-With"]){i["X-Requested-With"]="XMLHttpRequest"}try{for(u in i){a.setRequestHeader(u,i[u])}}catch(f){}a.send(n.hasContent&&n.data||null);r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t;if(o){a.onreadystatechange=w.noop;if(Un){delete In[o]}}if(i){if(a.readyState!==4){a.abort()}}else{c={};u=a.status;f=a.getAllResponseHeaders();if(typeof a.responseText==="string"){c.text=a.responseText}try{l=a.statusText}catch(h){l=""}if(!u&&n.isLocal&&!n.crossDomain){u=c.text?200:404}else if(u===1223){u=204}}}}catch(p){if(!i){s(-1,p)}}if(c){s(u,l,c,f)}};if(!n.async){r()}else if(a.readyState===4){setTimeout(r)}else{o=++Rn;if(Un){if(!In){In={};w(e).unload(Un)}In[o]=r}a.onreadystatechange=r}},abort:function(){if(r){r(t,true)}}}}})}var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3];i=i||[];o=+r||1;do{u=u||".5";o=o/u;w.style(n.elem,e,o+s)}while(u!==(u=n.cur()/r)&&u!==1&&--a)}if(i){o=n.start=+o||+r||0;n.unit=s;n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]}return n}]};w.Animation=w.extend(er,{tweener:function(e,t){if(w.isFunction(e)){t=e;e=["*"]}else{e=e.split(" ")}var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;if(a){l=i.position();c=l.top;h=l.left}else{c=parseFloat(o)||0;h=parseFloat(u)||0}if(w.isFunction(t)){t=t.call(e,n,s)}if(t.top!=null){f.top=t.top-s.top+c}if(t.left!=null){f.left=t.left-s.left+h}if("using"in t){t.using.call(e,f)}else{i.css(f)}}};w.fn.extend({position:function(){if(!this[0]){return}var e,t,n={top:0,left:0},r=this[0];if(w.css(r,"position")==="fixed"){t=r.getBoundingClientRect()}else{e=this.offsetParent();t=this.offset();if(!w.nodeName(e[0],"html")){n=e.offset()}n.top+=w.css(e[0],"borderTopWidth",true);n.left+=w.css(e[0],"borderLeftWidth",true)}return{top:t.top-n.top-w.css(r,"marginTop",true),left:t.left-n.left-w.css(r,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static"){e=e.offsetParent}return e||u})}});w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t){return o?n in o?o[n]:o.document.documentElement[i]:e[i]}if(o){o.scrollTo(!r?s:w(o).scrollLeft(),r?s:w(o).scrollTop())}else{e[i]=s}},e,i,arguments.length,null)}});w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!=="boolean"),u=r||(i===true||s===true?"margin":"border");return w.access(this,function(n,r,i){var s;if(w.isWindow(n)){return n.document.documentElement["client"+e]}if(n.nodeType===9){s=n.documentElement;return Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])}return i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})});w.fn.size=function(){return this.length};w.fn.andSelf=w.fn.addBack;if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=w}else{e.jQuery=e.$=w;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return w})}}})(window);(function(){"use strict";function encodeHTMLSource(){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(t,function(t){return e[t]||t}):this}}function resolveDefs(e,t,n){return(typeof t==="string"?t:t.toString()).replace(e.define||skip,function(t,r,i,s){if(r.indexOf("def.")===0){r=r.substring(4)}if(!(r in n)){if(i===":"){if(e.defineParams)s.replace(e.defineParams,function(e,t,i){n[r]={arg:t,text:i}});if(!(r in n))n[r]=s}else{(new Function("def","def['"+r+"']="+s))(n)}}return""}).replace(e.use||skip,function(t,r){if(e.useParams)r=r.replace(e.useParams,function(e,t,r,i){if(n[r]&&n[r].arg&&i){var s=(r+":"+i).replace(/'|\\/g,"_");n.__exp=n.__exp||{};n.__exp[s]=n[r].text.replace(new RegExp("(^|[^\\w$])"+n[r].arg+"([^\\w$])","g"),"$1"+i+"$2");return t+"def.__exp['"+s+"']"}});var i=(new Function("def","return "+r))(n);return i?resolveDefs(e,i,n):i})}function unescape(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var doT={version:"1.0.1-nanoui",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{:([\s\S]+?)\}\}/g,encode:/\{\{>([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\/?if\s*([\s\S]*?)\s*\}\}/g,conditionalElse:/\{\{else\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,props:/\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,empty:/\{\{empty\}\}/g,varname:"data, config, helper",strip:true,append:true,selfcontained:false},template:undefined,compile:undefined},global;if(typeof module!=="undefined"&&module.exports){module.exports=doT}else if(typeof define==="function"&&define.amd){define(function(){return doT})}else{global=function(){return this||(0,eval)("this")}();global.doT=doT}String.prototype.encodeHTML=encodeHTMLSource();var startend={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},skip=/$^/;doT.template=function(e,t,n){t=t||doT.templateSettings;var r=t.append?startend.append:startend.split,i,s=0,o=t.use||t.define?resolveDefs(t,e,n||{}):e;o=("var out='"+(t.strip?o.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):o).replace(/'|\\/g,"\\$&").replace(t.interpolate||skip,function(e,t){return r.start+unescape(t)+r.end}).replace(t.encode||skip,function(e,t){i=true;return r.start+unescape(t)+r.endencode}).replace(t.conditional||skip,function(e,t){return t?"';if("+unescape(t)+"){out+='":"';}out+='"}).replace(t.conditionalElse||skip,function(e,t){return t?"';}else if("+unescape(t)+"){out+='":"';}else{out+='"}).replace(t.iterate||skip,function(e,t,n,r){if(!t)return"';} } out+='";s+=1;n=n||"value";r=r||"index";t=unescape(t);var i="arr"+s;return"';var "+i+"="+t+";if("+i+" && "+i+".length > 0){var "+n+","+r+"=-1,l"+s+"="+i+".length-1;while("+r+" 0){var "+n+";for( var "+r+" in "+i+"){ if (!"+i+".hasOwnProperty("+r+")) continue; "+n+"="+i+"["+r+"];out+='"}).replace(t.empty||skip,function(e){return"';}}else{if(true){out+='"}).replace(t.evaluate||skip,function(e,t){return"';"+unescape(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+=");if(i&&t.selfcontained){o="String.prototype.encodeHTML=("+encodeHTMLSource.toString()+"());"+o}try{return new Function(t.varname,o)}catch(u){if(typeof console!=="undefined")console.log("Could not create a template function: "+o);throw u}};doT.compile=function(e,t){return doT.template(e,null,t)}})();jQuery.fn.extend({everyTime:function(e,t,n,r){return this.each(function(){jQuery.timer.add(this,e,t,n,r)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(e==undefined||e==null)return null;var t=this.regex.exec(jQuery.trim(e.toString()));return t[2]?parseFloat(t[1])*(this.powers[t[2]]||1):e},add:function(e,t,n,r,i){var s=0;if(jQuery.isFunction(n)){i||(i=r);r=n;n=t}t=jQuery.timer.timeParse(t);if(!(typeof t!="number"||isNaN(t)||t<0)){if(typeof i!="number"||isNaN(i)||i<0)i=0;i=i||0;var o=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});o[n]||(o[n]={});r.timerID=r.timerID||this.guid++;var u=function(){if(++s>i&&i!==0||r.call(e,s)===false)jQuery.timer.remove(e,n,r)};u.timerID=r.timerID;o[n][r.timerID]||(o[n][r.timerID]=window.setInterval(u,t));this.global.push(e)}},remove:function(e,t,n){var r=jQuery.data(e,this.dataKey),i;if(r){if(t){if(r[t]){if(n){if(n.timerID){window.clearInterval(r[t][n.timerID]);delete r[t][n.timerID]}}else for(n in r[t]){window.clearInterval(r[t][n]);delete r[t][n]}for(i in r[t])break;if(!i){i=null;delete r[t]}}}else for(t in r)this.remove(e,t,n);for(i in r)break;i||jQuery.removeData(e,this.dataKey)}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(e,t){jQuery.timer.remove(t)})}) \ No newline at end of file diff --git a/nano/js/libraries/2-doT.js b/nano/js/libraries/2-doT.js new file mode 100644 index 00000000000..a0ec5520c02 --- /dev/null +++ b/nano/js/libraries/2-doT.js @@ -0,0 +1,157 @@ +(function () { + "use strict"; + + var doT = { + version: '1.0.1-nanoui', + templateSettings: { + evaluate: /\{\{([\s\S]+?)\}\}/g, + interpolate: /\{\{:([\s\S]+?)\}\}/g, + encode: /\{\{>([\s\S]+?)\}\}/g, + use: /\{\{#([\s\S]+?)\}\}/g, + define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, + conditional: /\{\{\/?if\s*([\s\S]*?)\s*\}\}/g, + conditionalElse: /\{\{else\s*([\s\S]*?)\s*\}\}/g, + iterate: /\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g, + props: /\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g, + empty: /\{\{empty\}\}/g, + varname: 'data, config, helper', + strip: true, + append: true, + selfcontained: false + }, + template: undefined, //fn, compile template + compile: undefined //fn, for express + }, global; + + if (typeof module !== 'undefined' && module.exports) { + module.exports = doT; + } else if (typeof define === 'function' && define.amd) { + define(function () { + return doT; + }); + } else { + global = (function () { + return this || (0, eval)('this'); + }()); + global.doT = doT; + } + + function encodeHTMLSource() { + var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' }, + matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g; + return function () { + return this ? this.replace(matchHTML, function (m) { + return encodeHTMLRules[m] || m; + }) : this; + }; + } + + String.prototype.encodeHTML = encodeHTMLSource(); + + var startend = { + append: { start: "'+(", end: ")+'", endencode: "||'').toString().encodeHTML()+'" }, + split: { start: "';out+=(", end: ");out+='", endencode: "||'').toString().encodeHTML();out+='"} + }, skip = /$^/; + + function resolveDefs(c, block, def) { + return ((typeof block === 'string') ? block : block.toString()) + .replace(c.define || skip, function (m, code, assign, value) { + if (code.indexOf('def.') === 0) { + code = code.substring(4); + } + if (!(code in def)) { + if (assign === ':') { + if (c.defineParams) value.replace(c.defineParams, function (m, param, v) { + def[code] = {arg: param, text: v}; + }); + if (!(code in def)) def[code] = value; + } else { + new Function("def", "def['" + code + "']=" + value)(def); + } + } + return ''; + }) + .replace(c.use || skip, function (m, code) { + if (c.useParams) code = code.replace(c.useParams, function (m, s, d, param) { + if (def[d] && def[d].arg && param) { + var rw = (d + ":" + param).replace(/'|\\/g, '_'); + def.__exp = def.__exp || {}; + def.__exp[rw] = def[d].text.replace(new RegExp("(^|[^\\w$])" + def[d].arg + "([^\\w$])", "g"), "$1" + param + "$2"); + return s + "def.__exp['" + rw + "']"; + } + }); + var v = new Function("def", "return " + code)(def); + return v ? resolveDefs(c, v, def) : v; + }); + } + + function unescape(code) { + return code.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, ' '); + } + + doT.template = function (tmpl, c, def) { + c = c || doT.templateSettings; + var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, + str = (c.use || c.define) ? resolveDefs(c, tmpl, def || {}) : tmpl; + + str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ') + .replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str) + .replace(/'|\\/g, '\\$&') + .replace(c.interpolate || skip, function (m, code) { + return cse.start + unescape(code) + cse.end; + }) + .replace(c.encode || skip, function (m, code) { + needhtmlencode = true; + return cse.start + unescape(code) + cse.endencode; + }) + .replace(c.conditional || skip, function (m, code) { + return (code ? "';if(" + unescape(code) + "){out+='" : "';}out+='"); + }) + .replace(c.conditionalElse || skip, function (m, code) { + return (code ? "';}else if(" + unescape(code) + "){out+='" : "';}else{out+='"); + }) + .replace(c.iterate || skip, function (m, iterate, vname, iname) { + if (!iterate) return "';} } out+='"; + sid += 1; + vname = vname || "value"; + iname = iname || "index"; + iterate = unescape(iterate); + var arrayName = "arr" + sid; + return "';var " + arrayName + "=" + iterate + ";if(" + arrayName + " && " + arrayName + ".length > 0){var " + vname + "," + iname + "=-1,l" + sid + "=" + arrayName + ".length-1;while(" + iname + " 0){var " + vname + ";for( var " + iname + " in " + objectName + "){ if (!" + objectName + ".hasOwnProperty(" + iname + ")) continue; " + vname + "=" + objectName + "[" + iname + "];out+='"; + }) + .replace(c.empty || skip, function (m) { + return "';}}else{if(true){out+='"; // The "if(true)" condition is required to account for the for tag closing with two brackets + }) + .replace(c.evaluate || skip, function (m, code) { + return "';" + unescape(code) + "out+='"; + }) + + "';return out;") + .replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r') + .replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '') + .replace(/(\s|;|\}|^|\{)out\+=''\+/g, '$1out+='); + + if (needhtmlencode && c.selfcontained) { + str = "String.prototype.encodeHTML=(" + encodeHTMLSource.toString() + "());" + str; + } + try { + return new Function(c.varname, str); + } catch (e) { + if (typeof console !== 'undefined') console.log("Could not create a template function: " + str); + throw e; + } + }; + + doT.compile = function (tmpl, def) { + return doT.template(tmpl, null, def); + }; +}()); \ No newline at end of file diff --git a/nano/js/nano_base_callbacks.js b/nano/js/nano_base_callbacks.js new file mode 100644 index 00000000000..adbfb38fa47 --- /dev/null +++ b/nano/js/nano_base_callbacks.js @@ -0,0 +1,120 @@ +// NanoBaseCallbacks is where the base callbacks (common to all templates) are stored +NanoBaseCallbacks = function () +{ + // _canClick is used to disable clicks for a short period after each click (to avoid mis-clicks) + var _canClick = true; + + var _baseBeforeUpdateCallbacks = {} + + var _baseAfterUpdateCallbacks = { + // this callback is triggered after new data is processed + // it updates the status/visibility icon and adds click event handling to buttons/links + status: function (updateData) { + var uiStatusClass; + if (updateData['config']['status'] == 2) + { + uiStatusClass = 'icon24 uiStatusGood'; + $('.linkActive').removeClass('inactive'); + } + else if (updateData['config']['status'] == 1) + { + uiStatusClass = 'icon24 uiStatusAverage'; + $('.linkActive').addClass('inactive'); + } + else + { + uiStatusClass = 'icon24 uiStatusBad' + $('.linkActive').addClass('inactive'); + } + $('#uiStatusIcon').attr('class', uiStatusClass); + + $('.linkActive').stopTime('linkPending'); + $('.linkActive').removeClass('linkPending'); + + $('.linkActive') + .off('click') + .on('click', function (event) { + event.preventDefault(); + var href = $(this).data('href'); + if (href != null && _canClick) + { + _canClick = false; + $('body').oneTime(300, 'enableClick', function () { + _canClick = true; + }); + if (updateData['config']['status'] == 2) + { + $(this).oneTime(300, 'linkPending', function () { + $(this).addClass('linkPending'); + }); + } + window.location.href = href; + } + }); + }, + nanomap: function (updateData) { + $('.mapIcon') + .off('mouseenter mouseleave') + .on('mouseenter', + function (event) { + var self = this; + $('#uiMapTooltip') + .html($(this).children('.tooltip').html()) + .show() + .stopTime() + .oneTime(5000, 'hideTooltip', function () { + $(this).fadeOut(500); + }); + } + ); + + $('.zoomLink') + .off('click') + .on('click', function (event) { + event.preventDefault(); + var zoomLevel = $(this).data('zoomLevel'); + var uiMapObject = $('#uiMap'); + var uiMapWidth = uiMapObject.width() * zoomLevel; + var uiMapHeight = uiMapObject.height() * zoomLevel; + + uiMapObject.css({ + zoom: zoomLevel, + left: '50%', + top: '50%', + marginLeft: '-' + Math.floor(uiMapWidth / 2) + 'px', + marginTop: '-' + Math.floor(uiMapHeight / 2) + 'px' + }); + }); + } + }; + + return { + addCallbacks: function () { + NanoStateManager.addBeforeUpdateCallbacks(_baseBeforeUpdateCallbacks); + NanoStateManager.addAfterUpdateCallbacks(_baseAfterUpdateCallbacks); + }, + removeCallbacks: function () { + for (var callbackKey in _baseBeforeUpdateCallbacks) + { + if (_baseBeforeUpdateCallbacks.hasOwnProperty(callbackKey)) + { + NanoStateManager.removeBeforeUpdateCallback(callbackKey); + } + } + for (var callbackKey in _baseAfterUpdateCallbacks) + { + if (_baseAfterUpdateCallbacks.hasOwnProperty(callbackKey)) + { + NanoStateManager.removeAfterUpdateCallback(callbackKey); + } + } + } + }; +} (); + + + + + + + diff --git a/nano/js/nano_base_helpers.js b/nano/js/nano_base_helpers.js index fb5d499559e..dd7fa1b283c 100644 --- a/nano/js/nano_base_helpers.js +++ b/nano/js/nano_base_helpers.js @@ -1,40 +1,8 @@ // NanoBaseHelpers is where the base template helpers (common to all templates) are stored -NanoBaseHelpers = function () +NanoBaseHelpers = function () { - var _urlParameters = {}; // This is populated with the base url parameters (used by all links), which is probaby just the "src" parameter - - var init = function () - { - var body = $('body'); // We store data in the body tag, it's as good a place as any - - _urlParameters = body.data('urlParameters'); - - initHelpers(); - }; - - var initHelpers = function () - { - $.views.tags({ - fields: function(object) { - var key; - var ret = ""; - for (key in object) { - if (object.hasOwnProperty(key)) { - // For each property/field, render the content of the {{fields object}} tag, with "~key" as template parameter - ret += this.tagCtx.render(object[key], { key: key }); - } - } - return ret; - } - }); - $.views.helpers({ - combine: function( arr1, arr2 ) { - return arr1 && arr2 ? arr1.concat(arr2) : arr1 || arr2; - }, - dump: function( arr1 ) { - return JSON.stringify(arr1); - }, - + var _baseHelpers = { + // change ui styling to "syndicate mode" syndicateMode: function() { $('body').css("background-color","#8f1414"); $('body').css("background-image","url('uiBackground-Syndicate.png')"); @@ -45,12 +13,17 @@ NanoBaseHelpers = function () $('#uiTitleFluff').css("background-position","50% 50%"); $('#uiTitleFluff').css("background-repeat", "no-repeat"); - return ''; + return ''; }, - + combine: function( arr1, arr2 ) { + return arr1 && arr2 ? arr1.concat(arr2) : arr1 || arr2; + }, + dump: function( arr1 ) { + return JSON.stringify(arr1); + }, // Generate a Byond link link: function( text, icon, parameters, status, elementClass, elementId) { - + var iconHtml = ''; var iconClass = 'noIcon'; if (typeof icon != 'undefined' && icon) @@ -58,56 +31,55 @@ NanoBaseHelpers = function () iconHtml = '
'; iconClass = 'hasIcon'; } - + if (typeof elementClass == 'undefined' || !elementClass) { elementClass = ''; } - + var elementIdHtml = ''; if (typeof elementId != 'undefined' && elementId) { elementIdHtml = 'id="' + elementId + '"'; } - + if (typeof status != 'undefined' && status) { return ''; } - - return ''; + + return ''; }, - // Since jsrender breaks the ^ operator + // Since jsrender breaks the ^ operator xor: function(number,bit) { return number ^ bit; }, - // Round a number to the nearest integer - round: function(number) { - return Math.round(number); - }, - // Round a number to X decimal places. precisionRound: function (value, places) { if(places==0) return Math.round(number); var multiplier = Math.pow(10, places); return (Math.round(value * multiplier) / multiplier); }, + // Round a number to the nearest integer + round: function(number) { + return Math.round(number); + }, // Round a number down to integer - floor: function(number) { + floor: function(number) { return Math.floor(number); }, // Round a number up to integer - ceil: function(number) { + ceil: function(number) { return Math.ceil(number); }, // Format a string (~string("Hello {0}, how are {1}?", 'Martin', 'you') becomes "Hello Martin, how are you?") - string: function() { + string: function() { if (arguments.length == 0) - { + { return ''; } else if (arguments.length == 1) - { + { return arguments[0]; } else if (arguments.length > 1) @@ -115,15 +87,21 @@ NanoBaseHelpers = function () stringArgs = []; for (var i = 1; i < arguments.length; i++) { - stringArgs.push(arguments[i]); + stringArgs.push(arguments[i]); } return arguments[0].format(stringArgs); } return ''; }, + formatNumber: function(x) { + // From http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript + var parts = x.toString().split("."); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return parts.join("."); + }, // Display a bar. Used to show health, capacity, etc. - displayBar: function(value, rangeMin, rangeMax, styleClass, showText) { - + displayBar: function(value, rangeMin, rangeMax, styleClass, showText) { + if (rangeMin < rangeMax) { if (value < rangeMin) @@ -145,20 +123,20 @@ NanoBaseHelpers = function () { value = rangeMax; } - } - + } + if (typeof styleClass == 'undefined' || !styleClass) { styleClass = ''; } - + if (typeof showText == 'undefined' || !showText) { showText = ''; } - + var percentage = Math.round((value - rangeMin) / (rangeMax - rangeMin) * 100); - + return '
' + showText + '
'; }, // Convert danger level to class (for the air alarm) @@ -168,14 +146,14 @@ NanoBaseHelpers = function () return 'bad'; }, // Display DNA Blocks (for the DNA Modifier UI) - displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) { + displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) { if (!dnaString) { return '
Please place a valid subject into the DNA modifier.
'; } - + var characters = dnaString.split(''); - + var html = '
'; var block = 1; var subblock = 1; @@ -185,7 +163,7 @@ NanoBaseHelpers = function () { continue; } - + var parameters; if (paramKey.toUpperCase() == 'UI') { @@ -194,79 +172,53 @@ NanoBaseHelpers = function () else { parameters = { 'selectSEBlock' : block, 'selectSESubblock' : subblock }; - } - + } + var status = 'linkActive'; if (block == selectedBlock && subblock == selectedSubblock) { status = 'selected'; } - - html += ''; - + + html += '' + index++; if (index % blockSize == 0 && index < characters.length) { block++; subblock = 1; - html += '
'; + html += '
'; } else { subblock++; } } - + html += '
'; - + return html; } - }); - }; - - // generate a Byond href, combines _urlParameters with parameters - var generateHref = function (parameters) - { - var queryString = '?'; + }; - for (var key in _urlParameters) - { - if (_urlParameters.hasOwnProperty(key)) - { - if (queryString !== '?') - { - queryString += ';'; - } - queryString += key + '=' + _urlParameters[key]; - } - } - - for (var key in parameters) - { - if (parameters.hasOwnProperty(key)) - { - if (queryString !== '?') - { - queryString += ';'; - } - queryString += key + '=' + parameters[key]; - } - } - return queryString; - }; - return { - init: function () + addHelpers: function () { - init(); + NanoTemplate.addHelpers(_baseHelpers); + }, + removeHelpers: function () + { + for (var helperKey in _baseHelpers) + { + if (_baseHelpers.hasOwnProperty(helperKey)) + { + NanoTemplate.removeHelper(helperKey); + } + } } }; } (); - -$(document).ready(function() -{ - NanoBaseHelpers.init(); -}); + diff --git a/nano/js/nano_config.js b/nano/js/nano_config.js deleted file mode 100644 index 8352b197ccf..00000000000 --- a/nano/js/nano_config.js +++ /dev/null @@ -1,100 +0,0 @@ -// NanoConfig is the place to store utility functions -var NanoConfig = function () -{ - return { - init: function () - { - if (typeof jQuery == 'undefined') { - alert('ERROR: jQuery failed to load!'); - } - if (typeof $.views == 'undefined') { - alert('ERROR: JSRender failed to load!'); - } - } - } -} (); - -NanoConfig.init(); - -if (!Array.prototype.indexOf) -{ - Array.prototype.indexOf = function(elt /*, from*/) - { - var len = this.length; - - var from = Number(arguments[1]) || 0; - from = (from < 0) - ? Math.ceil(from) - : Math.floor(from); - if (from < 0) - from += len; - - for (; from < len; from++) - { - if (from in this && - this[from] === elt) - return from; - } - return -1; - }; -}; - -if (!String.prototype.format) -{ - String.prototype.format = function (args) { - var str = this; - return str.replace(String.prototype.format.regex, function(item) { - var intVal = parseInt(item.substring(1, item.length - 1)); - var replace; - if (intVal >= 0) { - replace = args[intVal]; - } else if (intVal === -1) { - replace = "{"; - } else if (intVal === -2) { - replace = "}"; - } else { - replace = ""; - } - return replace; - }); - }; - String.prototype.format.regex = new RegExp("{-?[0-9]+}", "g"); -}; - -Object.size = function(obj) { - var size = 0, key; - for (var key in obj) { - if (obj.hasOwnProperty(key)) size++; - } - return size; -}; - -if(!window.console) { - window.console = { - log : function(str) { - return false; - } - }; -}; - -String.prototype.toTitleCase = function () { - var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i; - - return this.replace(/([^\W_]+[^\s-]*) */g, function (match, p1, index, title) { - if (index > 0 && index + p1.length !== title.length && - p1.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && - title.charAt(index - 1).search(/[^\s-]/) < 0) { - return match.toLowerCase(); - } - - if (p1.substr(1).search(/[A-Z]|\../) > -1) { - return match; - } - - return match.charAt(0).toUpperCase() + match.substr(1); - }); -}; - -$.ajaxSetup({ - cache: false -}); \ No newline at end of file diff --git a/nano/js/nano_state.js b/nano/js/nano_state.js new file mode 100644 index 00000000000..818cf603a14 --- /dev/null +++ b/nano/js/nano_state.js @@ -0,0 +1,119 @@ +// This is the base state class, it is not to be used directly + +function NanoStateClass() { + /*if (typeof this.key != 'string' || !this.key.length) + { + alert('ERROR: Tried to create a state with an invalid state key: ' + this.key); + return; + } + + this.key = this.key.toLowerCase(); + + NanoStateManager.addState(this);*/ +} + +NanoStateClass.prototype.key = null; +NanoStateClass.prototype.layoutRendered = false; +NanoStateClass.prototype.contentRendered = false; +NanoStateClass.prototype.mapInitialised = false; + +NanoStateClass.prototype.isCurrent = function () { + return NanoStateManager.getCurrentState() == this; +}; + +NanoStateClass.prototype.onAdd = function (previousState) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + NanoBaseCallbacks.addCallbacks(); + NanoBaseHelpers.addHelpers(); +}; + +NanoStateClass.prototype.onRemove = function (nextState) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + NanoBaseCallbacks.removeCallbacks(); + NanoBaseHelpers.removeHelpers(); +}; + +NanoStateClass.prototype.onBeforeUpdate = function (data) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + data = NanoStateManager.executeBeforeUpdateCallbacks(data); + + return data; // Return data to continue, return false to prevent onUpdate and onAfterUpdate +}; + +NanoStateClass.prototype.onUpdate = function (data) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + try + { + if (!this.layoutRendered || (data['config'].hasOwnProperty('autoUpdateLayout') && data['config']['autoUpdateLayout'])) + { + $("#uiLayout").html(NanoTemplate.parse('layout', data)); // render the 'mail' template to the #mainTemplate div + this.layoutRendered = true; + } + if (!this.contentRendered || (data['config'].hasOwnProperty('autoUpdateContent') && data['config']['autoUpdateContent'])) + { + $("#uiContent").html(NanoTemplate.parse('main', data)); // render the 'mail' template to the #mainTemplate div + this.contentRendered = true; + } + if (NanoTemplate.templateExists('mapContent')) + { + if (!this.mapInitialised) + { + // Add drag functionality to the map ui + $('#uiMap').drags({handle : '#uiMapImage'}); + + $('#uiMapTooltip') + .off('click') + .on('click', function (event) { + event.preventDefault(); + $(this).fadeOut(400); + }); + + this.mapInitialised = true; + } + + $("#uiMapContent").html(NanoTemplate.parse('mapContent', data)); // render the 'mapContent' template to the #uiMapContent div + + if (data['config'].hasOwnProperty('showMap') && data['config']['showMap']) + { + $('#uiContent').addClass('hidden'); + $('#uiMapWrapper').removeClass('hidden'); + } + else + { + $('#uiMapWrapper').addClass('hidden'); + $('#uiContent').removeClass('hidden'); + } + } + if (NanoTemplate.templateExists('mapHeader')) + { + $("#uiMapHeader").html(NanoTemplate.parse('mapHeader', data)); // render the 'mapHeader' template to the #uiMapHeader div + } + if (NanoTemplate.templateExists('mapFooter')) + { + $("#uiMapFooter").html(NanoTemplate.parse('mapFooter', data)); // render the 'mapFooter' template to the #uiMapFooter div + } + } + catch(error) + { + alert('ERROR: An error occurred while rendering the UI: ' + error.message); + return; + } +}; + +NanoStateClass.prototype.onAfterUpdate = function (data) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + NanoStateManager.executeAfterUpdateCallbacks(data); +}; + +NanoStateClass.prototype.alertText = function (text) { + // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function + + alert(text); +}; + + diff --git a/nano/js/nano_state_default.js b/nano/js/nano_state_default.js new file mode 100644 index 00000000000..65493b8c87e --- /dev/null +++ b/nano/js/nano_state_default.js @@ -0,0 +1,14 @@ + +NanoStateDefaultClass.inheritsFrom(NanoStateClass); +var NanoStateDefault = new NanoStateDefaultClass(); + +function NanoStateDefaultClass() { + + this.key = 'default'; + + //this.parent.constructor.call(this); + + this.key = this.key.toLowerCase(); + + NanoStateManager.addState(this); +} \ No newline at end of file diff --git a/nano/js/nano_state_manager.js b/nano/js/nano_state_manager.js new file mode 100644 index 00000000000..69699765a48 --- /dev/null +++ b/nano/js/nano_state_manager.js @@ -0,0 +1,224 @@ +// NanoStateManager handles data from the server and uses it to render templates +NanoStateManager = function () +{ + // _isInitialised is set to true when all of this ui's templates have been processed/rendered + var _isInitialised = false; + + // the array of template names to use for this ui + var _templates = null; + // the data for this ui + var _data = null; + // new data which arrives before _isInitialised is true is stored here for processing later + var _earlyUpdateData = null; + + // this is an array of callbacks which are called when new data arrives, before it is processed + var _beforeUpdateCallbacks = {}; + // this is an array of callbacks which are called when new data arrives, before it is processed + var _afterUpdateCallbacks = {}; + + // this is an array of state objects, these can be used to provide custom javascript logic + var _states = {}; + + var _currentState = null; + + // the init function is called when the ui has loaded + // this function sets up the templates and base functionality + var init = function () + { + // We store initialData and templateData in the body tag, it's as good a place as any + _data = $('body').data('initialData'); + + if (_data == null || !_data.hasOwnProperty('config') || !_data.hasOwnProperty('data')) + { + alert('Error: Initial data did not load correctly.'); + } + + var stateKey = 'default'; + if (_data['config'].hasOwnProperty('stateKey') && _data['config']['stateKey']) + { + stateKey = _data['config']['stateKey'].toLowerCase(); + } + + NanoStateManager.setCurrentState(stateKey); + + $(document).on('templatesLoaded', function () { + doUpdate(_data); + + _isInitialised = true; + }); + }; + + // Receive update data from the server + var receiveUpdateData = function (jsonString) + { + var updateData; + try + { + // parse the JSON string from the server into a JSON object + updateData = jQuery.parseJSON(jsonString); + } + catch (error) + { + alert(error.Message); + return; + } + + if (!updateData.hasOwnProperty('data')) + { + if (_data && _data.hasOwnProperty('data')) + { + updateData['data'] = _data['data']; + } + else + { + updateData['data'] = {}; + } + } + + if (_isInitialised) // all templates have been registered, so render them + { + doUpdate(updateData); + } + else + { + _data = updateData; // all templates have not been registered. We set _data directly here which will be applied after the template is loaded with the initial data + } + }; + + // This function does the update by calling the methods on the current state + var doUpdate = function (data) + { + if (_currentState == null) + { + return; + } + + data = _currentState.onBeforeUpdate(data); + + if (data === false) + { + alert('data is false, return'); + return; // A beforeUpdateCallback returned a false value, this prevents the render from occuring + } + + _data = data; + + _currentState.onUpdate(_data); + + _currentState.onAfterUpdate(_data); + }; + + // Execute all callbacks in the callbacks array/object provided, updateData is passed to them for processing and potential modification + var executeCallbacks = function (callbacks, data) + { + for (var key in callbacks) + { + if (callbacks.hasOwnProperty(key) && jQuery.isFunction(callbacks[key])) + { + data = callbacks[key].call(this, data); + } + } + + return data; + }; + + return { + init: function () + { + init(); + }, + receiveUpdateData: function (jsonString) + { + receiveUpdateData(jsonString); + }, + addBeforeUpdateCallback: function (key, callbackFunction) + { + _beforeUpdateCallbacks[key] = callbackFunction; + }, + addBeforeUpdateCallbacks: function (callbacks) { + for (var callbackKey in callbacks) { + if (!callbacks.hasOwnProperty(callbackKey)) + { + continue; + } + NanoStateManager.addBeforeUpdateCallback(callbackKey, callbacks[callbackKey]); + } + }, + removeBeforeUpdateCallback: function (key) + { + if (_beforeUpdateCallbacks.hasOwnProperty(key)) + { + delete _beforeUpdateCallbacks[key]; + } + }, + executeBeforeUpdateCallbacks: function (data) { + return executeCallbacks(_beforeUpdateCallbacks, data); + }, + addAfterUpdateCallback: function (key, callbackFunction) + { + _afterUpdateCallbacks[key] = callbackFunction; + }, + addAfterUpdateCallbacks: function (callbacks) { + for (var callbackKey in callbacks) { + if (!callbacks.hasOwnProperty(callbackKey)) + { + continue; + } + NanoStateManager.addAfterUpdateCallback(callbackKey, callbacks[callbackKey]); + } + }, + removeAfterUpdateCallback: function (key) + { + if (_afterUpdateCallbacks.hasOwnProperty(key)) + { + delete _afterUpdateCallbacks[key]; + } + }, + executeAfterUpdateCallbacks: function (data) { + return executeCallbacks(_afterUpdateCallbacks, data); + }, + addState: function (state) + { + if (!(state instanceof NanoStateClass)) + { + alert('ERROR: Attempted to add a state which is not instanceof NanoStateClass'); + return; + } + if (!state.key) + { + alert('ERROR: Attempted to add a state with an invalid stateKey'); + return; + } + _states[state.key] = state; + }, + setCurrentState: function (stateKey) + { + if (typeof stateKey == 'undefined' || !stateKey) { + alert('ERROR: No state key was passed!'); + return false; + } + if (!_states.hasOwnProperty(stateKey)) + { + alert('ERROR: Attempted to set a current state which does not exist: ' + stateKey); + return false; + } + + var previousState = _currentState; + + _currentState = _states[stateKey]; + + if (previousState != null) { + previousState.onRemove(_currentState); + } + + _currentState.onAdd(previousState); + + return true; + }, + getCurrentState: function () + { + return _currentState; + } + }; +} (); + \ No newline at end of file diff --git a/nano/js/nano_template.js b/nano/js/nano_template.js new file mode 100644 index 00000000000..f8f5d265948 --- /dev/null +++ b/nano/js/nano_template.js @@ -0,0 +1,135 @@ + +var NanoTemplate = function () { + + var _templateData = {}; + + var _templates = {}; + var _compiledTemplates = {}; + + var _helpers = {}; + + var init = function () { + // We store templateData in the body tag, it's as good a place as any + _templateData = $('body').data('templateData'); + + if (_templateData == null) + { + alert('Error: Template data did not load correctly.'); + } + + loadNextTemplate(); + }; + + var loadNextTemplate = function () { + // we count the number of templates for this ui so that we know when they've all been rendered + var templateCount = Object.size(_templateData); + + if (!templateCount) + { + $(document).trigger('templatesLoaded'); + return; + } + + // load markup for each template and register it + for (var key in _templateData) + { + if (!_templateData.hasOwnProperty(key)) + { + continue; + } + + $.when($.ajax({ + url: _templateData[key], + cache: false, + dataType: 'text' + })) + .done(function(templateMarkup) { + + templateMarkup += '
'; + + try + { + NanoTemplate.addTemplate(key, templateMarkup); + } + catch(error) + { + alert('ERROR: An error occurred while loading the UI: ' + error.message); + return; + } + + delete _templateData[key]; + + loadNextTemplate(); + }) + .fail(function () { + alert('ERROR: Loading template ' + key + '(' + _templateData[key] + ') failed!'); + }); + + return; + } + } + + var compileTemplates = function () { + + for (var key in _templates) { + try { + _compiledTemplates[key] = doT.template(_templates[key], null, _templates) + } + catch (error) { + alert(error.message); + } + } + }; + + return { + init: function () { + init(); + }, + addTemplate: function (key, templateString) { + _templates[key] = templateString; + }, + templateExists: function (key) { + return _templates.hasOwnProperty(key); + }, + parse: function (templateKey, data) { + if (!_compiledTemplates.hasOwnProperty(templateKey) || !_compiledTemplates[templateKey]) { + if (!_templates.hasOwnProperty(templateKey)) { + alert('ERROR: Template "' + templateKey + '" does not exist in _compiledTemplates!'); + return '

Template error (does not exist)

'; + } + compileTemplates(); + } + if (typeof _compiledTemplates[templateKey] != 'function') { + alert(_compiledTemplates[templateKey]); + alert('ERROR: Template "' + templateKey + '" failed to compile!'); + return '

Template error (failed to compile)

'; + } + return _compiledTemplates[templateKey].call(this, data['data'], data['config'], _helpers); + }, + addHelper: function (helperName, helperFunction) { + if (!jQuery.isFunction(helperFunction)) { + alert('NanoTemplate.addHelper failed to add ' + helperName + ' as it is not a function.'); + return; + } + + _helpers[helperName] = helperFunction; + }, + addHelpers: function (helpers) { + for (var helperName in helpers) { + if (!helpers.hasOwnProperty(helperName)) + { + continue; + } + NanoTemplate.addHelper(helperName, helpers[helperName]); + } + }, + removeHelper: function (helperName) { + if (helpers.hasOwnProperty(helperName)) + { + delete _helpers[helperName]; + } + } + } +}(); + + diff --git a/nano/js/nano_utility.js b/nano/js/nano_utility.js new file mode 100644 index 00000000000..127e74ae383 --- /dev/null +++ b/nano/js/nano_utility.js @@ -0,0 +1,203 @@ +// NanoUtility is the place to store utility functions +var NanoUtility = function () +{ + var _urlParameters = {}; // This is populated with the base url parameters (used by all links), which is probaby just the "src" parameter + + return { + init: function () + { + var body = $('body'); // We store data in the body tag, it's as good a place as any + + _urlParameters = body.data('urlParameters'); + }, + // generate a Byond href, combines _urlParameters with parameters + generateHref: function (parameters) + { + var queryString = '?'; + + for (var key in _urlParameters) + { + if (_urlParameters.hasOwnProperty(key)) + { + if (queryString !== '?') + { + queryString += ';'; + } + queryString += key + '=' + _urlParameters[key]; + } + } + + for (var key in parameters) + { + if (parameters.hasOwnProperty(key)) + { + if (queryString !== '?') + { + queryString += ';'; + } + queryString += key + '=' + parameters[key]; + } + } + return queryString; + } + } +} (); + +if (typeof jQuery == 'undefined') { + alert('ERROR: Javascript library failed to load!'); +} +if (typeof doT == 'undefined') { + alert('ERROR: Template engine failed to load!'); +} + +// All scripts are initialised here, this allows control of init order +$(document).ready(function () { + NanoUtility.init(); + NanoStateManager.init(); + NanoTemplate.init(); +}); + +if (!Array.prototype.indexOf) +{ + Array.prototype.indexOf = function(elt /*, from*/) + { + var len = this.length; + + var from = Number(arguments[1]) || 0; + from = (from < 0) + ? Math.ceil(from) + : Math.floor(from); + if (from < 0) + from += len; + + for (; from < len; from++) + { + if (from in this && + this[from] === elt) + return from; + } + return -1; + }; +}; + +if (!String.prototype.format) +{ + String.prototype.format = function (args) { + var str = this; + return str.replace(String.prototype.format.regex, function(item) { + var intVal = parseInt(item.substring(1, item.length - 1)); + var replace; + if (intVal >= 0) { + replace = args[intVal]; + } else if (intVal === -1) { + replace = "{"; + } else if (intVal === -2) { + replace = "}"; + } else { + replace = ""; + } + return replace; + }); + }; + String.prototype.format.regex = new RegExp("{-?[0-9]+}", "g"); +}; + +Object.size = function(obj) { + var size = 0, key; + for (var key in obj) { + if (obj.hasOwnProperty(key)) size++; + } + return size; +}; + +if(!window.console) { + window.console = { + log : function(str) { + return false; + } + }; +}; + +String.prototype.toTitleCase = function () { + var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i; + + return this.replace(/([^\W_]+[^\s-]*) */g, function (match, p1, index, title) { + if (index > 0 && index + p1.length !== title.length && + p1.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && + title.charAt(index - 1).search(/[^\s-]/) < 0) { + return match.toLowerCase(); + } + + if (p1.substr(1).search(/[A-Z]|\../) > -1) { + return match; + } + + return match.charAt(0).toUpperCase() + match.substr(1); + }); +}; + +$.ajaxSetup({ + cache: false +}); + +Function.prototype.inheritsFrom = function (parentClassOrObject) { + this.prototype = new parentClassOrObject; + this.prototype.constructor = this; + this.prototype.parent = parentClassOrObject.prototype; + return this; +}; + +if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g, ''); + }; +} + +// Replicate the ckey proc from BYOND +if (!String.prototype.ckey) { + String.prototype.ckey = function () { + return this.replace(/\W/g, '').toLowerCase(); + }; +} + +(function($) { + $.fn.drags = function(opt) { + + opt = $.extend({handle:"",cursor:"move"}, opt); + + if(opt.handle === "") { + var $el = this; + } else { + var $el = this.find(opt.handle); + } + + return $el.css('cursor', opt.cursor).on("mousedown", function(e) { + if(opt.handle === "") { + var $drag = $(this).addClass('draggable'); + } else { + var $drag = $(this).addClass('active-handle').parent().addClass('draggable'); + } + var z_idx = $drag.css('z-index'), + drg_h = $drag.outerHeight(), + drg_w = $drag.outerWidth(), + pos_y = $drag.offset().top + drg_h - e.pageY, + pos_x = $drag.offset().left + drg_w - e.pageX; + $drag.css('z-index', 1000).parents().on("mousemove", function(e) { + $('.draggable').offset({ + top:e.pageY + pos_y - drg_h, + left:e.pageX + pos_x - drg_w + }).on("mouseup", function() { + $(this).removeClass('draggable').css('z-index', z_idx); + }); + }); + e.preventDefault(); // disable selection + }).on("mouseup", function() { + if(opt.handle === "") { + $(this).removeClass('draggable'); + } else { + $(this).removeClass('active-handle').parent().removeClass('draggable'); + } + }); + + } +})(jQuery); \ No newline at end of file diff --git a/nano/mapbase1024.png b/nano/mapbase1024.png new file mode 100644 index 00000000000..a927a71b6e7 Binary files /dev/null and b/nano/mapbase1024.png differ diff --git a/nano/templates/air_alarm.tmpl b/nano/templates/air_alarm.tmpl index 80d6ac9ce3d..4f4b425cbb0 100644 --- a/nano/templates/air_alarm.tmpl +++ b/nano/templates/air_alarm.tmpl @@ -2,7 +2,7 @@ Title: Air Alarm UI Used In File(s): /code/game/machinery/alarm.dm --> -{{!-- + +

{{:data.name}}

+{{if !data.air}} +
Unable to acquire air sample.
{{else}} -
-
-
Pressure:
- {{:~string("
{1} kPa
",~dangerToClass(air.danger.pressure),~precisionRound(air.pressure,4))}} -
- {{if !locked}} - {{if mode == 3}} - {{:~link("DEACTIVATE PANIC SYPHON",null,{"mode" : 1},null,'linkOn')}} - {{else}} - {{:~link("ACTIVATE PANIC SYPHON",null,{"mode" : 3},null,'red')}} +
+
+
Pressure:
+ {{:helper.string("
{1} kPa
",helper.dangerToClass(data.air.danger.pressure),helper.precisionRound(data.air.pressure,4))}} +
+ {{if !data.locked}} + {{if data.mode == 3}} + {{:helper.link("DEACTIVATE PANIC SYPHON",null,{"mode" : 1},null,'linkOn')}} + {{else}} + {{:helper.link("ACTIVATE PANIC SYPHON",null,{"mode" : 3},null,'red')}} + {{/if}} {{/if}} +
+
+
+
Oxygen:
+ {{:helper.displayBar(data.air.contents.oxygen, 0, 100, helper.dangerToClass(data.air.danger.oxygen))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.oxygen),helper.precisionRound(data.air.contents.oxygen,2))}} +
+
+
Nitrogen:
+ {{:helper.displayBar(data.air.contents.nitrogen, 0, 100, helper.dangerToClass(data.air.danger.nitrogen))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.nitrogen),helper.precisionRound(data.air.contents.nitrogen,2))}} +
+
+
Carbon Dioxide:
+ {{:helper.displayBar(data.air.contents.co2, 0, 100, helper.dangerToClass(data.air.danger.co2))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.co2),helper.precisionRound(data.air.contents.co2,2))}} +
+
+
Toxins:
+ {{:helper.displayBar(data.air.contents.plasma, 0, 100, helper.dangerToClass(data.air.danger.plasma))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.plasma),helper.precisionRound(data.air.contents.plasma,2))}} +
+ {{if data.air.danger.other>0}} +
+
Other:
+ {{:helper.displayBar(data.air.contents.other, 0, 100, helper.dangerToClass(data.air.danger.other))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.other),helper.precisionRound(data.air.contents.other,2))}} +
{{/if}} +
+
+ Temperature: +
+ {{:helper.string("
{1}°K ({2}°C)
",helper.dangerToClass(data.air.danger.temperature),helper.precisionRound(data.air.temperature,2),helper.precisionRound(data.air.temperature_c,2))}} +
+
+
Local Status:
+ {{if data.air.danger.overall == 0}} + {{if data.atmos_alarm}} +
Caution: Atmos alert in area + {{else}} +
Optimal + {{/if}} + {{else data.air.danger.overall == 1}} +
Caution + {{else}} +
DANGER: Internals Required + {{/if}} + {{if !data.locked}} + {{if data.alarmActivated}} + {{:helper.link('Reset Alarm',null,{'atmos_reset':1},null,'linkOn')}} + {{else}} + {{:helper.link('Activate Alarm',null,{'atmos_alarm':1},null,'red')}} + {{/if}} + {{/if}} +
+
+
+ +
Remote Control:
+ {{:helper.link('Off', null, {'rcon' : 1}, (data.rcon != 1) ? null : 'disabled')}} + {{:helper.link('Auto', null, {'rcon' : 2}, (data.rcon != 2) ? null : 'disabled')}} + {{:helper.link('On', null, {'rcon' : 3}, (data.rcon != 3) ? null : 'disabled')}} +
+
+
Thermostat:
+ {{:helper.link(data.target_temp+" C", 'carat-2-n-s', {'temperature': 1})}}
-
-
Oxygen:
- {{:~displayBar(air.contents.oxygen, 0, 100, ~dangerToClass(air.danger.oxygen))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.oxygen),~precisionRound(air.contents.oxygen,2))}} -
-
-
Nitrogen:
- {{:~displayBar(air.contents.nitrogen, 0, 100, ~dangerToClass(air.danger.nitrogen))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.nitrogen),~precisionRound(air.contents.nitrogen,2))}} -
-
-
Carbon Dioxide:
- {{:~displayBar(air.contents.co2, 0, 100, ~dangerToClass(air.danger.co2))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.co2),~precisionRound(air.contents.co2,2))}} -
-
-
Toxins:
- {{:~displayBar(air.contents.plasma, 0, 100, ~dangerToClass(air.danger.plasma))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.plasma),~precisionRound(air.contents.plasma,2))}} -
- {{if air.danger.other>0}} -
-
Other:
- {{:~displayBar(air.contents.other, 0, 100, ~dangerToClass(air.danger.other))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.other),~precisionRound(air.contents.other,2))}} -
- {{/if}} -
-
- Temperature: -
- {{:~string("
{1}°K ({2}°C)
",~dangerToClass(air.danger.temperature),~precisionRound(air.temperature,2),~precisionRound(air.temperature_c,2))}} -
-
-
Local Status:
- {{if air.danger.overall == 0}} - {{if atmos_alarm}} -
Caution: Atmos alert in area - {{else}} -
Optimal - {{/if}} - {{else air.danger.overall == 1}} -
Caution - {{else}} -
DANGER: Internals Required - {{/if}} - {{if !locked}} - {{if alarmActivated}} - {{:~link('Reset Alarm',null,{'atmos_reset':1},null,'linkOn')}} - {{else}} - {{:~link('Activate Alarm',null,{'atmos_alarm':1},null,'red')}} - {{/if}} - {{/if}} -
-
-
- -
Remote Control:
- {{:~link('Off', null, {'rcon' : 1}, (rcon != 1) ? null : 'disabled')}} - {{:~link('Auto', null, {'rcon' : 2}, (rcon != 2) ? null : 'disabled')}} - {{:~link('On', null, {'rcon' : 3}, (rcon != 3) ? null : 'disabled')}} -
-
-
Thermostat:
- {{:~link(target_temp+" C", 'carat-2-n-s', {'temperature': 1})}} -
-
{{/if}} -{{if locked}} +{{if data.locked}}
Swipe card to unlock.
{{else}}
Remember to lock with ID card after use.
Screen:
- {{:~link('Main', 'gear',{'screen':1},(screen==1)?'linkOn':'')}} - {{:~link('Vents', 'gear',{'screen':2},(screen==2)?'linkOn':'')}} - {{:~link('Scrubbers', 'gear',{'screen':3},(screen==3)?'linkOn':'')}} - {{:~link('Mode', 'gear',{'screen':4},(screen==4)?'linkOn':'')}} - {{:~link('Thresholds','gear',{'screen':5},(screen==5)?'linkOn':'')}} + {{:helper.link('Main', 'gear',{'screen':1},(data.screen==1)?'linkOn':'')}} + {{:helper.link('Vents', 'gear',{'screen':2},(data.screen==2)?'linkOn':'')}} + {{:helper.link('Scrubbers', 'gear',{'screen':3},(data.screen==3)?'linkOn':'')}} + {{:helper.link('Mode', 'gear',{'screen':4},(data.screen==4)?'linkOn':'')}} + {{:helper.link('Thresholds','gear',{'screen':5},(data.screen==5)?'linkOn':'')}}
- {{!-- VENTS --}} - {{if screen == 2}} + + {{if data.screen == 2}}

Vent Pump Settings

- {{for vents}} + {{for data.vents}}
- {{>name}}: {{:state}} + {{>value.name}}: {{:value.state}}
Operating:
- {{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}} - {{if direction=="siphon"}} - {{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'set_dir','dir':'release'})}} + {{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}} + {{if value.direction=="siphon"}} + {{:helper.link('Siphoning','arrowthickstop-1-s',{'id_tag':value.id_tag,'command':'set_dir','dir':'release'})}} {{else}} - {{:~link('Blowing','arrowthick-1-n',{'id_tag':id_tag,'command':'set_dir','dir':'siphon'})}} + {{:helper.link('Blowing','arrowthick-1-n',{'id_tag':value.id_tag,'command':'set_dir','dir':'siphon'})}} {{/if}}
Pressure checks:
- {{:~link('External','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,1)},null,(checks & 1 ?'linkOn':'red'))}} - {{:~link('Internal','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,2)},null,(checks & 2 ?'linkOn':'red'))}} + {{:helper.link('External','power',{'id_tag':value.id_tag,'command':'checks','val':helper.xor(value.checks,1)},null,(value.checks == 1 ?'linkOn':'red'))}} + {{:helper.link('Internal','power',{'id_tag':value.id_tag,'command':'checks','val':helper.xor(value.checks,2)},null,(value.checks == 2 ?'linkOn':'red'))}}
External pressure target:
- {{:~precisionRound(external,4)}} kPa + {{:helper.precisionRound(value.external,4)}} kPa
- {{:~link('Set','gear',{'id_tag':id_tag,'command':'set_external_pressure'})}} - {{:~link('Reset','arrowrefresh-1-n',{'id_tag':id_tag,'command':'set_external_pressure','val':101.325},null,'linkOn')}} + {{:helper.link('Set','gear',{'id_tag':value.id_tag,'command':'set_external_pressure'})}} + {{:helper.link('Reset','arrowrefresh-1-n',{'id_tag':value.id_tag,'command':'set_external_pressure','val':101.325},null,'linkOn')}}
- {{else}} + {{empty}} No vent pumps located in this area. {{/for}} - {{!-- SCRUBBERS --}} - {{else screen == 3}} + + {{else data.screen == 3}}

Scrubbers

- {{for scrubbers}} + {{for data.scrubbers}}
- {{>name}}: {{:state}} + {{>value.name}}: {{:value.state}}
Operating:
- {{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}} + {{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}}
Type:
- {{if scrubbing==0}} - {{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'scrubbing','val':1},null,'red')}} + {{if value.scrubbing==0}} + {{:helper.link('Siphoning','arrowthickstop-1-s',{'id_tag':value.id_tag,'command':'scrubbing','val':1},null,'red')}} {{else}} - {{:~link('Scrubbing','transferthick-e-w',{'id_tag':id_tag,'command':'scrubbing','val':0},null,'linkOn')}} + {{:helper.link('Scrubbing','transferthick-e-w',{'id_tag':value.id_tag,'command':'scrubbing','val':0},null,'linkOn')}} {{/if}}
- {{if scrubbing==1}} + {{if value.scrubbing==1}}
Filtering:
- {{:~link('CO2',null,{'id_tag':id_tag,'command':'co2_scrub','val':(filter_co2==0?1:0)},null,(filter_co2?'linkOn':''))}} - {{:~link('Plasma', null,{'id_tag':id_tag,'command':'tox_scrub','val':(filter_tox==0?1:0)},null,(filter_tox?'linkOn':''))}} - {{:~link('N2O',null,{'id_tag':id_tag,'command':'n2o_scrub','val':(filter_n2o==0?1:0)},null,(filter_n2o?'linkOn':''))}} - {{:~link('N2', null,{'id_tag':id_tag,'command':'n2_scrub', 'val':(filter_n2 ==0?1:0)},null,(filter_n2 ?'linkOn':''))}} - {{:~link('O2', null,{'id_tag':id_tag,'command':'o2_scrub', 'val':(filter_o2 ==0?1:0)},null,(filter_o2 ?'linkOn':''))}} + {{:helper.link('CO2',null,{'id_tag':value.id_tag,'command':'co2_scrub','val':(value.filter_co2==0?1:0)},null,(value.filter_co2?'linkOn':''))}} + {{:helper.link('Plasma', null,{'id_tag':value.id_tag,'command':'tox_scrub','val':(value.filter_tox==0?1:0)},null,(value.filter_tox?'linkOn':''))}} + {{:helper.link('N2O',null,{'id_tag':value.id_tag,'command':'n2o_scrub','val':(value.filter_n2o==0?1:0)},null,(value.filter_n2o?'linkOn':''))}} + {{:helper.link('O2', null,{'id_tag':value.id_tag,'command':'o2_scrub', 'val':(value.filter_o2 ==0?1:0)},null,(value.filter_o2 ?'linkOn':''))}}
{{/if}}
- {{else}} + {{empty}} No scrubbers located in this area. {{/for}} - {{!-- MODES --}} - {{else screen == 4}} + + {{else data.screen == 4}}

System Mode

- {{for modes}} + {{for data.modes}}
-
{{:~link(name,'gear',{'mode':#index+1},null,(#index+1==~root.mode?'linkOn':''))}}
+
{{:helper.link(value.name,'gear',{'mode':index+1},null,(index+1==data.mode?'linkOn':''))}}
- {{:desc}} + {{:value.desc}}
{{/for}} @@ -215,17 +214,17 @@ Used In File(s): /code/game/machinery/alarm.dm

System Preset

After making a selection, the system will automatically cycle in order to remove contaminants.
- {{for presets}} + {{for data.presets}}
-
{{:~link(name,'gear',{'preset':#index+1},null,(#index+1==~root.preset?'linkOn':''))}}
+
{{:helper.link(value.name,'gear',{'preset':index+1},null,(index+1==value.preset?'linkOn':''))}}
- {{:desc}} + {{:value.desc}}
{{/for}}
- {{!-- SENSORS --}} - {{else screen == 5}} + + {{else data.screen == 5}}

Sensor Thresholds

@@ -239,38 +238,38 @@ Used In File(s): /code/game/machinery/alarm.dm - {{for sensors.oxygen}} - + {{for data.sensors.oxygen}} + {{/for}} - {{for sensors.nitrogen}} - + {{for data.sensors.nitrogen}} + {{/for}} - {{for sensors.carbon_dioxide}} - + {{for data.sensors.carbon_dioxide}} + {{/for}} - {{for sensors.plasma}} - + {{for data.sensors.plasma}} + {{/for}} - {{for sensors.pressure}} - + {{for data.sensors.pressure}} + {{/for}} - {{for sensors.temperature}} - + {{for data.sensors.temperature}} + {{/for}} diff --git a/nano/templates/apc.tmpl b/nano/templates/apc.tmpl index f1e77ae6112..1db3cb3dda4 100644 --- a/nano/templates/apc.tmpl +++ b/nano/templates/apc.tmpl @@ -1,179 +1,177 @@
- {{if siliconUser}} + {{if data.siliconUser}}
Interface Lock:
- {{:~link('Engaged', 'locked', {'toggleaccess' : 1}, locked ? 'selected' : null)}}{{:~link('Disengaged', 'unlocked', {'toggleaccess' : 1}, malfStatus >= 2 ? 'linkOff' : (locked ? null : 'selected'))}} + {{:helper.link('Engaged', 'locked', {'toggleaccess' : 1}, data.locked ? 'selected' : null)}}{{:helper.link('Disengaged', 'unlocked', {'toggleaccess' : 1}, data.malfStatus >= 2 ? 'linkOff' : (data.locked ? null : 'selected'))}}
{{else}} - {{if locked}} - Swipe an ID card to unlock this interface. + {{if data.locked}} + Swipe an ID card to unlock this interface {{else}} - Swipe an ID card to lock this interface. + Swipe an ID card to lock this interface {{/if}} {{/if}}
-

Power Status

+

Power Status

-
-
- Main Breaker: -
-
- {{if locked && !siliconUser}} - {{if isOperating}} - On - {{else}} - Off - {{/if}} - {{else}} - {{:~link('On', 'power', {'breaker' : 1}, isOperating ? 'selected' : null)}}{{:~link('Off', 'close', {'breaker' : 1}, isOperating ? null : 'selected')}} - {{/if}} -
-
- -
-
- External Power: -
-
- {{if externalPower == 2}} - Good - {{else externalPower == 1}} - Low - {{else}} - None - {{/if}} -
-
- -
-
- Power Cell: -
- {{if powerCellStatus == null}} -
- Power cell removed. -
- {{else}} -
- {{:~round(powerCellStatus*10)/10}}% -
- {{:~displayBar(powerCellStatus, 0, 100, powerCellStatus >= 50 ? 'good' : powerCellStatus >= 25 ? 'average' : 'bad')}} - {{/if}} -
- -{{if powerCellStatus != null}}
- Charge Mode: + Main Breaker:
- {{if locked && !siliconUser}} - {{if chargeMode}} - Auto + {{if data.locked && !data.siliconUser}} + {{if data.isOperating}} + On {{else}} Off - {{/if}} + {{/if}} {{else}} - {{:~link('Auto', 'refresh', {'cmode' : 1}, chargeMode ? 'selected' : null)}}{{:~link('Off', 'close', {'cmode' : 1}, chargeMode ? null : 'selected')}} - {{/if}} -   - {{if chargingStatus > 1}} - [Fully Charged] - {{else chargingStatus == 1}} - [Charging] - {{else}} - [Not Charging] + {{:helper.link('On', 'power', {'breaker' : 1}, data.isOperating ? 'selected' : null)}}{{:helper.link('Off', 'close', {'breaker' : 1}, data.isOperating ? null : 'selected')}} {{/if}}
-{{/if}} - -

Power Channels

- -{{for powerChannels}}
- {{:title}}: + External Power: +
+
+ {{if data.externalPower == 2}} + Good + {{else data.externalPower == 1}} + Low + {{else}} + None + {{/if}} +
+
+ +
+
+ Power Cell: +
+ {{if data.powerCellStatus == null}} +
+ Power cell removed. +
+ {{else}} + + {{:helper.displayBar(data.powerCellStatus, 0, 100, (data.powerCellStatus >= 50) ? 'good' : (data.powerCellStatus >= 25) ? 'average' : 'bad')}} +
+ {{:helper.round(data.powerCellStatus*10)/10}}% +
+ {{/if}} +
+ + {{if data.powerCellStatus != null}} +
+
+ Charge Mode: +
+
+ {{if data.locked && !data.siliconUser}} + {{if data.chargeMode}} + Auto + {{else}} + Off + {{/if}} + {{else}} + {{:helper.link('Auto', 'refresh', {'cmode' : 1}, data.chargeMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'cmode' : 1}, data.chargeMode ? null : 'selected')}} + {{/if}} +   + {{if data.chargingStatus > 1}} + [Fully Charged] + {{else data.chargingStatus == 1}} + [Charging] + {{else}} + [Not Charging] + {{/if}} +
+
+ {{/if}} + + +

Power Channels

+ + {{for data.powerChannels}} +
+
+ {{:value.title}}: +
+
+ {{:value.powerLoad}} W +
+
+    + {{if value.status <= 1}} + Off + {{else value.status >= 2}} + On + {{/if}} + {{if data.locked}} + {{if value.status == 1 || value.status == 3}} +   Auto + {{else}} +   Manual + {{/if}} + {{/if}} +
+ {{if !data.locked || data.siliconUser}} +
+ {{:helper.link('Auto', 'refresh', value.topicParams.auto, (value.status == 1 || value.status == 3) ? 'selected' : null)}} + {{:helper.link('On', 'power', value.topicParams.on, (value.status == 2) ? 'selected' : null)}} + {{:helper.link('Off', 'close', value.topicParams.off, (value.status == 0) ? 'selected' : null)}} +
+ {{/if}} +
+ {{/for}} + +
+
+ Total Load:
- {{:~precisionRound(powerLoad,2)}} W + {{:data.totalLoad}} W
-
-    - {{if status <= 1}} - Off - {{else status >= 2}} - On - {{/if}} - {{if status == 1 || status == 3}} - [Auto] - {{else}} - [Manual] - {{/if}} +
+ +
 
+ +
+
+ Cover Lock:
- {{if !~root.locked || ~root.siliconUser}} -
- {{:~link('Auto', 'refresh', topicParams.auto, (status == 1 || status == 3) ? 'selected' : null)}} - {{:~link('On', 'power', topicParams.on, (status == 2) ? 'selected' : null)}} - {{:~link('Off', 'close', topicParams.off, (status == 0) ? 'selected' : null)}} -
- {{/if}} -
-{{/for}} - -
-
- Total Load: -
-
- {{:totalLoad}} W -
-
- -
 
- -
-
- Cover Lock: -
-
- {{if locked && !siliconUser}} - {{if coverLocked}} - Engaged +
+ {{if data.locked && !data.siliconUser}} + {{if data.coverLocked}} + Engaged + {{else}} + Disengaged + {{/if}} {{else}} - Disengaged + {{:helper.link('Engaged', 'locked', {'lock' : 1}, data.coverLocked ? 'selected' : null)}}{{:helper.link('Disengaged', 'unlocked', {'lock' : 1}, data.coverLocked ? null : 'selected')}} {{/if}} - {{else}} - {{:~link('Engaged', 'locked', {'lock' : 1}, coverLocked ? 'selected' : null)}}{{:~link('Disengaged', 'unlocked', {'lock' : 1}, coverLocked ? null : 'selected')}} - {{/if}} +
-
+ {{if data.siliconUser}} +

System Overrides

-{{if siliconUser}} -

System Overrides

- -
- {{:~link('Overload Lighting Circuit', 'lightbulb', {'overload' : 1})}} - {{if malfStatus == 1}} - {{:~link('Override Programming', 'script', {'malfhack' : 1})}} - {{else malfStatus == 2}} - {{:~link('Shunt Core Processes', 'arrowreturn-1-s', {'occupyapc' : 1})}} - {{else malfStatus == 3}} - {{:~link('Return to Main Core', 'arrowreturn-1-w', {'deoccupyapc' : 1})}} - {{else malfStatus == 4}} - {{:~link('Shunt Core Processes', 'arrowreturn-1-s', {'occupyapc' : 1}, 'linkOff')}} +
+ {{:helper.link('Overload Lighting Circuit', 'lightbulb', {'overload' : 1})}} + {{if data.malfStatus == 1}} + {{:helper.link('Override Programming', 'script', {'malfhack' : 1})}} + {{else data.malfStatus > 1}} +
APC Hacked
+ {{/if}} +
{{/if}} -
-{{/if}}
\ No newline at end of file diff --git a/nano/templates/atmos_control.tmpl b/nano/templates/atmos_control.tmpl index 5a8301bc8e1..47651211132 100644 --- a/nano/templates/atmos_control.tmpl +++ b/nano/templates/atmos_control.tmpl @@ -2,7 +2,7 @@ Title: Atmos Control UI Used In File(s): /code/game/machinery/alarm.dm --> -{{!-- + +{{if !data.alarm}}

Atmospherics Control

- {{for alarms}} + {{for data.alarms}}
- {{:~string("
{1}
",~dangerToClass(danger),name)}} - {{:~link("Access","gear",{"alarm":ID},null,"floatRight")}} + {{:helper.string("
{1}
",helper.dangerToClass(value.danger),value.name)}} + {{:helper.link("Access","gear",{"alarm":value.ID},null,"floatRight")}}
{{/for}}
{{else}} - {{:~link("Main Menu","gear",{"reset":1},null,null)}} -

{{:name}}

- {{if !air}} -
Unable to acquire air sample.
- {{else}} -
-
-
Pressure:
- {{:~string("
{1} kPa
",~dangerToClass(air.danger.pressure),~precisionRound(air.pressure,4))}} -
- {{if !locked}} - {{if mode == 3}} - {{:~link("DEACTIVATE PANIC SYPHON",null,{"mode" : 1},null,'linkOn')}} - {{else}} - {{:~link("ACTIVATE PANIC SYPHON",null,{"mode" : 3},null,'red')}} - {{/if}} - {{/if}} -
-
-
-
Oxygen:
- {{:~displayBar(air.contents.oxygen, 0, 100, ~dangerToClass(air.danger.oxygen))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.oxygen),~precisionRound(air.contents.oxygen,2))}} -
-
-
Nitrogen:
- {{:~displayBar(air.contents.nitrogen, 0, 100, ~dangerToClass(air.danger.nitrogen))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.nitrogen),~precisionRound(air.contents.nitrogen,2))}} -
-
-
Carbon Dioxide:
- {{:~displayBar(air.contents.co2, 0, 100, ~dangerToClass(air.danger.co2))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.co2),~precisionRound(air.contents.co2,2))}} -
-
-
Toxins:
- {{:~displayBar(air.contents.plasma, 0, 100, ~dangerToClass(air.danger.plasma))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.plasma),~precisionRound(air.contents.plasma,2))}} -
- {{if air.danger.other>0}} -
-
Other:
- {{:~displayBar(air.contents.other, 0, 100, ~dangerToClass(air.danger.other))}} - {{:~string("
{1}%
",~dangerToClass(air.danger.other),~precisionRound(air.contents.other,2))}} -
- {{/if}} -
-
- Temperature: -
- {{:~string("
{1}°K ({2}°C)
",~dangerToClass(air.danger.temperature),~precisionRound(air.temperature,2),~precisionRound(air.temperature_c,2))}} -
-
-
Local Status:
- {{if air.danger.overall == 0}} - {{if atmos_alarm}} -
Caution: Atmos alert in area - {{else}} -
Optimal - {{/if}} - {{else air.danger.overall == 1}} -
Caution - {{else}} -
DANGER: Internals Required - {{/if}} - {{if !locked}} - {{if atmos_alarm}} - {{:~link('Reset Alarm',null,{'atmos_reset':1},null,'linkOn floatRight')}} - {{else}} - {{:~link('Activate Alarm',null,{'atmos_alarm':1},null,'red floatRight')}} - {{/if}} - {{/if}} -
-
-
- -
Remote Control:
- {{:~link('Off', null, {'rcon' : 1}, (rcon != 1) ? null : 'disabled')}} - {{:~link('Auto', null, {'rcon' : 2}, (rcon != 2) ? null : 'disabled')}} - {{:~link('On', null, {'rcon' : 3}, (rcon != 3) ? null : 'disabled')}} -
-
-
Thermostat:
- {{:~link(target_temp+" C", 'carat-2-n-s', {'temperature': 1})}} -
-
- {{/if}} + {{:helper.link("Main Menu","gear",{"reset":1},null,null)}} - {{if locked}} + +

{{:data.name}}

+ {{if !data.air}} +
Unable to acquire air sample.
+ {{else}} +
+
+
Pressure:
+ {{:helper.string("
{1} kPa
",helper.dangerToClass(data.air.danger.pressure),helper.precisionRound(data.air.pressure,4))}} +
+ {{if !data.locked}} + {{if data.mode == 3}} + {{:helper.link("DEACTIVATE PANIC SYPHON",null,{"mode" : 1},null,'linkOn')}} + {{else}} + {{:helper.link("ACTIVATE PANIC SYPHON",null,{"mode" : 3},null,'red')}} + {{/if}} + {{/if}} +
+
+
+
Oxygen:
+ {{:helper.displayBar(data.air.contents.oxygen, 0, 100, helper.dangerToClass(data.air.danger.oxygen))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.oxygen),helper.precisionRound(data.air.contents.oxygen,2))}} +
+
+
Nitrogen:
+ {{:helper.displayBar(data.air.contents.nitrogen, 0, 100, helper.dangerToClass(data.air.danger.nitrogen))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.nitrogen),helper.precisionRound(data.air.contents.nitrogen,2))}} +
+
+
Carbon Dioxide:
+ {{:helper.displayBar(data.air.contents.co2, 0, 100, helper.dangerToClass(data.air.danger.co2))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.co2),helper.precisionRound(data.air.contents.co2,2))}} +
+
+
Toxins:
+ {{:helper.displayBar(data.air.contents.plasma, 0, 100, helper.dangerToClass(data.air.danger.plasma))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.plasma),helper.precisionRound(data.air.contents.plasma,2))}} +
+ {{if data.air.danger.other>0}} +
+
Other:
+ {{:helper.displayBar(data.air.contents.other, 0, 100, helper.dangerToClass(data.air.danger.other))}} + {{:helper.string("
{1}%
",helper.dangerToClass(data.air.danger.other),helper.precisionRound(data.air.contents.other,2))}} +
+ {{/if}} +
+
+ Temperature: +
+ {{:helper.string("
{1}°K ({2}°C)
",helper.dangerToClass(data.air.danger.temperature),helper.precisionRound(data.air.temperature,2),helper.precisionRound(data.air.temperature_c,2))}} +
+
+
Local Status:
+ {{if data.air.danger.overall == 0}} + {{if data.atmos_alarm}} +
Caution: Atmos alert in area + {{else}} +
Optimal + {{/if}} + {{else data.air.danger.overall == 1}} +
Caution + {{else}} +
DANGER: Internals Required + {{/if}} + {{if !data.locked}} + {{if data.alarmActivated}} + {{:helper.link('Reset Alarm',null,{'atmos_reset':1},null,'linkOn')}} + {{else}} + {{:helper.link('Activate Alarm',null,{'atmos_alarm':1},null,'red')}} + {{/if}} + {{/if}} +
+
+
+ +
Remote Control:
+ {{:helper.link('Off', null, {'rcon' : 1}, (data.rcon != 1) ? null : 'disabled')}} + {{:helper.link('Auto', null, {'rcon' : 2}, (data.rcon != 2) ? null : 'disabled')}} + {{:helper.link('On', null, {'rcon' : 3}, (data.rcon != 3) ? null : 'disabled')}} +
+
+
Thermostat:
+ {{:helper.link(data.target_temp+" C", 'carat-2-n-s', {'temperature': 1})}} +
+
+ {{/if}} + + {{if data.locked}}
Swipe card to unlock.
{{else}}
Remember to lock with ID card after use.
Screen:
- {{:~link('Main', 'gear',{'screen':1},(screen==1)?'linkOn':'')}} - {{:~link('Vents', 'gear',{'screen':2},(screen==2)?'linkOn':'')}} - {{:~link('Scrubbers', 'gear',{'screen':3},(screen==3)?'linkOn':'')}} - {{:~link('Mode', 'gear',{'screen':4},(screen==4)?'linkOn':'')}} - {{:~link('Thresholds','gear',{'screen':5},(screen==5)?'linkOn':'')}} + {{:helper.link('Main', 'gear',{'screen':1},(data.screen==1)?'linkOn':'')}} + {{:helper.link('Vents', 'gear',{'screen':2},(data.screen==2)?'linkOn':'')}} + {{:helper.link('Scrubbers', 'gear',{'screen':3},(data.screen==3)?'linkOn':'')}} + {{:helper.link('Mode', 'gear',{'screen':4},(data.screen==4)?'linkOn':'')}} + {{:helper.link('Thresholds','gear',{'screen':5},(data.screen==5)?'linkOn':'')}}
- {{!-- VENTS --}} - {{if screen == 2}} + + {{if data.screen == 2}}

Vent Pump Settings

- {{for vents}} + {{for data.vents}}
- {{>name}}: {{:state}} + {{>value.name}}: {{:value.state}}
Operating:
- {{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}} - {{if direction=="siphon"}} - {{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'set_dir','dir':'release'})}} + {{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}} + {{if value.direction=="siphon"}} + {{:helper.link('Siphoning','arrowthickstop-1-s',{'id_tag':value.id_tag,'command':'set_dir','dir':'release'})}} {{else}} - {{:~link('Blowing','arrowthick-1-n',{'id_tag':id_tag,'command':'set_dir','dir':'siphon'})}} + {{:helper.link('Blowing','arrowthick-1-n',{'id_tag':value.id_tag,'command':'set_dir','dir':'siphon'})}} {{/if}}
Pressure checks:
- {{:~link('External','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,1)},null,(checks & 1 ?'linkOn':'red'))}} - {{:~link('Internal','power',{'id_tag':id_tag,'command':'checks','val':~xor(checks,2)},null,(checks & 2 ?'linkOn':'red'))}} + {{:helper.link('External','power',{'id_tag':value.id_tag,'command':'checks','val':helper.xor(value.checks,1)},null,(value.checks == 1 ?'linkOn':'red'))}} + {{:helper.link('Internal','power',{'id_tag':value.id_tag,'command':'checks','val':helper.xor(value.checks,2)},null,(value.checks == 2 ?'linkOn':'red'))}}
External pressure target:
- {{:~precisionRound(external,4)}} kPa + {{:helper.precisionRound(value.external,4)}} kPa
- {{:~link('Set','gear',{'id_tag':id_tag,'command':'set_external_pressure'})}} - {{:~link('Reset','arrowrefresh-1-n',{'id_tag':id_tag,'command':'set_external_pressure','val':101.325},null,'linkOn')}} + {{:helper.link('Set','gear',{'id_tag':value.id_tag,'command':'set_external_pressure'})}} + {{:helper.link('Reset','arrowrefresh-1-n',{'id_tag':value.id_tag,'command':'set_external_pressure','val':101.325},null,'linkOn')}}
- {{else}} + {{empty}} No vent pumps located in this area. {{/for}} - {{!-- SCRUBBERS --}} - {{else screen == 3}} + + {{else data.screen == 3}}

Scrubbers

- {{for scrubbers}} + {{for data.scrubbers}}
- {{>name}}: {{:state}} + {{>value.name}}: {{:value.state}}
Operating:
- {{:~link(power ? 'On':'Off','power',{'id_tag':id_tag,'command':'power','val':power?0:1},null,(power?'linkOn':'red'))}} + {{:helper.link(value.power ? 'On':'Off','power',{'id_tag':value.id_tag,'command':'power','val':value.power?0:1},null,(value.power?'linkOn':'red'))}}
Type:
- {{if scrubbing==0}} - {{:~link('Siphoning','arrowthickstop-1-s',{'id_tag':id_tag,'command':'scrubbing','val':1},null,'red')}} + {{if value.scrubbing==0}} + {{:helper.link('Siphoning','arrowthickstop-1-s',{'id_tag':value.id_tag,'command':'scrubbing','val':1},null,'red')}} {{else}} - {{:~link('Scrubbing','transferthick-e-w',{'id_tag':id_tag,'command':'scrubbing','val':0},null,'linkOn')}} + {{:helper.link('Scrubbing','transferthick-e-w',{'id_tag':value.id_tag,'command':'scrubbing','val':0},null,'linkOn')}} {{/if}}
- {{if scrubbing==1}} + {{if value.scrubbing==1}}
Filtering:
- {{:~link('CO2',null,{'id_tag':id_tag,'command':'co2_scrub','val':(filter_co2==0?1:0)},null,(filter_co2?'linkOn':''))}} - {{:~link('Plasma', null,{'id_tag':id_tag,'command':'tox_scrub','val':(filter_tox==0?1:0)},null,(filter_tox?'linkOn':''))}} - {{:~link('N2O',null,{'id_tag':id_tag,'command':'n2o_scrub','val':(filter_n2o==0?1:0)},null,(filter_n2o?'linkOn':''))}} - {{:~link('O2', null,{'id_tag':id_tag,'command':'o2_scrub', 'val':(filter_o2 ==0?1:0)},null,(filter_o2 ?'linkOn':''))}} + {{:helper.link('CO2',null,{'id_tag':value.id_tag,'command':'co2_scrub','val':(value.filter_co2==0?1:0)},null,(value.filter_co2?'linkOn':''))}} + {{:helper.link('Plasma', null,{'id_tag':value.id_tag,'command':'tox_scrub','val':(value.filter_tox==0?1:0)},null,(value.filter_tox?'linkOn':''))}} + {{:helper.link('N2O',null,{'id_tag':value.id_tag,'command':'n2o_scrub','val':(value.filter_n2o==0?1:0)},null,(value.filter_n2o?'linkOn':''))}} + {{:helper.link('O2', null,{'id_tag':value.id_tag,'command':'o2_scrub', 'val':(value.filter_o2 ==0?1:0)},null,(value.filter_o2 ?'linkOn':''))}}
{{/if}}
- {{else}} + {{empty}} No scrubbers located in this area. {{/for}} - {{!-- MODES --}} - {{else screen == 4}} + + {{else data.screen == 4}}

System Mode

- {{for modes}} + {{for data.modes}}
-
{{:~link(name,'gear',{'mode':#index+1},null,(#index+1==~root.mode?'linkOn':''))}}
+
{{:helper.link(value.name,'gear',{'mode':index+1},null,(index+1==data.mode?'linkOn':''))}}
- {{:desc}} + {{:value.desc}}
{{/for}} @@ -226,17 +228,17 @@ Used In File(s): /code/game/machinery/alarm.dm

System Preset

After making a selection, the system will automatically cycle in order to remove contaminants.
- {{for presets}} + {{for data.presets}}
-
{{:~link(name,'gear',{'preset':#index+1},null,(#index+1==~root.preset?'linkOn':''))}}
+
{{:helper.link(value.name,'gear',{'preset':index+1},null,(index+1==value.preset?'linkOn':''))}}
- {{:desc}} + {{:value.desc}}
{{/for}}
- {{!-- SENSORS --}} - {{else screen == 5}} + + {{else data.screen == 5}}

Sensor Thresholds

O2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'oxygen','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'oxygen','var':index+1})}}
N2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'nitrogen','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'nitrogen','var':index+1})}}
CO2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'carbon_dioxide','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'carbon_dioxide','var':index+1})}}
Toxins{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'plasma','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'plasma','var':index+1})}}
Pressure{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'pressure','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'pressure','var':index+1})}}
Temperature (K){{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'temperature','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'temperature','var':index+1})}}
@@ -250,38 +252,38 @@ Used In File(s): /code/game/machinery/alarm.dm - {{for sensors.oxygen}} - + {{for data.sensors.oxygen}} + {{/for}} - {{for sensors.nitrogen}} - + {{for data.sensors.nitrogen}} + {{/for}} - {{for sensors.carbon_dioxide}} - + {{for data.sensors.carbon_dioxide}} + {{/for}} - {{for sensors.plasma}} - + {{for data.sensors.plasma}} + {{/for}} - {{for sensors.pressure}} - + {{for data.sensors.pressure}} + {{/for}} - {{for sensors.temperature}} - + {{for data.sensors.temperature}} + {{/for}} diff --git a/nano/templates/canister.tmpl b/nano/templates/canister.tmpl index 3bd69a4a9bb..e4033eb0164 100644 --- a/nano/templates/canister.tmpl +++ b/nano/templates/canister.tmpl @@ -3,8 +3,8 @@
Tank Label:
-
-
{{:name}}
{{:~link('Relabel', 'pencil', {'relabel' : 1}, (canLabel) ? null : 'disabled')}} +
+
{{:data.name}}
{{:helper.link('Relabel', 'pencil', {'relabel' : 1}, data.canLabel ? null : 'disabled')}}
@@ -12,8 +12,8 @@
Tank Pressure:
-
- {{:tankPressure}} kPa +
+ {{:data.tankPressure}} kPa
@@ -21,19 +21,19 @@
Port Status:
-
- {{:portConnected ? 'Connected' : 'Disconnected'}} +
+ {{:data.portConnected ? 'Connected' : 'Disconnected'}}

Holding Tank Status

-{{if hasHoldingTank}} +{{if data.hasHoldingTank}}
Tank Label:
-
-
{{:holdingTank.name}}
{{:~link('Eject', 'eject', {'remove_tank' : 1})}} +
+
{{:data.holdingTank.name}}
{{:helper.link('Eject', 'eject', {'remove_tank' : 1})}}
@@ -41,11 +41,11 @@
Tank Pressure:
-
- {{:holdingTank.tankPressure}} kPa +
+ {{:data.holdingTank.tankPressure}} kPa
-{{else}} +{{else}}
No holding tank inserted.
 
{{/if}} @@ -57,17 +57,17 @@ Release Pressure:
- {{:~displayBar(releasePressure, minReleasePressure, maxReleasePressure)}} + {{:helper.displayBar(data.releasePressure, data.minReleasePressure, data.maxReleasePressure)}}
- {{:~link('-', null, {'pressure_adj' : -1000}, (releasePressure > minReleasePressure) ? null : 'disabled')}} - {{:~link('-', null, {'pressure_adj' : -100}, (releasePressure > minReleasePressure) ? null : 'disabled')}} - {{:~link('-', null, {'pressure_adj' : -10}, (releasePressure > minReleasePressure) ? null : 'disabled')}} - {{:~link('-', null, {'pressure_adj' : -1}, (releasePressure > minReleasePressure) ? null : 'disabled')}} -
 {{:releasePressure}} kPa 
- {{:~link('+', null, {'pressure_adj' : 1}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('+', null, {'pressure_adj' : 10}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('+', null, {'pressure_adj' : 100}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('+', null, {'pressure_adj' : 1000}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('-', null, {'pressure_adj' : -1000}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}} + {{:helper.link('-', null, {'pressure_adj' : -100}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}} + {{:helper.link('-', null, {'pressure_adj' : -10}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}} + {{:helper.link('-', null, {'pressure_adj' : -1}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}} +
 {{:data.releasePressure}} kPa 
+ {{:helper.link('+', null, {'pressure_adj' : 1}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('+', null, {'pressure_adj' : 10}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('+', null, {'pressure_adj' : 100}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('+', null, {'pressure_adj' : 1000}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}}
@@ -77,7 +77,7 @@ Release Valve:
- {{:~link('Open', 'unlocked', {'toggle' : 1}, valveOpen ? 'selected' : null)}}{{:~link('Close', 'locked', {'toggle' : 1}, valveOpen ? null : 'selected')}} + {{:helper.link('Open', 'unlocked', {'toggle' : 1}, data.valveOpen ? 'selected' : null)}}{{:helper.link('Close', 'locked', {'toggle' : 1}, data.valveOpen ? null : 'selected')}}
diff --git a/nano/templates/chem_dispenser.tmpl b/nano/templates/chem_dispenser.tmpl index 23ba1b29b3a..1dd960f9c8a 100644 --- a/nano/templates/chem_dispenser.tmpl +++ b/nano/templates/chem_dispenser.tmpl @@ -7,7 +7,7 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm Energy:
- {{:~displayBar(energy, 0, maxEnergy, 'good', energy + ' Units')}} + {{:helper.displayBar(data.energy, 0, data.maxEnergy, 'good', data.energy + ' Units')}}
@@ -16,19 +16,17 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm Dispense:
- {{:~link('5', 'gear', {'amount' : 5}, (amount == 5 && !custom) ? 'selected' : null)}} - {{:~link('10', 'gear', {'amount' : 10}, (amount == 10 && !custom) ? 'selected' : null)}} - {{:~link('20', 'gear', {'amount' : 20}, (amount == 20 && !custom) ? 'selected' : null)}} - {{:~link('30', 'gear', {'amount' : 30}, (amount == 30 && !custom) ? 'selected' : null)}} - {{:~link('50', 'gear', {'amount' : 50}, (amount == 50 && !custom) ? 'selected' : null)}} - {{:~link('100', 'gear', {'amount' : 100}, (amount == 100 && !custom) ? 'selected' : null)}} - {{:~link((custom) ? 'Custom: ' + amount : 'Custom', 'gear', {'amount' : 0}, null, (custom) ? 'selected' : null)}} + {{:helper.link('5', 'gear', {'amount' : 5}, (data.amount == 5) ? 'selected' : null)}} + {{:helper.link('10', 'gear', {'amount' : 10}, (data.amount == 10) ? 'selected' : null)}} + {{:helper.link('20', 'gear', {'amount' : 20}, (data.amount == 20) ? 'selected' : null)}} + {{:helper.link('30', 'gear', {'amount' : 30}, (data.amount == 30) ? 'selected' : null)}} + {{:helper.link('50', 'gear', {'amount' : 50}, (data.amount == 50) ? 'selected' : null)}}
 
- {{if glass}} + {{if data.glass}} Drink Dispenser {{else}} Chemical Dispenser @@ -37,8 +35,8 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
- {{for chemicals}} - {{:~link(title, 'circle-arrow-s', commands, null, ~root.glass ? 'fixedLeftWide' : 'fixedLeft')}} + {{for data.chemicals}} + {{:helper.link(value.title, 'circle-arrow-s', value.commands, null, data.glass ? 'fixedLeftWide' : 'fixedLeft')}} {{/for}}
@@ -46,39 +44,43 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
 
- {{if glass}} + {{if data.glass}} Glass {{else}} Beaker {{/if}} Contents
- {{:~link(glass ? 'Eject Glass' : 'Eject Beaker', 'eject', {'ejectBeaker' : 1}, isBeakerLoaded ? null : 'disabled', 'floatRight')}} + {{:helper.link(data.glass ? 'Eject Glass' : 'Eject Beaker', 'eject', {'ejectBeaker' : 1}, data.isBeakerLoaded ? null : 'disabled', 'floatRight')}}
-
+
- {{if isBeakerLoaded}} - Volume: {{:beakerCurrentVolume}} / {{:beakerMaxVolume}}
- {{for beakerContents}} - {{:volume}} units of {{:name}}
- {{else}} + {{if data.isBeakerLoaded}} + Volume: {{:data.beakerCurrentVolume}} / {{:data.beakerMaxVolume}}
+ {{for data.beakerContents}} + {{:value.volume}} units of {{:value.name}}
+ {{empty}} - {{if glass}} - Glass - {{else}} - Beaker - {{/if}} - is empty + {{if data.glass}} + Glass + {{else}} + Beaker + {{/if}} + is empty + {{/for}} {{else}} - No - {{if glass}} - Glass - {{else}} - Beaker - {{/if}} loaded + + No + {{if data.glass}} + Glass + {{else}} + Beaker + {{/if}} + loaded + {{/if}}
diff --git a/nano/templates/comm_console.tmpl b/nano/templates/comm_console.tmpl index 604ec1a0cda..1d830f5b7e9 100644 --- a/nano/templates/comm_console.tmpl +++ b/nano/templates/comm_console.tmpl @@ -2,133 +2,133 @@ Title: Communications Used In File(s): /code/game/machinery/computers/communications.dm --> -{{!-- + +{{if !data.authenticated}} +
Please swipe your ID card. {{:helper.link('Log In','unlocked',{'operation':'login'},null,'fixed')}}
{{else}} - {{if !is_ai}} -
Please remember to {{:~link('Log Out','locked',{'operation':'logout'},null,'fixed')}}
+ {{if !data.is_ai}} +
Please remember to {{:helper.link('Log Out','locked',{'operation':'logout'},null,'fixed')}}
{{/if}}

Emergency Shuttle:

- {{if shuttle.eta}} + {{if data.shuttle.eta}}
ETA:
- {{>shuttle.eta}} + {{>data.shuttle.eta}}
- {{/if}}{{!-- SHUTTLE ETA --}} + {{/if}}
Options:
- {{if shuttle.pos == 0}} - {{if shuttle.on && !is_ai}} - {{:~link('Cancel Shuttle','arrowreturnthick-1-w',{'operation':'cancelshuttle'})}} - {{else !shuttle.on}} - {{:~link('Call Shuttle','arrowthickstop-1-s',{'operation':'callshuttle'})}} + {{if data.shuttle.pos == 0}} + {{if data.shuttle.on && !data.is_ai}} + {{:helper.link('Cancel Shuttle','arrowreturnthick-1-w',{'operation':'cancelshuttle'})}} + {{else !data.shuttle.on}} + {{:helper.link('Call Shuttle','arrowthickstop-1-s',{'operation':'callshuttle'})}} {{/if}} {{/if}}
- {{if screen==1}} - {{!-- MAIN SCREEN --}} + {{if data.screen==1}} +

Menu

- {{if authenticated==2}} + {{if data.authenticated==2}}
- {{:~link('Make an Announcement','alert',{'operation':'announce'})}} + {{:helper.link('Make an Announcement','alert',{'operation':'announce'})}}
- {{if emagged}} - {{:~link('Message [UNKNOWN]','mail-closed',{'operation':'MessageSyndicate'})}} + {{if data.emagged}} + {{:helper.link('Message [UNKNOWN]','mail-closed',{'operation':'MessageSyndicate'})}}
- {{:~link('Reset Relays','refresh',{'operation':'MessageCentcomm'})}} + {{:helper.link('Reset Relays','refresh',{'operation':'MessageCentcomm'})}} {{else}} - {{:~link('Message CentComm','mail-closed',{'operation':'MessageCentcomm'})}} + {{:helper.link('Message CentComm','mail-closed',{'operation':'MessageCentcomm'})}} {{/if}}
{{/if}}
- {{:~link('Change Alert Level','signal-diag',{'operation':'changeseclevel'})}} + {{:helper.link('Change Alert Level','signal-diag',{'operation':'changeseclevel'})}}
- {{:~link('Change Status Displays','info',{'operation':'status'})}} + {{:helper.link('Change Status Displays','info',{'operation':'status'})}}
- {{:~link('Message List','comment',{'operation':'messagelist'})}} + {{:helper.link('Message List','comment',{'operation':'messagelist'})}}
- {{else screen==2}} - {{!-- STATUS DISPLAYS --}} + {{else data.screen==2}} +

Status Displays

- {{:~link('Back','home',{'operation':'main'})}} + {{:helper.link('Back','home',{'operation':'main'})}}

Presets

- {{for stat_display.presets}} + {{for data.stat_display.presets}}
-
{{:~link(label,'info',{'operation':'setstat','statdisp':name},null,(name==~root.stat_display.type?'linkOn':''))}}
+
{{:helper.link(data.label,'info',{'operation':'setstat','statdisp':name},null,(name==data.stat_display.type?'linkOn':''))}}
{{/for}}

Alerts

- {{for stat_display.alerts}} + {{for data.stat_display.alerts}}
-
{{:~link(label,'alert',{'operation':'setstat','statdisp':'alert','alert':alert},null,(name==~root.stat_display.type?'linkOn':''))}}
+
{{:helper.link(data.label,'alert',{'operation':'setstat','statdisp':'alert','alert':alert},null,(name==data.stat_display.type?'linkOn':''))}}
{{/for}}

Messages

- {{if stat_display.type}} + {{if data.stat_display.type}}
-
{{:~link('Line 1:','gear',{'operation':'setmsg1'})}}
-
{{>stat_display.line_1}}
+
{{:helper.link('Line 1:','gear',{'operation':'setmsg1'})}}
+
{{>data.stat_display.line_1}}
-
{{:~link('Line 2:','gear',{'operation':'setmsg2'})}}
-
{{>stat_display.line_2}}
+
{{:helper.link('Line 2:','gear',{'operation':'setmsg2'})}}
+
{{>data.stat_display.line_2}}
{{/if}}
- {{else screen==3}} - {{!-- MESSAGES --}} + {{else data.screen==3}} +

Messages

- {{if current_message}} - {{:~link('Messages','home',{'operation':'messagelist'})}} + {{if data.current_message}} + {{:helper.link('Messages','home',{'operation':'messagelist'})}}

{{>title}}

{{>body}}
{{else}} - {{:~link('Back','home',{'operation':'main'})}} - {{for messages}} + {{:helper.link('Back','home',{'operation':'main'})}} + {{for data.messages}}
- {{:~link('Open','mail-open',{'operation':'messagelist','msgid':id})}} - {{:~link('Delete','close',{'operation':'delmessage','msgid':id},'red')}} - {{>title}} + {{:helper.link('Open','mail-open',{'operation':'messagelist','msgid':data.id})}} + {{:helper.link('Delete','close',{'operation':'delmessage','msgid':data.id},'red')}} + {{>data.title}}
{{/for}} {{/if}} - {{else screen==4}} - {{!-- ALERT LEVEL --}} + {{else data.screen==4}} +

Security Level

- {{:~link('Back','home',{'operation':'main'})}} + {{:helper.link('Back','home',{'operation':'main'})}}
Security Level:
-
{{>str_security_level}}
+
{{>data.str_security_level}}
Presets:
- {{for levels}} - {{:~link(name,'comment',{'operation':'newalertlevel','level':id},null,(id==~root.security_level?'linkOn':''))}} + {{for data.levels}} + {{:helper.link(name,'comment',{'operation':'newalertlevel','level':data.id},null,(data.id==data.security_level?'linkOn':''))}} {{/for}}
- {{/if}}{{!-- SCREEN --}} -{{/if}}{{!-- AUTHENTICATED --}} \ No newline at end of file + {{/if}} +{{/if}} \ No newline at end of file diff --git a/nano/templates/crew_monitor.tmpl b/nano/templates/crew_monitor.tmpl new file mode 100644 index 00000000000..db3e5673b47 --- /dev/null +++ b/nano/templates/crew_monitor.tmpl @@ -0,0 +1,16 @@ + +{{:helper.link('Show Tracker Map', 'pin-s', {'showMap' : 1})}} +
O2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'oxygen','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'oxygen','var':index+1})}}
N2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'nitrogen','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'nitrogen','var':index+1})}}
CO2{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'carbon_dioxide','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'carbon_dioxide','var':index+1})}}
Toxins{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'plasma','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'plasma','var':index+1})}}
Pressure{{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'pressure','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'pressure','var':index+1})}}
Temperature (K){{:~link(#data >= 0 ? ~precisionRound(#data,4) : "OFF",null,{'command':'set_threshold','env':'temperature','var':#index+1})}}{{:helper.link(value >= 0 ? helper.precisionRound(value,4) : "OFF",null,{'command':'set_threshold','env':'temperature','var':index+1})}}
+ {{for data.crewmembers}} + {{if value.sensor_type == 1}} + + {{else value.sensor_type == 2}} + + {{else value.sensor_type == 3}} + + {{/if}} + {{/for}} +
{{:value.name}}{{:value.dead ? "Deceased" : "Living"}}Not Available
{{:value.name}}{{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}})Not Available
{{:value.name}}{{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}}){{:value.area}}({{:value.x}}, {{:value.y}})
\ No newline at end of file diff --git a/nano/templates/crew_monitor_map_content.tmpl b/nano/templates/crew_monitor_map_content.tmpl new file mode 100644 index 00000000000..1a04f3fe9fb --- /dev/null +++ b/nano/templates/crew_monitor_map_content.tmpl @@ -0,0 +1,13 @@ + +{{for data.crewmembers}} + {{if value.sensor_type == 3}} +
+ +
+ {{/if}} +{{/for}} \ No newline at end of file diff --git a/nano/templates/crew_monitor_map_header.tmpl b/nano/templates/crew_monitor_map_header.tmpl new file mode 100644 index 00000000000..f9f5e2f707d --- /dev/null +++ b/nano/templates/crew_monitor_map_header.tmpl @@ -0,0 +1,12 @@ + +{{:helper.link('Show Detail List', 'script', {'showMap' : 0})}} +
+ Zoom Level:  + + + + +
\ No newline at end of file diff --git a/nano/templates/cryo.tmpl b/nano/templates/cryo.tmpl index c8c5610aa61..e8302b07df9 100644 --- a/nano/templates/cryo.tmpl +++ b/nano/templates/cryo.tmpl @@ -5,60 +5,62 @@ Used In File(s): \code\game\machinery\cryo.dm

Cryo Cell Status

- {{if !hasOccupant}} + {{if !data.hasOccupant}}
Cell Unoccupied
{{else}}
- {{:occupant.name}} =>  - {{if occupant.stat == 0}} + {{:data.occupant.name}} =>  + {{if data.occupant.stat == 0}} Conscious - {{else occupant.stat == 1}} + {{else data.occupant.stat == 1}} Unconscious {{else}} DEAD {{/if}}
- {{if occupant.stat < 2}} + {{if data.occupant.stat < 2}}
Health:
- {{if occupant.health >= 0}} - {{:~displayBar(occupant.health, 0, occupant.maxHealth, 'good')}} + {{if data.occupant.health >= 0}} + {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}} {{else}} - {{:~displayBar(occupant.health, 0, occupant.minHealth, 'average alignRight')}} + {{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}} {{/if}} -
{{:~round(occupant.health)}}
+
{{:helper.round(data.occupant.health)}}
=> Brute Damage:
- {{:~displayBar(occupant.bruteLoss, 0, occupant.maxHealth, 'bad')}} -
{{:~round(occupant.bruteLoss)}}
+ {{:helper.displayBar(data.occupant.bruteLoss, 0, data.occupant.maxHealth, 'bad')}} +
{{:helper.round(data.occupant.bruteLoss)}}
=> Resp. Damage:
- {{:~displayBar(occupant.oxyLoss, 0, occupant.maxHealth, 'bad')}} -
{{:~round(occupant.oxyLoss)}}
+ {{:helper.displayBar(data.occupant.oxyLoss, 0, data.occupant.maxHealth, 'bad')}} +
{{:helper.round(data.occupant.oxyLoss)}}
=> Toxin Damage:
- {{:~displayBar(occupant.toxLoss, 0, occupant.maxHealth, 'bad')}} -
{{:~round(occupant.toxLoss)}}
+ {{:helper.displayBar(data.occupant.toxLoss, 0, data.occupant.maxHealth, 'bad')}} +
{{:helper.round(data.occupant.toxLoss)}}
=> Burn Severity:
- {{:~displayBar(occupant.fireLoss, 0, occupant.maxHealth, 'bad')}} -
{{:~round(occupant.fireLoss)}}
+ {{:helper.displayBar(data.occupant.fireLoss, 0, data.occupant.maxHealth, 'bad')}} +
{{:helper.round(data.occupant.fireLoss)}}
{{/if}} {{/if}}
-
Cell Temperature:
- {{:~string('{1} K', cellTemperatureStatus, cellTemperature)}} -
+
+
Cell Temperature:
+ {{:data.cellTemperature}} K +
+

Cryo Cell Operation

@@ -67,10 +69,10 @@ Used In File(s): \code\game\machinery\cryo.dm Cryo Cell Status:
- {{:~link('On', 'power', {'switchOn' : 1}, isOperating ? 'selected' : null)}}{{:~link('Off', 'close', {'switchOff' : 1}, isOperating ? null : 'selected')}} + {{:helper.link('On', 'power', {'switchOn' : 1}, data.isOperating ? 'selected' : null)}}{{:helper.link('Off', 'close', {'switchOff' : 1}, data.isOperating ? null : 'selected')}}
- {{:~link('Eject Occupant', 'arrowreturnthick-1-s', {'ejectOccupant' : 1}, hasOccupant ? null : 'disabled')}} + {{:helper.link('Eject Occupant', 'arrowreturnthick-1-s', {'ejectOccupant' : 1}, data.hasOccupant ? null : 'disabled')}}
 
@@ -79,10 +81,10 @@ Used In File(s): \code\game\machinery\cryo.dm Beaker:
- {{if isBeakerLoaded}} - {{:beakerLabel ? beakerLabel : 'No label'}}
- {{if beakerVolume}} - {{:beakerVolume}} units remaining
+ {{if data.isBeakerLoaded}} + {{:data.beakerLabel ? data.beakerLabel : 'No label'}}
+ {{if data.beakerVolume}} + {{:data.beakerVolume}} units remaining
{{else}} Beaker is empty {{/if}} @@ -91,6 +93,6 @@ Used In File(s): \code\game\machinery\cryo.dm {{/if}}
- {{:~link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, isBeakerLoaded ? null : 'disabled')}} + {{:helper.link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, data.isBeakerLoaded ? null : 'disabled')}}
\ No newline at end of file diff --git a/nano/templates/dna_modifier.tmpl b/nano/templates/dna_modifier.tmpl index b064de84b85..9a2804ba987 100644 --- a/nano/templates/dna_modifier.tmpl +++ b/nano/templates/dna_modifier.tmpl @@ -5,54 +5,54 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm

Status

- {{if !hasOccupant}} + {{if !data.hasOccupant}}
Cell Unoccupied
{{else}}
- {{:occupant.name}} =>  - {{if occupant.stat == 0}} + {{:data.occupant.name}} =>  + {{if data.occupant.stat == 0}} Conscious - {{else occupant.stat == 1}} + {{else data.occupant.stat == 1}} Unconscious {{else}} DEAD {{/if}}
- {{if !occupant.isViableSubject || !occupant.uniqueIdentity || !occupant.structuralEnzymes}} + {{if !data.occupant.isViableSubject || !data.occupant.uniqueIdentity || !data.occupant.structuralEnzymes}}
The occupant's DNA structure is ruined beyond recognition, please insert a subject with an intact DNA structure.
- {{else occupant.stat < 2}} + {{else data.occupant.stat < 2}}
Health:
- {{if occupant.health >= 0}} - {{:~displayBar(occupant.health, 0, occupant.maxHealth, 'good')}} + {{if data.occupant.health >= 0}} + {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}} {{else}} - {{:~displayBar(occupant.health, 0, occupant.minHealth, 'average alignRight')}} + {{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}} {{/if}} -
{{:~round(occupant.health)}}
+
{{:helper.round(data.occupant.health)}}
Radiation:
- {{:~displayBar(occupant.radiationLevel, 0, 100, 'average')}} -
{{:~round(occupant.radiationLevel)}}
+ {{:helper.displayBar(data.occupant.radiationLevel, 0, 100, 'average')}} +
{{:helper.round(data.occupant.radiationLevel)}}
Unique Enzymes:
-
{{:occupant.uniqueEnzymes ? occupant.uniqueEnzymes : 'Unknown'}}
+
{{:data.occupant.uniqueEnzymes ? data.occupant.uniqueEnzymes : 'Unknown'}}
{{/if}} {{/if}} @@ -61,65 +61,65 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm

Operations

- {{:~link('Modify U.I.', 'link', {'selectMenuKey' : 'ui'}, selectedMenuKey == 'ui' ? 'selected' : null)}} - {{:~link('Modify S.E.', 'link', {'selectMenuKey' : 'se'}, selectedMenuKey == 'se' ? 'selected' : null)}} - {{:~link('Transfer Buffers', 'disk', {'selectMenuKey' : 'buffer'}, selectedMenuKey == 'buffer' ? 'selected' : null)}} - {{:~link('Rejuvenators', 'plusthick', {'selectMenuKey' : 'rejuvenators'}, selectedMenuKey == 'rejuvenators' ? 'selected' : null)}} + {{:helper.link('Modify U.I.', 'link', {'selectMenuKey' : 'ui'}, data.selectedMenuKey == 'ui' ? 'selected' : null)}} + {{:helper.link('Modify S.E.', 'link', {'selectMenuKey' : 'se'}, data.selectedMenuKey == 'se' ? 'selected' : null)}} + {{:helper.link('Transfer Buffers', 'disk', {'selectMenuKey' : 'buffer'}, data.selectedMenuKey == 'buffer' ? 'selected' : null)}} + {{:helper.link('Rejuvenators', 'plusthick', {'selectMenuKey' : 'rejuvenators'}, data.selectedMenuKey == 'rejuvenators' ? 'selected' : null)}}
 
-{{if !selectedMenuKey || selectedMenuKey == 'ui'}} +{{if !data.selectedMenuKey || data.selectedMenuKey == 'ui'}}

Modify Unique Identifier

- {{:~displayDNABlocks(occupant.uniqueIdentity, selectedUIBlock, selectedUISubBlock, dnaBlockSize, 'UI')}} + {{:helper.displayDNABlocks(data.occupant.uniqueIdentity, data.selectedUIBlock, data.selectedUISubBlock, data.dnaBlockSize, 'UI')}}
Target:
- {{:~link('-', null, {'changeUITarget' : 0}, selectedUITarget > 0 ? null : 'disabled')}} -
 {{:selectedUITargetHex}} 
- {{:~link('+', null, {'changeUITarget' : 1}, selectedUITarget < 15 ? null : 'disabled')}} + {{:helper.link('-', null, {'changeUITarget' : 0}, (data.selectedUITarget > 0) ? null : 'disabled')}} +
 {{:data.selectedUITargetHex}} 
+ {{:helper.link('+', null, {'changeUITarget' : 1}, (data.selectedUITarget < 15) ? null : 'disabled')}}
- {{:~link('Irradiate Block', 'radiation', {'pulseUIRadiation' : 1}, !occupant.isViableSubject ? 'disabled' : null)}} + {{:helper.link('Irradiate Block', 'radiation', {'pulseUIRadiation' : 1}, !data.occupant.isViableSubject ? 'disabled' : null)}}
-{{else selectedMenuKey == 'se'}} +{{else data.selectedMenuKey == 'se'}}

Modify Structural Enzymes

- {{:~displayDNABlocks(occupant.structuralEnzymes, selectedSEBlock, selectedSESubBlock, dnaBlockSize, 'SE')}} + {{:helper.displayDNABlocks(data.occupant.structuralEnzymes, data.selectedSEBlock, data.selectedSESubBlock, data.dnaBlockSize, 'SE')}}
- {{:~link('Irradiate Block', 'radiation', {'pulseSERadiation' : 1}, !occupant.isViableSubject ? 'disabled' : null)}} + {{:helper.link('Irradiate Block', 'radiation', {'pulseSERadiation' : 1}, !data.occupant.isViableSubject ? 'disabled' : null)}}
-{{else selectedMenuKey == 'buffer'}} +{{else data.selectedMenuKey == 'buffer'}}

Transfer Buffers

- {{for buffers}} -

Buffer {{:#index + 1}}

+ {{for data.buffers}} +

Buffer {{:(index + 1)}}

Load Data:
- {{:~link('Subject U.I.', 'link', {'bufferOption' : 'saveUI', 'bufferId' : (#index + 1)}, !~root.hasOccupant ? 'disabled' : null)}} - {{:~link('Subject U.I. + U.E.', 'link', {'bufferOption' : 'saveUIAndUE', 'bufferId' : (#index + 1)}, !~root.hasOccupant ? 'disabled' : null)}} - {{:~link('Subject S.E.', 'link', {'bufferOption' : 'saveSE', 'bufferId' : (#index + 1)}, !~root.hasOccupant ? 'disabled' : null)}} - {{:~link('From Disk', 'disk', {'bufferOption' : 'loadDisk', 'bufferId' : (#index + 1)}, !~root.hasDisk || !~root.disk.data ? 'disabled' : null)}} + {{:helper.link('Subject U.I.', 'link', {'bufferOption' : 'saveUI', 'bufferId' : (index + 1)}, !data.hasOccupant ? 'disabled' : null)}} + {{:helper.link('Subject U.I. + U.E.', 'link', {'bufferOption' : 'saveUIAndUE', 'bufferId' : (index + 1)}, !data.hasOccupant ? 'disabled' : null)}} + {{:helper.link('Subject S.E.', 'link', {'bufferOption' : 'saveSE', 'bufferId' : (index + 1)}, !data.hasOccupant ? 'disabled' : null)}} + {{:helper.link('From Disk', 'disk', {'bufferOption' : 'loadDisk', 'bufferId' : (index + 1)}, (!data.hasDisk || !data.disk.data) ? 'disabled' : null)}}
- {{if data}} + {{if value.data}}
Label:
- {{:~link(label, 'document-b', {'bufferOption' : 'changeLabel', 'bufferId' : (#parent.index + 1)})}} + {{:helper.link(value.label, 'document-b', {'bufferOption' : 'changeLabel', 'bufferId' : (index + 1)})}}
@@ -127,7 +127,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Subject:
- {{:owner ? owner : 'Unknown'}} + {{:value.owner ? value.owner : 'Unknown'}}
@@ -135,8 +135,8 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Stored Data:
- {{:data == 'ui' ? 'Unique Identifiers' : 'Structural Enzymes'}} - {{:ue ? ' + Unique Enzymes' : ''}} + {{:value.data == 'ui' ? 'Unique Identifiers' : 'Structural Enzymes'}} + {{:value.ue ? ' + Unique Enzymes' : ''}}
{{else}} @@ -151,11 +151,11 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Options:
- {{:~link('Clear', 'trash', {'bufferOption' : 'clear', 'bufferId' : (#index + 1)}, !data ? 'disabled' : null)}} - {{:~link('Injector', ~root.isInjectorReady ? 'pencil' : 'clock', {'bufferOption' : 'createInjector', 'bufferId' : (#index + 1)}, !~root.isInjectorReady || !data ? 'disabled' : null)}} - {{:~link('Block Injector', ~root.isInjectorReady ? 'pencil' : 'clock', {'bufferOption' : 'createInjector', 'bufferId' : (#index + 1), 'createBlockInjector' : 1}, !~root.isInjectorReady || !data ? 'disabled' : null)}} - {{:~link('Transfer', 'radiation', {'bufferOption' : 'transfer', 'bufferId' : (#index + 1)}, !~root.hasOccupant || !data ? 'disabled' : null)}} - {{:~link('Save To Disk', 'disk', {'bufferOption' : 'saveDisk', 'bufferId' : (#index + 1)}, !data || !~root.hasDisk ? 'disabled' : null)}} + {{:helper.link('Clear', 'trash', {'bufferOption' : 'clear', 'bufferId' : (index + 1)}, !value.data ? 'disabled' : null)}} + {{:helper.link('Injector', data.isInjectorReady ? 'pencil' : 'clock', {'bufferOption' : 'createInjector', 'bufferId' : (index + 1)}, (!data.isInjectorReady || !value.data) ? 'disabled' : null)}} + {{:helper.link('Block Injector', data.isInjectorReady ? 'pencil' : 'clock', {'bufferOption' : 'createInjector', 'bufferId' : (index + 1), 'createBlockInjector' : 1}, (!data.isInjectorReady || !value.data) ? 'disabled' : null)}} + {{:helper.link('Transfer', 'radiation', {'bufferOption' : 'transfer', 'bufferId' : (index + 1)}, (!data.hasOccupant || !value.data) ? 'disabled' : null)}} + {{:helper.link('Save To Disk', 'disk', {'bufferOption' : 'saveDisk', 'bufferId' : (index + 1)}, (!value.data || !data.hasDisk) ? 'disabled' : null)}}
@@ -163,14 +163,14 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm

Data Disk

- {{if hasDisk}} - {{if disk.data}} + {{if data.hasDisk}} + {{if data.disk.data}}
Label:
- {{:disk.label ? disk.label : 'No Label'}} + {{:data.disk.label ? data.disk.label : 'No Label'}}
@@ -178,7 +178,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Subject:
- {{:disk.owner ? disk.owner : 'Unknown'}} + {{:data.disk.owner ? data.disk.owner : 'Unknown'}}
@@ -186,8 +186,8 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Stored Data:
- {{:disk.data == 'ui' ? 'Unique Identifiers' : 'Structural Enzymes'}} - {{:disk.ue ? ' + Unique Enzymes' : ''}} + {{:data.disk.data == 'ui' ? 'Unique Identifiers' : 'Structural Enzymes'}} + {{:data.disk.ue ? ' + Unique Enzymes' : ''}}
{{else}} @@ -206,26 +206,26 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{/if}}
- Options: + Options:
- {{:~link('Wipe Disk', 'trash', {'bufferOption' : 'wipeDisk'}, !hasDisk || !disk.data ? 'disabled' : null)}} - {{:~link('Eject Disk', 'eject', {'bufferOption' : 'ejectDisk'}, !hasDisk ? 'disabled' : null)}} + {{:helper.link('Wipe Disk', 'trash', {'bufferOption' : 'wipeDisk'}, (!data.hasDisk || !data.disk.data) ? 'disabled' : null)}} + {{:helper.link('Eject Disk', 'eject', {'bufferOption' : 'ejectDisk'}, !data.hasDisk ? 'disabled' : null)}}
-{{else selectedMenuKey == 'rejuvenators'}} +{{else data.selectedMenuKey == 'rejuvenators'}}

Rejuvenators

Inject:
- {{:~link('5', 'pencil', {'injectRejuvenators' : 5}, !hasOccupant || !beakerVolume ? 'disabled' : null)}} - {{:~link('10', 'pencil', {'injectRejuvenators' : 10}, !hasOccupant || !beakerVolume ? 'disabled' : null)}} - {{:~link('20', 'pencil', {'injectRejuvenators' : 20}, !hasOccupant || !beakerVolume ? 'disabled' : null)}} - {{:~link('30', 'pencil', {'injectRejuvenators' : 30}, !hasOccupant || !beakerVolume ? 'disabled' : null)}} - {{:~link('50', 'pencil', {'injectRejuvenators' : 50}, !hasOccupant || !beakerVolume ? 'disabled' : null)}} + {{:helper.link('5', 'pencil', {'injectRejuvenators' : 5}, (!data.hasOccupant || !data.beakerVolume) ? 'disabled' : null)}} + {{:helper.link('10', 'pencil', {'injectRejuvenators' : 10}, (!data.hasOccupant || !data.beakerVolume) ? 'disabled' : null)}} + {{:helper.link('20', 'pencil', {'injectRejuvenators' : 20}, (!data.hasOccupant || !data.beakerVolume) ? 'disabled' : null)}} + {{:helper.link('30', 'pencil', {'injectRejuvenators' : 30}, (!data.hasOccupant || !data.beakerVolume) ? 'disabled' : null)}} + {{:helper.link('50', 'pencil', {'injectRejuvenators' : 50}, (!data.hasOccupant || !data.beakerVolume) ? 'disabled' : null)}}
 
@@ -234,10 +234,10 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Beaker:
- {{if isBeakerLoaded}} - {{:beakerLabel ? beakerLabel : 'No label'}}
- {{if beakerVolume}} - {{:beakerVolume}} units remaining
+ {{if data.isBeakerLoaded}} + {{:data.beakerLabel ? data.beakerLabel : 'No label'}}
+ {{if data.beakerVolume}} + {{:data.beakerVolume}} units remaining
{{else}} Beaker is empty {{/if}} @@ -246,23 +246,23 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm {{/if}}
- {{:~link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, isBeakerLoaded ? null : 'disabled')}} + {{:helper.link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, data.isBeakerLoaded ? null : 'disabled')}}
{{/if}}
 
-{{if !selectedMenuKey || selectedMenuKey == 'ui' || selectedMenuKey == 'se'}} +{{if !data.selectedMenuKey || data.selectedMenuKey == 'ui' || data.selectedMenuKey == 'se'}}

Radiation Emitter Settings

Intensity:
- {{:~link('-', null, {'radiationIntensity' : 0}, radiationIntensity > 1 ? null : 'disabled')}} -
 {{:radiationIntensity}} 
- {{:~link('+', null, {'radiationIntensity' : 1}, radiationIntensity < 10 ? null : 'disabled')}} + {{:helper.link('-', null, {'radiationIntensity' : 0}, (data.radiationIntensity > 1) ? null : 'disabled')}} +
 {{:data.radiationIntensity}} 
+ {{:helper.link('+', null, {'radiationIntensity' : 1}, (data.radiationIntensity < 10) ? null : 'disabled')}}
@@ -270,9 +270,9 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Duration:
- {{:~link('-', null, {'radiationDuration' : 0}, radiationDuration > 2 ? null : 'disabled')}} -
 {{:radiationDuration}} 
- {{:~link('+', null, {'radiationDuration' : 1}, radiationDuration < 20 ? null : 'disabled')}} + {{:helper.link('-', null, {'radiationDuration' : 0}, (data.radiationDuration > 2) ? null : 'disabled')}} +
 {{:data.radiationDuration}} 
+ {{:helper.link('+', null, {'radiationDuration' : 1}, (data.radiationDuration < 20) ? null : 'disabled')}}
@@ -280,7 +280,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm  
- {{:~link('Pulse Radiation', 'radiation', {'pulseRadiation' : 1}, !hasOccupant ? 'disabled' : null)}} + {{:helper.link('Pulse Radiation', 'radiation', {'pulseRadiation' : 1}, !data.hasOccupant ? 'disabled' : null)}}
{{/if}} @@ -294,7 +294,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Occupant:
- {{:~link('Eject Occupant', 'eject', {'ejectOccupant' : 1}, locked || !hasOccupant || irradiating ? 'disabled' : null)}} + {{:helper.link('Eject Occupant', 'eject', {'ejectOccupant' : 1}, data.locked || !data.hasOccupant || data.irradiating ? 'disabled' : null)}}
@@ -302,16 +302,16 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm Door Lock:
- {{:~link('Engaged', 'locked', {'toggleLock' : 1}, locked ? 'selected' : !hasOccupant ? 'disabled' : null)}} - {{:~link('Disengaged', 'unlocked', {'toggleLock' : 1}, !locked ? 'selected' : irradiating ? 'disabled' : null)}} + {{:helper.link('Engaged', 'locked', {'toggleLock' : 1}, data.locked ? 'selected' : !data.hasOccupant ? 'disabled' : null)}} + {{:helper.link('Disengaged', 'unlocked', {'toggleLock' : 1}, !data.locked ? 'selected' : data.irradiating ? 'disabled' : null)}}
-{{if irradiating}} +{{if data.irradiating}}

Irradiating Subject

-

For {{:irradiating}} seconds.

+

For {{:data.irradiating}} seconds.

{{/if}} diff --git a/nano/templates/geoscanner.tmpl b/nano/templates/geoscanner.tmpl index d3205e2ebe7..351ddc4cf76 100644 --- a/nano/templates/geoscanner.tmpl +++ b/nano/templates/geoscanner.tmpl @@ -6,10 +6,10 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan

Machine Status

- {{:~link(scanning ? 'Halt Scan' : 'Begin Scan', 'signal-diag', {'scanItem' : 1}, null)}} + {{:helper.link(data.scanning ? 'Halt Scan' : 'Begin Scan', 'signal-diag', {'scanItem' : 1}, null)}}
- {{:~link('Eject item', 'eject', {'ejectItem' : 1}, (scanned_item && !scanning) ? null : 'disabled')}} + {{:helper.link('Eject item', 'eject', {'ejectItem' : 1}, (data.scanned_item && !data.scanning) ? null : 'disabled')}}
@@ -17,8 +17,8 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Item:
- {{if scanned_item}} - {{:scanned_item}} + {{if data.scanned_item}} + {{:data.scanned_item}} {{else}} No item inserted {{/if}} @@ -27,8 +27,8 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Heuristic analysis:
- {{if scanned_item_desc}} - {{:scanned_item_desc}} + {{if data.scanned_item_desc}} + {{:data.scanned_item_desc}} {{/if}}
@@ -38,11 +38,11 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Scan progress:
- {{:~displayBar(scan_progress, 0, 100, 'good')}} - {{:scan_progress}} % + {{:helper.displayBar(data.scan_progress, 0, 100, 'good')}} + {{:data.scan_progress}} %
- {{if scan_progress >= 100}} + {{if data.scan_progress >= 100}} Scan completed successfully. {{/if}}
@@ -50,11 +50,11 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Vacuum seal integrity:
- {{:~displayBar(scanner_seal_integrity, 0, 100, (scanner_seal_integrity < 66 ? (scanner_seal_integrity < 33 ? 'bad' : 'average') : 'good'))}} - {{:scanner_seal_integrity}} % + {{:helper.displayBar(data.scanner_seal_integrity, 0, 100, ((data.scanner_seal_integrity < 66) ? ((data.scanner_seal_integrity < 33) ? 'bad' : 'average') : 'good'))}} + {{:data.scanner_seal_integrity}} %
- {{if scanner_seal_integrity < 25}} + {{if data.scanner_seal_integrity < 25}} Warning! Vacuum seal breach will result in scan failure! {{/if}}
@@ -64,11 +64,11 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
MASER Efficiency:
- {{:~displayBar(maser_efficiency, 1, 100, (maser_efficiency < 66 ? (maser_efficiency < 33 ? 'bad' : 'average') : 'good'))}} - {{:maser_efficiency}} % + {{:helper.displayBar(data.maser_efficiency, 1, 100, ((data.maser_efficiency < 66) ? ((data.maser_efficiency) < 33 ? 'bad' : 'average') : 'good'))}} + {{:data.maser_efficiency}} %
- {{if maser_efficiency < 50}} + {{if data.maser_efficiency < 50}} Match wavelengths to progress the scan. {{/if}}
@@ -76,25 +76,25 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Optimal Wavelength:
- {{:~displayBar(optimal_wavelength, 1, 10000, 'good')}} - {{:optimal_wavelength}} MHz + {{:helper.displayBar(data.optimal_wavelength, 1, 10000, 'good')}} + {{:data.optimal_wavelength}} MHz
Current Wavelength:
- {{:~displayBar(maser_wavelength, 1, 10000, 'good')}} - {{:maser_wavelength}} MHz + {{:helper.displayBar(data.maser_wavelength, 1, 10000, 'good')}} + {{:data.maser_wavelength}} MHz
- {{:~link('-2 KHz', null, {'maserWavelength' : -2}, null)}} - {{:~link('-1 KHz', null, {'maserWavelength' : -1}, null)}} - {{:~link('-0.5 KHz', null, {'maserWavelength' : -0.5}, null)}} + {{:helper.link('-2 KHz', null, {'maserWavelength' : -2}, null)}} + {{:helper.link('-1 KHz', null, {'maserWavelength' : -1}, null)}} + {{:helper.link('-0.5 KHz', null, {'maserWavelength' : -0.5}, null)}}
- {{:~link('+0.5 KHz', null, {'maserWavelength' : 0.5}, null)}} - {{:~link('+1 KHz', null, {'maserWavelength' : 1}, null)}} - {{:~link('+2 KHz', null, {'maserWavelength' : 2}, null)}} + {{:helper.link('+0.5 KHz', null, {'maserWavelength' : 0.5}, null)}} + {{:helper.link('+1 KHz', null, {'maserWavelength' : 1}, null)}} + {{:helper.link('+2 KHz', null, {'maserWavelength' : 2}, null)}}
@@ -102,18 +102,18 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Centrifuge speed:
- {{:~displayBar(scanner_rpm, 0, 1000, 'good')}} - {{:scanner_rpm}} RPM + {{:helper.displayBar(data.scanner_rpm, 0, 1000, 'good')}} + {{:data.scanner_rpm}} RPM
Internal temperature:
- {{:~displayBar(scanner_temperature, 0, 1273, (scanner_temperature > 250 ? (scanner_temperature > 1000 ? 'bad' : 'average') : 'good')))}} - {{:scanner_temperature}} K + {{:helper.displayBar(data.scanner_temperature, 0, 1273, (data.scanner_temperature > 250 ? (data.scanner_temperature > 1000 ? 'bad' : 'average') : 'good')))}} + {{:data.scanner_temperature}} K
- {{if scanner_temperature > 1000}} + {{if data.scanner_temperature > 1000}} Warning! Exceeding 1200K will result in scan failure! {{/if}}
@@ -123,12 +123,12 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Ambient radiation:
- {{:~displayBar(radiation, 0, 100, (radiation > 15 ? (radiation > 65 ? 'bad' : 'average') : 'good'))}} - {{:radiation}} mSv + {{:helper.displayBar(data.radiation, 0, 100, ((data.radiation > 15) ? ((data.radiation > 65) ? 'bad' : 'average') : 'good'))}} + {{:data.radiation}} mSv
- {{:~link(rad_shield_on ? 'Disable Radiation Shielding' : 'Enable Radiation Shielding', 'radiation', {'toggle_rad_shield' : 1}, null)}} - {{if rad_shield_on}} + {{:helper.link(data.rad_shield_on ? 'Disable Radiation Shielding' : 'Enable Radiation Shielding', 'radiation', {'toggle_rad_shield' : 1}, null)}} + {{if data.rad_shield_on}} Shield blocking scanner. {{/if}}
@@ -138,11 +138,11 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Coolant remaining:
- {{:~displayBar(unused_coolant_per, 0, 100, (unused_coolant_per < 66 ? (unused_coolant_per < 33 ? 'bad' : 'average') : 'good'))}} - {{:unused_coolant_abs}} u + {{:helper.displayBar(data.unused_coolant_per, 0, 100, ((data.unused_coolant_per < 66) ? ((data.unused_coolant_per < 33) ? 'bad' : 'average') : 'good'))}} + {{:data.unused_coolant_abs}} u
- {{if unused_coolant_per < 20}} + {{if data.unused_coolant_per < 20}} Warning! Coolant stocks low! {{/if}}
@@ -150,28 +150,28 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan
Coolant flow rate:
- {{:~displayBar(coolant_usage_rate, 0, 10, 'good')}} - {{:coolant_usage_rate}} u/s + {{:helper.displayBar(data.coolant_usage_rate, 0, 10, 'good')}} + {{:data.coolant_usage_rate}} u/s
- {{:~link('Min u/s', null, {'coolantRate' : -10}, null)}} - {{:~link('-3 u/s', null, {'coolantRate' : -3}, null)}} - {{:~link('-1 u/s', null, {'coolantRate' : -1}, null)}} + {{:helper.link('Min u/s', null, {'coolantRate' : -10}, null)}} + {{:helper.link('-3 u/s', null, {'coolantRate' : -3}, null)}} + {{:helper.link('-1 u/s', null, {'coolantRate' : -1}, null)}}
- {{:~link('+1 u/s', null, {'coolantRate' : 1}, null)}} - {{:~link('+3 u/s', null, {'coolantRate' : 3}, null)}} - {{:~link('Max u/s', null, {'coolantRate' : 10}, null)}} + {{:helper.link('+1 u/s', null, {'coolantRate' : 1}, null)}} + {{:helper.link('+3 u/s', null, {'coolantRate' : 3}, null)}} + {{:helper.link('Max u/s', null, {'coolantRate' : 10}, null)}}
Coolant purity:
- {{:~displayBar(coolant_purity, 0, 100, (coolant_purity < 66 ? (coolant_purity < 33 ? 'bad' : 'average') : 'good'))}} - {{:coolant_purity}} % + {{:helper.displayBar(data.coolant_purity, 0, 100, ((data.coolant_purity < 66) ? ((data.coolant_purity < 33) ? 'bad' : 'average') : 'good'))}} + {{:data.coolant_purity}} %
- {{if coolant_purity < 0.5}} + {{if data.coolant_purity < 0.5}} Warning! Check coolant for contaminants! {{/if}}
@@ -180,6 +180,6 @@ Used In File(s): \code\modules\research\xenoarchaeology\machinery\geosample_scan

Latest Results

- {{:last_scan_data}} + {{:data.last_scan_data}}
diff --git a/nano/templates/layout_default.tmpl b/nano/templates/layout_default.tmpl new file mode 100644 index 00000000000..ad63ff3bfe5 --- /dev/null +++ b/nano/templates/layout_default.tmpl @@ -0,0 +1,30 @@ +
{{:config.title}}
+ +
+
Initiating...
+
\ No newline at end of file diff --git a/nano/templates/pda.tmpl b/nano/templates/pda.tmpl index 3f7ee3d3146..8b59e4ac124 100644 --- a/nano/templates/pda.tmpl +++ b/nano/templates/pda.tmpl @@ -1,18 +1,18 @@ - -{{if owner}} +{{if data.owner}}
Functions:
- - {{:~link('Close', 'gear', {'choice' : "Close"}, null, 'fixedLeft')}} - {{if idInserted}} {{:~link('Update PDA Info', 'eject', {'choice' : "UpdateInfo"}, null, 'fixedLeftWide')}} {{/if}} - {{if mode != 0}} {{:~link('Return', 'arrowreturn-1-w', {'choice' : "Return"}, null, 'fixedLeft')}} {{/if}} + + {{:helper.link('Close', 'gear', {'choice' : "Close"}, null, 'fixedLeft')}} + {{if data.idInserted}} {{:helper.link('Update PDA Info', 'eject', {'choice' : "UpdateInfo"}, null, 'fixedLeftWide')}} {{/if}} + {{if data.mode != 0}} {{:helper.link('Return', 'arrowreturn-1-w', {'choice' : "Return"}, null, 'fixedLeft')}} {{/if}}

@@ -21,913 +21,933 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm Station Time:
- {{:stationTime}} + {{:data.stationTime}}

- {{if mode == 0}} -
-
- Owner: -
-
- {{:owner}}, {{:ownjob}} -
-
-
-
-
- ID: -
-
- {{:~link(idLink, 'eject', {'choice' : "Authenticate"}, idInserted ? null : 'disabled', idInserted ? 'fixedLeftWidest' : 'fixedLeft')}} -
-
-
-
-
- Cartridge: -
-
- {{if cart_loaded==1}} - {{:~link(cartridge.name, 'eject', {'choice' : "Eject"},null,null)}} - {{else}} - {{:~link('None', 'eject', {'choice' : "Eject"},'disabled',null)}} - {{/if}} -
-
-
-

Functions

-
-
-
- General: -
-
- {{:~link('Notekeeper', 'note', {'choice' : "1"}, null, 'fixedLeftWide')}} - {{:~link('Messenger', newMessage ? 'mail-closed' : 'mail-open', {'choice' : "2"}, null, 'fixedLeftWide')}} - {{:~link('Crew Manifest', 'contact', {'choice' : "41"}, null, 'fixedLeftWide')}} -
-
-
- {{if cartridge}} - {{if cartridge.access.access_clown == 1}} + + + {{if data.mode == 0}}
-
- Clown: -
-
- {{:~link('Honk Synthesizer', 'gear', {'choice' : "Honk"}, null, 'fixedLeftWide')}} -
-
-
- {{/if}} - {{if cartridge.access.access_engine == 1}} -
-
- Engineering: -
-
- {{:~link('Power Monitor', 'alert', {'choice' : "43"}, null, 'fixedLeftWide')}} -
-
-
- {{/if}} - {{if cartridge.access.access_medical == 1}} -
-
- Medical: -
-
- {{:~link('Medical Records', 'gear', {'choice' : "44"}, null, 'fixedLeftWide')}} - {{:~link(scanmode == 1 ? 'Disable Med Scanner' : 'Enable Med Scanner', 'gear', {'choice' : "Medical Scan"}, null , 'fixedLeftWide')}} -
-
-
- {{/if}} - {{if cartridge.access.access_security == 1}} -
-
- Security: -
-
- {{:~link('Security Records', 'gear', {'choice' : "45"}, null, 'fixedLeftWide')}} - {{if cartridge.radio ==1}} {{:~link('Security Bot Access', 'gear', {'choice' : "46"}, null, 'fixedLeftWide')}} {{/if}} -
-
-
-
- {{/if}} - {{if cartridge.access.access_quartermaster == 1}} -
-
- Quartermaster: -
-
- {{:~link('Supply Records', 'gear', {'choice' : "47"}, null, 'fixedLeftWide')}} - {{if cartridge.radio == 3}} {{:~link('Delivery Bot Control', 'gear', {'choice' : "48"}, null, 'fixedLeftWide')}} {{/if}} -
-
-
-
- {{/if}} - {{/if}} -
-
-
- Utilities: -
-
- {{if cartridge}} - {{if cartridge.access.access_status_display == 1}} {{:~link('Status Display', 'gear', {'choice' : "42"}, null, 'fixedLeftWide')}}{{/if}} - {{if cartridge.access.access_janitor==1}} {{:~link('Custodial Locator', 'gear', {'choice' : "49"}, null, 'fixedLeftWide')}} {{/if}} - {{if cartridge.radio == 2}} {{:~link('Signaler System', 'gear', {'choice' : "40"}, null, 'fixedLeftWide')}} {{/if}} - {{if cartridge.access.access_reagent_scanner==1}} {{:~link(scanmode == 3 ? 'Disable Reagent Scanner' : 'Enable Reagent Scanner', 'gear', {'choice' : "Reagent Scan"}, null, 'fixedLeftWider')}} {{/if}} - {{if cartridge.access.access_engine==1}} {{:~link(scanmode == 4 ? 'Disable Halogen Counter' : 'Enable Halogen Counter', 'gear', {'choice' : "Halogen Counter"}, null, 'fixedLeftWider')}} {{/if}} - {{if cartridge.access.access_atmos==1}} {{:~link(scanmode == 5 ? 'Disable Gas Scanner' : 'Enable Gas Scanner', 'gear', {'choice' : "Gas Scan"}, null, 'fixedLeftWide')}} {{/if}} - {{if cartridge.access.access_remote_door==1}}{{:~link('Toggle Door', 'gear', {'choice' : "Toggle Door"}, null, 'fixedLeftWide')}} {{/if}} - {{/if}} - {{:~link('Atmospheric Scan', 'gear', {'choice' : "3"}, null, 'fixedLeftWide')}} - {{:~link(fon==1 ? 'Disable Flashlight' : 'Enable Flashlight', 'lightbulb', {'choice' : "Light"}, null,'fixedLeftWide')}} -
-
- {{if pai}} -
-
- PAI Utilities: -
-
- {{:~link('Configuration', 'gear', {'choice' : "pai", 'option' : "1"}, null, 'fixedLeft')}} - {{:~link('Eject pAI', 'eject', {'choice' : "pai", 'option' : "2"}, null, 'fixedLeft')}} -
-
- {{/if}} - {{/if}} - {{if mode == 1}} -
-
- Notes: -
-
-
-
-
- {{:note}} -
-
-
-
-
- {{:~link('Edit Notes', 'gear', {'choice' : "Edit"}, null, 'fixedLeft')}} -
-
- - - {{else mode == 2}} -

SpaceMessenger V4.0.1

-
-
- Messenger Functions: -
- -
- {{:~link(silent==1 ? 'Ringer: Off' : 'Ringer: On', silent==1 ? 'volume-off' : 'volume-on', {'choice' : "Toggle Ringer"}, null, 'fixedLeftWide')}} - {{:~link(toff==1 ? 'Messenger: Off' : 'Messenger: On',toff==1 ? 'close':'check', {'choice' : "Toggle Messenger"}, null, 'fixedLeftWide')}} - {{:~link('Set Ringtone', 'comment', {'choice' : "Ringtone"}, null, 'fixedLeftWide')}} - {{:~link('Delete all Conversations', 'trash', {'choice' : "Clear", 'option' : "All"}, null, 'fixedLeftWider')}} -
-
- {{if toff == 0}} -

- {{if cartridge}} - {{if cartridge.charges}} -
- {{:cartridge.charges}} - {{if cartridge.type == "/obj/item/weapon/cartridge/syndicate"}} detonation charges left. {{/if}} - {{if cartridge.type == "/obj/item/weapon/cartridge/clown" || cartridge.type == "/obj/item/weapon/cartridge/mime"}} viral files left. {{/if}} -

-
- {{/if}} - {{/if}} - - {{if pda_count == 0}}No other PDAS located - {{else}} -

Current Conversations

- {{for convopdas}} -
- {{:~link(Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : Reference } , null, fixedLeftWider)}} - {{if ~root.cartridge}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && Detonate == 1}} {{:~link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:~link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:~link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{/if}} -
- {{/for}} -

Other PDAs

- {{for pdas}} -
- {{:~link(Name, 'circle-arrow-s', {'choice' : "Message", 'target' : Reference}, null, fixedLeftWider)}} - {{if ~root.cartridge}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && Detonate == 1}} {{:~link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:~link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{if ~root.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:~link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : Reference}, null, 'fixedLeft')}} {{/if}} - {{/if}} -
- {{/for}} - {{/if}} - {{/if}} - - {{else mode == 21}} -

SpaceMessenger V4.0.1

-
-
- Messenger Functions: -
- -
- {{:~link('Delete Conversation', 'trash', {'choice' : "Clear", 'option' : "Convo"}, null, 'fixedLeftWide')}} -
-
-

-

Conversation with: {{:convo_name}} ({{:convo_job}})

-
-
-
- {{for messages}} - {{if ~root.active_conversation == target}} - {{if sent==0}} - Them: {{:message}}
- {{else}} - You: {{:message}}
- {{/if}} - {{/if}} - {{/for}} - -
-
-
- {{:~link('Reply', 'comment', {'choice' : "Message", 'target': active_conversation}, null, 'fixedLeft')}} - - {{else mode== 41}} -
-
- {{if manifest.heads.length}} - - {{for manifest["heads"]}} - {{if rank == "Captain"}} - - {{else}} - - {{/if}} - {{/for}} - {{/if}} - {{if manifest.sec.length}} - - {{for manifest["sec"]}} - {{if rank == "Head of Security"}} - - {{else}} - - {{/if}} - {{/for}} - {{/if}} - {{if manifest.eng.length}} - - {{for manifest["eng"]}} - {{if rank == "Chief Engineer"}} - - {{else}} - - {{/if}} - - {{/for}} - {{/if}} - {{if manifest.med.length}} - - {{for manifest["med"]}} - {{if rank == "Chief Medical Officer"}} - - {{else}} - - {{/if}} - {{/for}} - {{/if}} - {{if manifest.sci.length}} - - {{for manifest["sci"]}} - {{if rank == "Research Director"}} - - {{else}} - - {{/if}} - {{/for}} - {{/if}} - {{if manifest.civ.length}} - - {{for manifest["civ"]}} - {{if rank == "Head of Personnel"}} - - {{else}} - - {{/if}} - {{/for}} - {{/if}} - {{if manifest.misc.length}} - - {{for manifest["misc"]}} - - {{/for}} - {{/if}} - - -
Command
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Security
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Engineering
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Medical
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Science
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Civilian
{{:name}}{{:rank}}{{:active}}
{{:name}}{{:rank}}{{:active}}
Misc
{{:name}}{{:rank}}{{:active}}
-
- {{else mode == 3}} - -

Atmospheric Scan

-
-
- {{if aircontents.reading == 1}} -
- Pressure: -
-
- {{:~string('{1} kPa', aircontents.pressure < 80 || aircontents.pressure > 120 ? 'bad' : aircontents.pressure < 95 || aircontents.pressure > 110 ? 'average' : 'good' , aircontents.pressure)}} -
-
- Temperature: -
-
- {{:~string('{1} °C', aircontents.temp < 5 || aircontents.temp > 35 ? 'bad' : aircontents.temp < 15 || aircontents.temp > 25 ? 'average' : 'good' , aircontents.temp)}} -
-
-
- Oxygen: -
-
- {{:~string('{1}%', aircontents.oxygen < 17 ? 'bad' : aircontents.oxygen < 19 ? 'average' : 'good' , aircontents.oxygen)}} -
-
- Nitrogen: -
-
- {{:~string('{1}%', aircontents.nitrogen > 82 ? 'bad' : aircontents.nitrogen > 80 ? 'average' : 'good' , aircontents.nitrogen)}} -
-
- Carbon Dioxide: -
-
- {{:~string('{1}%', aircontents.carbon_dioxide > 5 ? 'bad' : 'good' , aircontents.carbon_dioxide)}} -
-
- Plasma: -
-
- {{:~string('{1}%', aircontents.plasma > 0 ? 'bad' : 'good' , aircontents.plasma)}} - -
- {{if aircontents.other > 0}} -
- Unknown: -
-
- {{:aircontents.other}}% -
- {{/if}} - {{else}} -
- Unable to get air reading -
- {{/if}} -
- -
- {{else mode == 40}} -

Remote Signaling System

-
-
- Frequency: -
-
- {{:records.signal_freq}} -
-  {{:~link('-1', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "-10"}, null, null)}}  - {{:~link('-.2', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "-2"}, null, null)}}  - - {{:~link('+.2', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "2"}, null, null)}}  - {{:~link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "10"}, null, null)}} -
-
-

-
-
- Code: -
-
- - {{:records.signal_code}}
-
- {{:~link('-5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-5"}, null, null)}} - {{:~link('-1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-1"}, null, null)}} - {{:~link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "1"}, null, null)}} - {{:~link('+5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "5"}, null, null)}} -
-
-
- {{:~link('Send Signal', 'radiation', {'cartmenu' : "1", 'choice' : "Send Signal"}, null, null)}} -
- - {{else mode == 42}} -

Station Status Displays Interlink

-
-
- Code: -
-
- {{:~link('Clear', 'trash', {'cartmenu' : "1", 'choice' : "Status", 'statdisp' : "blank"}, null, null)}} - {{:~link('Shuttle ETA', 'gear', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "shuttle"}, null, null)}} - {{:~link('Message', 'gear', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "message"}, null, null)}} -
-
-
-
-
- Message line 1 -
-
- {{:~link(records.message1 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg1"}, null, null)}} -
-
-
-
- Message line 2 -
-
- {{:~link(records.message2 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg2"}, null, null)}} -
-
- -
-
-
- ALERT!: -
-
- {{:~link('None', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "default"}, null, null)}} - {{:~link('Red Alert', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "redalert"}, null, null)}} - {{:~link('Lockdown', 'caution', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "lockdown"}, null, null)}} - {{:~link('Biohazard', 'radiation', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "biohazard"}, null, null)}} -
-
- - {{else mode == 43}} - -

Station Powermonitors

-
- Select A power monitor: -
- {{for records.powermonitors}} -
- {{:~link(Name, 'radiation', {'cartmenu' : "1", 'choice' : "Power Select",'target' : ref}, null, null)}} -
- {{/for}} - - {{else mode == 433}} -

Powernet Status

-
-
- Current Load: -
-
- {{:records.powerload}} W -
-
-
-
- Total Power: -
-
- {{:records.poweravail}} W -
-
-
-
- - {{for records.apcs}} - {{if #index % 20 === 0}} - - {{/if}} - - - {{:~string('', Equipment==1 ? '#4f7529' : '#8f1414')}} - {{:~string('', Lights==1 ? '#4f7529' : '#8f1414')}} - {{:~string('', Environment==1 ? '#4f7529' : '#8f1414')}} - {{:~string('', CellStatus==1 ? '#4f7529' : '#8f1414', CellStatus==-1 ? 'No Cell' : CellPct + '%')}} - - {{/for}} -
 Area  Eqp.  Lgt.  Env  Cell 
{{:Name}}   {1}
-
- - {{else mode == 44}} -

Medical Record List

-
- Select A record -
-
- {{for records.medical_records}} -
- {{:~link(Name, 'gear', {'cartmenu' : "1", 'choice' : "Medical Records",'target' : ref}, null, null)}} -
- {{/for}} - - - - {{else mode == 441}} -

Medical Record

-
-
-
- {{if records.general_exists == 1}} - Name: {{:records.general.name}}
- Sex: {{:records.general.sex}}
- Species: {{:records.general.species}}
- Age: {{:records.general.age}}
- Rank: {{:records.general.rank}}
- Fingerprint: {{:records.general.fingerprint}}
- Physical Status: {{:records.general.p_stat}}
- Mental Status: {{:records.general.m_stat}}

- {{else}} - - General Record Lost!

-
- {{/if}} - {{if records.medical_exists == 1}} - Medical Data:
- Blood Type: {{:records.medical.b_type}}

- Minor Disabilities: {{:records.medical.mi_dis}}
- Details: {{:records.medical.mi_dis_d}}

- Major Disabilities: {{:records.medical.ma_dis}}
- Details: {{:records.medical.ma_dis_d}}

- Allergies: {{:records.medical.alg}}
- Details: {{:records.medical.alg_d}}

- Current Disease: {{:records.medical.cdi}}
- Details: {{:records.medical.alg_d}}

- Important Notes: {{:records.medical.notes}} - {{else}} - - Medical Record Lost!

-
- {{/if}} -
-
-
- - - {{else mode == 45}} -

Security Record List

-
- Select A record +
+ Owner: +
+
+ {{:data.owner}}, {{:data.ownjob}} +

- {{for records.security_records}}
- {{:~link(Name, 'gear', {'cartmenu' : "1", 'choice' : "Security Records",'target' : ref}, null, null)}} +
+ ID: +
+
+ {{:helper.link(data.idLink, 'eject', {'choice' : "Authenticate"}, data.idInserted ? null : 'disabled', data.idInserted ? 'fixedLeftWidest' : 'fixedLeft')}} +
- {{/for}} - - - - {{else mode == 451}} -

Security Record

-
-
-
- {{if records.general_exists == 1}} - Name: {{:records.general.name}}
- Sex: {{:records.general.sex}}
- Species: {{:records.general.species}}
- Age: {{:records.general.age}}
- Rank: {{:records.general.rank}}
- Fingerprint: {{:records.general.fingerprint}}
- Physical Status: {{:records.general.p_stat}}
- Mental Status: {{:records.general.m_stat}}

+
+
+
+ Cartridge: +
+
+ {{if data.cart_loaded==1}} + {{:helper.link(data.cartridge.name, 'eject', {'choice' : "Eject"},null,null)}} {{else}} - - General Record Lost!

-
+ {{:helper.link('None', 'eject', {'choice' : "Eject"},'disabled',null)}} {{/if}} - {{if records.security_exists == 1}} - Security Data:
- Criminal Status: {{:records.security.criminal}}

- Minor Crimes: {{:records.security.mi_crim}}
- Details: {{:records.security.mi_crim_d}}

- Major Crimes: {{:records.security.ma_crim}}
- Details: {{:records.security.ma_crim_d}}

- Important Notes: {{:records.security.notes}} - {{else}} - - Security Record Lost!

-
- {{/if}} -
-
+
- {{else mode == 46}} -

Security Bot Control

- {{if records.beepsky.active == null || records.beepsky.active == 0}} - {{if records.beepsky.count == 0}} +
+

Functions

+
+
+
+ General: +
+
+ {{:helper.link('Notekeeper', 'note', {'choice' : "1"}, null, 'fixedLeftWide')}} + {{:helper.link('Messenger', data.newMessage ? 'mail-closed' : 'mail-open', {'choice' : "2"}, null, 'fixedLeftWide')}} + {{:helper.link('Crew Manifest', 'contact', {'choice' : "41"}, null, 'fixedLeftWide')}} +
+
+
+ {{if data.cartridge}} + {{if data.cartridge.access.access_clown == 1}} +
+
+ Clown: +
+
+ {{:helper.link('Honk Synthesizer', 'gear', {'choice' : "Honk"}, null, 'fixedLeftWide')}} +
+
+
+ {{/if}} + {{if data.cartridge.access.access_engine == 1}} +
+
+ Engineering: +
+
+ {{:helper.link('Power Monitor', 'alert', {'choice' : "43"}, null, 'fixedLeftWide')}} +
+
+
+ {{/if}} + {{if data.cartridge.access.access_medical == 1}} +
+
+ Medical: +
+
+ {{:helper.link('Medical Records', 'gear', {'choice' : "44"}, null, 'fixedLeftWide')}} + {{:helper.link(data.scanmode == 1 ? 'Disable Med Scanner' : 'Enable Med Scanner', 'gear', {'choice' : "Medical Scan"}, null , 'fixedLeftWide')}} +
+
+
+ {{/if}} + {{if data.cartridge.access.access_security == 1}} +
+
+ Security: +
+
+ {{:helper.link('Security Records', 'gear', {'choice' : "45"}, null, 'fixedLeftWide')}} + {{if data.cartridge.radio ==1}} {{:helper.link('Security Bot Access', 'gear', {'choice' : "46"}, null, 'fixedLeftWide')}} {{/if}} +
+
+
+
+ {{/if}} + {{if data.cartridge.access.access_quartermaster == 1}} +
+
+ Quartermaster: +
+
+ {{:helper.link('Supply Records', 'gear', {'choice' : "47"}, null, 'fixedLeftWide')}} + {{if data.cartridge.radio == 3}} {{:helper.link('Delivery Bot Control', 'gear', {'choice' : "48"}, null, 'fixedLeftWide')}} {{/if}} +
+
+
+
+ {{/if}} + {{/if}} +
+
+
+ Utilities: +
+
+ {{if data.cartridge}} + {{if data.cartridge.access.access_status_display == 1}} + {{:helper.link('Status Display', 'gear', {'choice' : "42"}, null, 'fixedLeftWide')}} + {{/if}} + {{if data.cartridge.access.access_janitor==1}} + {{:helper.link('Custodial Locator', 'gear', {'choice' : "49"}, null, 'fixedLeftWide')}} + {{/if}} + {{if data.cartridge.radio == 2}} + {{:helper.link('Signaler System', 'gear', {'choice' : "40"}, null, 'fixedLeftWide')}} + {{/if}} + {{if data.cartridge.access.access_reagent_scanner==1}} + {{:helper.link(data.scanmode == 3 ? 'Disable Reagent Scanner' : 'Enable Reagent Scanner', 'gear', {'choice' : "Reagent Scan"}, null, 'fixedLeftWider')}} + {{/if}} + {{if data.cartridge.access.access_engine==1}} + {{:helper.link(data.scanmode == 4 ? 'Disable Halogen Counter' : 'Enable Halogen Counter', 'gear', {'choice' : "Halogen Counter"}, null, 'fixedLeftWider')}} + {{/if}} + {{if data.cartridge.access.access_atmos==1}} + {{:helper.link(data.scanmode == 5 ? 'Disable Gas Scanner' : 'Enable Gas Scanner', 'gear', {'choice' : "Gas Scan"}, null, 'fixedLeftWide')}} + {{/if}} + {{if data.cartridge.access.access_remote_door==1}} + {{:helper.link('Toggle Door', 'gear', {'choice' : "Toggle Door"}, null, 'fixedLeftWide')}} + {{/if}} + {{/if}} + {{:helper.link('Atmospheric Scan', 'gear', {'choice' : "3"}, null, 'fixedLeftWide')}} + {{:helper.link(data.fon==1 ? 'Disable Flashlight' : 'Enable Flashlight', 'lightbulb', {'choice' : "Light"}, null,'fixedLeftWide')}} +
+
+ {{if data.pai}} +
+
+ PAI Utilities: +
+
+ {{:helper.link('Configuration', 'gear', {'choice' : "pai", 'option' : "1"}, null, 'fixedLeft')}} + {{:helper.link('Eject pAI', 'eject', {'choice' : "pai", 'option' : "2"}, null, 'fixedLeft')}} +
+
+ {{/if}} + + + {{else data.mode == 1}} +
+
+ Notes: +
+
+
+
+
+ {{:data.note}} +
+
+
+
+
+ {{:helper.link('Edit Notes', 'gear', {'choice' : "Edit"}, null, 'fixedLeft')}} +
+
+ + + {{else data.mode == 2}} +

SpaceMessenger V4.0.1

+
+
+ Messenger Functions: +
+
+ {{:helper.link(data.silent==1 ? 'Ringer: Off' : 'Ringer: On', data.silent==1 ? 'volume-off' : 'volume-on', {'choice' : "Toggle Ringer"}, null, 'fixedLeftWide')}} + {{:helper.link(data.toff==1 ? 'Messenger: Off' : 'Messenger: On',data.toff==1 ? 'close':'check', {'choice' : "Toggle Messenger"}, null, 'fixedLeftWide')}} + {{:helper.link('Set Ringtone', 'comment', {'choice' : "Ringtone"}, null, 'fixedLeftWide')}} + {{:helper.link('Delete all Conversations', 'trash', {'choice' : "Clear", 'option' : "All"}, null, 'fixedLeftWider')}} +
+
+ {{if data.toff == 0}} +

+ {{if data.cartridge}} + {{if data.cartridge.charges}} +
+ {{:data.cartridge.charges}} + {{if data.cartridge.type == "/obj/item/weapon/cartridge/syndicate"}} detonation charges left. {{/if}} + {{if data.cartridge.type == "/obj/item/weapon/cartridge/clown" || data.cartridge.type == "/obj/item/weapon/cartridge/mime"}} viral files left. {{/if}} + +

+
+ {{/if}} + {{/if}} + + {{if data.pda_count == 0}} + No other PDAS located + {{else}} +

Current Conversations

+ {{for data.convopdas}} +
+ {{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : value.Reference } , null, value.fixedLeftWider)}} + {{if value.cartridge}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && value.Detonate == 1}} + {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : value.Reference}, null, 'fixedLeft')}} + {{/if}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/clown"}} + {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : value.Reference}, null, 'fixedLeft')}} + {{/if}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/mime"}} + {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : value.Reference}, null, 'fixedLeft')}} + {{/if}} + {{/if}} +
+ {{/for}} +

Other PDAs

+ {{for data.pdas}} +
+ {{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Message", 'target' : value.Reference}, null, value.fixedLeftWider)}} + {{if value.cartridge}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && value.Detonate == 1}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}} + {{if value.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}} + {{/if}} +
+ {{/for}} + {{/if}} + {{/if}} + + + {{else data.mode == 21}} +

SpaceMessenger V4.0.1

+
+
+ Messenger Functions: +
+
+ {{:helper.link('Delete Conversation', 'trash', {'choice' : "Clear", 'option' : "Convo"}, null, 'fixedLeftWide')}} +
+
+
+
+

Conversation with: {{:data.convo_name}} ({{:data.convo_job}})

+
+
+
+ {{for data.messages}} + {{if data.active_conversation == value.target}} + {{if value.sent==0}} + Them: {{:value.message}}
+ {{else}} + You: {{:value.message}}
+ {{/if}} + {{/if}} + {{/for}} +
+
+
+ {{:helper.link('Reply', 'comment', {'choice' : "Message", 'target': data.active_conversation}, null, 'fixedLeft')}} + + + {{else data.mode== 41}} +
+
+ {{if data.manifest.heads}} + + {{for data.manifest["heads"]}} + {{if value.rank == "Captain"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.sec}} + + {{for data.manifest["sec"]}} + {{if value.rank == "Head of Security"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.eng}} + + {{for data.manifest["eng"]}} + {{if value.rank == "Chief Engineer"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.med}} + + {{for data.manifest["med"]}} + {{if value.rank == "Chief Medical Officer"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.sci}} + + {{for data.manifest["sci"]}} + {{if value.rank == "Research Director"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.civ}} + + {{for data.manifest["civ"]}} + {{if value.rank == "Head of Personnel"}} + + {{else}} + + {{/if}} + {{/for}} + {{/if}} + {{if data.manifest.misc}} + + {{for data.manifest["misc"]}} + + {{/for}} + {{/if}} +
Command
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Security
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Engineering
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Medical
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Science
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Civilian
{{:value.name}}{{:value.rank}}{{:value.active}}
{{:value.name}}{{:value.rank}}{{:value.active}}
Misc
{{:value.name}}{{:value.rank}}{{:value.active}}
+
+ + + {{else data.mode == 3}} +

Atmospheric Scan

+
+
+ {{if data.aircontents.reading == 1}} +
+ Pressure: +
+
+ {{:helper.string('{1} kPa', data.aircontents.pressure < 80 || data.aircontents.pressure > 120 ? 'bad' : data.aircontents.pressure < 95 || data.aircontents.pressure > 110 ? 'average' : 'good' , data.aircontents.pressure)}} +
+
+ Temperature: +
+
+ {{:helper.string('{1} °C', data.aircontents.temp < 5 || data.aircontents.temp > 35 ? 'bad' : data.aircontents.temp < 15 || data.aircontents.temp > 25 ? 'average' : 'good' , data.aircontents.temp)}} +
+
+
+ Oxygen: +
+
+ {{:helper.string('{1}%', data.aircontents.oxygen < 17 ? 'bad' : data.aircontents.oxygen < 19 ? 'average' : 'good' , data.aircontents.oxygen)}} +
+
+ Nitrogen: +
+
+ {{:helper.string('{1}%', data.aircontents.nitrogen > 82 ? 'bad' : data.aircontents.nitrogen > 80 ? 'average' : 'good' , data.aircontents.nitrogen)}} +
+
+ Carbon Dioxide: +
+
+ {{:helper.string('{1}%', data.aircontents.carbon_dioxide > 5 ? 'bad' : 'good' , data.aircontents.carbon_dioxide)}} +
+
+ Plasma: +
+
+ {{:helper.string('{1}%', data.aircontents.plasma > 0 ? 'bad' : 'good' , data.aircontents.plasma)}} + +
+ {{if data.aircontents.other > 0}} +
+ Unknown: +
+
+ {{:data.aircontents.other}}% +
+ {{/if}} + {{else}} +
+ Unable to get air reading +
+ {{/if}} +
+
+ + + {{else data.mode == 40}} +

Remote Signaling System

+
+
+ Frequency: +
+
+ {{:data.records.signal_freq}} +
+   + {{:helper.link('-1', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "-10"}, null, null)}}  + {{:helper.link('-.2', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "-2"}, null, null)}}  + + {{:helper.link('+.2', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "2"}, null, null)}}  + {{:helper.link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "10"}, null, null)}} +
+
+
+
+
+
+ Code: +
+
+ + {{:data.records.signal_code}}
+
+ {{:helper.link('-5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-5"}, null, null)}} + {{:helper.link('-1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-1"}, null, null)}} + {{:helper.link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "1"}, null, null)}} + {{:helper.link('+5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "5"}, null, null)}} +
+
+
+ {{:helper.link('Send Signal', 'radiation', {'cartmenu' : "1", 'choice' : "Send Signal"}, null, null)}} +
+ + + {{else data.mode == 42}} +

Station Status Displays Interlink

+
+
+ Code: +
+
+ {{:helper.link('Clear', 'trash', {'cartmenu' : "1", 'choice' : "Status", 'statdisp' : "blank"}, null, null)}} + {{:helper.link('Shuttle ETA', 'gear', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "shuttle"}, null, null)}} + {{:helper.link('Message', 'gear', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "message"}, null, null)}} +
+
+
+
+
+ Message line 1 +
+
+ {{:helper.link(data.records.message1 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg1"}, null, null)}} +
+
+
+
+ Message line 2 +
+
+ {{:helper.link(data.records.message2 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg2"}, null, null)}} +
+
+ +
+
+
+ ALERT!: +
+
+ {{:helper.link('None', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "default"}, null, null)}} + {{:helper.link('Red Alert', 'alert', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "redalert"}, null, null)}} + {{:helper.link('Lockdown', 'caution', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "lockdown"}, null, null)}} + {{:helper.link('Biohazard', 'radiation', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "alert", 'alert' : "biohazard"}, null, null)}} +
+
+ + + {{else data.mode == 43}} +

Station Powermonitors

+
+ Select A power monitor: +
+ {{for data.records.powermonitors}} +
+ {{:helper.link(value.Name, 'radiation', {'cartmenu' : "1", 'choice' : "Power Select",'target' : value.ref}, null, null)}} +
+ {{/for}} + + + {{else data.mode == 433}} +

Powernet Status

+
+
+ Current Load: +
+
+ {{:data.records.powerload}} W +
+
+
+
+ Total Power: +
+
+ {{:data.records.poweravail}} W +
+
+
+
+ + {{for data.records.apcs}} + {{if index % 20 === 0}} + + {{/if}} + + {{:helper.string('', value.Equipment==1 ? '#4f7529' : '#8f1414')}} + {{:helper.string('', value.Lights==1 ? '#4f7529' : '#8f1414')}} + {{:helper.string('', value.Environment==1 ? '#4f7529' : '#8f1414')}} + {{:helper.string('', value.CellStatus==1 ? '#4f7529' : '#8f1414', value.CellStatus==-1 ? 'No Cell' : CellPct + '%')}} + + {{/for}} +
 Area  Eqp.  Lgt.  Env  Cell 
{{:value.Name}}   {1}
+
+ + + {{else data.mode == 44}} +

Medical Record List

+
+ Select A record +
+
+ {{for data.records.medical_records}} +
+ {{:helper.link(value.Name, 'gear', {'cartmenu' : "1", 'choice' : "Medical Records",'target' : value.ref}, null, null)}} +
+ {{/for}} + + + {{else data.mode == 441}} +

Medical Record

+
+
+
+ {{if data.records.general_exists == 1}} + Name: {{:data.records.general.name}}
+ Sex: {{:data.records.general.sex}}
+ Species: {{:data.records.general.species}}
+ Age: {{:data.records.general.age}}
+ Rank: {{:data.records.general.rank}}
+ Fingerprint: {{:data.records.general.fingerprint}}
+ Physical Status: {{:data.records.general.p_stat}}
+ Mental Status: {{:data.records.general.m_stat}}

+ {{else}} + + General Record Lost!

+
+ {{/if}} + {{if data.records.medical_exists == 1}} + Medical Data:
+ Blood Type: {{:data.records.medical.b_type}}

+ Minor Disabilities: {{:data.records.medical.mi_dis}}
+ Details: {{:data.records.medical.mi_dis_d}}

+ Major Disabilities: {{:data.records.medical.ma_dis}}
+ Details: {{:data.records.medical.ma_dis_d}}

+ Allergies: {{:data.records.medical.alg}}
+ Details: {{:data.records.medical.alg_d}}

+ Current Disease: {{:data.records.medical.cdi}}
+ Details: {{:data.records.medical.alg_d}}

+ Important Notes: {{:data.records.medical.notes}} + {{else}} + + Medical Record Lost! +
+
+
+ {{/if}} +
+
+
+ + + {{else data.mode == 45}} +

Security Record List

+
+ Select A record +
+
+ {{for data.records.security_records}} +
+ {{:helper.link(value.Name, 'gear', {'cartmenu' : "1", 'choice' : "Security Records",'target' : value.ref}, null, null)}} +
+ {{/for}} + + + {{else data.mode == 451}} +

Security Record

+
+
+
+ {{if data.records.general_exists == 1}} + Name: {{:data.records.general.name}}
+ Sex: {{:data.records.general.sex}}
+ Species: {{:data.records.general.species}}
+ Age: {{:data.records.general.age}}
+ Rank: {{:data.records.general.rank}}
+ Fingerprint: {{:data.records.general.fingerprint}}
+ Physical Status: {{:data.records.general.p_stat}}
+ Mental Status: {{:data.records.general.m_stat}}

+ {{else}} + + General Record Lost!

+
+ {{/if}} + {{if data.records.security_exists == 1}} + Security Data:
+ Criminal Status: {{:data.records.security.criminal}}

+ Minor Crimes: {{:data.records.security.mi_crim}}
+ Details: {{:data.records.security.mi_crim_d}}

+ Major Crimes: {{:data.records.security.ma_crim}}
+ Details: {{:data.records.security.ma_crim_d}}

+ Important Notes: {{:data.records.security.notes}} + {{else}} + + Security Record Lost!

+
+ {{/if}} +
+
+
+ + + {{else data.mode == 46}} +

Security Bot Control

+ {{if data.records.beepsky.active == null || data.records.beepsky.active == 0}} + {{if data.records.beepsky.count == 0}}

No bots found.

{{else}} -
+
Select A Bot. -
-
- {{for records.beepsky.bots}} +
+
+ {{for data.records.beepsky.bots}}
- {{:~link(Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : ref}, null, null)}} (Location: {{:Location}}) + {{:helper.link(value.Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : value.ref}, null, null)}} (Location: {{:value.Location}})
- {{/for}} + {{/for}} {{/if}}
- {{:~link('Scan for Bots','gear', {'radiomenu' : "1", 'op' : "scanbots"}, null, null)}} - + {{:helper.link('Scan for Bots','gear', {'radiomenu' : "1", 'op' : "scanbots"}, null, null)}} {{else}} -

{{:records.beepsky.active}}

+

{{:data.records.beepsky.active}}



- {{if records.beepsky.botstatus.mode == -1}} -

Waiting for response...

+ {{if data.records.beepsky.botstatus.mode == -1}} +

Waiting for response...

{{else}} -

Status:

-
-
-
- Location: -
-
- {{:records.beepsky.botstatus.loca}} -
-
-
-
- Mode: -
-
- - {{if records.beepsky.botstatus.mode ==0}} Ready - {{else records.beepsky.botstatus.mode == 1}} - Apprehending target - {{else records.beepsky.botstatus.mode ==2 || records.beepsky.botstatus.mode == 3}} - Arresting target - {{else records.beepsky.botstatus.mode ==4}} - Starting patrol - {{else records.beepsky.botstatus.mode ==5}} - On Patrol - {{else records.beepsky.botstatus.mode ==6}} - Responding to summons - {{/if}} - -
-
-
- {{:~link('Stop Patrol', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}} - {{:~link('Start Patrol', 'gear', {'radiomenu' : "1", 'op' : "go"}, null, null)}} - {{:~link('Summon Bot', 'gear', {'radiomenu' : "1", 'op' : "summon"}, null, null)}} -
- {{/if}} - {{:~link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}} +

Status:

+
+
+
+ Location: +
+
+ {{:data.records.beepsky.botstatus.loca}} +
+
+
+
+ Mode: +
+
+ + {{if data.records.beepsky.botstatus.mode ==0}} + Ready + {{else data.records.beepsky.botstatus.mode == 1}} + Apprehending target + {{else data.records.beepsky.botstatus.mode ==2 || data.records.beepsky.botstatus.mode == 3}} + Arresting target + {{else data.records.beepsky.botstatus.mode ==4}} + Starting patrol + {{else data.records.beepsky.botstatus.mode ==5}} + On Patrol + {{else data.records.beepsky.botstatus.mode ==6}} + Responding to summons + {{/if}} + +
+
+
+ {{:helper.link('Stop Patrol', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}} + {{:helper.link('Start Patrol', 'gear', {'radiomenu' : "1", 'op' : "go"}, null, null)}} + {{:helper.link('Summon Bot', 'gear', {'radiomenu' : "1", 'op' : "summon"}, null, null)}} +
+ {{/if}} + {{:helper.link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}} {{/if}} - {{else mode == 47}} + + + {{else data.mode == 47}}

Supply Record Interlink

-
+
Location:
- {{if records.supply.shuttle_moving}} - Moving to station ({{:records.supply.shuttle_eta}}) + {{if data.records.supply.shuttle_moving}} + Moving to station ({{:data.records.supply.shuttle_eta}}) {{else}} - Shuttle at {{:records.supply.shuttle_loc}} + Shuttle at {{:data.records.supply.shuttle_loc}} {{/if}}
-
-
-
- Current Approved Orders
- {{if records.supply.approved_count == 0}} - No current approved orders

- {{else}} - {{for records.supply.approved}} - #{{:Number}} - {{:Name}} approved by {{:OrderedBy}}
{{if Comment != ""}} {{:Comment}}
{{/if}}
- {{/for}} - {{/if}} -

- Current Requested Orders
- {{if records.supply.requests_count == 0}} - No current requested orders

- {{else}} - {{for records.supply.requests}} - #{{:Number}} - {{:Name}} requested by {{:OrderedBy}}
{{if Comment != ""}} {{:Comment}}
{{/if}}
- {{/for}} - {{/if}} +
+
+
+ Current Approved Orders
+ {{if data.records.supply.approved_count == 0}} + No current approved orders

+ {{else}} + {{for data.records.supply.approved}} + #{{:value.Number}} - {{:value.Name}} approved by {{:value.OrderedBy}}
{{if value.Comment != ""}} {{:value.Comment}}
{{/if}}
+ {{/for}} + {{/if}} +

+ Current Requested Orders
+ {{if data.records.supply.requests_count == 0}} + No current requested orders

+ {{else}} + {{for data.records.supply.requests}} + #{{:value.Number}} - {{:value.Name}} requested by {{:value.OrderedBy}}
{{if value.Comment != ""}} {{:value.Comment}}
{{/if}}
+ {{/for}} + {{/if}}
- - {{else mode == 48}} + + + {{else data.mode == 48}}

Mule Control

- {{if records.mulebot.active == null || records.mulebot.active == 0}} - {{if records.mulebot.count == 0}} -

No bots found.

- - {{else}} -

Mule List

-
- Select A Mulebot -
-
- {{for records.mulebot.bots}} -
- {{:~link(Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : ref}, null, null)}} (Location: {{:Location}}) -
- {{/for}} - {{/if}} -
- {{:~link('Scan for Bots','gear', {'radiomenu' : "1", 'op' : "scanbots"}, null, null)}} - {{else}} - {{if records.mulebot.botstatus.mode == -1}} -

Waiting for response...

- {{else}} -

Status:

-
-
-
- Location: -
-
- {{:records.mulebot.botstatus.loca}} -
-
-
-
- Mode: -
-
- - {{if records.mulebot.botstatus.mode ==0}} Ready - {{else records.mulebot.botstatus.mode == 1}} - Loading/Unloading - {{else records.mulebot.botstatus.mode ==2}} - Navigating to Delivery Location - {{else records.mulebot.botstatus.mode == 3}} - Navigating to Home - {{else records.mulebot.botstatus.mode ==4}} - Waiting for Clear Path - {{else records.mulebot.botstatus.mode ==5 || records.mulebot.botstatus.mode == 6}} - Calculating navigation Path - - {{else records.mulebot.botstatus.mode ==7}} - Unable to locate destination - {{/if}} - -
-
-
-
- Current Load: -
-
- - {{:~link(records.mulebot.botstatus.load == null ? 'None (Unload)' : records.mulebot.botstatus.load + ' (Unload)', 'gear', {'radiomenu' : "1", 'op' : "unload"},records.mulebot.botstatus.load == null ? 'disabled' : null, null)}} - -
-
-
-
- Power: -
-
- - {{:records.mulebot.botstatus.powr}}% - -
-
- -
-
- Destination: -
-
- {{:~link(records.mulebot.botstatus.dest == null || records.mulebot.botstatus.dest == "" ? 'None (Set)': records.mulebot.botstatus.dest+ ' (Set)', 'gear', {'radiomenu' : "1", 'op' : "setdest"}, null, null)}} -
- -
-
-
- Home: -
-
- {{if records.mulebot.botstatus.home == null}} None {{else}} {{:records.mulebot.botstatus.home}} {{/if}} -
-
-
-
- Auto Return: -
-
- {{:~link(records.mulebot.botstatus.retn == 1 ? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : records.mulebot.botstatus.retn==1 ? "retoff" : "reton"}, null, null)}} -
-
-
-
- Auto Pickup: -
-
- {{:~link(records.mulebot.botstatus.pick==1? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : records.mulebot.botstatus.pick==1 ? "pickoff" : "pickon"}, null, null)}} -
-
-
-
- Functions: -
-
- {{:~link('Stop', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}} - {{:~link('Proceed', 'gear', {'radiomenu' : "1", 'op' : "go"}, null, null)}} - {{:~link('Return Home', 'gear', {'radiomenu' : "1", 'op' : "home"}, null, null)}} -
-
-

- {{:~link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}} - - - {{/if}} - {{/if}} - - - - {{else mode == 49}} -

Janatorial Supplies Locator

-
- Current Location: - {{if records.janitor.user_loc.x == 0}} - Unknown - {{else}} - {{:records.janitor.user_loc.x}} / {{:records.janitor.user_loc.y}} - {{/if}} -
-
- {{for records.janitor.mops}} - {{if x==0}} - Unable to locate Mop - {{else}} - Mop Location: - ({{:x}} / {{:y}}) - {{:dir}} - Status: {{:status}}
- {{/if}} + {{if data.records.mulebot.active == null || data.records.mulebot.active == 0}} + {{if data.records.mulebot.count == 0}} +

No bots found.

+ {{else}} +

Mule List

+
+ Select A Mulebot +
+
+ {{for data.records.mulebot.bots}} +
+ {{:helper.link(value.Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : value.ref}, null, null)}} (Location: {{:value.Location}}) +
{{/for}} -
-
- {{for records.janitor.buckets}} - {{if x==0}} - Unable to locate Water Buckets - {{else}} - Water Buckets Location: - ({{:x}} / {{:y}}) - {{:dir}} - Water Level: {{:status}}
- {{/if}} - {{/for}} -
-
- {{for records.janitor.cleanbots}} - {{if x==0}} - Unable to locate Clean Bots - {{else}} - Clean Bots Location: - ({{:x}} / {{:y}}) - {{:dir}} - Status: {{:status}}
- {{/if}} - - {{/for}} -
-
- {{for records.janitor.carts}} - {{if x==0}} - Unable to locate Janitorial Cart - {{else}} - Janitorial cart Location: - ({{:x}} / {{:y}}) - {{:dir}} - Status: {{:status}}
- {{/if}} - - {{/for}} -
- - - - + {{/if}} +
+ {{:helper.link('Scan for Bots','gear', {'radiomenu' : "1", 'op' : "scanbots"}, null, null)}} + {{else}} + {{if data.records.mulebot.botstatus.mode == -1}} +

Waiting for response...

+ {{else}} +

Status:

+
+
+
+ Location: +
+
+ {{:data.records.mulebot.botstatus.loca}} +
+
+
+
+ Mode: +
+
+ + {{if data.records.mulebot.botstatus.mode ==0}} + Ready + {{else data.records.mulebot.botstatus.mode == 1}} + Loading/Unloading + {{else data.records.mulebot.botstatus.mode ==2}} + Navigating to Delivery Location + {{else data.records.mulebot.botstatus.mode == 3}} + Navigating to Home + {{else data.records.mulebot.botstatus.mode ==4}} + Waiting for Clear Path + {{else data.records.mulebot.botstatus.mode ==5 || data.records.mulebot.botstatus.mode == 6}} + Calculating navigation Path + {{else data.records.mulebot.botstatus.mode ==7}} + Unable to locate destination + {{/if}} + +
+
+
+
+ Current Load: +
+
+ + {{:helper.link(data.records.mulebot.botstatus.load == null ? 'None (Unload)' : data.records.mulebot.botstatus.load + ' (Unload)', 'gear', {'radiomenu' : "1", 'op' : "unload"},data.records.mulebot.botstatus.load == null ? 'disabled' : null, null)}} + +
+
+
+
+ Power: +
+
+ + {{:data.records.mulebot.botstatus.powr}}% + +
+
+
+
+ Destination: +
+
+ {{:helper.link(data.records.mulebot.botstatus.dest == null || data.records.mulebot.botstatus.dest == "" ? 'None (Set)': data.records.mulebot.botstatus.dest+ ' (Set)', 'gear', {'radiomenu' : "1", 'op' : "setdest"}, null, null)}} +
+
+
+
+ Home: +
+
+ {{if data.records.mulebot.botstatus.home == null}} None {{else}} {{:data.records.mulebot.botstatus.home}} {{/if}} +
+
+
+
+ Auto Return: +
+
+ {{:helper.link(data.records.mulebot.botstatus.retn == 1 ? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : data.records.mulebot.botstatus.retn==1 ? "retoff" : "reton"}, null, null)}} +
+
+
+
+ Auto Pickup: +
+
+ {{:helper.link(data.records.mulebot.botstatus.pick==1? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : data.records.mulebot.botstatus.pick==1 ? "pickoff" : "pickon"}, null, null)}} +
+
+
+
+ Functions: +
+
+ {{:helper.link('Stop', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}} + {{:helper.link('Proceed', 'gear', {'radiomenu' : "1", 'op' : "go"}, null, null)}} + {{:helper.link('Return Home', 'gear', {'radiomenu' : "1", 'op' : "home"}, null, null)}} +
+
+

+ {{:helper.link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}} + {{/if}} {{/if}} + {{else data.mode == 49}} +

Janatorial Supplies Locator

+
+ Current Location: + {{if data.records.janitor.user_loc.x == 0}} + Unknown + {{else}} + {{:data.records.janitor.user_loc.x}} / {{:data.records.janitor.user_loc.y}} + {{/if}} +
+
+ {{for data.records.janitor.mops}} + {{if value.x==0}} + Unable to locate Mop + {{else}} + Mop Location: + ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
+ {{/if}} + {{/for}} +
+
+ {{for data.records.janitor.buckets}} + {{if value.x==0}} + Unable to locate Water Buckets + {{else}} + Water Buckets Location: + ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Water Level: {{:value.status}}
+ {{/if}} + {{/for}} +
+
+ {{for data.records.janitor.cleanbots}} + {{if value.x==0}} + Unable to locate Clean Bots + {{else}} + Clean Bots Location: + ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
+ {{/if}} + {{/for}} +
+
+ {{for data.records.janitor.carts}} + {{if value.x==0}} + Unable to locate Janitorial Cart + {{else}} + Janitorial cart Location: + ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
+ {{/if}} + {{/for}} +
+ {{/if}} {{else}} -







No Owner information found, please swipe ID -
+
+






No Owner information found, please swipe ID +
{{/if}} diff --git a/nano/templates/smes.tmpl b/nano/templates/smes.tmpl index 760228e4cd5..04b93b41480 100644 --- a/nano/templates/smes.tmpl +++ b/nano/templates/smes.tmpl @@ -3,9 +3,9 @@ Stored Capacity:
- {{:~displayBar(storedCapacity, 0, 100, charging ? 'good' : 'average')}} + {{:helper.displayBar(data.storedCapacity, 0, 100, data.charging ? 'good' : 'average')}}
- {{:~round(storedCapacity)}}% + {{:helper.round(data.storedCapacity)}}%
@@ -16,9 +16,9 @@ Charge Mode:
- {{:~link('Auto', 'refresh', {'cmode' : 1}, chargeMode ? 'selected' : null)}}{{:~link('Off', 'close', {'cmode' : 1}, chargeMode ? null : 'selected')}} + {{:helper.link('Auto', 'refresh', {'cmode' : 1}, data.chargeMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'cmode' : 1}, data.chargeMode ? null : 'selected')}}   - {{if charging}} + {{if data.charging}} [Charging] {{else}} [Not Charging] @@ -31,12 +31,12 @@ Input Level:
- {{:~displayBar(chargeLevel, 0, chargeMax)}} + {{:helper.displayBar(data.chargeLevel, 0, data.chargeMax)}}
- {{:~link('MIN', null, {'input' : 'min'}, (chargeLevel > 0) ? null : 'disabled')}} - {{:~link('SET', null, {'input' : 'set'}, null)}} - {{:~link('MAX', null, {'input' : 'max'}, (chargeLevel < chargeMax) ? null : 'disabled')}} -
 {{:chargeLevel}} W 
+ {{:helper.link('MIN', null, {'input' : 'min'}, (data.chargeLevel > 0) ? null : 'disabled')}} + {{:helper.link('SET', null, {'input' : 'set'}, null)}} + {{:helper.link('MAX', null, {'input' : 'max'}, (data.chargeLevel < data.chargeMax) ? null : 'disabled')}} +
 {{:data.chargeLevel}} W 
@@ -47,7 +47,7 @@ Output Status:
- {{:~link('Online', 'power', {'online' : 1}, outputOnline ? 'selected' : null)}}{{:~link('Offline', 'close', {'online' : 1}, outputOnline ? null : 'selected')}} + {{:helper.link('Online', 'power', {'online' : 1}, data.outputOnline ? 'selected' : null)}}{{:helper.link('Offline', 'close', {'online' : 1}, data.outputOnline ? null : 'selected')}}
@@ -56,12 +56,12 @@ Output Level:
- {{:~displayBar(outputLevel, 0, outputMax)}} + {{:helper.displayBar(data.outputLevel, 0, data.outputMax)}}
- {{:~link('MIN', null, {'output' : 'min'}, (outputLevel > 0) ? null : 'disabled')}} - {{:~link('SET', null, {'output' : 'set'}, null)}} - {{:~link('MAX', null, {'output' : 'max'}, (outputLevel < outputMax) ? null : 'disabled')}} -
 {{:outputLevel}} W 
+ {{:helper.link('MIN', null, {'output' : 'min'}, (data.outputLevel > 0) ? null : 'disabled')}} + {{:helper.link('SET', null, {'output' : 'set'}, null)}} + {{:helper.link('MAX', null, {'output' : 'max'}, (data.outputLevel < data.outputMax) ? null : 'disabled')}} +
 {{:data.outputLevel}} W 
@@ -71,9 +71,9 @@ Output Load:
- {{:~displayBar(outputLoad, 0, outputMax, (outputLoad < outputLevel) ? 'good' : 'average')}} + {{:helper.displayBar(data.outputLoad, 0, data.outputMax, (data.outputLoad < data.outputLevel) ? 'good' : 'average')}}
- {{:outputLoad}} W + {{:data.outputLoad}} W
\ No newline at end of file diff --git a/nano/templates/tanks.tmpl b/nano/templates/tanks.tmpl index af7ab874f64..c9d4e6c335a 100644 --- a/nano/templates/tanks.tmpl +++ b/nano/templates/tanks.tmpl @@ -1,4 +1,4 @@ -{{if maskConnected}} +{{if data.maskConnected}}
This tank is connected to a mask.
{{else}}
This tank is NOT connected to a mask.
@@ -9,9 +9,9 @@ Tank Pressure:
- {{:~displayBar(tankPressure, 0, 1013, (tankPressure > 200) ? 'good' : (tankPressure > 100) ? 'average' : 'bad'))}} + {{:helper.displayBar(data.tankPressure, 0, 1013, (data.tankPressure > 200) ? 'good' : ((data.tankPressure > 100) ? 'average' : 'bad'))}}
- {{:tankPressure}} kPa + {{:data.tankPressure}} kPa
@@ -23,15 +23,15 @@ Mask Release Pressure:
- {{:~displayBar(releasePressure, 0, maxReleasePressure, (releasePressure >= 23) ? null : ((releasePressure >= 17) ? 'average' : 'bad'))}} + {{:helper.displayBar(data.releasePressure, 0, data.maxReleasePressure, (data.releasePressure >= 23) ? null : ((data.releasePressure >= 17) ? 'average' : 'bad'))}}
- {{:~link('-', null, {'dist_p' : -10}, (releasePressure > 0) ? null : 'disabled')}} - {{:~link('-', null, {'dist_p' : -1}, (releasePressure > 0) ? null : 'disabled')}} -
 {{:releasePressure}} kPa 
- {{:~link('+', null, {'dist_p' : 1}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('+', null, {'dist_p' : 10}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('Max', null, {'dist_p' : 'max'}, (releasePressure < maxReleasePressure) ? null : 'disabled')}} - {{:~link('Reset', null, {'dist_p' : 'reset'}, (releasePressure != defaultReleasePressure) ? null : 'disabled')}} + {{:helper.link('-', null, {'dist_p' : -10}, (data.releasePressure > 0) ? null : 'disabled')}} + {{:helper.link('-', null, {'dist_p' : -1}, (data.releasePressure > 0) ? null : 'disabled')}} +
 {{:data.releasePressure}} kPa 
+ {{:helper.link('+', null, {'dist_p' : 1}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('+', null, {'dist_p' : 10}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('Max', null, {'dist_p' : 'max'}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}} + {{:helper.link('Reset', null, {'dist_p' : 'reset'}, (data.releasePressure != data.defaultReleasePressure) ? null : 'disabled')}}
@@ -41,7 +41,7 @@ Mask Release Valve:
- {{:~link('Open', 'unlocked', {'stat' : 1}, (!maskConnected) ? 'disabled' : (valveOpen ? 'selected' : null))}}{{:~link('Close', 'locked', {'stat' : 1}, valveOpen ? null : 'selected')}} + {{:helper.link('Open', 'unlocked', {'stat' : 1}, (!data.maskConnected) ? 'disabled' : (data.valveOpen ? 'selected' : null))}}{{:helper.link('Close', 'locked', {'stat' : 1}, data.valveOpen ? null : 'selected')}}
diff --git a/nano/templates/telescience_console.tmpl b/nano/templates/telescience_console.tmpl index 6d11b8dd590..4f88267510c 100644 --- a/nano/templates/telescience_console.tmpl +++ b/nano/templates/telescience_console.tmpl @@ -3,35 +3,18 @@ Title: Telescience Control UI Used In File(s): \code\modules\telesci\telesci_computer.dm -->
-
Offsets:
+
Coordinates:
- {{:~link('X offset: ' + pOffsetX, 'gear', {'setPOffsetX': 1})}} - {{:~link('Y offset: ' + pOffsetY, 'gear', {'setPOffsetY': 1})}} -
-
Coordinates:
-
- {{:~link('X: ' + coordx, 'gear', {'setx': 1})}} - {{:~link('Y: ' + coordy, 'gear', {'sety': 1})}} - {{:~link('Z: ' + coordz, 'gear', {'setz': 1})}} + {{:helper.link('X: ' + data.coordx, 'gear', {'setx': 1})}} + {{:helper.link('Y: ' + data.coordy, 'gear', {'sety': 1})}} + {{:helper.link('Z: ' + data.coordz, 'gear', {'setz': 1})}}
Controls:
- {{:~link('Send', 'gear', {'send': 1}, null, (coordx != null && coordy != null && coordz != null) ? '' : 'disabled')}} - {{:~link('Receive', 'gear', {'receive': 1}, null, (coordx != null && coordy != null && coordz != null) ? '' : 'disabled')}} - {{:~link('Recalibrate', 'gear', {'recal': 1})}} + {{:helper.link('Send', 'gear', {'send': 1}, null, (data.coordx != null && data.coordy != null && data.coordz != null) ? '' : 'disabled')}} + {{:helper.link('Receive', 'gear', {'receive': 1}, null, (data.coordx != null && data.coordy != null && data.coordz != null) ? '' : 'disabled')}} + {{:helper.link('Recalibrate', 'gear', {'recal': 1})}}
-{{if !cell}} -
No power cell detected.
-{{else}} -
-
-
Charge:
- {{:~displayBar(cell.charge,0,cell.maxcharge,(cell.charge<1000)?"bad":"good")}} - {{:cell.charge}}/{{:cell.maxcharge}} - {{:~link("Eject", "eject", {"eject_cell":1},null)}} -
-
-{{/if}} diff --git a/nano/templates/transfer_valve.tmpl b/nano/templates/transfer_valve.tmpl index c2d957652a9..f8395839994 100644 --- a/nano/templates/transfer_valve.tmpl +++ b/nano/templates/transfer_valve.tmpl @@ -3,12 +3,12 @@ Attachment One:
- {{if attachmentOne}} - {{:attachmentOne}} + {{if data.attachmentOne}} + {{:data.attachmentOne}} {{else}} None {{/if}} - {{:~link('Remove', 'eject', {'tankone' : 1}, attachmentOne ? null : 'disabled')}} + {{:helper.link('Remove', 'eject', {'tankone' : 1}, data.attachmentOne ? null : 'disabled')}}
@@ -17,12 +17,12 @@ Attachment Two:
- {{if attachmentTwo}} - {{:attachmentTwo}} + {{if data.attachmentTwo}} + {{:data.attachmentTwo}} {{else}} None {{/if}} - {{:~link('Remove', 'eject', {'tanktwo' : 1}, attachmentTwo ? null : 'disabled')}} + {{:helper.link('Remove', 'eject', {'tanktwo' : 1}, data.attachmentTwo ? null : 'disabled')}}
@@ -31,12 +31,15 @@ Valve Attachment:
- {{if valveAttachment}} - {{:valveAttachment}} + {{if data.valveAttachment}} + {{:data.valveAttachment}} {{else}} None {{/if}} - {{:~link('Remove', 'eject', {'rem_device' : 1}, valveAttachment ? null : 'disabled')}} + {{:helper.link('Remove', 'eject', {'rem_device' : 1}, data.valveAttachment ? null : 'disabled')}} + {{if data.valveAttachment}} + {{:helper.link('View', 'wrench', {'device' : 1})}} + {{/if}}
@@ -47,7 +50,7 @@ Valve Status:
- {{:~link('Open', 'unlocked', {'open' : 1}, (!attachmentOne || !attachmentTwo) ? 'disabled' : (valveOpen ? 'selected' : null))}}{{:~link('Close', 'locked', {'open' : 1}, (!attachmentOne || !attachmentTwo) ? 'disabled' : (valveOpen ? null : 'selected'))}} + {{:helper.link('Open', 'unlocked', {'open' : 1}, (!data.attachmentOne || !data.attachmentTwo) ? 'disabled' : (data.valveOpen ? 'selected' : null))}}{{:helper.link('Close', 'locked', {'open' : 1}, (!data.attachmentOne || !data.attachmentTwo) ? 'disabled' : (data.valveOpen ? null : 'selected'))}}
diff --git a/nano/templates/uplink.tmpl b/nano/templates/uplink.tmpl index 34188899a59..dd92bcd0bea 100644 --- a/nano/templates/uplink.tmpl +++ b/nano/templates/uplink.tmpl @@ -3,44 +3,43 @@ Title: Syndicate Uplink, uses some javascript to change nanoUI up a bit. Used In File(s): \code\game\objects\items\devices\uplinks.dm --> -{{:~syndicateMode()}} -

{{:welcome}}

+{{:helper.syndicateMode()}} +

{{:data.welcome}}


Functions:
- {{:~link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}} + {{:helper.link('Close', 'gear', {'lock' : "1"}, null, 'fixedLeft')}}

-
- Tele-Crystals: -
-
- {{:crystals}} -
+
+ Tele-Crystals: +
+
+ {{:data.crystals}} +

Request items:


Each item costs a number of tele-crystals as indicated by the number following their name.

-{{for nano_items}} -
-

{{:Category}}

-
- {{for items}} -
- {{:~link( Name, 'gear', {'buy_item' : obj_path, 'cost' : Cost}, Cost > ~root.crystals ? 'disabled' : null, null)}} - {{:Cost}} -
+{{for data.nano_items}} +
+

{{:value.Category}}

+
+ {{for data.items :itemValue:itemIndex}} +
+ {{:helper.link( itemValue.Name, 'gear', {'buy_item' : itemValue.obj_path, 'cost' : itemValue.Cost}, itemValue.Cost > data.crystals ? 'disabled' : null, null)}} - {{:itemValue.Cost}} +
{{/for}} -
- +
{{/for}}
- {{:~link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}} + {{:helper.link('Buy Random (??)' , 'gear', {'buy_item' : 'random'}, null, 'fixedLeftWidest')}}