aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-11 11:17:41 -0700
committerArmen Kesablyan2012-06-11 11:17:41 -0700
commit278769df00ced8620fd73371e38fe2e43f07ca3b (patch)
treedeb505c8a66b660eee1f17a2c6c4c575c7939f6f /js/components
parent555fd6efa605b937800b3979a4c68fa7eb8666ae (diff)
parent0f040acabfb7a4bf3138debec5aff869487ceb11 (diff)
downloadninja-278769df00ced8620fd73371e38fe2e43f07ca3b.tar.gz
Merge branch 'refs/heads/master' into binding
Conflicts: js/document/models/html.js js/document/views/design.js js/ninja.reel/ninja.js Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/components')
-rw-r--r--js/components/converter/string-units-converter.js2
-rw-r--r--js/components/converter/string-value-converter.js2
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js48
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.html6
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js112
-rwxr-xr-xjs/components/layout/document-entry.reel/close_button.gifbin139 -> 0 bytes
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.css20
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.html21
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js58
-rwxr-xr-xjs/components/layout/documents-tab.reel/documents-tab.html13
-rwxr-xr-xjs/components/layout/documents-tab.reel/documents-tab.js33
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.html6
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.js40
-rwxr-xr-xjs/components/layout/tools-properties.reel/tools-properties.js46
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.html13
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.html13
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.js18
-rwxr-xr-xjs/components/menu/menu.reel/menu.html25
-rwxr-xr-xjs/components/menu/menu.reel/menu.js17
-rw-r--r--js/components/toolbar.reel/toolbar-button.js28
-rw-r--r--js/components/toolbar.reel/toolbar.html2
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.html41
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.js19
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css15
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html116
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js28
-rwxr-xr-xjs/components/tools-properties/pen-properties.reel/pen-properties.js27
-rwxr-xr-xjs/components/tools-properties/text-properties.reel/text-properties.html9
-rwxr-xr-xjs/components/tools-properties/text-properties.reel/text-properties.js154
29 files changed, 467 insertions, 465 deletions
diff --git a/js/components/converter/string-units-converter.js b/js/components/converter/string-units-converter.js
index 6b97d5c5..9f6e4112 100644
--- a/js/components/converter/string-units-converter.js
+++ b/js/components/converter/string-units-converter.js
@@ -9,7 +9,6 @@ var Montage = require("montage").Montage,
9 9
10exports.StringUnitsConverter = Montage.create(Converter, { 10exports.StringUnitsConverter = Montage.create(Converter, {
11 11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: { 12 convert: {
14 value: function(value) { 13 value: function(value) {
15 if(value) { 14 if(value) {
@@ -20,7 +19,6 @@ exports.StringUnitsConverter = Montage.create(Converter, {
20 } 19 }
21 }, 20 },
22 21
23 // revert celsius to fahrenheit
24 revert: { 22 revert: {
25 value: function(value) { 23 value: function(value) {
26 console.log("revert string to unit ", value); 24 console.log("revert string to unit ", value);
diff --git a/js/components/converter/string-value-converter.js b/js/components/converter/string-value-converter.js
index 28d7dd29..f397f731 100644
--- a/js/components/converter/string-value-converter.js
+++ b/js/components/converter/string-value-converter.js
@@ -9,7 +9,6 @@ var Montage = require("montage").Montage,
9 9
10exports.StringValueConverter = Montage.create(Converter, { 10exports.StringValueConverter = Montage.create(Converter, {
11 11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: { 12 convert: {
14 value: function(value) { 13 value: function(value) {
15 console.log(value); 14 console.log(value);
@@ -18,7 +17,6 @@ exports.StringValueConverter = Montage.create(Converter, {
18 } 17 }
19 }, 18 },
20 19
21 // revert celsius to fahrenheit
22 revert: { 20 revert: {
23 value: function(value) { 21 value: function(value) {
24 console.log("revert string to value ", value); 22 console.log("revert string to value ", value);
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index 49dbe3cb..ac131f2c 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -9,21 +9,44 @@ var Montage = require("montage/core/core").Montage,
9 9
10exports.Breadcrumb = Montage.create(Component, { 10exports.Breadcrumb = Montage.create(Component, {
11 11
12 disabled: { 12 _currentDocument: {
13 value: true 13 enumerable: false,
14 value: null
14 }, 15 },
15 16
16 handleOpenDocument: { 17 currentDocument: {
17 value: function(){ 18 enumerable: false,
18 this.disabled = false; 19 get: function() {
20 return this._currentDocument;
21 },
22 set: function(value) {
23 if (value === this._currentDocument) {
24 return;
25 }
26
27 this._currentDocument = value;
28
29 if(!value) {
30 this.disabled = true;
31 } else {
32 this.disabled = this._currentDocument.currentView !== "design";
33 }
34
19 } 35 }
20 }, 36 },
21 37
22 handleCloseDocument: { 38
23 value: function(){ 39 _disabled: {
24 if(!this.application.ninja.documentController.activeDocument && this.application.ninja.currentDocument.currentView !== "code") { 40 value: true
25 this.disabled = true; 41 },
26 this.application.ninja.currentSelectedContainer = (this.application.ninja.currentDocument ? this.application.ninja.currentDocument.model.documentRoot : null); 42
43 disabled: {
44 get: function() {
45 return this._disabled;
46 },
47 set: function(value) {
48 if(value !== this._disabled) {
49 this._disabled = value;
27 } 50 }
28 } 51 }
29 }, 52 },
@@ -50,8 +73,6 @@ exports.Breadcrumb = Montage.create(Component, {
50 73
51 prepareForDraw: { 74 prepareForDraw: {
52 value: function() { 75 value: function() {
53 this.eventManager.addEventListener("openDocument", this, false);
54 this.eventManager.addEventListener("closeDocument", this, false);
55 this.breadcrumbBt.addEventListener("action", this, false); 76 this.breadcrumbBt.addEventListener("action", this, false);
56 } 77 }
57 }, 78 },
@@ -65,7 +86,7 @@ exports.Breadcrumb = Montage.create(Component, {
65 86
66 parentNode = this.container; 87 parentNode = this.container;
67 88
68 while(parentNode !== this.application.ninja.currentDocument.model.documentRoot) { 89 while(parentNode !== this.currentDocument.model.documentRoot) {
69 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); 90 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
70 parentNode = parentNode.parentNode; 91 parentNode = parentNode.parentNode;
71 } 92 }
@@ -87,6 +108,7 @@ exports.Breadcrumb = Montage.create(Component, {
87 this.containerElements.pop(); 108 this.containerElements.pop();
88 } 109 }
89 110
111 // TODO: This is bound 2 ways, update the internal property
90 this.application.ninja.currentSelectedContainer = this.containerElements[i].node; 112 this.application.ninja.currentSelectedContainer = this.containerElements[i].node;
91 } 113 }
92 } 114 }
diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html
index 760186ba..a35b5590 100755
--- a/js/components/layout/document-bar.reel/document-bar.html
+++ b/js/components/layout/document-bar.reel/document-bar.html
@@ -37,11 +37,7 @@
37 "element": {"#": "disabledCondition"} 37 "element": {"#": "disabledCondition"}
38 }, 38 },
39 "bindings": { 39 "bindings": {
40 "condition": { 40 "condition": {"<-": "@owner.disabled"}
41 "boundObject": {"@": "owner"},
42 "boundObjectPropertyPath": "disabled",
43 "oneway": true
44 }
45 } 41 }
46 }, 42 },
47 43
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index 56b61f1d..1cb0bd90 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -9,13 +9,64 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentBar = Montage.create(Component, { 10exports.DocumentBar = Montage.create(Component, {
11 11
12 designView: { value: null, enumerable: false}, 12 _currentDocument: {
13 codeView: { value: null, enumerable: false}, 13 enumerable: false,
14 zoomControl: { value: null, enumerable: false }, 14 value: null
15 _type: { enume