From bffc9b2a4bd3480a6e369a36660ce402f7e16aba Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 15 May 2012 12:01:37 -0700 Subject: File save for banner template Adding file save for templates, completing I/O. --- js/document/models/base.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index 0f58e75c..5f2a5893 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -138,6 +138,7 @@ exports.BaseDocumentModel = Montage.create(Component, { file: this.file, webgl: this.webGlHelper.glData, styles: this.getStyleSheets(), + template: this.fileTemplate, document: this.views.design.iframe.contentWindow.document, head: this.views.design.iframe.contentWindow.document.head, body: this.views.design.iframe.contentWindow.document.body @@ -165,6 +166,7 @@ exports.BaseDocumentModel = Montage.create(Component, { file: this.file, webgl: this.webGlHelper.glData, css: this.getStyleSheets(), + template: this.fileTemplate, document: this.views.design.iframe.contentWindow.document, head: this.views.design.iframe.contentWindow.document.head, body: this.views.design.iframe.contentWindow.document.body -- cgit v1.2.3 From 620ae8f53d4da25c65adb675c0b0ee187e5754fc Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 15 May 2012 16:49:32 -0700 Subject: Adding special preview for templates --- js/document/models/base.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index 5f2a5893..e8eba89f 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -93,13 +93,21 @@ exports.BaseDocumentModel = Montage.create(Component, { //Currently only supporting current browser (Chrome, obviously) switch (this.browser) { case 'chrome': - window.open(this.url); + if (this.template.type === 'banner' || this.template.type === 'animation') { + window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); + } else { + window.open(this.url); + } break; default: - window.open(this.url); + if (this.template.type === 'banner' || this.template.type === 'animation') { + window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); + } else { + window.open(this.url); + } break; } - }.bind({browser: browser, url: url})); + }.bind({browser: browser, url: url, template: this.fileTemplate})); } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 919a0d0ed35c24b1047281723ddde2ac98fc9a3e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 15 May 2012 22:36:44 -0700 Subject: document close handler. initial working draft Signed-off-by: Valerio Virgillito --- js/document/models/base.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index 5f2a5893..d34fb2dd 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -206,10 +206,11 @@ exports.BaseDocumentModel = Montage.create(Component, { if (this.views.design && (!view || view === 'design')) { // this.parentContainer.removeChild(this.views.design.iframe); + this.views.design.pauseAndStopVideos(); this.views.design = null; } // - if (callback) callback(success); + return success; } } //////////////////////////////////////////////////////////////////// -- cgit v1.2.3