aboutsummaryrefslogtreecommitdiff
path: root/js/document/models
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-08 12:59:13 -0700
committerValerio Virgillito2012-06-08 12:59:13 -0700
commita50814178be2775892ed999c28041d8e81291e22 (patch)
tree309af98cd840d3841be74c32e87c30fa8739ff1e /js/document/models
parent4070475b8da7257eca629be7288bf7a31d5e384e (diff)
parentd14249dd2d76e9eb8d14733c10393d36bd2ea8ee (diff)
downloadninja-a50814178be2775892ed999c28041d8e81291e22.tar.gz
Merge branch 'refs/heads/master' into timeline-resizer-fix
Diffstat (limited to 'js/document/models')
-rwxr-xr-xjs/document/models/base.js41
-rwxr-xr-xjs/document/models/html.js2
2 files changed, 35 insertions, 8 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index a3644815..5fa06259 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -68,12 +68,8 @@ exports.BaseDocumentModel = Montage.create(Component, {
68 //////////////////////////////////////////////////////////////////// 68 ////////////////////////////////////////////////////////////////////
69 // 69 //
70 selection: { 70 selection: {
71 get: function() { 71 get: function() {return this._selection;},
72 return this._selection; 72 set: function(value) {this._selection = value;}
73 },
74 set: function(value) {
75 this._selection = value;
76 }
77 }, 73 },
78 //////////////////////////////////////////////////////////////////// 74 ////////////////////////////////////////////////////////////////////
79 // 75 //
@@ -92,6 +88,11 @@ exports.BaseDocumentModel = Montage.create(Component, {
92 }, 88 },
93 //////////////////////////////////////////////////////////////////// 89 ////////////////////////////////////////////////////////////////////
94 // 90 //
91 libs: {
92 value: null
93 },
94 ////////////////////////////////////////////////////////////////////
95 //
95 switchViewTo: { 96 switchViewTo: {
96 value: function (view) { 97 value: function (view) {
97 // 98 //
@@ -167,8 +168,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
167 // 168 //
168 if (this.currentView === this.views.design) { 169 if (this.currentView === this.views.design) {
169 // 170 //
170 this.application.ninja.ioMediator.fileSave({ 171 var save = this.application.ninja.ioMediator.fileSave({
171 mode: 'html', 172 mode: 'html',
173 libs: this.libs,
172 file: this.file, 174 file: this.file,
173 webgl: this.webGlHelper.glData, 175 webgl: this.webGlHelper.glData,
174 styles: this.getStyleSheets(), 176 styles: this.getStyleSheets(),
@@ -178,6 +180,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
178 body: this.views.design.iframe.contentWindow.document.body, 180 body: this.views.design.iframe.contentWindow.document.body,
179 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 181 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
180 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 182 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
183 //TODO: Improve detection during save routine
184 if (save) {
185 if (save.montageId) {
186 this.libs.montageId = save.montageId;
187 this.libs.montage = true;
188 }
189 if (save.canvasId) {
190 this.libs.canvasId = save.canvasId;
191 this.libs.canvas = true;
192 }
193 }
181 } else { 194 } else {
182 //TODO: Add logic to save code view data 195 //TODO: Add logic to save code view data
183 } 196 }
@@ -196,8 +209,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
196 // 209 //
197 if (this.currentView === this.views.design) { 210 if (this.currentView === this.views.design) {
198 // 211 //
199 this.application.ninja.ioMediator.fileSave({ 212 var save = this.application.ninja.ioMediator.fileSave({
200 mode: 'html', 213 mode: 'html',
214 libs: this.libs,
201 file: this.file, 215 file: this.file,
202 webgl: this.webGlHelper.glData, 216 webgl: this.webGlHelper.glData,
203 css: this.getStyleSheets(), 217 css: this.getStyleSheets(),
@@ -207,6 +221,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
207 body: this.views.design.iframe.contentWindow.document.body, 221 body: this.views.design.iframe.contentWindow.document.body,
208 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 222 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
209 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 223 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
224 //TODO: Improve detection during save routine
225 if (save) {
226 if (save.montageId) {
227 this.libs.montageId = save.montageId;
228 this.libs.montage = true;
229 }
230 if (save.canvasId) {
231 this.libs.canvasId = save.canvasId;
232 this.libs.canvas = true;
233 }
234 }
210 } else { 235 } else {
211 //TODO: Add logic to save code view data 236 //TODO: Add logic to save code view data
212 } 237 }
diff --git a/js/document/models/html.js b/js/document/models/html.js
index 6bdc6546..7064c6e3 100755
--- a/js/document/models/html.js
+++ b/js/document/models/html.js
@@ -23,6 +23,8 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, {
23 value:function() { 23 value:function() {
24 //Creating instance of the webGL helper for this model 24 //Creating instance of the webGL helper for this model
25 this.webGlHelper = webGlDocumentHelper.create(); 25 this.webGlHelper = webGlDocumentHelper.create();
26 //
27 this.libs = {montage: false, canvas: false, montageId: null, canvasId: null};
26 } 28 }
27 }, 29 },
28 //////////////////////////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////////////