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 +++++++++++++++++++++++++++++++ js/io/templates/files/animation.txt | 6 +++ js/io/templates/files/banner.txt | 6 +++ 4 files changed, 87 insertions(+), 3 deletions(-) create mode 100755 js/document/templates/preview/banner.html (limited to '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})); } }, //////////////////////////////////////////////////////////////////// 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 diff --git a/js/io/templates/files/animation.txt b/js/io/templates/files/animation.txt index 8a3dbd41..a850f186 100755 --- a/js/io/templates/files/animation.txt +++ b/js/io/templates/files/animation.txt @@ -8,6 +8,12 @@ diff --git a/js/io/templates/files/banner.txt b/js/io/templates/files/banner.txt index f26accf6..fcfac14c 100755 --- a/js/io/templates/files/banner.txt +++ b/js/io/templates/files/banner.txt @@ -8,6 +8,12 @@ -- cgit v1.2.3