NanoUI Updates.

* Restructured HTML in an attempt to fix the "blank UI" issue.
* Added a crap ton of debugging messages.
* Added a loading message to the UI.

Conflicts:
	code/modules/nano/nanoui.dm
	nano/js/nano_update.js
This commit is contained in:
Mark Aherne (Faerdan)
2014-01-07 23:28:51 -05:00
committed by ZomgPonies
parent 906d3b80d8
commit 8d64095078
3 changed files with 50 additions and 27 deletions
+10 -14
View File
@@ -93,12 +93,9 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/proc/add_common_assets()
//add_script("libraries.min.js") // The jQuery library
add_script("1-jquery.js")
add_script("2-jsviews.js")
add_script("3-jquery.timers.js")
add_script("libraries.min.js") // The jQuery library
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_config.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_stylesheet("shared.css") // this CSS sheet is common to all UIs
add_stylesheet("icons.css") // this CSS sheet is common to all UIs
@@ -263,8 +260,12 @@ nanoui is used to open and update nano browser uis
*/
/datum/nanoui/proc/get_header()
var/head_content = ""
for (var/filename in scripts)
head_content += "<script type='text/javascript' src='[filename]'></script> "
for (var/filename in stylesheets)
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'>"
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'> "
var/templatel_data[0]
for (var/key in templates)
@@ -297,7 +298,7 @@ nanoui is used to open and update nano browser uis
}
else
{
alert('receiveUpdateData error: something is not defined!');
alert('receiveUpdateData ERROR: something is not defined!');
if (typeof NanoUpdate == 'undefined')
{
alert('NanoUpdate not defined!');
@@ -313,7 +314,7 @@ nanoui is used to open and update nano browser uis
<div id='uiWrapper'>
[title ? "<div id='uiTitleWrapper'><div id='uiStatusIcon' class='icon24 uiStatusGood'></div><div id='uiTitle'>[title]</div><div id='uiTitleFluff'></div></div>" : ""]
<div id='uiContent'>
<noscript><div id='uiNoJavaScript'>Your browser does not have JavaScript enabled. Please enable JavaScript restart SS13.</div></noscript>
<div id='uiNoJavaScript'>Initiating...</div>
"}
/**
@@ -322,13 +323,8 @@ nanoui is used to open and update nano browser uis
* @return string HTML footer content
*/
/datum/nanoui/proc/get_footer()
var/scriptsContent = ""
for (var/filename in scripts)
scriptsContent += "<script type='text/javascript' src='[filename]'></script>"
return {"
[scriptsContent]
</div>
</div>
</body>
@@ -431,7 +427,7 @@ nanoui is used to open and update nano browser uis
if (!src_object || !user)
close()
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)
else