mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 10:04:30 +01:00
Update NanoUI Javascript libraries, SMES UI
This commit is contained in:
@@ -93,8 +93,10 @@
|
||||
* Add the assets required by all NanoUIs.
|
||||
**/
|
||||
/datum/nanoui/proc/add_common_assets()
|
||||
// Libraries: jQuery, doT and timer.js
|
||||
add_script("libraries.min.js")
|
||||
// Libraries: jQuery, jQuery-UI, and doT.
|
||||
add_script("jquery.js")
|
||||
add_script("jquery-ui.js")
|
||||
add_script("doT.js")
|
||||
// Nano Utility: Utility functions and sanity checks.
|
||||
add_script("nano_utility.js") // The NanoUtility JS, this is used to store utility functions.
|
||||
// Nano Template: Renders templates using doT.
|
||||
@@ -336,12 +338,12 @@
|
||||
add_template("layout", "layout_[layout_key].tmpl")
|
||||
|
||||
// Generate <script> and <link> tags.
|
||||
var/head_content = ""
|
||||
var/script_html = ""
|
||||
for (var/script in scripts)
|
||||
head_content += "<script type='text/javascript' src='[script]'></script>"
|
||||
head_content += "\n"
|
||||
script_html += "<script type='text/javascript' src='[script]'></script>"
|
||||
var/stylesheet_html = ""
|
||||
for (var/stylesheet in stylesheets)
|
||||
head_content += "<link rel='stylesheet' type='text/css' href='[stylesheet]' />"
|
||||
stylesheet_html += "<link rel='stylesheet' type='text/css' href='[stylesheet]' />"
|
||||
|
||||
// Generate template JSON.
|
||||
var/template_data_json = "{}"
|
||||
@@ -369,7 +371,8 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
[head_content]
|
||||
[script_html]
|
||||
[stylesheet_html]
|
||||
</head>
|
||||
<body scroll=auto data-template-data='[template_data_json]' data-initial-data='[initial_data_json]' data-url-parameters='[url_parameters_json]'>
|
||||
<div id="uiLayout"></div>
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
|
||||
SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "smes.tmpl", name, 350, 560)
|
||||
ui = new(user, src, ui_key, "smes.tmpl", name, 500, 400)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/smes/get_ui_data()
|
||||
|
||||
Reference in New Issue
Block a user