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 +++++-- js/document/templates/preview/banner.html | 64 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100755 js/document/templates/preview/banner.html (limited to 'js/document') 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})); } }, //////////////////////////////////////////////////////////////////// diff --git a/js/document/templates/preview/banner.html b/js/document/templates/preview/banner.html new file mode 100755 index 00000000..5838ec91 --- /dev/null +++ b/js/document/templates/preview/banner.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3