From 4b5cc9cf1f01552f61c08b9299b6e99366432e03 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 24 Apr 2012 15:36:03 -0700 Subject: Added a body controller Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 3 ++- js/document/templates/montage-web/default_html.css | 2 +- js/document/templates/montage-web/index.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 8cb88516..b19ca0d0 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -270,7 +270,8 @@ exports.HtmlDocument = Montage.create(Component, { //TODO Finish this implementation once we start caching Core Elements // Assign a model to the UserContent and add the ViewPort reference to it. - document.application.njUtils.makeElementModel(this.documentRoot, "Stage", "stage"); + document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); +// this.documentRoot.elementModel.props3D.init(this.documentRoot, true); for(i = 0; i < this._stylesheets.length; i++) { if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") { diff --git a/js/document/templates/montage-web/default_html.css b/js/document/templates/montage-web/default_html.css index db069d4e..08e39f22 100755 --- a/js/document/templates/montage-web/default_html.css +++ b/js/document/templates/montage-web/default_html.css @@ -11,7 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } .active-element-outline { - outline: #adff2f solid 2px; + outline: #adff2f solid 2px; } .nj-preset-transition { diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html index 90b0f7fd..c52a5394 100755 --- a/js/document/templates/montage-web/index.html +++ b/js/document/templates/montage-web/index.html @@ -42,7 +42,7 @@ -
IPSUM
+ -- cgit v1.2.3 From 1ccc4d6dcff232b00763a5a49d7ad7a91f78ad3f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 13:24:51 -0700 Subject: Fixing the element model and adding get element Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 6 ++++++ js/document/html-document.js | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index b19ca0d0..24eb4f47 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -310,6 +310,12 @@ exports.HtmlDocument = Montage.create(Component, { } }, + GetElementFromPoint: { + value: function(x, y) { + return this._window.getElement(x,y); + } + }, + // Handler for user content main reel. Gets called once the main reel of the template // gets deserialized. // Setting up the currentSelectedContainer to the document body. diff --git a/js/document/html-document.js b/js/document/html-document.js index 3876670c..3dbf96ce 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -759,10 +759,14 @@ exports.HTMLDocument = Montage.create(TextDocument, { //TODO Finish this implementation once we start caching Core Elements // Assign a model to the UserContent and add the ViewPort reference to it. NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); - //this.documentRoot.elementModel.viewPort = this.iframe.contentWindow.document.getElementById("Viewport"); - NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); + NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); - + + // Initialize the 3D properties + this.documentRoot.elementModel.props3D.init(this.documentRoot, true); + this.stageBG.elementModel.props3D.init(this.stageBG, true); + this.iframe.contentWindow.document.getElementById("Viewport").elementModel.props3D.init(this.iframe.contentWindow.document.getElementById("Viewport"), true); + for(i = 0; i < this._stylesheets.length; i++) { if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; -- cgit v1.2.3 From 238586be0df568c6804268d97bf9d3ef7cd33fda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 15:33:48 -0700 Subject: Simplifying the getElement method from stage and adding an exclusion list to the new template Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 24eb4f47..d9789cd2 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -31,6 +31,10 @@ exports.HtmlDocument = Montage.create(Component, { value: null }, + exclusionList: { + value: ["HTML"] + }, + // Getters for the model. // TODO: Change how these properties are accessed through Ninja name: { @@ -316,6 +320,17 @@ exports.HtmlDocument = Montage.create(Component, { } }, + inExclusion: { + value: function(element) { + if(this.exclusionList.indexOf(element.nodeName) === -1) { + return -1; + } + + return 1; + + } + }, + // Handler for user content main reel. Gets called once the main reel of the template // gets deserialized. // Setting up the currentSelectedContainer to the document body. -- cgit v1.2.3 From bcfb200482c26b2bfc0d6577b1eb0de7a19a6762 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 26 Apr 2012 16:23:59 -0700 Subject: Removing all "module" declarations and replaced with "prototype" in preparation for montage converting to the new "prototype" format fully --- js/document/templates/montage-html/index.html | 3 +-- js/document/templates/montage-web/index.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'js/document') diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html index b3f68030..79c6cd51 100755 --- a/js/document/templates/montage-html/index.html +++ b/js/document/templates/montage-html/index.html @@ -24,8 +24,7 @@ diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html index 90b0f7fd..53d14847 100755 --- a/js/document/templates/montage-web/index.html +++ b/js/document/templates/montage-web/index.html @@ -24,8 +24,7 @@ -- cgit v1.2.3 From a0e730636083eff0c757cd9e16698e3b8e0066c1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 17:05:45 -0700 Subject: Fixed the stage border and layout in the new template Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 24 +++++++++++++++++++++++- js/document/models/base.js | 8 ++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index d9789cd2..89717dd6 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -32,7 +32,7 @@ exports.HtmlDocument = Montage.create(Component, { }, exclusionList: { - value: ["HTML"] + value: ["HTML", "BODY"] }, // Getters for the model. @@ -46,6 +46,24 @@ exports.HtmlDocument = Montage.create(Component, { } }, + isActive: { + get: function() { + return this.model._isActive; + }, + set: function(value) { + this.model._isActive = value; + } + }, + + needsSave: { + get: function() { + return this.model._needsSave; + }, + set: function(value) { + this.model._needsSave = value; + } + }, + // View Properties // TODO: Move those into a view object - for now dump it here iframe: { @@ -57,6 +75,10 @@ exports.HtmlDocument = Montage.create(Component, { return this._uuid; } }, + + currentView: { + value: "design" + }, //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// init: { diff --git a/js/document/models/base.js b/js/document/models/base.js index 8925fc40..f237e793 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -25,6 +25,14 @@ exports.BaseDocumentModel = Montage.create(Montage, { _name: { value: null }, + + _isActive: { + value: null + }, + + _needsSave: { + value: null + }, //////////////////////////////////////////////////////////////////// // njdata: { -- cgit v1.2.3