diff options
author | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
commit | 6c8f3525b839e82cf43df43700a0160ee2c5458f (patch) | |
tree | 3fb801fa54b759c5568d75bb467e02652ce77c3e /js/document/models | |
parent | e8ae5db7ce7023b638375cbc27a3f7b7a2f77b23 (diff) | |
parent | 342c97ac9b727b22a7b0bfefca4d2a168bc3055b (diff) | |
download | ninja-6c8f3525b839e82cf43df43700a0160ee2c5458f.tar.gz |
Merge branch 'refs/heads/dom-architecture' into binding
Conflicts:
css/ninja.css
scss/imports/scss/_toolbar.scss
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/document/models')
-rwxr-xr-x | js/document/models/base.js | 23 | ||||
-rwxr-xr-x | js/document/models/html.js | 5 |
2 files changed, 22 insertions, 6 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js index 5f2a5893..649539ea 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -93,13 +93,21 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
93 | //Currently only supporting current browser (Chrome, obviously) | 93 | //Currently only supporting current browser (Chrome, obviously) |
94 | switch (this.browser) { | 94 | switch (this.browser) { |
95 | case 'chrome': | 95 | case 'chrome': |
96 | window.open(this.url); | 96 | if (this.template && (this.template.type === 'banner' || this.template.type === 'animation')) { |
97 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); | ||
98 | } else { | ||
99 | window.open(this.url); | ||
100 | } | ||
97 | break; | 101 | break; |
98 | default: | 102 | default: |
99 | window.open(this.url); | 103 | if (this.template.type === 'banner' || this.template.type === 'animation') { |
104 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); | ||
105 | } else { | ||
106 | window.open(this.url); | ||
107 | } | ||
100 | break; | 108 | break; |
101 | } | 109 | } |
102 | }.bind({browser: browser, url: url})); | 110 | }.bind({browser: browser, url: url, template: this.fileTemplate})); |
103 | } | 111 | } |
104 | }, | 112 | }, |
105 | //////////////////////////////////////////////////////////////////// | 113 | //////////////////////////////////////////////////////////////////// |
@@ -141,7 +149,8 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
141 | template: this.fileTemplate, | 149 | template: this.fileTemplate, |
142 | document: this.views.design.iframe.contentWindow.document, | 150 | document: this.views.design.iframe.contentWindow.document, |
143 | head: this.views.design.iframe.contentWindow.document.head, | 151 | head: this.views.design.iframe.contentWindow.document.head, |
144 | body: this.views.design.iframe.contentWindow.document.body | 152 | body: this.views.design.iframe.contentWindow.document.body, |
153 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator | ||
145 | }, callback.bind(this)); | 154 | }, callback.bind(this)); |
146 | } else { | 155 | } else { |
147 | //TODO: Add logic to save code view data | 156 | //TODO: Add logic to save code view data |
@@ -169,7 +178,8 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
169 | template: this.fileTemplate, | 178 | template: this.fileTemplate, |
170 | document: this.views.design.iframe.contentWindow.document, | 179 | document: this.views.design.iframe.contentWindow.document, |
171 | head: this.views.design.iframe.contentWindow.document.head, | 180 | head: this.views.design.iframe.contentWindow.document.head, |
172 | body: this.views.design.iframe.contentWindow.document.body | 181 | body: this.views.design.iframe.contentWindow.document.body, |
182 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator | ||
173 | }, callback.bind(this)); | 183 | }, callback.bind(this)); |
174 | } else { | 184 | } else { |
175 | //TODO: Add logic to save code view data | 185 | //TODO: Add logic to save code view data |
@@ -206,10 +216,11 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
206 | if (this.views.design && (!view || view === 'design')) { | 216 | if (this.views.design && (!view || view === 'design')) { |
207 | // | 217 | // |
208 | this.parentContainer.removeChild(this.views.design.iframe); | 218 | this.parentContainer.removeChild(this.views.design.iframe); |
219 | this.views.design.pauseAndStopVideos(); | ||
209 | this.views.design = null; | 220 | this.views.design = null; |
210 | } | 221 | } |
211 | // | 222 | // |
212 | if (callback) callback(success); | 223 | return success; |
213 | } | 224 | } |
214 | } | 225 | } |
215 | //////////////////////////////////////////////////////////////////// | 226 | //////////////////////////////////////////////////////////////////// |
diff --git a/js/document/models/html.js b/js/document/models/html.js index b57ff832..67457863 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js | |||
@@ -17,6 +17,11 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { | |||
17 | hasTemplate: { | 17 | hasTemplate: { |
18 | value: false | 18 | value: false |
19 | }, | 19 | }, |
20 | //////////////////////////////////////////////////////////////////// | ||
21 | // | ||
22 | selection: { | ||
23 | value: [] | ||
24 | }, | ||
20 | //////////////////////////////////////////////////////////////////// | 25 | //////////////////////////////////////////////////////////////////// |
21 | // | 26 | // |
22 | draw3DGrid: { | 27 | draw3DGrid: { |