aboutsummaryrefslogtreecommitdiff
path: root/js/document/views
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/views')
-rwxr-xr-xjs/document/views/design.js58
1 files changed, 38 insertions, 20 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js
index 0e42dcc2..3d11e138 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -23,7 +23,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
23 value: null 23 value: null
24 }, 24 },
25 //////////////////////////////////////////////////////////////////// 25 ////////////////////////////////////////////////////////////////////
26 // 26 //
27 _viewCallback: { 27 _viewCallback: {
28 value: null 28 value: null
29 }, 29 },
@@ -34,11 +34,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
34 }, 34 },
35 //////////////////////////////////////////////////////////////////// 35 ////////////////////////////////////////////////////////////////////
36 // 36 //
37 _document: {
38 value: null
39 },
40 ////////////////////////////////////////////////////////////////////
41 //
42 _bodyFragment: { 37 _bodyFragment: {
43 value: null 38 value: null
44 }, 39 },
@@ -58,8 +53,29 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
58 value: null 53 value: null
59 }, 54 },
60 //////////////////////////////////////////////////////////////////// 55 ////////////////////////////////////////////////////////////////////
61 //TODO: Remove usage 56 //
62 model: { 57 _liveNodeList: {
58 value: null
59 },
60 ////////////////////////////////////////////////////////////////////
61 //
62 _webGlHelper: {
63 value: null
64 },
65 ////////////////////////////////////////////////////////////////////
66 //
67 _baseHref: {
68 value: null
69 },
70 ////////////////////////////////////////////////////////////////////
71 //
72 baseHref: {
73 get: function() {return this._baseHref;},
74 set: function(value) {this._baseHref = value;}
75 },
76 ////////////////////////////////////////////////////////////////////
77 //
78 _document: {
63 value: null 79 value: null
64 }, 80 },
65 //////////////////////////////////////////////////////////////////// 81 ////////////////////////////////////////////////////////////////////
@@ -69,11 +85,17 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
69 set: function(value) {this._document = value;} 85 set: function(value) {this._document = value;}
70 }, 86 },
71 //////////////////////////////////////////////////////////////////// 87 ////////////////////////////////////////////////////////////////////
72 // 88 //
73 _liveNodeList: { 89 _documentRoot: {
74 value: null 90 value: null
75 }, 91 },
76 //////////////////////////////////////////////////////////////////// 92 ////////////////////////////////////////////////////////////////////
93 //
94 documentRoot: {
95 get: function() {return this._documentRoot;},
96 set: function(value) {this._documentRoot = value;}
97 },
98 ////////////////////////////////////////////////////////////////////
77 // 99 //
78 getLiveNodeList: { 100 getLiveNodeList: {
79 value: function(useFilter) { 101 value: function(useFilter) {
@@ -149,7 +171,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
149 if (basetag.length) { 171 if (basetag.length) {
150 if (basetag[basetag.length-1].getAttribute && basetag[basetag.length-1].getAttribute('href')) { 172 if (basetag[basetag.length-1].getAttribute && basetag[basetag.length-1].getAttribute('href')) {
151 //Setting base HREF in model 173 //Setting base HREF in model
152 this.model.baseHref = basetag[basetag.length-1].getAttribute('href'); 174 this.baseHref = basetag[basetag.length-1].getAttribute('href');
153 } 175 }
154 } 176 }
155 //Checking to content to be template 177 //Checking to content to be template
@@ -285,16 +307,16 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
285 //Else there is not data to parse 307 //Else there is not data to parse
286 if(this._viewCallback) { 308 if(this._viewCallback) {
287 this._viewCallback.viewCallback.call(this._viewCallback.context); 309 this._viewCallback.viewCallback.call(this._viewCallback.context);
288 } 310 }
289 } 311 }
290 //TODO: Verify appropiate location for this operation 312 //TODO: Verify appropiate location for this operation
291 if (this._template && this._template.type === 'banner') { 313 if (this._template && this._template.type === 'banner') {
292 this.model.documentRoot = this.document.body.getElementsByTagName('ninja-content')[0]; 314 this.documentRoot = this.document.body.getElementsByTagName('ninja-content')[0];
293 } else { 315 } else {
294 this.model.documentRoot = this.document.body; 316 this.documentRoot = this.document.body;
295 } 317 }
296 //Storing node list for reference (might need to store in the model) 318 //Storing node list for reference (might need to store in the model)
297 this._liveNodeList = this.model.documentRoot.getElementsByTagName('*'); 319 this._liveNodeList = this.documentRoot.getElementsByTagName('*');
298 //Getting list of original nodes 320 //Getting list of original nodes
299 orgNodes = this.document.getElementsByTagName('*'); 321 orgNodes = this.document.getElementsByTagName('*');
300 //TODO: Figure out if this is ideal for identifying nodes created by Ninja 322 //TODO: Figure out if this is ideal for identifying nodes created by Ninja
@@ -302,8 +324,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
302 if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true'); 324 if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true');
303 } 325 }
304 326
305
306
307 //Makign callback if specified 327 //Makign callback if specified
308 if (this._callback) this._callback(); 328 if (this._callback) this._callback();
309 } 329 }
@@ -373,8 +393,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
373 value: function (scripttags) { 393 value: function (scripttags) {
374 // 394 //
375 var n, webgldata, fileRead; 395 var n, webgldata, fileRead;
376 //Setting the iFrame property for reference in helper class
377 this.model.webGlHelper.iframe = this.model.views.design.iframe;
378 //Checking for webGL Data 396 //Checking for webGL Data
379 for (var w in scripttags) { 397 for (var w in scripttags) {
380 // 398 //
@@ -400,7 +418,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
400 webgldata.data[n] = unescape(webgldata.data[n]); 418 webgldata.data[n] = unescape(webgldata.data[n]);
401 } 419 }
402 //TODO: Improve setter of webGL and reference 420 //TODO: Improve setter of webGL and reference
403 this.model.webGlHelper.glData = webgldata.data; 421 this._webGlHelper.glData = webgldata.data;
404 } 422 }
405 } 423 }
406 } 424 }