diff --git a/nodes/core/core/lib/debug/debug.js b/nodes/core/core/lib/debug/debug.js index 4529ada7f..839ddddbc 100644 --- a/nodes/core/core/lib/debug/debug.js +++ b/nodes/core/core/lib/debug/debug.js @@ -68,10 +68,55 @@ $(function() { ''; } - msg.innerHTML += ''+ payload+ ''; + if (format !== 'Object') { + msg.innerHTML += ''+ payload+ ''; + } else { + var el = $('').appendTo(msg); + buildMessageElement(JSON.parse(payload)).appendTo(el); + } $("#debug-content").append(msg); + $("#debug-content").scrollTop($("#debug-content")[0].scrollHeight); + },false); - - - },false) + function buildMessageElement(obj) { + var i; + var e; + var entryObj; + var element = $(''); + if (Array.isArray(obj)) { + $('').html('Array['+obj.length+']').appendTo(element); + for (i=0;i