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 From 5de553a1b3bdd8783ab6ce017ae70369ad92a890 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 11:37:05 -0700 Subject: Fixing preview bug Also setting up for Montage component serialization. --- js/document/models/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index f9844b70..033e16f6 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -93,7 +93,7 @@ exports.BaseDocumentModel = Montage.create(Component, { //Currently only supporting current browser (Chrome, obviously) switch (this.browser) { case 'chrome': - if (this.template.type === 'banner' || this.template.type === 'animation') { + if (this.template && (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); -- cgit v1.2.3 From ac750fd9b9c311dcd48c6ee309607edc6fa048e1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 14:22:18 -0700 Subject: Adding basic montage components I/O Only for saving basic components without a reel. --- js/document/models/base.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index 033e16f6..649539ea 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -149,7 +149,8 @@ exports.BaseDocumentModel = Montage.create(Component, { 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 + body: this.views.design.iframe.contentWindow.document.body, + mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator }, callback.bind(this)); } else { //TODO: Add logic to save code view data @@ -177,7 +178,8 @@ exports.BaseDocumentModel = Montage.create(Component, { 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 + body: this.views.design.iframe.contentWindow.document.body, + mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator }, callback.bind(this)); } else { //TODO: Add logic to save code view data -- cgit v1.2.3