diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 76623d41e30..755ad12b35c 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1232,10 +1232,10 @@ B --><-- A return L -/atom/proc/contains(var/atom/location) - if(!location) + +/atom/proc/contains(var/atom/A) + if(!A) return 0 - for(location, location && location != src, location=location.loc); //semicolon is for the empty statement + for(var/atom/location = A.loc, location, location = location.loc) if(location == src) - return 1 - return 0 + return 1 \ No newline at end of file diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index 5b40ebbcacb..22604f811db 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -9,8 +9,8 @@ var/datum/subsystem/tgui/SStgui can_fire = 1 // This needs to fire before round start. var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key. - var/list/processing_uis = list() // A list of processing UIs, not grouped. - var/basehtml // The HTML template used by new UIs; minus initial data. + var/list/processing_uis = list() // A list of processing UIs, ungrouped. + var/basehtml // The HTML base used for all UIs. /datum/subsystem/tgui/New() @@ -19,9 +19,9 @@ var/datum/subsystem/tgui/SStgui NEW_SS_GLOBAL(SStgui) /datum/subsystem/tgui/stat_entry() - ..("O:[open_uis.len]|P:[processing_uis.len]") // Show how many interfaces we have open/are processing. + ..("P:[processing_uis.len]") -/datum/subsystem/tgui/fire() // Process UIs. +/datum/subsystem/tgui/fire() for(var/thing in processing_uis) var/datum/tgui/ui = thing if(ui && ui.user && ui.src_object) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 29ab749d9c3..a5e94437036 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -190,7 +190,7 @@ /obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "air_alarm", name, 390, 590) + ui = new(user, src, ui_key, "air_alarm", name, 440, 650) ui.open() /obj/machinery/alarm/get_ui_data(mob/user) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 3e716979df8..961b9f8ee28 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -17,6 +17,7 @@ /obj/Destroy() if(!istype(src, /obj/machinery)) SSobj.processing.Remove(src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists + SStgui.close_uis(src) return ..() /obj/assume_air(datum/gas_mixture/giver) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 61d71170384..6fd6d507597 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -35,10 +35,6 @@ return cmd_admin_pm(href_list["priv_msg"],null) return - // NanoUI - if(href_list["nano_error"]) - src << href_list["nano_error"] - throw EXCEPTION("NanoUI: [href_list["nano_error"]]") //Logs all hrefs if(config && config.log_hrefs && href_logfile) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 9f6fe1b90e6..5e5fe08cf4f 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -629,7 +629,7 @@ /obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", var/datum/tgui/ui = null, force_open = 0) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "apc", name, 460, 520) + ui = new(user, src, ui_key, "apc", name, 535, 515) ui.open() /obj/machinery/power/apc/get_ui_data(mob/user) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index c65d57658b2..a5ebf395dec 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -88,7 +88,7 @@ /obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open) if (!ui) - ui = new(user, src, ui_key, "chem_dispenser", name, 550, 700) + ui = new(user, src, ui_key, "chem_dispenser", name, 550, 550) ui.open() /obj/machinery/chem_dispenser/get_ui_data() @@ -129,11 +129,9 @@ switch(action) if("amount") - amount = round(text2num(params["amount"]), 5) // round to nearest 5 - if (amount < 0) // Since the user can actually type the commands himself, some sanity checking - amount = 0 - if (amount > 100) - amount = 100 + var/amount = text2num(params["amount"]) + if(amount in beaker.possible_transfer_amounts) + src.amount = amount if("dispense") if(beaker && dispensable_reagents.Find(params["reagent"])) var/datum/reagents/R = beaker.reagents diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index 1efa5cee8fe..d42f1d227eb 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -17,7 +17,7 @@ * optional master_ui datum/tgui The parent UI. * optional state datum/ui_state The state used to determine status. **/ -/atom/movable/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, \ +/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, \ force_open = 0, datum/tgui/master_ui = null, \ datum/ui_state/state = default_state) return -1 // Sorta implemented. @@ -32,7 +32,7 @@ * * return list Data to be sent to the UI. **/ -/atom/movable/proc/get_ui_data(mob/user) +/datum/proc/get_ui_data(mob/user) return list() // Not implemented. @@ -47,7 +47,7 @@ * * return bool If the UI should be updated or not. **/ -/atom/movable/proc/ui_act(action, list/params) +/datum/proc/ui_act(action, list/params) return // Not implemented. @@ -55,9 +55,10 @@ * private * * The UI's host object (usually src_object). - * Used internally by ui_state(s). + * This allows modules/datums to have the UI attached to them, + * and be a part of another object. **/ -/atom/proc/ui_host() +/datum/proc/ui_host() return src /** diff --git a/code/modules/tgui/states/admin.dm b/code/modules/tgui/states/admin.dm index c9a3bb467c4..62e18bb6b96 100644 --- a/code/modules/tgui/states/admin.dm +++ b/code/modules/tgui/states/admin.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/admin_state/admin_state = new() -/datum/ui_state/admin_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/admin_state/can_use_topic(src_object, mob/user) if(check_rights_for(user.client, R_ADMIN)) return UI_INTERACTIVE return UI_CLOSE diff --git a/code/modules/tgui/states/conscious.dm b/code/modules/tgui/states/conscious.dm index 1b781a458d7..9a5c1a5e54f 100644 --- a/code/modules/tgui/states/conscious.dm +++ b/code/modules/tgui/states/conscious.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/conscious_state/conscious_state = new() -/datum/ui_state/conscious_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/conscious_state/can_use_topic(src_object, mob/user) if(user.stat == CONSCIOUS) return UI_INTERACTIVE return UI_CLOSE diff --git a/code/modules/tgui/states/contained.dm b/code/modules/tgui/states/contained.dm index 20cda3241e0..6cb88abea28 100644 --- a/code/modules/tgui/states/contained.dm +++ b/code/modules/tgui/states/contained.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/contained_state/contained_state = new() -/datum/ui_state/contained_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user) if(!src_object.contains(user)) return UI_CLOSE return user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/deep_inventory.dm b/code/modules/tgui/states/deep_inventory.dm index 4fef9ad5b3c..70f2a59992e 100644 --- a/code/modules/tgui/states/deep_inventory.dm +++ b/code/modules/tgui/states/deep_inventory.dm @@ -1,12 +1,12 @@ /** * tgui state: deep_inventory_state * - * Checks that the src_object is in the user's fist-level (backpack, webbing, etc) inventory. + * Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory. **/ /var/global/datum/ui_state/deep_inventory_state/deep_inventory_state = new() -/datum/ui_state/deep_inventory_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/deep_inventory_state/can_use_topic(src_object, mob/user) if(!user.contains(src_object)) return UI_CLOSE return user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm index 8e1c3e8dec9..56ec71b7cc8 100644 --- a/code/modules/tgui/states/default.dm +++ b/code/modules/tgui/states/default.dm @@ -6,20 +6,20 @@ /var/global/datum/ui_state/default/default_state = new() -/datum/ui_state/default/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/default/can_use_topic(src_object, mob/user) return user.default_can_use_topic(src_object) // Call the individual mob-overriden procs. -/mob/proc/default_can_use_topic(atom/movable/src_object) +/mob/proc/default_can_use_topic(src_object) return UI_CLOSE // Don't allow interaction by default. -/mob/living/default_can_use_topic(atom/movable/src_object) +/mob/living/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) - if(. > UI_CLOSE) - . = min(., shared_living_ui_distance(src_object)) // Check the distance... + if(. > UI_CLOSE && loc) + . = min(., loc.contents_ui_distance(src_object, src)) // Check the distance... if(. == UI_INTERACTIVE) // Non-human living mobs can only look, not touch. return UI_UPDATE -/mob/living/carbon/human/default_can_use_topic(atom/movable/src_object) +/mob/living/carbon/human/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) if(. > UI_CLOSE) . = min(., shared_living_ui_distance(src_object)) // Check the distance... @@ -27,7 +27,7 @@ if(prob(getBrainLoss())) return UI_UPDATE -/mob/living/silicon/robot/default_can_use_topic(atom/movable/src_object) +/mob/living/silicon/robot/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) if(. <= UI_DISABLED) return @@ -37,7 +37,7 @@ return UI_INTERACTIVE return UI_DISABLED // Otherwise they can keep the UI open. -/mob/living/silicon/ai/default_can_use_topic(atom/movable/src_object) +/mob/living/silicon/ai/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) if(. < UI_INTERACTIVE) return @@ -47,12 +47,12 @@ return UI_INTERACTIVE return UI_CLOSE -/mob/living/simple_animal/drone/default_can_use_topic(atom/movable/src_object) +/mob/living/simple_animal/drone/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) if(. > UI_CLOSE) . = min(., shared_living_ui_distance(src_object)) // Drones can only use things they're near. -/mob/living/silicon/pai/default_can_use_topic(atom/movable/src_object) +/mob/living/silicon/pai/default_can_use_topic(src_object) // pAIs can only use themselves and the owner's radio. if((src_object == src || src_object == radio) && !stat) return UI_INTERACTIVE diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm index 536a90597e4..11b1c021cc2 100644 --- a/code/modules/tgui/states/hands.dm +++ b/code/modules/tgui/states/hands.dm @@ -6,15 +6,15 @@ /var/global/datum/ui_state/hands_state/hands_state = new() -/datum/ui_state/hands_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/hands_state/can_use_topic(src_object, mob/user) . = user.shared_ui_interaction(src_object) if(. > UI_CLOSE) return min(., user.hands_can_use_topic(src_object)) -/mob/proc/hands_can_use_topic(atom/movable/src_object) +/mob/proc/hands_can_use_topic(src_object) return UI_CLOSE -/mob/living/hands_can_use_topic(atom/movable/src_object) +/mob/living/hands_can_use_topic(src_object) if(src_object in get_both_hands(src)) return UI_INTERACTIVE return UI_CLOSE \ No newline at end of file diff --git a/code/modules/tgui/states/inventory.dm b/code/modules/tgui/states/inventory.dm index a5f7233f00d..02870296338 100644 --- a/code/modules/tgui/states/inventory.dm +++ b/code/modules/tgui/states/inventory.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/inventory_state/inventory_state = new() -/datum/ui_state/inventory_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/inventory_state/can_use_topic(src_object, mob/user) if(!(src_object in user)) return UI_CLOSE return user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/notcontained.dm b/code/modules/tgui/states/notcontained.dm index 8df75b57626..0b6462fe331 100644 --- a/code/modules/tgui/states/notcontained.dm +++ b/code/modules/tgui/states/notcontained.dm @@ -6,21 +6,21 @@ /var/global/datum/ui_state/notcontained_state/notcontained_state = new() -/datum/ui_state/notcontained_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user) . = user.shared_ui_interaction(src_object) if(. > UI_CLOSE) return min(., user.notcontained_can_use_topic(src_object)) -/mob/proc/notcontained_can_use_topic(atom/movable/src_object) +/mob/proc/notcontained_can_use_topic(src_object) return UI_CLOSE -/mob/living/notcontained_can_use_topic(atom/movable/src_object) +/mob/living/notcontained_can_use_topic(atom/src_object) if(src_object.contains(src)) return UI_CLOSE // Close if we're inside it. return default_can_use_topic(src_object) -/mob/living/silicon/notcontained_can_use_topic(atom/movable/src_object) +/mob/living/silicon/notcontained_can_use_topic(src_object) return default_can_use_topic(src_object) // Silicons use default bevhavior. -/mob/living/simple_animal/drone/notcontained_can_use_topic(atom/movable/src_object) +/mob/living/simple_animal/drone/notcontained_can_use_topic(src_object) return default_can_use_topic(src_object) // Drones use default bevhavior. diff --git a/code/modules/tgui/states/physical.dm b/code/modules/tgui/states/physical.dm index a3fae3b276e..5cbcae97f7c 100644 --- a/code/modules/tgui/states/physical.dm +++ b/code/modules/tgui/states/physical.dm @@ -6,16 +6,16 @@ /var/global/datum/ui_state/physical/physical_state = new() -/datum/ui_state/physical/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/physical/can_use_topic(src_object, mob/user) . = user.shared_ui_interaction(src_object) if(. > UI_CLOSE) return min(., user.physical_can_use_topic(src_object)) -/mob/proc/physical_can_use_topic(atom/movable/src_object) +/mob/proc/physical_can_use_topic(src_object) return UI_CLOSE -/mob/living/physical_can_use_topic(atom/movable/src_object) +/mob/living/physical_can_use_topic(src_object) return shared_living_ui_distance(src_object) -/mob/living/silicon/physical_can_use_topic(atom/movable/src_object) +/mob/living/silicon/physical_can_use_topic(src_object) return max(UI_UPDATE, shared_living_ui_distance(src_object)) // Silicons can always see. diff --git a/code/modules/tgui/states/self.dm b/code/modules/tgui/states/self.dm index edb7c3ef300..b08fe373c6a 100644 --- a/code/modules/tgui/states/self.dm +++ b/code/modules/tgui/states/self.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/self_state/self_state = new() -/datum/ui_state/self_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/self_state/can_use_topic(src_object, mob/user) if(src_object != user) return UI_CLOSE return user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/states.dm b/code/modules/tgui/states/states.dm index 195d9394e3e..11653b30a0d 100644 --- a/code/modules/tgui/states/states.dm +++ b/code/modules/tgui/states/states.dm @@ -7,14 +7,14 @@ /** * public * - * Checks if a user can use src_object's UI, under the given state. + * Checks the UI state for a mob. * * required user mob The mob who opened/is using the UI. * required state datum/ui_state The state to check. * * return UI_state The state of the UI. **/ -/atom/proc/ui_state(mob/user, datum/ui_state/state) +/datum/proc/ui_status(mob/user, datum/ui_state/state) var/src_object = ui_host() if(istype(user, /mob/dead/observer)) // Special-case ghosts. @@ -31,12 +31,12 @@ * Checks if a user can use src_object's UI, and returns the state. * Can call a mob proc, which allows overrides for each mob. * - * required src_object atom/movable The object which owns the UI. + * required src_object datum The object/datum which owns the UI. * required user mob The mob who opened/is using the UI. * * return UI_state The state of the UI. **/ -/datum/ui_state/proc/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/proc/can_use_topic(src_object, mob/user) return UI_CLOSE // Don't allow interaction by default. @@ -47,7 +47,7 @@ * * return UI_state The state of the UI. **/ -/mob/proc/shared_ui_interaction(atom/movable/src_object) +/mob/proc/shared_ui_interaction(src_object) if(!client || stat) // Close UIs if mindless or dead/unconcious. return UI_CLOSE // Update UIs if incapicitated but concious. @@ -55,19 +55,19 @@ return UI_UPDATE return UI_INTERACTIVE -/mob/living/carbon/human/shared_ui_interaction(atom/movable/src_object) +/mob/living/carbon/human/shared_ui_interaction(src_object) // If we have telekinesis and remain close enough, allow interaction. if(dna.check_mutation(TK)) if(tkMaxRangeCheck(src, src_object)) return UI_INTERACTIVE return ..() -/mob/living/silicon/ai/shared_ui_interaction(atom/movable/src_object) +/mob/living/silicon/ai/shared_ui_interaction(src_object) if(lacks_power()) // Close UIs if the AI is unpowered. return UI_CLOSE return ..() -/mob/living/silicon/robot/shared_ui_interaction(atom/movable/src_object) +/mob/living/silicon/robot/shared_ui_interaction(src_object) if(cell.charge <= 0) // Close UIs if the Borg is unpowered. return UI_CLOSE if(lockcharge) // Disable UIs if the Borg is locked. @@ -81,12 +81,12 @@ * Really only used for checks outside the context of a mob. * Otherwise, use shared_living_ui_distance(). * - * required src_object atom/movable The object which owns the UI. + * required src_object The object which owns the UI. * required user mob The mob who opened/is using the UI. * * return UI_state The state of the UI. **/ -/atom/proc/contents_ui_distance(atom/movable/src_object, mob/living/user) +/atom/proc/contents_ui_distance(src_object, mob/living/user) return user.shared_living_ui_distance(src_object) // Just call this mob's check. /** diff --git a/code/modules/tgui/states/zlevel.dm b/code/modules/tgui/states/zlevel.dm index 2f06f36c8f8..1871980a82a 100644 --- a/code/modules/tgui/states/zlevel.dm +++ b/code/modules/tgui/states/zlevel.dm @@ -6,7 +6,7 @@ /var/global/datum/ui_state/z_state/z_state = new() -/datum/ui_state/z_state/can_use_topic(atom/movable/src_object, mob/user) +/datum/ui_state/z_state/can_use_topic(src_object, mob/user) var/turf/turf_obj = get_turf(src_object) var/turf/turf_usr = get_turf(user) if(!turf_obj || !turf_usr || !(turf_obj.z == turf_usr.z)) diff --git a/code/modules/tgui/subsystem.dm b/code/modules/tgui/subsystem.dm index 14b4dd5f7e5..e2ce952f57c 100644 --- a/code/modules/tgui/subsystem.dm +++ b/code/modules/tgui/subsystem.dm @@ -10,7 +10,7 @@ * Get a open UI given a user, src_object, and ui_key and try to update it with data. * * required user mob The mob who opened/is using the UI. - * required src_object atom/movable The object which owns the UI. + * required src_object datum The object/datum which owns the UI. * required ui_key string The ui_key of the UI. * optional ui datum/tgui The UI to be updated, if it exists. * optional data list The data to update the UI with, if it exists. @@ -18,7 +18,7 @@ * * return datum/tgui The found UI. **/ -/datum/subsystem/tgui/proc/try_update_ui(mob/user, atom/movable/src_object, ui_key, datum/tgui/ui, \ +/datum/subsystem/tgui/proc/try_update_ui(mob/user, datum/src_object, ui_key, datum/tgui/ui, \ list/data = null, force_open = 0) if(!data) data = src_object.get_ui_data(user) @@ -41,12 +41,12 @@ * Get a open UI given a user, src_object, and ui_key. * * required user mob The mob who opened/is using the UI. - * required src_object atom/movable The object which owns the UI. + * required src_object datum The object/datum which owns the UI. * required ui_key string The ui_key of the UI. * * return datum/tgui The found UI. **/ -/datum/subsystem/tgui/proc/get_open_ui(mob/user, atom/movable/src_object, ui_key) +/datum/subsystem/tgui/proc/get_open_ui(mob/user, datum/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)) return null // No UIs open. @@ -64,11 +64,11 @@ * * Update all UIs attached to src_object. * - * required src_object atom/movable The object which owns the UIs. + * required src_object datum The object/datum which owns the UIs. * * return int The number of UIs updated. **/ -/datum/subsystem/tgui/proc/update_uis(atom/movable/src_object) +/datum/subsystem/tgui/proc/update_uis(datum/src_object) var/src_object_key = "\ref[src_object]" if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list)) return 0 // Couldn't find any UIs for this object. @@ -86,11 +86,11 @@ * * Close all UIs attached to src_object. * - * required src_object atom/movable The object which owns the UIs. + * required src_object datum The object/datum which owns the UIs. * * return int The number of UIs closed. **/ -/datum/subsystem/tgui/proc/close_uis(atom/movable/src_object) +/datum/subsystem/tgui/proc/close_uis(datum/src_object) var/src_object_key = "\ref[src_object]" if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list)) return 0 // Couldn't find any UIs for this object. @@ -109,12 +109,12 @@ * Update all UIs belonging to a user. * * required user mob The mob who opened/is using the UI. - * optional src_object atom/movable If provided, only update UIs belonging this atom. + * optional src_object datum If provided, only update UIs belonging this src_object. * optional ui_key string If provided, only update UIs with this UI key. * * return int The number of UIs updated. **/ -/datum/subsystem/tgui/proc/update_user_uis(mob/user, atom/movable/src_object = null, ui_key = null) +/datum/subsystem/tgui/proc/update_user_uis(mob/user, datum/src_object = null, ui_key = null) if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0) return 0 // Couldn't find any UIs for this user. @@ -131,12 +131,12 @@ * Close all UIs belonging to a user. * * required user mob The mob who opened/is using the UI. - * optional src_object atom/movable If provided, only update UIs belonging this atom. - * optional ui_key string If provided, only update UIs with this UI key. + * optional src_object datum If provided, only close UIs belonging this src_object. + * optional ui_key string If provided, only close UIs with this UI key. * * return int The number of UIs closed. **/ -/datum/subsystem/tgui/proc/close_user_uis(mob/user, atom/movable/src_object = null, ui_key = null) +/datum/subsystem/tgui/proc/close_user_uis(mob/user, datum/src_object = null, ui_key = null) if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0) return 0 // Couldn't find any UIs for this user. diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 42fa08b2f8b..0d775e1824e 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -9,7 +9,7 @@ **/ /datum/tgui var/mob/user // The mob who opened/is using the UI. - var/atom/movable/src_object // The object which owns the UI. + var/datum/src_object // The object which owns the UI. var/title // The title of te UI. var/ui_key // The ui_key of the UI. This allows multiple UIs for one src_object. var/window_id // The window_id for browse() and onclose(). @@ -40,7 +40,7 @@ * Create a new UI. * * required user mob The mob who opened/is using the UI. - * required src_object atom/movable The object which owns the UI. + * required src_object datum The object or datum which owns the UI. * required ui_key string The ui_key of the UI. * required interface string The interface used to render the UI. * optional title string The title of the UI. @@ -52,7 +52,7 @@ * * return datum/tgui The requested UI. **/ -/datum/tgui/New(mob/user, atom/movable/src_object, ui_key, interface, \ +/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, \ title, width = 0, height = 0, \ atom/ref = null, datum/tgui/master_ui = null, \ datum/ui_state/state = default_state) @@ -89,12 +89,13 @@ * optional data list The data to intialize the UI with. **/ /datum/tgui/proc/open(list/data = null) + set waitfor = 0 // Don't wait on sleep()s. if(!user.client) return // Bail if there is no client. update_status(push = 0) // Update the window status. if(status == UI_CLOSE) - return // Bail if we should close. + return // Bail if we're not supposed to open. if(!initial_data) if(!data) // If we don't have initial_data and data was not passed, get data from the src_object. @@ -105,7 +106,11 @@ if(width && height) // If we have a width and height, use them. window_size = "size=[width]x[height];" - user << browse(get_html(), "window=[window_id];[window_size][list2params(window_options)]") // Open the window. + var/debugable = check_rights_for(user.client, R_DEBUG) + user << browse(get_html(debugable), "window=[window_id];[window_size][list2params(window_options)]") // Open the window. + if(!debugable) + sleep(1) + user << output(url_encode(get_json(initial_data)), "[window_id].browser:initialize") // If the window is not debugable (JSON not inlined), send the JSON. winset(user, window_id, "on-close=\"uiclose \ref[src]\"") // Instruct the client to signal UI when the window is closed. SStgui.on_open(src) @@ -135,6 +140,9 @@ SStgui.on_close(src) for(var/datum/tgui/child in children) // Loop through and close all children. child.close() + children.Cut() + state = null + master_ui = null /** * public @@ -192,11 +200,18 @@ * * Generate HTML for this UI. * + * optional bool inline If the JSON should be inlined into the HTML (for debugging). + * * return string UI HTML output. **/ -/datum/tgui/proc/get_html() - // Poplate HTML with JSON. - return replacetextEx(SStgui.basehtml, "{}", get_json(initial_data)) +/datum/tgui/proc/get_html(var/inline) + var/html + // Poplate HTML with JSON if we're supposed to inline. + if(inline) + html = replacetextEx(SStgui.basehtml, "{}", get_json(initial_data)) + else + html = SStgui.basehtml + return html /** * private @@ -207,20 +222,20 @@ **/ /datum/tgui/proc/get_config_data() var/list/config_data = list( - "title" = title, - "status" = status, - "style" = style, - "interface" = interface, - "fancy" = user.client.prefs.tgui_fancy, - "locked" = user.client.prefs.tgui_lock, - "window" = window_id, - "ref" = "\ref[src]", - "user" = list( - "name" = user.name, - "ref" = "\ref[user]" + "title" = title, + "status" = status, + "style" = style, + "interface" = interface, + "fancy" = user.client.prefs.tgui_fancy, + "locked" = user.client.prefs.tgui_lock, + "window" = window_id, + "ref" = "\ref[src]", + "user" = list( + "name" = user.name, + "ref" = "\ref[user]" ), - "srcObject" = list( - "name" = src_object.name, + "srcObject" = list( + "name" = "[src_object]", "ref" = "\ref[src_object]" ) ) @@ -240,6 +255,7 @@ json_data["config"] = get_config_data() if(!isnull(data)) json_data["data"] = data + json_data["adata"] = data // Generate the JSON; replace bad characters. var/json = JSON.stringify(json_data) @@ -262,6 +278,18 @@ var/action = href_list["action"] // Pull the action out. href_list -= "action" + // Handle any special actions. + switch(action) + if("tgui:ie") + user << link("http://windows.microsoft.com/en-us/internet-explorer/download-ie") + return + if("tgui:fancy") + user.client.prefs.tgui_fancy = TRUE + return + if("tgui:nofrills") + user.client.prefs.tgui_fancy = FALSE + return + var/update = src_object.ui_act(action, href_list, state) // Call ui_act() on the src_object. if(src_object && update) SStgui.update_uis(src_object) // If we have a src_object and its ui_act() told us to update. @@ -297,8 +325,8 @@ if(status <= UI_DISABLED && !force) return // Cannot update UI, we have no visibility. - // Send the new JSON to the recieveUpdate() Javascript function. - user << output(url_encode(get_json(data)), "[window_id].browser:receiveUpdate") + // Send the new JSON to the update() Javascript function. + user << output(url_encode(get_json(data)), "[window_id].browser:update") /** @@ -320,14 +348,14 @@ * optional push bool Push an update to the UI (an update is always sent for UI_DISABLED). **/ /datum/tgui/proc/update_status(push = 0) - var/new_status = src_object.ui_state(user, state) + var/obj/host = src_object.ui_host() + var/status = host.ui_status(user, state) if(master_ui) - new_status = min(new_status, master_ui.status) + status = min(status, master_ui.status) - if(new_status == UI_CLOSE) + set_status(status, push) + if(status == UI_CLOSE) close() - else - set_status(new_status, push) /** * private diff --git a/tgui/.gitattributes b/tgui/.gitattributes new file mode 100644 index 00000000000..3acb4c9ebd7 --- /dev/null +++ b/tgui/.gitattributes @@ -0,0 +1 @@ +assets/* binary diff --git a/tgui/assets/tgui.css b/tgui/assets/tgui.css index f7911a750af..15539c37f2c 100644 --- a/tgui/assets/tgui.css +++ b/tgui/assets/tgui.css @@ -1 +1 @@ -.normal{color:#40628a}.good{color:#537d29}.average{color:#be6209}.bad{color:#b00e0e}.highlight,.label{color:#8ba5c4}.dark{color:#272727}html{box-sizing:border-box;min-height:100%;margin:0;cursor:default}*,:after,:before{box-sizing:inherit}body{min-height:100%;height:100%;margin:0 6px;background-color:#202020;font-family:Verdana,Geneva,sans-serif;font-size:12px;color:#fff}main{display:block;margin-top:32px;padding-top:3px}hr{height:2px;background-color:#40628a;border:none}h1,h2,h3,h4{display:inline-block;margin:0;padding:6px 0}h1{font-size:18px}h2{font-size:16px}h3{font-size:14px}h4{font-size:12px}.bar .barText,span.button{color:#fff;font-size:12px;font-weight:400;font-style:normal;text-decoration:none}.bold{font-weight:700}.italic{font-style:italic}[unselectable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bar{display:inline-block;position:relative;vertical-align:middle;width:100%;height:20px;line-height:17px;padding:1px;border:1px solid #40628a;background:#272727}.bar .barText{position:absolute;top:0;right:3px}.bar .barFill{display:block;height:100%;transition:background-color 1s;background-color:#40628a}.bar .barFill.good{background-color:#537d29}.bar .barFill.average{background-color:#be6209}.bar .barFill.bad{background-color:#b00e0e}.bar .barFill.highlight{background-color:#8ba5c4}span.button{display:inline-block;vertical-align:middle;height:20px;line-height:19px;padding:0 5px;white-space:nowrap;transition:background-color .25s,box-shadow .25s}span.button .fa{padding-right:2px}span.button.normal{background-color:#40628a}span.button.normal:focus,span.button.normal:hover{outline:0;box-shadow:inset 0 0 100px 100px hsla(0,0%,100%,.15)}span.button.disabled{background-color:#999}span.button.selected{background-color:#2f943c}span.button.caution{background-color:#9a9d00}span.button.danger{background-color:#9d0808}span.button.gridable{width:125px;margin:2px 0}div.display,div.notice{width:100%;padding:4px;margin:6px 0;background-color:#000;-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr=#54000000,endColorStr=#54000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorStr=#54000000,endColorStr=#54000000);background-color:rgba(0,0,0,.33);box-shadow:inset 0 0 5px rgba(0,0,0,.5)}div.display header,div.notice header,div.subdisplay header{display:block;position:relative;width:100%;padding:0 4px;margin-bottom:6px;border-bottom:2px solid #40628a}div.display header .button,div.notice header .button,div.subdisplay header .button{position:absolute;bottom:6px;right:4px}div.display article,div.notice article,div.subdisplay article{display:table;width:100%;border-spacing:4px 6px}div.notice{background-color:#bb9b68;background-image:repeating-linear-gradient(-45deg,#bb9b68,#bb9b68 10px,#b1905d 0,#b1905d 20px);margin:8px 0;box-shadow:none;color:#000;font-weight:700;font-style:italic}div.notice .button{outline:1px solid #272727}div.notice .label{color:#000}div.resize{position:fixed;bottom:0;right:0;width:0;height:0;border-style:solid;border-width:0 0 45px 45px;border-color:transparent transparent #363636;-webkit-transform:rotate(1turn);-ms-transform:rotate(1turn);transform:rotate(1turn)}section .content,section .label,section .line{display:table-cell;margin:0;text-align:left;vertical-align:middle}section{display:table-row;width:100%;padding:3px 0}section:not(first-child){padding-top:4px}section .label{width:1%;padding-right:32px;white-space:nowrap;color:#8ba5c4}section .content:not(:last-child){padding-right:16px}section .line{width:100%}section .buttoninfo{margin-left:5px}div.subdisplay{width:100%;margin:0}header.titlebar .close,header.titlebar .minimize{display:inline-block;position:relative;padding:7px;margin:-7px;color:#98b0c3}header.titlebar .close:hover,header.titlebar .minimize:hover{color:#a7bccc}header.titlebar{position:fixed;top:0;left:0;width:100%;height:32px;background-color:#363636;box-shadow:0 3px 3px rgba(0,0,0,.1)}header.titlebar .statusicon{position:absolute;top:4px;left:12px;transition:color .5s}header.titlebar .title{position:absolute;top:6px;left:46px;color:#98b0c3;font-size:16px;white-space:nowrap}header.titlebar .minimize{position:absolute;top:6px;right:46px}header.titlebar .close{position:absolute;top:4px;right:12px}.wf-inactive .minimize:after{content:"-"}.wf-inactive .close:after{content:"X"}body.generic{background:linear-gradient(180deg,#2a2a2a 0,#202020)}body.generic,body.nanotrasen{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2a2a2a',endColorstr='#ff202020',GradientType=0)}body.nanotrasen{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCA0MjUgMjAwIiBvcGFjaXR5PSIuMjUiPgogIDxwYXRoIGQ9Im0gMTc4LjAwMzk5LDAuMDM4NjkgLTcxLjIwMzkzLDAgYSA2Ljc2MTM0MjIsNi4wMjU1NDk1IDAgMCAwIC02Ljc2MTM0LDYuMDI1NTUgbCAwLDE4Ny44NzE0NyBhIDYuNzYxMzQyMiw2LjAyNTU0OTUgMCAwIDAgNi43NjEzNCw2LjAyNTU0IGwgNTMuMTA3MiwwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA2Ljc2MTM1LC02LjAyNTU0IGwgMCwtMTAxLjU0NDAxOCA3Mi4yMTYyOCwxMDQuNjk5Mzk4IGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA1Ljc2MDE1LDIuODcwMTYgbCA3My41NTQ4NywwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA2Ljc2MTM1LC02LjAyNTU0IGwgMCwtMTg3Ljg3MTQ3IGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCAtNi43NjEzNSwtNi4wMjU1NSBsIC01NC43MTY0NCwwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCAtNi43NjEzMyw2LjAyNTU1IGwgMCwxMDIuNjE5MzUgTCAxODMuNzY0MTMsMi45MDg4NiBhIDYuNzYxMzQyMiw2LjAyNTU0OTUgMCAwIDAgLTUuNzYwMTQsLTIuODcwMTcgeiIgLz4KICA8cGF0aCBkPSJNIDQuODQ0NjMzMywyMi4xMDg3NSBBIDEzLjQxMjAzOSwxMi41MDE4NDIgMCAwIDEgMTMuNDc3NTg4LDAuMDM5MjQgbCA2Ni4xMTgzMTUsMCBhIDUuMzY0ODE1OCw1LjAwMDczNyAwIDAgMSA1LjM2NDgyMyw1LjAwMDczIGwgMCw3OS44NzkzMSB6IiAvPgogIDxwYXRoIGQ9Im0gNDIwLjE1NTM1LDE3Ny44OTExOSBhIDEzLjQxMjAzOCwxMi41MDE4NDIgMCAwIDEgLTguNjMyOTUsMjIuMDY5NTEgbCAtNjYuMTE4MzIsMCBhIDUuMzY0ODE1Miw1LjAwMDczNyAwIDAgMSAtNS4zNjQ4MiwtNS4wMDA3NCBsIDAsLTc5Ljg3OTMxIHoiIC8+Cjwvc3ZnPgo=") no-repeat fixed center/70% 70%,linear-gradient(180deg,#2a2a2a 0,#202020)} \ No newline at end of file +.normal{color:#40628a}.good{color:#537d29}.average{color:#be6209}.bad{color:#b00e0e}.highlight,.label{color:#8ba5c4}.dark{color:#272727}html{box-sizing:border-box;min-height:100%;margin:0;cursor:default}*,:after,:before{box-sizing:inherit}body{min-height:100%;height:100%;margin:0 6px;background-color:#202020;font-family:Verdana,Geneva,sans-serif;font-size:12px;color:#fff}main{display:block;margin-top:32px;padding-top:3px}hr{height:2px;background-color:#40628a;border:none}h1,h2,h3,h4{display:inline-block;margin:0;padding:6px 0}h1{font-size:18px}h2{font-size:16px}h3{font-size:14px}h4{font-size:12px}.bar .barText,span.button{color:#fff;font-size:12px;font-weight:400;font-style:normal;text-decoration:none}.bold{font-weight:700}.italic{font-style:italic}[unselectable=on]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bar{display:inline-block;position:relative;vertical-align:middle;width:100%;height:20px;line-height:17px;padding:1px;border:1px solid #40628a;background:#272727}.bar .barText{position:absolute;top:0;right:3px}.bar .barFill{display:block;height:100%;transition:background-color 1s;background-color:#40628a}.bar .barFill.good{background-color:#537d29}.bar .barFill.average{background-color:#be6209}.bar .barFill.bad{background-color:#b00e0e}.bar .barFill.highlight{background-color:#8ba5c4}span.button{display:inline-block;vertical-align:middle;height:20px;line-height:19px;padding:0 5px;white-space:nowrap;transition:background-color .25s,box-shadow .25s}span.button .fa{padding-right:2px}span.button.normal{background-color:#40628a}span.button.normal:focus,span.button.normal:hover{outline:0;box-shadow:inset 0 0 100px 100px hsla(0,0%,100%,.15)}span.button.disabled{background-color:#999}span.button.selected{background-color:#2f943c}span.button.caution{background-color:#9a9d00}span.button.danger{background-color:#9d0808}span.button.gridable{width:125px;margin:2px 0}div.display,div.notice{width:100%;padding:4px;margin:6px 0;background-color:#000;-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr=#54000000,endColorStr=#54000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorStr=#54000000,endColorStr=#54000000);background-color:rgba(0,0,0,.33);box-shadow:inset 0 0 5px rgba(0,0,0,.5)}div.display header,div.notice header,div.subdisplay header{display:block;position:relative;width:100%;padding:0 4px;margin-bottom:6px;border-bottom:2px solid #40628a}div.display header .buttonRight,div.notice header .buttonRight,div.subdisplay header .buttonRight{position:absolute;bottom:6px;right:4px}div.display article,div.notice article,div.subdisplay article{display:table;width:100%;border-spacing:4px 6px}div.notice{background-color:#bb9b68;background-image:repeating-linear-gradient(-45deg,#bb9b68,#bb9b68 10px,#b1905d 0,#b1905d 20px);margin:8px 0;box-shadow:none;color:#000;font-weight:700;font-style:italic}div.notice .button{outline:1px solid #272727}div.notice .label{color:#000}div.notice hr{background-color:#272727}div.resize{position:fixed;bottom:0;right:0;width:0;height:0;border-style:solid;border-width:0 0 45px 45px;border-color:transparent transparent #363636;-webkit-transform:rotate(1turn);-ms-transform:rotate(1turn);transform:rotate(1turn)}section .content,section .label,section .line{display:table-cell;margin:0;text-align:left;vertical-align:middle}section{display:table-row;width:100%;padding:3px 0}section:not(first-child){padding-top:4px}section .label{width:1%;padding-right:32px;white-space:nowrap;color:#8ba5c4}section .content:not(:last-child){padding-right:16px}section .line{width:100%}section .buttoninfo{margin-left:5px}div.subdisplay{width:100%;margin:0}header.titlebar .close,header.titlebar .minimize{display:inline-block;position:relative;padding:7px;margin:-7px;color:#98b0c3}header.titlebar .close:hover,header.titlebar .minimize:hover{color:#a7bccc}header.titlebar{position:fixed;top:0;left:0;width:100%;height:32px;background-color:#363636;box-shadow:0 3px 3px rgba(0,0,0,.1)}header.titlebar .statusicon{position:absolute;top:4px;left:12px;transition:color .5s}header.titlebar .title{position:absolute;top:6px;left:46px;color:#98b0c3;font-size:16px;white-space:nowrap}header.titlebar .minimize{position:absolute;top:6px;right:46px}header.titlebar .close{position:absolute;top:4px;right:12px}.wf-inactive .minimize:after{content:"-"}.wf-inactive .close:after{content:"X"}body.generic{background:linear-gradient(180deg,#2a2a2a 0,#202020)}body.generic,body.nanotrasen{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2a2a2a',endColorstr='#ff202020',GradientType=0)}body.nanotrasen{background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCA0MjUgMjAwIiBvcGFjaXR5PSIuMjUiPgogIDxwYXRoIGQ9Im0gMTc4LjAwMzk5LDAuMDM4NjkgLTcxLjIwMzkzLDAgYSA2Ljc2MTM0MjIsNi4wMjU1NDk1IDAgMCAwIC02Ljc2MTM0LDYuMDI1NTUgbCAwLDE4Ny44NzE0NyBhIDYuNzYxMzQyMiw2LjAyNTU0OTUgMCAwIDAgNi43NjEzNCw2LjAyNTU0IGwgNTMuMTA3MiwwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA2Ljc2MTM1LC02LjAyNTU0IGwgMCwtMTAxLjU0NDAxOCA3Mi4yMTYyOCwxMDQuNjk5Mzk4IGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA1Ljc2MDE1LDIuODcwMTYgbCA3My41NTQ4NywwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCA2Ljc2MTM1LC02LjAyNTU0IGwgMCwtMTg3Ljg3MTQ3IGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCAtNi43NjEzNSwtNi4wMjU1NSBsIC01NC43MTY0NCwwIGEgNi43NjEzNDIyLDYuMDI1NTQ5NSAwIDAgMCAtNi43NjEzMyw2LjAyNTU1IGwgMCwxMDIuNjE5MzUgTCAxODMuNzY0MTMsMi45MDg4NiBhIDYuNzYxMzQyMiw2LjAyNTU0OTUgMCAwIDAgLTUuNzYwMTQsLTIuODcwMTcgeiIgLz4KICA8cGF0aCBkPSJNIDQuODQ0NjMzMywyMi4xMDg3NSBBIDEzLjQxMjAzOSwxMi41MDE4NDIgMCAwIDEgMTMuNDc3NTg4LDAuMDM5MjQgbCA2Ni4xMTgzMTUsMCBhIDUuMzY0ODE1OCw1LjAwMDczNyAwIDAgMSA1LjM2NDgyMyw1LjAwMDczIGwgMCw3OS44NzkzMSB6IiAvPgogIDxwYXRoIGQ9Im0gNDIwLjE1NTM1LDE3Ny44OTExOSBhIDEzLjQxMjAzOCwxMi41MDE4NDIgMCAwIDEgLTguNjMyOTUsMjIuMDY5NTEgbCAtNjYuMTE4MzIsMCBhIDUuMzY0ODE1Miw1LjAwMDczNyAwIDAgMSAtNS4zNjQ4MiwtNS4wMDA3NCBsIDAsLTc5Ljg3OTMxIHoiIC8+Cjwvc3ZnPgo=") no-repeat fixed center/70% 70%,linear-gradient(180deg,#2a2a2a 0,#202020)} \ No newline at end of file diff --git a/tgui/assets/tgui.js b/tgui/assets/tgui.js index b148dd3de62..52f6e2de839 100644 --- a/tgui/assets/tgui.js +++ b/tgui/assets/tgui.js @@ -1,9 +1,9 @@ -!function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o-1}}([].indexOf||function(t){for(V=this.length;V--&&this[V]!==t;);return V}),item:function(t){return this[t]||null},remove:function(){for(var t,e=0;e0||-1)*Math.floor(Math.abs(e))),e},ToPrimitive:function(e){var n,r,i;if(R(e))return e;if(r=e.valueOf,t(r)&&(n=r.call(e),R(n)))return n;if(i=e.toString,t(i)&&(n=i.call(e),R(n)))return n;throw new TypeError},ToObject:function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return r(t)},ToUint32:function(t){return t>>>0}},D=function(){};M(a,{bind:function(e){var n=this;if(!t(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,a=l.call(arguments,1),o=function(){if(this instanceof i){var t=n.apply(this,d.call(a,l.call(arguments)));return r(t)===t?t:this}return n.apply(e,d.call(a,l.call(arguments)))},s=g(0,n.length-a.length),u=[],c=0;s>c;c++)h.call(u,"$"+c);return i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this, arguments); }")(o),n.prototype&&(D.prototype=n.prototype,i.prototype=new D,D.prototype=null),i}});var U=m.bind(i.hasOwnProperty),V=m.bind(i.toString),B=m.bind(l),q=v.bind(l),H=m.bind(s.slice),z=m.bind(s.split),W=m.bind(s.indexOf),$=m.bind(h),G=m.bind(i.propertyIsEnumerable),K=m.bind(n.sort),Q=e.isArray||function(t){return"[object Array]"===V(t)},Y=1!==[].unshift(0);M(n,{unshift:function(){return f.apply(this,arguments),this.length}},Y),M(e,{isArray:Q});var J=r("a"),Z="a"!==J[0]||!(0 in J),X=function(t){var e=!0,n=!0;return t&&(t.call("foo",function(t,n,r){"object"!=typeof r&&(e=!1)}),t.call([1],function(){"use strict";n="string"==typeof this},"x")),!!t&&e&&n};M(n,{forEach:function(e){var n,r=I.ToObject(this),i=Z&&A(this)?z(this,""):r,a=-1,o=I.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!t(e))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++a1&&(r=arguments[1]),!t(n))throw new TypeError("Array.prototype.map callback must be a function");for(var u=0;o>u;u++)u in a&&(void 0===r?s[u]=n(a[u],u,i):s[u]=n.call(r,a[u],u,i));return s}},!X(n.map)),M(n,{filter:function(e){var n,r,i=I.ToObject(this),a=Z&&A(this)?z(this,""):i,o=I.ToUint32(a.length),s=[];if(arguments.length>1&&(r=arguments[1]),!t(e))throw new TypeError("Array.prototype.filter callback must be a function");for(var u=0;o>u;u++)u in a&&(n=a[u],(void 0===r?e(n,u,i):e.call(r,n,u,i))&&$(s,n));return s}},!X(n.filter)),M(n,{every:function(e){var n,r=I.ToObject(this),i=Z&&A(this)?z(this,""):r,a=I.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!t(e))throw new TypeError("Array.prototype.every callback must be a function");for(var o=0;a>o;o++)if(o in i&&!(void 0===n?e(i[o],o,r):e.call(n,i[o],o,r)))return!1;return!0}},!X(n.every)),M(n,{some:function(e){var n,r=I.ToObject(this),i=Z&&A(this)?z(this,""):r,a=I.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!t(e))throw new TypeError("Array.prototype.some callback must be a function");for(var o=0;a>o;o++)if(o in i&&(void 0===n?e(i[o],o,r):e.call(n,i[o],o,r)))return!0;return!1}},!X(n.some));var tt=!1;n.reduce&&(tt="object"==typeof n.reduce.call("es5",function(t,e,n,r){return r})),M(n,{reduce:function(e){var n=I.ToObject(this),r=Z&&A(this)?z(this,""):n,i=I.ToUint32(r.length);if(!t(e))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var a,o=0;if(arguments.length>=2)a=arguments[1];else for(;;){if(o in r){a=r[o++];break}if(++o>=i)throw new TypeError("reduce of empty array with no initial value")}for(;i>o;o++)o in r&&(a=e(a,r[o],o,n));return a}},!tt);var et=!1;n.reduceRight&&(et="object"==typeof n.reduceRight.call("es5",function(t,e,n,r){return r})),M(n,{reduceRight:function(e){var n=I.ToObject(this),r=Z&&A(this)?z(this,""):n,i=I.ToUint32(r.length);if(!t(e))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var a,o=i-1;if(arguments.length>=2)a=arguments[1];else for(;;){if(o in r){a=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>o)return a;do o in r&&(a=e(a,r[o],o,n));while(o--);return a}},!et);var nt=n.indexOf&&-1!==[0,1].indexOf(1,2);M(n,{indexOf:function(t){var e=Z&&A(this)?z(this,""):I.ToObject(this),n=I.ToUint32(e.length);if(0===n)return-1;var r=0;for(arguments.length>1&&(r=I.ToInteger(arguments[1])),r=r>=0?r:g(0,n+r);n>r;r++)if(r in e&&e[r]===t)return r;return-1}},nt);var rt=n.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);M(n,{lastIndexOf:function(t){var e=Z&&A(this)?z(this,""):I.ToObject(this),n=I.ToUint32(e.length);if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=b(r,I.ToInteger(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in e&&t===e[r])return r;return-1}},rt);var it=function(){var t=[1,2],e=t.splice();return 2===t.length&&Q(e)&&0===e.length}();M(n,{splice:function(t,e){return 0===arguments.length?[]:p.apply(this,arguments)}},!it);var at=function(){var t={};return n.splice.call(t,0,0,1),1===t.length}();M(n,{splice:function(t,e){if(0===arguments.length)return[];var n=arguments;return this.length=g(I.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof e&&(n=B(arguments),n.length<2?$(n,this.length-t):n[1]=I.ToInteger(e)),p.apply(this,n)}},!at);var ot=function(){var t=new e(1e5);return t[8]="x",t.splice(1,1),7===t.indexOf("x")}(),st=function(){var t=256,e=[];return e[t]="a",e.splice(t+1,0,"b"),"a"===e[t]}();M(n,{splice:function(t,e){for(var n,r=I.ToObject(this),i=[],a=I.ToUint32(r.length),s=I.ToInteger(t),u=0>s?g(a+s,0):b(s,a),c=b(g(I.ToInteger(e),0),a-u),l=0;c>l;)n=o(u+l),U(r,n)&&(i[l]=r[n]),l+=1;var p,h=B(arguments,2),f=h.length;if(c>f){for(l=u;a-c>l;)n=o(l+c),p=o(l+f),U(r,n)?r[p]=r[n]:delete r[p],l+=1;for(l=a;l>a-c+f;)delete r[l-1],l-=1}else if(f>c)for(l=a-c;l>u;)n=o(l+c-1),p=o(l+f-1),U(r,n)?r[p]=r[n]:delete r[p],l-=1;l=u;for(var d=0;d=0&&!Q(e)&&t(e.callee)},At=St(arguments)?St:Ot;M(r,{keys:function(e){var n=t(e),r=At(e),i=null!==e&&"object"==typeof e,a=i&&A(e);if(!i&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var s=[],u=yt&&n;if(a&&wt||r)for(var c=0;ch;h++){var f=Tt[h];p&&"constructor"===f||!U(e,f)||$(s,f)}return s}});var Pt=r.keys&&function(){return 2===r.keys(arguments).length}(1,2),jt=r.keys&&function(){var t=r.keys(arguments);return 1!==arguments.length||1!==t.length||1!==t[0]}(1),Nt=r.keys;M(r,{keys:function(t){return Nt(At(t)?B(t):t)}},!Pt||jt);var Ft=-621987552e5,Mt="-000001",Rt=Date.prototype.toISOString&&-1===new Date(Ft).toISOString().indexOf(Mt),Lt=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString();M(Date.prototype,{toISOString:function(){var t,e,n,r,i;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");for(r=this.getUTCFullYear(),i=this.getUTCMonth(),r+=Math.floor(i/12),i=(i%12+12)%12,t=[i+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()],r=(0>r?"-":r>9999?"+":"")+H("00000"+Math.abs(r),r>=0&&9999>=r?-4:-6),e=t.length;e--;)n=t[e],10>n&&(t[e]="0"+n);return r+"-"+B(t,0,2).join("-")+"T"+B(t,2).join(":")+"."+H("000"+this.getUTCMilliseconds(),-3)+"Z"}},Rt||Lt);var It=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(Ft).toJSON().indexOf(Mt)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(t){return!1}}();It||(Date.prototype.toJSON=function(e){var n=r(this),i=I.ToPrimitive(n);if("number"==typeof i&&!isFinite(i))return null;var a=n.toISOString;if(!t(a))throw new TypeError("toISOString property is not callable");return a.call(n)});var Dt=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),Ut=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),Vt=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(Vt||Ut||!Dt){var Bt=Math.pow(2,31)-1,qt=L(new Date(1970,0,1,0,0,0,Bt+1).getTime());Date=function(t){var e=function(n,r,i,a,s,u,c){var l,p=arguments.length;if(this instanceof t){var h=u,f=c;if(qt&&p>=7&&c>Bt){var d=Math.floor(c/Bt)*Bt,m=Math.floor(d/1e3);h+=m,f-=1e3*m}l=1===p&&o(n)===n?new t(e.parse(n)):p>=7?new t(n,r,i,a,s,h,f):p>=6?new t(n,r,i,a,s,h):p>=5?new t(n,r,i,a,s):p>=4?new t(n,r,i,a):p>=3?new t(n,r,i):p>=2?new t(n,r):p>=1?new t(n):new t}else l=t.apply(this,arguments);return R(l)||M(l,{constructor:e},!0),l},n=RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],i=function(t,e){var n=e>1?1:0;return r[e]+Math.floor((t-1969+n)/4)-Math.floor((t-1901+n)/100)+Math.floor((t-1601+n)/400)+365*(t-1970)},a=function(e){var n=0,r=e;if(qt&&r>Bt){var i=Math.floor(r/Bt)*Bt,a=Math.floor(i/1e3);n+=a,r-=1e3*a}return u(new t(1970,0,1,0,0,n,r))};for(var s in t)U(t,s)&&(e[s]=t[s]);M(e,{now:t.now,UTC:t.UTC},!0),e.prototype=t.prototype,M(e.prototype,{constructor:e},!0);var c=function(e){var r=n.exec(e);if(r){var o,s=u(r[1]),c=u(r[2]||1)-1,l=u(r[3]||1)-1,p=u(r[4]||0),h=u(r[5]||0),f=u(r[6]||0),d=Math.floor(1e3*u(r[7]||0)),m=!(!r[4]||r[8]),v="-"===r[9]?1:-1,g=u(r[10]||0),b=u(r[11]||0),y=h>0||f>0||d>0;return(y?24:25)>p&&60>h&&60>f&&1e3>d&&c>-1&&12>c&&24>g&&60>b&&l>-1&&l=-864e13&&864e13>=o)?o:NaN}return t.parse.apply(this,arguments)};return M(e,{parse:c}),e}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var Ht=c.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0)),zt={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(t,e){for(var n=-1,r=e;++n=0;)n+=zt.data[e],zt.data[e]=Math.floor(n/t),n=n%t*zt.base},numToString:function(){for(var t=zt.size,e="";--t>=0;)if(""!==e||0===t||0!==zt.data[t]){var n=o(zt.data[t]);""===e?e=n:e+=H("0000000",0,7-n.length)+n}return e},pow:function ue(t,e,n){return 0===e?n:e%2===1?ue(t,e-1,n*t):ue(t*t,e/2,n)},log:function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}},Wt=function(t){var e,n,r,i,a,s,c,l;if(e=u(t),e=L(e)?0:Math.floor(e),0>e||e>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=u(this),L(n))return"NaN";if(-1e21>=n||n>=1e21)return o(n);if(r="",0>n&&(r="-",n=-n),i="0",n>1e-21)if(a=zt.log(n*zt.pow(2,69,1))-69,s=0>a?n*zt.pow(2,-a,1):n/zt.pow(2,a,1),s*=4503599627370496,a=52-a,a>0){for(zt.multiply(0,s),c=e;c>=7;)zt.multiply(1e7,0),c-=7;for(zt.multiply(zt.pow(10,c,1),0),c=a-1;c>=23;)zt.divide(1<<23),c-=23;zt.divide(1<0?(l=i.length,i=e>=l?r+H("0.0000000000000000000",0,e-l+2)+i:r+H(i,0,l-e)+"."+H(i,l-e)):i=r+i,i};M(c,{toFixed:Wt},Ht);var $t=function(){try{return"1"===1..toPrecision(void 0)}catch(t){return!0}}(),Gt=c.toPrecision;M(c,{toPrecision:function(t){return void 0===t?Gt.call(this):Gt.call(this,t)}},$t),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var t=void 0===/()??/.exec("")[1],e=Math.pow(2,32)-1;s.split=function(n,r){var i=this+"";if(void 0===n&&0===r)return[];if(!T(n))return z(this,n,r);var a,o,s,u,c=[],l=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(n.sticky?"y":""),p=0,f=RegExp(n.source,l+"g");t||(a=RegExp("^"+f.source+"$(?!\\s)",l));var d=void 0===r?e:I.ToUint32(r);for(o=f.exec(i);o&&(s=o.index+o[0].length,!(s>p&&($(c,H(i,p,o.index)),!t&&o.length>1&&o[0].replace(a,function(){for(var t=1;t1&&o.index=d)));)f.lastIndex===o.index&&f.lastIndex++,o=f.exec(i);return p===i.length?(u||!f.test(""))&&$(c,""):$(c,H(i,p)),c.length>d?H(c,0,d):c}}():"0".split(void 0,0).length&&(s.split=function(t,e){return void 0===t&&0===e?[]:z(this,t,e)});var Kt=s.replace,Qt=function(){var t=[];return"x".replace(/x(.)?/g,function(e,n){$(t,n)}),1===t.length&&void 0===t[0]}();Qt||(s.replace=function(e,n){var r=t(n),i=T(e)&&/\)[*?]/.test(e.source);if(r&&i){var a=function(t){var r=arguments.length,i=e.lastIndex;e.lastIndex=0;var a=e.exec(t)||[];return e.lastIndex=i,$(a,arguments[r-2],arguments[r-1]),n.apply(this,a)};return Kt.call(this,e,a)}return Kt.call(this,e,n)});var Yt=s.substr,Jt="".substr&&"b"!=="0b".substr(-1);M(s,{substr:function(t,e){var n=t;return 0>t&&(n=g(this.length+t,0)),Yt.call(this,n,e)}},Jt);var Zt=" \n\x0B\f\r   ᠎              \u2028\u2029\ufeff",Xt="​",te="["+Zt+"]",ee=RegExp("^"+te+te+"*"),ne=RegExp(te+te+"*$"),re=s.trim&&(Zt.trim()||!Xt.trim());M(s,{trim:function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return o(this).replace(ee,"").replace(ne,"")}},re);var ie=s.lastIndexOf&&-1!=="abcあい".lastIndexOf("あい",2);M(s,{lastIndexOf:function(t){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");for(var e=o(this),n=o(t),r=arguments.length>1?u(arguments[1]):NaN,i=L(r)?1/0:I.ToInteger(r),a=b(g(i,0),e.length),s=n.length,c=a+s;c>0;){c=g(0,c-s);var l=W(H(e,c,a+s),n);if(-1!==l)return c+l}return-1}},ie);var ae=s.lastIndexOf;if(M(s,{lastIndexOf:function(t){return ae.apply(this,arguments)}},1!==s.lastIndexOf.length),(8!==parseInt(Zt+"08")||22!==parseInt(Zt+"0x16"))&&(parseInt=function(t){var e=/^[\-+]?0[xX]/;return function(n,r){var i=o(n).trim(),a=u(r)||(e.test(i)?16:10);return t(i,a)}}(parseInt)),new RangeError("test")+""!="RangeError: test"){var oe=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");var t=this.name;void 0===t?t="Error":"string"!=typeof t&&(t=o(t));var e=this.message;return void 0===e?e="":"string"!=typeof e&&(e=o(e)),t?e?t+": "+e:t:e};Error.prototype.toString=oe}if(F){var se=function(t,e){if(G(t,e)){var n=Object.getOwnPropertyDescriptor(t,e);n.enumerable=!1,Object.defineProperty(t,e,n)}};se(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),se(Error.prototype,"name")}})},{}],3:[function(t,e,n){!function(t,n){function r(t,e){var n=t.createElement("p"),r=t.getElementsByTagName("head")[0]||t.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function i(){var t=w.elements;return"string"==typeof t?t.split(" "):t}function a(t,e){var n=w.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof t&&(t=t.join(" ")),w.elements=n+" "+t,l(e)}function o(t){var e=y[t[g]];return e||(e={},b++,t[g]=b,y[b]=e),e}function s(t,e,r){if(e||(e=n),h)return e.createElement(t);r||(r=o(e));var i;return i=r.cache[t]?r.cache[t].cloneNode():v.test(t)?(r.cache[t]=r.createElem(t)).cloneNode():r.createElem(t),!i.canHaveChildren||m.test(t)||i.tagUrn?i:r.frag.appendChild(i)}function u(t,e){if(t||(t=n),h)return t.createDocumentFragment();e=e||o(t);for(var r=e.frag.cloneNode(),a=0,s=i(),u=s.length;u>a;a++)r.createElement(s[a]);return r}function c(t,e){e.cache||(e.cache={},e.createElem=t.createElement,e.createFrag=t.createDocumentFragment,e.frag=e.createFrag()),t.createElement=function(n){return w.shivMethods?s(n,t,e):e.createElem(n)},t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/[\w\-:]+/g,function(t){return e.createElem(t),e.frag.createElement(t),'c("'+t+'")'})+");return n}")(w,e.frag)}function l(t){t||(t=n);var e=o(t);return!w.shivCSS||p||e.hasCSS||(e.hasCSS=!!r(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),h||c(t,e),t}var p,h,f="3.7.3-pre",d=t.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,v=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g="_html5shiv",b=0,y={};!function(){try{var t=n.createElement("a");t.innerHTML="",p="hidden"in t,h=1==t.childNodes.length||function(){n.createElement("a");var t=n.createDocumentFragment();return void 0===t.cloneNode||void 0===t.createDocumentFragment||void 0===t.createElement}()}catch(e){p=!0,h=!0}}();var w={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:f,shivCSS:d.shivCSS!==!1,supportsUnknownElements:h,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:l,createElement:s,createDocumentFragment:u,addElements:a};t.html5=w,l(n),"object"==typeof e&&e.exports&&(e.exports=w)}("undefined"!=typeof window?window:this,document)},{}],4:[function(t,e,n){(function(t){!function(t){function e(t,e,n,r){for(var a,o=n.slice(),s=i(e,t),u=0,c=o.length;c>u&&(handler=o[u],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(s):handler.call(t,s),!s.stoppedImmediatePropagation);u++);return a=!s.stoppedPropagation,r&&a&&t.parentNode?t.parentNode.dispatchEvent(s):!s.defaultPrevented}function n(t,e){return{configurable:!0,get:t,set:e}}function r(t,e,r){var i=b(e||t,r);v(t,"textContent",n(function(){return i.get.call(this)},function(t){i.set.call(this,t)}))}function i(t,e){return t.currentTarget=e,t.eventPhase=t.target===t.currentTarget?2:3,t}function a(t,e){for(var n=t.length;n--&&t[n]!==e;);return n}function o(){if("BR"===this.tagName)return"\n";for(var t=this.firstChild,e=[];t;)8!==t.nodeType&&7!==t.nodeType&&e.push(t.textContent),t=t.nextSibling;return e.join("")}function s(t){var e=document.createEvent("Event");e.initEvent("input",!0,!0),(t.srcElement||t.fromElement||document).dispatchEvent(e)}function u(t){!h&&k.test(document.readyState)&&(h=!h,document.detachEvent(f,u),t=document.createEvent("Event"),t.initEvent(d,!0,!0),document.dispatchEvent(t))}function c(t){for(var e;e=this.lastChild;)this.removeChild(e);null!=t&&this.appendChild(document.createTextNode(t))}function l(e,n){return n||(n=t.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(!document.createEvent){var p=!0,h=!1,f="onreadystatechange",d="DOMContentLoaded",m="__IE8__"+Math.random(),v=Object.defineProperty||function(t,e,n){t[e]=n.value},g=Object.defineProperties||function(e,n){for(var r in n)if(y.call(n,r))try{v(e,r,n[r])}catch(i){t.console&&console.log(r+" failed on object:",e,i.message)}},b=Object.getOwnPropertyDescriptor,y=Object.prototype.hasOwnProperty,w=t.Element.prototype,x=t.Text.prototype,_=/^[a-z]+$/,k=/loaded|complete/,E={},T=document.createElement("div"),C=document.documentElement,S=C.removeAttribute,O=C.setAttribute;r(t.HTMLCommentElement.prototype,w,"nodeValue"),r(t.HTMLScriptElement.prototype,null,"text"),r(x,null,"nodeValue"),r(t.HTMLTitleElement.prototype,null,"text"),v(t.HTMLStyleElement.prototype,"textContent",function(t){return n(function(){return t.get.call(this.styleSheet)},function(e){t.set.call(this.styleSheet,e)})}(b(t.CSSStyleSheet.prototype,"cssText"))),g(w,{textContent:{get:o,set:c},firstElementChild:{get:function(){for(var t=this.childNodes||[],e=0,n=t.length;n>e;e++)if(1==t[e].nodeType)return t[e]}},lastElementChild:{get:function(){for(var t=this.childNodes||[],e=t.length;e--;)if(1==t[e].nodeType)return t[e]}},oninput:{get:function(){return this._oninput||null},set:function(t){this._oninput&&(this.removeEventListener("input",this._oninput),this._oninput=t,t&&this.addEventListener("input",t))}},previousElementSibling:{get:function(){for(var t=this.previousSibling;t&&1!=t.nodeType;)t=t.previousSibling;return t}},nextElementSibling:{get:function(){for(var t=this.nextSibling;t&&1!=t.nodeType;)t=t.nextSibling;return t}},childElementCount:{get:function(){for(var t=0,e=this.childNodes||[],n=e.length;n--;t+=1==e[n].nodeType);return t}},addEventListener:{value:function(t,n,r){var i,o,u=this,c="on"+t,p=u[m]||v(u,m,{value:{}})[m],h=p[c]||(p[c]={}),f=h.h||(h.h=[]);if(!y.call(h,"w")){if(h.w=function(t){return t[m]||e(u,l(u,t),f,!1)},!y.call(E,c))if(_.test(t)){try{i=document.createEventObject(),i[m]=!0,9!=u.nodeType&&null==u.parentNode&&T.appendChild(u),(o=u.getAttribute(c))&&S.call(u,c),u.fireEvent(c,i),E[c]=!0}catch(i){for(E[c]=!1;T.hasChildNodes();)T.removeChild(T.firstChild)}null!=o&&O.call(u,c,o)}else E[c]=!1;(h.n=E[c])&&u.attachEvent(c,h.w)}a(f,n)<0&&f[r?"unshift":"push"](n),"input"===t&&u.attachEvent("onkeyup",s)}},dispatchEvent:{value:function(t){var n,r=this,i="on"+t.type,a=r[m],o=a&&a[i],s=!!o;return t.target||(t.target=r),s?o.n?r.fireEvent(i,t):e(r,t,o.h,!0):(n=r.parentNode)?n.dispatchEvent(t):!0,!t.defaultPrevented}},removeEventListener:{value:function(t,e,n){var r=this,i="on"+t,o=r[m],s=o&&o[i],u=s&&s.h,c=u?a(u,e):-1;c>-1&&u.splice(c,1)}}}),g(x,{addEventListener:{value:w.addEventListener},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener}}),g(t.XMLHttpRequest.prototype,{addEventListener:{value:function(t,e,n){var r=this,i="on"+t,o=r[m]||v(r,m,{value:{}})[m],s=o[i]||(o[i]={}),u=s.h||(s.h=[]);a(u,e)<0&&(r[i]||(r[i]=function(){var e=document.createEvent("Event");e.initEvent(t,!0,!0),r.dispatchEvent(e)}),u[n?"unshift":"push"](e))}},dispatchEvent:{value:function(t){var n=this,r="on"+t.type,i=n[m],a=i&&i[r],o=!!a;return o&&(a.n?n.fireEvent(r,t):e(n,t,a.h,!0))}},removeEventListener:{value:w.removeEventListener}}),g(t.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(t,e,n){this.type=t,this.bubbles=!!e,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),g(t.HTMLDocument.prototype,{defaultView:{get:function(){ -return this.parentWindow}},textContent:{get:function(){return 11===this.nodeType?o.call(this):null},set:function(t){11===this.nodeType&&c.call(this,t)}},addEventListener:{value:function(e,n,r){var i=this;w.addEventListener.call(i,e,n,r),p&&e===d&&!k.test(i.readyState)&&(p=!1,i.attachEvent(f,u),t==top&&!function a(t){try{i.documentElement.doScroll("left"),u()}catch(e){setTimeout(a,50)}}())}},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener},createEvent:{value:function(t){var e;if("Event"!==t)throw Error("unsupported "+t);return e=document.createEventObject(),e.timeStamp=(new Date).getTime(),e}}}),g(t.Window.prototype,{getComputedStyle:{value:function(){function t(t){this._=t}function e(){}var n=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,r=/^(top|right|bottom|left)$/,i=/\-([a-z])/g,a=function(t,e){return e.toUpperCase()};return t.prototype.getPropertyValue=function(t){var e,o,s,u=this._,c=u.style,l=u.currentStyle,p=u.runtimeStyle;return t=("float"===t?"style-float":t).replace(i,a),e=l?l[t]:c[t],n.test(e)&&!r.test(t)&&(o=c.left,s=p&&p.left,s&&(p.left=l.left),c.left="fontSize"===t?"1em":e,e=c.pixelLeft+"px",c.left=o,s&&(p.left=s)),null==e?e:e+""||"auto"},e.prototype.getPropertyValue=function(){return null},function(n,r){return r?new e(n):new t(n)}}()},addEventListener:{value:function(n,r,i){var o,s=t,u="on"+n;s[u]||(s[u]=function(t){return e(s,l(s,t),o,!1)}),o=s[u][m]||(s[u][m]=[]),a(o,r)<0&&o[i?"unshift":"push"](r)}},dispatchEvent:{value:function(e){var n=t["on"+e.type];return n?n.call(t,e)!==!1&&!e.defaultPrevented:!0}},removeEventListener:{value:function(e,n,r){var i="on"+e,o=(t[i]||Object)[m],s=o?a(o,n):-1;s>-1&&o.splice(s,1)}}}),function(t,e,n){for(n=0;n1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var i,a;a=n.shift();)for(i in a)Oo.call(a,i)&&(t[i]=a[i]);return t}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return n.forEach(function(e){for(var n in e)!e.hasOwnProperty(n)||n in t||(t[n]=e[n])}),t}function a(t){return"[object Array]"===Ao.call(t)}function o(t){return Po.test(Ao.call(t))}function s(t,e){return null===t&&null===e?!0:"object"==typeof t||"object"==typeof e?!1:t===e}function u(t){return!isNaN(parseFloat(t))&&isFinite(t)}function c(t){return t&&"[object Object]"===Ao.call(t)}function l(t,e){return t.replace(/%s/g,function(){return e.shift()})}function p(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];throw t=l(t,n),Error(t)}function h(){Av.DEBUG&&To.apply(null,arguments)}function f(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];t=l(t,n),Co(t,n)}function d(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];t=l(t,n),No[t]||(No[t]=!0,Co(t,n))}function m(){Av.DEBUG&&f.apply(null,arguments)}function v(){Av.DEBUG&&d.apply(null,arguments)}function g(t,e,n){var r=b(t,e,n);return r?r[t][n]:null}function b(t,e,n){for(;e;){if(n in e[t])return e;if(e.isolated)return null;e=e.parent}}function y(t){return function(){return t}}function w(t){var e,n,r,i,a,o;for(e=t.split("."),(n=Bo[e.length])||(n=x(e.length)),a=[],r=function(t,n){return t?"*":e[n]},i=n.length;i--;)o=n[i].map(r).join("."),a.hasOwnProperty(o)||(a.push(o),a[o]=!0);return a}function x(t){var e,n,r,i,a,o,s,u,c="";if(!Bo[t]){for(r=[];c.length=a;a+=1){for(n=a.toString(2);n.lengtho;o++)u.push(i(n[o]));r[a]=u}Bo[t]=r}return Bo[t]}function _(t,e,n,r){var i=t[e];if(!i||!i.equalsOrStartsWith(r)&&i.equalsOrStartsWith(n))return t[e]=i?i.replace(n,r):r,!0}function k(t){var e=t.slice(2);return"i"===t[1]&&u(e)?+e:e}function E(t){return null==t?t:(zo.hasOwnProperty(t)||(zo[t]=new Wo(t)),zo[t])}function T(t,e){function n(e,n){var r,i,o;return n.isRoot?o=[].concat(Object.keys(t.viewmodel.data),Object.keys(t.viewmodel.mappings),Object.keys(t.viewmodel.computations)):(r=t.viewmodel.wrapped[n.str],i=r?r.get():t.viewmodel.get(n),o=i?Object.keys(i):null),o&&o.forEach(function(t){"_ractive"===t&&a(i)||e.push(n.join(t))}),e}var r,i,o;for(r=e.str.split("."),o=[Go];i=r.shift();)"*"===i?o=o.reduce(n,[]):o[0]===Go?o[0]=E(i):o=o.map(C(i));return o}function C(t){return function(e){return e.join(t)}}function S(t){return t?t.replace(qo,".$1"):""}function O(t,e,n){if("string"!=typeof e||!u(n))throw Error("Bad arguments");var r=void 0,i=void 0;if(/\*/.test(e))return i={},T(t,E(S(e))).forEach(function(e){var r=t.viewmodel.get(e);if(!u(r))throw Error(Qo);i[e.str]=r+n}),t.set(i);if(r=t.get(e),!u(r))throw Error(Qo);return t.set(e,+r+n)}function A(t,e){return Ko(this,t,void 0===e?1:+e)}function P(t){this.event=t,this.method="on"+t,this.deprecate=ts[t]}function j(t,e){var n=t.indexOf(e);-1===n&&t.push(e)}function N(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]==e)return!0;return!1}function F(t,e){var n;if(!a(t)||!a(e))return!1;if(t.length!==e.length)return!1;for(n=t.length;n--;)if(t[n]!==e[n])return!1;return!0}function M(t){return"string"==typeof t?[t]:void 0===t?[]:t}function R(t){return t[t.length-1]}function L(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}function I(t){for(var e=[],n=t.length;n--;)e[n]=t[n];return e}function D(t){setTimeout(t,0)}function U(t,e){return function(){for(var n;n=t.shift();)n(e)}}function V(t,e,n,r){var i;if(e===t)throw new TypeError("A promise's fulfillment handler cannot return the same promise");if(e instanceof es)e.then(n,r);else if(!e||"object"!=typeof e&&"function"!=typeof e)n(e);else{try{i=e.then}catch(a){return void r(a)}if("function"==typeof i){var o,s,u;s=function(e){o||(o=!0,V(t,e,n,r))},u=function(t){o||(o=!0,r(t))};try{i.call(e,s,u)}catch(a){if(!o)return r(a),void(o=!0)}}else n(e)}}function B(t,e,n){var r;return e=S(e),"~/"===e.substr(0,2)?(r=E(e.substring(2)),z(t,r.firstKey,n)):"."===e[0]?(r=q(ss(n),e),r&&z(t,r.firstKey,n)):r=H(t,E(e),n),r}function q(t,e){var n;if(void 0!=t&&"string"!=typeof t&&(t=t.str),"."===e)return E(t);if(n=t?t.split("."):[],"../"===e.substr(0,3)){for(;"../"===e.substr(0,3);){if(!n.length)throw Error('Could not resolve reference - too many "../" prefixes');n.pop(),e=e.substring(3)}return n.push(e),E(n.join("."))}return E(t?t+e.replace(/^\.\//,"."):e.replace(/^\.\/?/,""))}function H(t,e,n,r){var i,a,o,s,u;if(e.isRoot)return e;for(a=e.firstKey;n;)if(i=n.context,n=n.parent,i&&(s=!0,o=t.viewmodel.get(i),o&&("object"==typeof o||"function"==typeof o)&&a in o))return i.join(e.str);return W(t.viewmodel,a)?e:t.parent&&!t.isolated&&(s=!0,n=t.component.parentFragment,a=E(a),u=H(t.parent,a,n,!0))?(t.viewmodel.map(a,{origin:t.parent.viewmodel,keypath:u}),e):r||s?void 0:(t.viewmodel.set(e,void 0),e)}function z(t,e){var n;!t.parent||t.isolated||W(t.viewmodel,e)||(e=E(e),(n=H(t.parent,e,t.component.parentFragment,!0))&&t.viewmodel.map(e,{origin:t.parent.viewmodel,keypath:n}))}function W(t,e){return""===e||e in t.data||e in t.computations||e in t.mappings}function $(t){t.teardown()}function G(t){t.unbind()}function K(t){t.unrender()}function Q(t){t.cancel()}function Y(t){t.detach()}function J(t){t.detachNodes()}function Z(t){!t.ready||t.outros.length||t.outroChildren||(t.outrosComplete||(t.parent?t.parent.decrementOutros(t):t.detachNodes(),t.outrosComplete=!0),t.intros.length||t.totalChildren||("function"==typeof t.callback&&t.callback(),t.parent&&t.parent.decrementTotal()))}function X(){for(var t,e,n;ls.ractives.length;)e=ls.ractives.pop(),n=e.viewmodel.applyChanges(),n&&ds.fire(e,n);for(tt(),t=0;t=0;a--)i=t._subs[e[a]],i&&(s=gt(t,i,n,r)&&s);if(Vs.dequeue(t),t.parent&&s){if(o&&t.component){var u=t.component.name+"."+e[e.length-1];e=E(u).wildcardMatches(),n&&(n.component=t)}vt(t.parent,e,n,r)}}function gt(t,e,n,r){var i=null,a=!1;n&&!n._noArg&&(r=[n].concat(r)),e=e.slice();for(var o=0,s=e.length;s>o;o+=1)e[o].apply(t,r)===!1&&(a=!0);return n&&!n._noArg&&a&&(i=n.original)&&(i.preventDefault&&i.preventDefault(),i.stopPropagation&&i.stopPropagation()),!a}function bt(t){var e={args:Array.prototype.slice.call(arguments,1)};Bs(this,t,e)}function yt(t){var e;return t=E(S(t)),e=this.viewmodel.get(t,zs),void 0===e&&this.parent&&!this.isolated&&us(this,t.str,this.component.parentFragment)&&(e=this.viewmodel.get(t)),e}function wt(e,n){if(!this.fragment.rendered)throw Error("The API has changed - you must call `ractive.render(target[, anchor])` to render your Ractive instance. Once rendered you can use `ractive.insert()`.");if(e=t(e),n=t(n)||null,!e)throw Error("You must specify a valid target to insert into");e.insertBefore(this.detach(),n),this.el=e,(e.__ractive_instances__||(e.__ractive_instances__=[])).push(this),this.detached=null,xt(this)}function xt(t){$s.fire(t),t.findAllComponents("*").forEach(function(t){xt(t.instance)})}function _t(t,e,n){var r,i;return t=E(S(t)),r=this.viewmodel.get(t),a(r)&&a(e)?(i=ms.start(this,!0),this.viewmodel.merge(t,r,e,n),ms.end(),i):this.set(t,e,n&&n.complete)}function kt(t,e){var n,r;return n=T(t,e),r={},n.forEach(function(e){r[e.str]=t.get(e.str)}),r}function Et(t,e,n,r){var i,a,o;e=E(S(e)),r=r||su,e.isPattern?(i=new au(t,e,n,r),t.viewmodel.patternObservers.push(i),a=!0):i=new Ys(t,e,n,r),i.init(r.init),t.viewmodel.register(e,i,a?"patternObservers":"observers"),i.ready=!0;var s={cancel:function(){var n;o||(a?(n=t.viewmodel.patternObservers.indexOf(i),t.viewmodel.patternObservers.splice(n,1),t.viewmodel.unregister(e,i,"patternObservers")):t.viewmodel.unregister(e,i,"observers"),o=!0)}};return t._observers.push(s),s}function Tt(t,e,n){var r,i,a,o;if(c(t)){n=e,i=t,r=[];for(t in i)i.hasOwnProperty(t)&&(e=i[t],r.push(this.observe(t,e,n)));return{cancel:function(){for(;r.length;)r.pop().cancel()}}}if("function"==typeof t)return n=e,e=t,t="",ou(this,t,e,n);if(a=t.split(" "),1===a.length)return ou(this,t,e,n);for(r=[],o=a.length;o--;)t=a[o],t&&r.push(ou(this,t,e,n));return{cancel:function(){for(;r.length;)r.pop().cancel()}}}function Ct(t,e,n){var r=this.observe(t,function(){e.apply(this,arguments),r.cancel()},{init:!1,defer:n&&n.defer});return r}function St(t,e){var n,r=this;if(t)n=t.split(" ").map(lu).filter(pu),n.forEach(function(t){var n,i;(n=r._subs[t])&&(e?(i=n.indexOf(e),-1!==i&&n.splice(i,1)):r._subs[t]=[])});else for(t in this._subs)delete this._subs[t];return this}function Ot(t,e){var n,r,i,a=this;if("object"==typeof t){n=[];for(r in t)t.hasOwnProperty(r)&&n.push(this.on(r,t[r]));return{cancel:function(){for(var t;t=n.pop();)t.cancel()}}}return i=t.split(" ").map(lu).filter(pu),i.forEach(function(t){(a._subs[t]||(a._subs[t]=[])).push(e)}),{cancel:function(){return a.off(t,e)}}}function At(t,e){var n=this.on(t,function(){e.apply(this,arguments),n.cancel()});return n}function Pt(t,e,n){var r,i,a,o,s,u,c=[];if(r=jt(t,e,n),!r)return null;for(i=t.length,s=r.length-2-r[1],a=Math.min(i,r[0]),o=a+r[1],u=0;a>u;u+=1)c.push(u);for(;o>u;u+=1)c.push(-1);for(;i>u;u+=1)c.push(u+s);return 0!==s?c.touchedFrom=r[0]:c.touchedFrom=t.length,c}function jt(t,e,n){switch(e){case"splice":for(void 0!==n[0]&&n[0]<0&&(n[0]=t.length+Math.max(n[0],-t.length));n.length<2;)n.push(0);return n[1]=Math.min(n[1],t.length-n[0]),n;case"sort":case"reverse":return null;case"pop":return t.length?[t.length-1,1]:[0,0];case"push":return[t.length,0].concat(n);case"shift":return[0,t.length?1:0];case"unshift":return[0,0].concat(n)}}function Nt(e,n){var r,i,a,o=this;if(a=this.transitionsEnabled,this.noIntro&&(this.transitionsEnabled=!1),r=ms.start(this,!0),ms.scheduleTask(function(){return Ou.fire(o)},!0),this.fragment.rendered)throw Error("You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first");if(e=t(e)||this.el,n=t(n)||this.anchor,this.el=e,this.anchor=n,!this.append&&e){var s=e.__ractive_instances__;s&&s.length&&Ft(s),e.innerHTML=""}return this.cssId&&Cu.apply(),e&&((i=e.__ractive_instances__)?i.push(this):e.__ractive_instances__=[this],n?e.insertBefore(this.fragment.render(),n):e.appendChild(this.fragment.render())),ms.end(),this.transitionsEnabled=a,r.then(function(){return Au.fire(o)})}function Ft(t){t.splice(0,t.length).forEach($)}function Mt(t,e){for(var n=t.slice(),r=e.length;r--;)~n.indexOf(e[r])||n.push(e[r]);return n}function Rt(t,e){var n,r,i;return r='[data-ractive-css~="{'+e+'}"]',i=function(t){var e,n,i,a,o,s,u,c=[];for(e=[];n=Ru.exec(t);)e.push({str:n[0],base:n[1],modifiers:n[2]});for(a=e.map(It),u=e.length;u--;)s=a.slice(),i=e[u],s[u]=i.base+r+i.modifiers||"",o=a.slice(),o[u]=r+" "+o[u],c.push(s.join(" "),o.join(" "));return c.join(", ")},n=Iu.test(t)?t.replace(Iu,r):t.replace(Mu,"").replace(Fu,function(t,e){var n,r;return Lu.test(e)?t:(n=e.split(",").map(Lt),r=n.map(i).join(", ")+" ",t.replace(e,r))})}function Lt(t){return t.trim?t.trim():t.replace(/^\s+/,"").replace(/\s+$/,"")}function It(t){return t.str}function Dt(t){t&&t.constructor!==Object&&("function"==typeof t||("object"!=typeof t?p("data option must be an object or a function, `"+t+"` is not valid"):m("If supplied, options.data should be a plain JavaScript object - using a non-POJO as the root object may work, but is discouraged")))}function Ut(t,e){Dt(e);var n="function"==typeof t,r="function"==typeof e;return e||n||(e={}),n||r?function(){var i=r?Vt(e,this):e,a=n?Vt(t,this):t;return Bt(i,a)}:Bt(e,t)}function Vt(t,e){var n=t.call(e);if(n)return"object"!=typeof n&&p("Data function must return an object"),n.constructor!==Object&&v("Data function returned something other than a plain JavaScript object. This might work, but is strongly discouraged"),n}function Bt(t,e){if(t&&e){for(var n in e)n in t||(t[n]=e[n]);return t}return t||e}function qt(t){var e=wo(Wu);return e.parse=function(e,n){return Ht(e,n||t)},e}function Ht(t,e){if(!Hu)throw Error("Missing Ractive.parse - cannot parse template. Either preparse or use the version that includes the parser");return Hu(t,e||this.options)}function zt(t,e){var n;if(!Za){if(e&&e.noThrow)return;throw Error("Cannot retrieve template #"+t+" as Ractive is not running in a browser.")}if(Wt(t)&&(t=t.substring(1)),!(n=document.getElementById(t))){if(e&&e.noThrow)return;throw Error("Could not find template element with id #"+t)}if("SCRIPT"!==n.tagName.toUpperCase()){if(e&&e.noThrow)return;throw Error("Template element with id #"+t+", must be a + on-click-enter='{{#clickable}}press{{/}}'> {{#if icon}} {{/if}} diff --git a/tgui/scripts/components/display.ract b/tgui/scripts/components/display.ract index cdb1fb3c070..176c1781717 100644 --- a/tgui/scripts/components/display.ract +++ b/tgui/scripts/components/display.ract @@ -2,7 +2,9 @@ {{#if title}}

