From 7e61ce5aba0c8465595804da21e365baf4d8c15d Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 23 Mar 2012 13:22:42 -0700 Subject: Removing m-js components I/O and fix for webGL Removed saving m-js components as new components broke I/O when present. Also made a fix for checking length of webGL array since first item now is non-user data. (That is to be removed) --- js/document/html-document.js | 8 +++++--- js/mediators/io-mediator.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 7ab4272b..8f9d2870 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -871,7 +871,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { //TODO: Add logic to handle save before preview this.application.ninja.documentController.handleExecuteSaveAll(null); //Temp check for webGL Hack - if (this.application.ninja.documentController.activeDocument.glData.length && this.application.ninja.documentController.activeDocument.glData.length > 0) { + if (this.application.ninja.documentController.activeDocument.glData.length && this.application.ninja.documentController.activeDocument.glData.length > 1) {//TODO: Should be 0, temp hack fix setTimeout(function () {window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);}.bind(this), 3500); } else { window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); @@ -894,7 +894,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } } - return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; + //return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; + return {mode: 'html', document: this._userDocument, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; } else if (this.currentView === "code"){ //TODO: Would this get call when we are in code of HTML? } else { @@ -917,7 +918,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } } - return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; + //return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; + return {mode: 'html', document: this._userDocument, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; } else if (this.currentView === "code"){ //TODO: Would this get call when we are in code of HTML? } else { diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index cbed3a99..1efbb8bb 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -348,7 +348,7 @@ exports.IoMediator = Montage.create(Component, { } } //Checking for webGL elements in document - if (template.webgl && template.webgl.length > 0) { + if (template.webgl && template.webgl.length > 1) {//TODO: Should be length 0, hack for a temp fix var rdgeDirName, rdgeVersion; //Copy webGL library if needed for (var i in this.application.ninja.coreIoApi.ninjaLibrary.libs) { -- cgit v1.2.3