aboutsummaryrefslogtreecommitdiff
path: root/js/document/document-html.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-27 14:21:35 -0700
committerValerio Virgillito2012-04-27 14:21:35 -0700
commitb08cc404d32dd1d4dbc2139ce8f06d7d88b681a8 (patch)
treeae45391131c7c5203ae8e0d3470d106d835c8c6b /js/document/document-html.js
parent314709dd189807bfc762aa150bb1b29d2ccdf25b (diff)
parent6c1aa27b7753bc9007514859b42160fae265740d (diff)
downloadninja-b08cc404d32dd1d4dbc2139ce8f06d7d88b681a8.tar.gz
Merge branch 'refs/heads/serialization'
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-xjs/document/document-html.js46
1 files changed, 45 insertions, 1 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index 8cb88516..89717dd6 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -31,6 +31,10 @@ exports.HtmlDocument = Montage.create(Component, {
31 value: null 31 value: null
32 }, 32 },
33 33
34 exclusionList: {
35 value: ["HTML", "BODY"]
36 },
37
34 // Getters for the model. 38 // Getters for the model.
35 // TODO: Change how these properties are accessed through Ninja 39 // TODO: Change how these properties are accessed through Ninja
36 name: { 40 name: {
@@ -42,6 +46,24 @@ exports.HtmlDocument = Montage.create(Component, {
42 } 46 }
43 }, 47 },
44 48
49 isActive: {
50 get: function() {
51 return this.model._isActive;
52 },
53 set: function(value) {
54 this.model._isActive = value;
55 }
56 },
57
58 needsSave: {
59 get: function() {
60 return this.model._needsSave;
61 },
62 set: function(value) {
63 this.model._needsSave = value;
64 }
65 },
66
45 // View Properties 67 // View Properties
46 // TODO: Move those into a view object - for now dump it here 68 // TODO: Move those into a view object - for now dump it here
47 iframe: { 69 iframe: {
@@ -53,6 +75,10 @@ exports.HtmlDocument = Montage.create(Component, {
53 return this._uuid; 75 return this._uuid;
54 } 76 }
55 }, 77 },
78
79 currentView: {
80 value: "design"
81 },
56 //////////////////////////////////////////////////////////////////// 82 ////////////////////////////////////////////////////////////////////
57 //////////////////////////////////////////////////////////////////// 83 ////////////////////////////////////////////////////////////////////
58 init: { 84 init: {
@@ -270,7 +296,8 @@ exports.HtmlDocument = Montage.create(Component, {
270 296
271 //TODO Finish this implementation once we start caching Core Elements 297 //TODO Finish this implementation once we start caching Core Elements
272 // Assign a model to the UserContent and add the ViewPort reference to it. 298 // Assign a model to the UserContent and add the ViewPort reference to it.
273 document.application.njUtils.makeElementModel(this.documentRoot, "Stage", "stage"); 299 document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body");
300// this.documentRoot.elementModel.props3D.init(this.documentRoot, true);
274 301
275 for(i = 0; i < this._stylesheets.length; i++) { 302 for(i = 0; i < this._stylesheets.length; i++) {
276 if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") { 303 if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") {
@@ -309,6 +336,23 @@ exports.HtmlDocument = Montage.create(Component, {
309 } 336 }
310 }, 337 },
311 338
339 GetElementFromPoint: {
340 value: function(x, y) {
341 return this._window.getElement(x,y);
342 }
343 },
344
345 inExclusion: {
346 value: function(element) {
347 if(this.exclusionList.indexOf(element.nodeName) === -1) {
348 return -1;
349 }
350
351 return 1;
352
353 }
354 },
355
312 // Handler for user content main reel. Gets called once the main reel of the template 356 // Handler for user content main reel. Gets called once the main reel of the template
313 // gets deserialized. 357 // gets deserialized.
314 // Setting up the currentSelectedContainer to the document body. 358 // Setting up the currentSelectedContainer to the document body.