{{title}}

- {{#if button}}{{yield button}}{{/if}} + {{#if button}} +
{{yield button}}
+ {{/if}}
{{/if}}
diff --git a/tgui/scripts/components/warnings.ract b/tgui/scripts/components/warnings.ract new file mode 100644 index 00000000000..ae6bf9aa27e --- /dev/null +++ b/tgui/scripts/components/warnings.ract @@ -0,0 +1,33 @@ + + + +{{#if config.fancy && ie && ie <= 8}} + + You have an old (<= 8) version of Internet Explorer installed. Please upgrade to the latest available version of IE.
+ To upgrade, please click 'Check For Upgrades' below to download the latest available version from Microsoft.
+ Otherwise, if you are unable (XP/Wine) or unwilling to upgrade past IE8, please click 'No Frills' below to disable incompatible features (and this message). +
+ Check For Upgrades + No Frills + Debug Info + {{#if debug}} +
+ Detected: IE{{ie}}
+ User Agent: {{userAgent}} + {{/if}} +
+{{/if}} diff --git a/tgui/scripts/dragresize.coffee b/tgui/scripts/dragresize.coffee index c4e6e6d0b07..321090078c6 100644 --- a/tgui/scripts/dragresize.coffee +++ b/tgui/scripts/dragresize.coffee @@ -3,6 +3,7 @@ byond = require "./byond" module.exports = drag: (ractive, event) -> + event.preventDefault() lock = (x, y) -> if x < 0 # Left x = 0 @@ -23,6 +24,7 @@ module.exports = ractive.set x: event.screenX, y: event.screenY resize: (ractive, event) -> + event.preventDefault() sane = (x, y) -> x = Math.clamp x, 100, screen.width y = Math.clamp y, 100, screen.height diff --git a/tgui/scripts/interfaces/air_alarm/scrubbers.ract b/tgui/scripts/interfaces/air_alarm/scrubbers.ract index efa4e63b97f..7b561723192 100644 --- a/tgui/scripts/interfaces/air_alarm/scrubbers.ract +++ b/tgui/scripts/interfaces/air_alarm/scrubbers.ract @@ -20,9 +20,9 @@ Oxygen + action='co2_scrub' params='{"id_tag": "{{id_tag}}", "val": {{+!filter_co2}}}'>CO2 Nitrogen + action='n2o_scrub' params='{"id_tag": "{{id_tag}}", "val": {{+!filter_n2o}}}'>N2O Plasma diff --git a/tgui/scripts/interfaces/air_alarm/status.ract b/tgui/scripts/interfaces/air_alarm/status.ract index ddb278d0d76..767e6d3c7d1 100644 --- a/tgui/scripts/interfaces/air_alarm/status.ract +++ b/tgui/scripts/interfaces/air_alarm/status.ract @@ -1,6 +1,6 @@ {{#if data.environment_data}} - {{#each data.environment_data}} + {{#each adata.environment_data}} {{Math.fixed(value, 2)}}{{unit}} @@ -13,19 +13,18 @@ - + {{data.atmos_alarm ? "Atmosphere Alarm" : fire_alarm ? "Fire Alarm" : "Nominal"}} {{else}} - - Warning: Cannot obtain air sample for analysis. + + Cannot obtain air sample for analysis. {{/if}} {{#if data.emagged}} -
- - Warning: Safety measures offline. Device may exhibit abnormal behavior. + + Safety measures offline. Device may exhibit abnormal behavior. {{/if}}
diff --git a/tgui/scripts/interfaces/chem_dispenser.ract b/tgui/scripts/interfaces/chem_dispenser.ract index 8ec9acf8b68..072863e93dd 100644 --- a/tgui/scripts/interfaces/chem_dispenser.ract +++ b/tgui/scripts/interfaces/chem_dispenser.ract @@ -1,16 +1,14 @@ - + {{Math.fixed(adata.energy)}} Units - {{#if data.beakerTransferAmounts}} - - {{#each data.beakerTransferAmounts}} - {{.}} - {{/each}} - - {{/if}} - + + {{#partial button}} + {{#each data.beakerTransferAmounts}} + {{.}} + {{/each}} + {{/partial}} {{#each data.chemicals}} {{title}} @@ -19,15 +17,11 @@ {{#partial button}} + {{#each data.beakerTransferAmounts}} + {{.}} + {{/each}} Eject {{/partial}} - {{#if data.beakerTransferAmounts}} - - {{#each data.beakerTransferAmounts}} - {{.}} - {{/each}} - - {{/if}} {{#if data.isBeakerLoaded}} {{Math.round(adata.beakerCurrentVolume)}}/{{data.beakerMaxVolume}} Units diff --git a/tgui/scripts/main.coffee b/tgui/scripts/main.coffee index 71be68abf76..7d90a6dbcd9 100644 --- a/tgui/scripts/main.coffee +++ b/tgui/scripts/main.coffee @@ -6,24 +6,23 @@ require "./math" Ractive = require "ractive" -# Set Ractive debug mode based on if we're minified or not. -Ractive.DEBUG = /minified/.test (minified) -> +Ractive.DEBUG = /minified/.test (minified) -> # Set Ractive debug mode based on if we're minified or not. WebFont = require "webfontloader" -# Load FontAwesome asynchronously from CDNJS. -WebFont.load +WebFont.load # Load FontAwesome asynchronously from CDNJS. custom: families: ["FontAwesome"] urls: ["https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"] testStrings: FontAwesome: "\uf240" -tgui = require "./tgui" -# Create the UI; this is just a Ractive component. -window.tgui = new tgui - el: "#container" - data: -> - data = JSON.parse document.getElementById("data").textContent # Load initial data from the server. - alert "Initial data did not load correctly." if not data? or not (data.data? and data.config?) - data.adata = data.data # Spoof animated data as this is the first load. - data +tgui = require "./tgui.ract" +window.initialize = (dataString) -> # So we can get data inline or from the server. + return if window.tgui # Just incase we get called again; only do this once. + window.tgui = new tgui # Create the UI; this is just a Ractive component. + el: "#container" # Attach the UI to the existing container div. + data: -> data = JSON.parse dataString # Load initial data from the server. + +holder = document.getElementById "data" +if holder.textContent != "{}" # If the JSON was inlined, load it. + window.initialize(holder.textContent) diff --git a/tgui/scripts/tgui.ract b/tgui/scripts/tgui.ract index 9cc60f70c6f..9871625ffe3 100644 --- a/tgui/scripts/tgui.ract +++ b/tgui/scripts/tgui.ract @@ -1,7 +1,9 @@ + {{{config.title}}}
+
diff --git a/tgui/styles/components/display.styl b/tgui/styles/components/display.styl index 1201c07e62c..0dd58c482e5 100644 --- a/tgui/styles/components/display.styl +++ b/tgui/styles/components/display.styl @@ -15,7 +15,7 @@ div.display border-bottom: 2px solid colors.rule - .button + .buttonRight position: absolute bottom: 6px right: 4px diff --git a/tgui/styles/components/notice.styl b/tgui/styles/components/notice.styl index 76c9b6b3580..999631aadb0 100644 --- a/tgui/styles/components/notice.styl +++ b/tgui/styles/components/notice.styl @@ -25,3 +25,6 @@ div.notice .label color: colors.textinverse + + hr + background-color: colors.border diff --git a/tgui/styles/core/text.styl b/tgui/styles/core/text.styl index 62541c38381..387cc59f0b1 100644 --- a/tgui/styles/core/text.styl +++ b/tgui/styles/core/text.styl @@ -13,5 +13,5 @@ $fontReset font-style: italic // Make 'unselectable' text unselectable on all browsers. -[unselectable] +[unselectable=on] user-select: none diff --git a/tgui/tgui.html b/tgui/tgui.html index c4be20105b8..76c8b08776a 100644 --- a/tgui/tgui.html +++ b/tgui/tgui.html @@ -3,22 +3,21 @@ - - + - +