aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.css2
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js4
-rwxr-xr-xjs/controllers/selection-controller.js4
-rwxr-xr-xjs/controllers/styles-controller.js2
-rwxr-xr-xjs/document/document-html.js8
-rwxr-xr-xjs/panels/Panel.reel/Panel.js13
-rwxr-xr-xjs/stage/layout.js2
-rw-r--r--manifest.json2
8 files changed, 29 insertions, 8 deletions
diff --git a/js/components/layout/document-bar.reel/document-bar.css b/js/components/layout/document-bar.reel/document-bar.css
index 5eba72e8..2c547a22 100755
--- a/js/components/layout/document-bar.reel/document-bar.css
+++ b/js/components/layout/document-bar.reel/document-bar.css
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
33 background: -webkit-radial-gradient(center, ellipse cover, rgba(100, 100, 100, .9) 40%, rgba(100, 100, 100, .4) 50%, rgba(100, 100, 100, 0) 51%), -webkit-radial-gradient(center, ellipse cover, rgba(100, 100, 100, .9) 40%, rgba(100, 100, 100, .4) 50%, rgba(100, 100, 100, 0) 51%), -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(60, 60, 60)), color-stop(70%, rgb(30, 30, 30)), color-stop(100%, rgb(25, 25, 25))), -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(10, 10, 10)), color-stop(50%, rgb(20, 20, 20)), color-stop(100%, rgb(10, 10, 10))) !important; 33 background: -webkit-radial-gradient(center, ellipse cover, rgba(100, 100, 100, .9) 40%, rgba(100, 100, 100, .4) 50%, rgba(100, 100, 100, 0) 51%), -webkit-radial-gradient(center, ellipse cover, rgba(100, 100, 100, .9) 40%, rgba(100, 100, 100, .4) 50%, rgba(100, 100, 100, 0) 51%), -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(60, 60, 60)), color-stop(70%, rgb(30, 30, 30)), color-stop(100%, rgb(25, 25, 25))), -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(10, 10, 10)), color-stop(50%, rgb(20, 20, 20)), color-stop(100%, rgb(10, 10, 10))) !important;
34 background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat !important; 34 background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat !important;
35 background-position: 49.5% center, 50.5% center, center center, left top !important; 35 background-position: 49.5% center, 50.5% center, center center, left top !important;
36 background-size: 5px 5px, 5px 5px, 3% 100%, 100% 100%; 36 background-size: 5px 5px, 5px 5px, 3% 100%, 100% 100% !important;
37} 37}
38 38
39.documentBar { 39.documentBar {
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index 098e9e68..88c4a24b 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -246,7 +246,7 @@ exports.DocumentBar = Montage.create(Component, {
246 file: this._currentDocument.model.file, 246 file: this._currentDocument.model.file,
247 webgl: this._currentDocument.model.webGlHelper.glData, 247 webgl: this._currentDocument.model.webGlHelper.glData,
248 styles: this._currentDocument.model.getStyleSheets(), 248 styles: this._currentDocument.model.getStyleSheets(),
249 template: this._currentDocument.fileTemplate, 249 template: this._currentDocument.model.fileTemplate,
250 document: this._currentDocument.model.views.design.iframe.contentWindow.document, 250 document: this._currentDocument.model.views.design.iframe.contentWindow.document,
251 head: this._currentDocument.model.views.design.iframe.contentWindow.document.head, 251 head: this._currentDocument.model.views.design.iframe.contentWindow.document.head,
252 body: this._currentDocument.model.views.design.iframe.contentWindow.document.body, 252 body: this._currentDocument.model.views.design.iframe.contentWindow.document.body,
@@ -256,7 +256,7 @@ exports.DocumentBar = Montage.create(Component, {
256 doc = this._currentDocument.model.views.code.textArea.value; 256 doc = this._currentDocument.model.views.code.textArea.value;
257 } 257 }
258 //Reloading the document from changes made 258 //Reloading the document from changes made
259 this._currentDocument.reloadView(view, this.fileTemplate, doc); 259 this._currentDocument.reloadView(view, doc.template, doc);
260 } 260 }
261 } 261 }
262 }, 262 },
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 7a26ed3b..4b031d70 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -58,13 +58,13 @@ exports.SelectionController = Montage.create(Component, {
58 return; 58 return;
59 } 59 }
60 60
61 if(this._currentDocument && this._currentDocument.currentView === "design") { 61 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
62 this._currentDocument.model._selection = this.application.ninja.selectedElements; 62 this._currentDocument.model._selection = this.application.ninja.selectedElements;
63 } 63 }
64 64
65 this._currentDocument = value; 65 this._currentDocument = value;
66 66
67 if(this._currentDocument && this._currentDocument.currentView === "design") { 67 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
68 this.selectedElements = this._currentDocument.model.selection; 68 this.selectedElements = this._currentDocument.model.selection;
69 } 69 }
70 /* 70 /*
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index e95c6614..68d031fb 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -87,7 +87,7 @@ var stylesController = exports.StylesController = Montage.create(Component, {
87 set : function(document) { 87 set : function(document) {
88 ///// If the document is null set default stylesheets to null 88 ///// If the document is null set default stylesheets to null
89 89
90 if(!document || document.currentView === "code") { 90 if(!document || (document.currentView === "code" && document.model.currentView.identifier !== "design-code")) {
91 this._currentDocument = null; 91 this._currentDocument = null;
92 this._stageStylesheet = null; 92 this._stageStylesheet = null;
93 this.defaultStylesheet = null; 93 this.defaultStylesheet = null;
diff --git a/js/document/document-html.js b/js/document/document-html.js
index f3163339..d610c69d 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -157,6 +157,14 @@ exports.HtmlDocument = Montage.create(Component, {
157 this.model.views.design.show(); 157 this.model.views.design.show();
158 this.model.views.design.iframe.style.opacity = 0; 158 this.model.views.design.iframe.style.opacity = 0;
159 this.model.views.design.content = this.application.ninja.ioMediator.tmplt.parseHtmlToNinjaTemplate(doc); 159 this.model.views.design.content = this.application.ninja.ioMediator.tmplt.parseHtmlToNinjaTemplate(doc);
160 //
161 if (!template) {
162 if (this.model.views.design.content.body.indexOf('Ninja-Banner Dimensions@@@') !== -1) {
163 dimensions = (this.model.views.design.content.body.split('Ninja-Banner Dimensions@@@'))[1].split('-->')[0].split('x');
164 dimensions = {width: parseInt(dimensions[0]), height: parseInt(dimensions[1])};
165 template = {type: 'banner', size: dimensions};
166 }
167 }
160 //TODO: Improve reference (probably through binding values) 168 //TODO: Improve reference (probably through binding values)
161 this.model.views.design._webGlHelper = this.model.webGlHelper; 169 this.model.views.design._webGlHelper = this.model.webGlHelper;
162 //Rendering design view, using observers to know when template is ready 170 //Rendering design view, using observers to know when template is ready
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js
index 988088e3..586636e1 100755
--- a/js/panels/Panel.reel/Panel.js
+++ b/js/panels/Panel.reel/Panel.js
@@ -159,11 +159,24 @@ exports.Panel = Montage.create(Component, {
159 this.disabled = true; 159 this.disabled = true;
160 } else { 160 } else {
161 this.disabled = this._currentDocument.currentView !== "design"; 161 this.disabled = this._currentDocument.currentView !== "design";
162 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
162 } 163 }
163 164
164 } 165 }
165 }, 166 },
166 167
168 handleChange: {
169 value: function(notification) {
170 if(notification.currentPropertyPath === "model.currentViewIdentifier") {
171 if(this.currentDocument.model.currentView.identifier === "design-code") {
172 this.disabled = true;
173 } else {
174 this.disabled = false;
175 }
176 }
177 }
178 },
179
167 handleBtnCollapseAction: { 180 handleBtnCollapseAction: {
168 value: function() { 181 value: function() {
169 this.collapsed = !this.collapsed; 182 this.collapsed = !this.collapsed;
diff --git a/js/stage/layout.js b/js/stage/layout.js
index 5cc8dbea..5e6e8152 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -69,7 +69,7 @@ exports.Layout = Montage.create(Component, {
69 set : function(value) { 69 set : function(value) {
70 if (value !== this._currentDocument) { 70 if (value !== this._currentDocument) {
71 this._currentDocument = value; 71 this._currentDocument = value;
72 if(this._currentDocument && this._currentDocument.currentView === "design") { 72 if(this._currentDocument && (this._currentDocument.currentView === "design" || this._currentDocument.model.currentView.identifier !== "code")) {
73 this.elementsToDraw = Array.prototype.slice.call(this._currentDocument.model.documentRoot.childNodes, 0); 73 this.elementsToDraw = Array.prototype.slice.call(this._currentDocument.model.documentRoot.childNodes, 0);
74 } 74 }
75 } 75 }
diff --git a/manifest.json b/manifest.json
index 14d8b239..46b444c3 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
1{ 1{
2 "name": "Ninja Authoring Tool Preview", 2 "name": "Ninja Authoring Tool Preview",
3 "description": "Ninja HTML5 Authoring Tool Preview", 3 "description": "Ninja HTML5 Authoring Tool Preview",
4 "version": "0.8.0.0", 4 "version": "0.7.2.0",
5 "app": { 5 "app": {
6 "launch": { 6 "launch": {
7 "local_path": "index.html" 7 "local_path": "index.html"