mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Fix Major UI updating issues, jQuery changes, debug hooks.
Also fixes incredibly fucked-up air alarm template and CSS.
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
world << "[src]'s Topic: [href] destined for [hsrc]."
|
||||
|
||||
if(href_list["nano_err"]) //nano throwing errors
|
||||
world << "## NanoUI Error for [src], Error:" + href_list["nano_err"]
|
||||
world << "## NanoUI, Subject [src]: " + html_decode(href_list["nano_err"]) //NANO DEBUG HOOK
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -179,9 +179,11 @@ nanoui is used to open and update nano browser uis
|
||||
* @return /list config data
|
||||
*/
|
||||
/datum/nanoui/proc/get_config_data()
|
||||
var/name = "[src_object]"
|
||||
name = sanitize(name) //jQuery's parseJSON fails with byond formatting characters in the JSON
|
||||
var/list/config_data = list(
|
||||
"title" = title,
|
||||
"srcObject" = list("name" = "[src_object]"),
|
||||
"srcObject" = list("name" = name),
|
||||
"stateKey" = state_key,
|
||||
"status" = status,
|
||||
"autoUpdateLayout" = auto_update_layout,
|
||||
@@ -371,6 +373,10 @@ nanoui is used to open and update nano browser uis
|
||||
{
|
||||
NanoStateManager.receiveUpdateData(jsonString);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('browser.recieveUpdateData failed due to jQuery or NanoStateManager being unavailiable.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
[head_content]
|
||||
@@ -447,7 +453,7 @@ nanoui is used to open and update nano browser uis
|
||||
|
||||
var/list/send_data = get_send_data(data)
|
||||
|
||||
//user << list2json(data) // used for debugging
|
||||
//user << list2json_usecache(send_data) // used for debugging //NANO DEBUG HOOK
|
||||
user << output(list2params(list(list2json_usecache(send_data))),"[window_id].browser:receiveUpdateData")
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,6 +298,7 @@ div.notice {
|
||||
border: 1px solid #40628a;
|
||||
padding: 4px;
|
||||
margin: 3px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.statusDisplayRecords {
|
||||
|
||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+26
-37
@@ -8508,51 +8508,40 @@ var nonce = jQuery.now();
|
||||
|
||||
var rquery = (/\?/);
|
||||
|
||||
var rvalidchars = /^[\],:{}\s]*$/;
|
||||
var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;
|
||||
var rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g;
|
||||
var rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;
|
||||
|
||||
|
||||
var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
|
||||
|
||||
jQuery.parseJSON = function( data ) {
|
||||
// Attempt to parse using the native JSON parser first
|
||||
if ( window.JSON && window.JSON.parse ) {
|
||||
// Support: Android 2.3
|
||||
// Workaround failure to string-cast null input
|
||||
return window.JSON.parse( data + "" );
|
||||
}
|
||||
|
||||
var requireNonComma,
|
||||
depth = null,
|
||||
str = jQuery.trim( data + "" );
|
||||
|
||||
// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
|
||||
// after removing valid tokens
|
||||
return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
|
||||
|
||||
// Force termination if we see a misplaced comma
|
||||
if ( requireNonComma && comma ) {
|
||||
depth = 0;
|
||||
jQuery.parseJSON: function( data ) {
|
||||
// Attempt to parse using the native JSON parser first
|
||||
if ( window.JSON && window.JSON.parse ) {
|
||||
return window.JSON.parse( data );
|
||||
}
|
||||
|
||||
// Perform no more replacements after returning to outermost depth
|
||||
if ( depth === 0 ) {
|
||||
return token;
|
||||
if ( data === null ) {
|
||||
return data;
|
||||
}
|
||||
|
||||
// Commas must not follow "[", "{", or ","
|
||||
requireNonComma = open || comma;
|
||||
if ( typeof data === "string" ) {
|
||||
|
||||
// Determine new depth
|
||||
// array/object open ("[" or "{"): depth += true - false (increment)
|
||||
// array/object close ("]" or "}"): depth += false - true (decrement)
|
||||
// other cases ("," or primitive): depth += true - true (numeric cast)
|
||||
depth += !close - !open;
|
||||
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
||||
data = jQuery.trim( data );
|
||||
|
||||
if ( data ) {
|
||||
// Make sure the incoming data is actual JSON
|
||||
// Logic borrowed from http://json.org/json2.js
|
||||
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
||||
.replace( rvalidtokens, "]" )
|
||||
.replace( rvalidbraces, "")) ) {
|
||||
|
||||
return ( new Function( "return " + data ) )();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove this token
|
||||
return "";
|
||||
}) ) ?
|
||||
( Function( "return " + str ) )() :
|
||||
jQuery.error( "Invalid JSON: " + data );
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Cross-browser xml parsing
|
||||
|
||||
@@ -48,6 +48,8 @@ NanoStateManager = function ()
|
||||
var receiveUpdateData = function (jsonString)
|
||||
{
|
||||
var updateData;
|
||||
|
||||
alert("recieveUpdateData called." + "<br>Type: " + typeof jsonString);
|
||||
try
|
||||
{
|
||||
// parse the JSON string from the server into a JSON object
|
||||
@@ -55,10 +57,12 @@ NanoStateManager = function ()
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
alert(error.Message);
|
||||
alert("recieveUpdateData failed. " + "<br>Error name: " + error.name + "<br>Error Message: " + error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
alert("recieveUpdateData passed trycatch block.");
|
||||
|
||||
if (!updateData.hasOwnProperty('data'))
|
||||
{
|
||||
if (_data && _data.hasOwnProperty('data'))
|
||||
|
||||
@@ -53,7 +53,7 @@ if (typeof doT == 'undefined') {
|
||||
(function() {
|
||||
var _alert = window.alert;
|
||||
window.alert = function(str) {
|
||||
window.location = "byond://?nano_err=" + str;
|
||||
window.location = "byond://?nano_err=" + encodeURIComponent(str);
|
||||
_alert(str);
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -87,7 +87,6 @@ Used In File(s): /code/game/machinery/alarm.dm
|
||||
{{:helper.link('Activate Alarm',null,{'atmos_alarm':1},null)}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<!--
|
||||
|
||||
Reference in New Issue
Block a user