From e67540d23a1bd5d2480ce47634c0cbe523dd5e4a Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sun, 26 Feb 2012 11:50:42 -0800 Subject: Cleaning up formatting for webGL data --- js/mediators/io-mediator.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index c33ccced..30180155 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -297,15 +297,19 @@ exports.IoMediator = Montage.create(Component, { webgltag.setAttribute('data-ninja-webgl', 'true'); template.document.content.document.head.appendChild(webgltag); } - // + //TODO: Add version and other data for RDGE json = '\n({\n\t"version": "X.X.X.X",\n\t"data": ['; - // + //Looping through data to create escaped array for (var j=0; template.webgl[j]; j++) { - json += '\n\t"'+escape(template.webgl[j])+'"'; + if (j === 0) { + json += '\n\t\t\t"'+escape(template.webgl[j])+'"'; + } else { + json += ',\n\t\t\t"'+escape(template.webgl[j])+'"'; + } } - // - json += ']\n})\n'; - // + //Closing array (make-shift JSON string to validate data in