From 9a87513929290b6f84a090b4b4cca8fab0f2ab81 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 24 Feb 2012 14:51:29 -0800 Subject: Added import/export of RDGE data This is only the IO aspect, the data getter seems broken for 2D canvas and does not allow for save, and nothing works for setting the data on load. However, the IO aspect of saving and opening the data are not incorporated. --- js/mediators/io-mediator.js | 47 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index c4f3b361..e5eb1fc6 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -195,11 +195,10 @@ exports.IoMediator = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - //TODO: Expand to allow more templates + //TODO: Expand to allow more templates, clean up variables parseNinjaTemplateToHtml: { enumerable: false, value: function (template) { - //TODO: Clean up variables //Injecting head and body into old document template.document.content.document.body.innerHTML = template.body; template.document.content.document.head.innerHTML = template.head; @@ -210,7 +209,7 @@ exports.IoMediator = Montage.create(Component, { //Looping through link tags and removing file recreated elements for (var j in styletags) { if (styletags[j].getAttribute) { - if(styletags[j].getAttribute('ninjauri') !== null) { + if(styletags[j].getAttribute('ninjauri') !== null) {//TODO: Use querySelectorAll try { //Checking head first template.document.content.document.head.removeChild(styletags[j]); @@ -228,7 +227,7 @@ exports.IoMediator = Montage.create(Component, { } //TODO: Add logic to only enble tags we disabled for (var l in linktags) { - if (linktags[l].getAttribute && linktags[l].getAttribute('disabled')) { + if (linktags[l].getAttribute && linktags[l].getAttribute('disabled')) {//TODO: Use querySelectorAll linktags[l].removeAttribute('disabled'); } } @@ -259,7 +258,7 @@ exports.IoMediator = Montage.create(Component, { for(var i in template.css) { if (template.css[i].ownerNode) { if (template.css[i].ownerNode.getAttribute) { - if (template.css[i].ownerNode.getAttribute('ninjauri') === null) { + if (template.css[i].ownerNode.getAttribute('ninjauri') === null) {//TODO: Use querySelectorAll //Inseting data from rules array into