From 0efbbf8287517b755be1774f6aa49947bed50a0d Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 7 Jun 2012 11:24:29 -0700 Subject: Adding unique ID to canvas data folders Also set up for tracking ID created, will be adding support for parsing files without saving later, but flag is now present. --- js/mediators/io-mediator.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/mediators/io-mediator.js') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index c9e10896..c487fef5 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -162,9 +162,9 @@ exports.IoMediator = Montage.create(Component, { case 'html': //Getting content from function to properly handle saving assets (as in external if flagged) if (doc.template && (doc.template.type === 'banner' || doc.template.type === 'animation')) { - parsedDoc = this.tmplt.parseNinjaTemplateToHtml(doc, true, libCopyCallback); + parsedDoc = this.tmplt.parseNinjaTemplateToHtml(true, doc, true, libCopyCallback); } else { - parsedDoc = this.tmplt.parseNinjaTemplateToHtml(doc, false, libCopyCallback); + parsedDoc = this.tmplt.parseNinjaTemplateToHtml(true, doc, false, libCopyCallback); } break; default: @@ -176,13 +176,17 @@ exports.IoMediator = Montage.create(Component, { save = this.fio.saveFile({uri: doc.file.uri, contents: parsedDoc.content}); //Checking for callback if (callback) callback(save); + //Checking for libraries, making callback if specified + if (!parsedDoc.libs && libCopyCallback) libCopyCallback(true); // - if (!parsedDoc.libs && libCopyCallback) libCopyCallback(true); + return {montageId: parsedDoc.montageId, canvasId: parsedDoc.canvasId}; } else { //Making call to save file save = this.fio.saveFile({uri: doc.file.uri, contents: content}); //Checking for callback if (callback) callback(save); + // + return null; } } }, -- cgit v1.2.3