aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/clipboard/external-apps-clipboard-agent.js6
-rw-r--r--js/components/converter/node-name-converter.js54
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html6
-rw-r--r--js/controllers/clipboard-controller.js21
-rwxr-xr-xjs/controllers/elements/shapes-controller.js8
-rwxr-xr-xjs/lib/geom/circle.js57
-rwxr-xr-xjs/lib/geom/geom-obj.js20
-rwxr-xr-xjs/lib/geom/line.js26
-rwxr-xr-xjs/lib/geom/rectangle.js57
-rwxr-xr-xjs/mediators/element-mediator.js9
-rwxr-xr-xjs/models/element-model.js8
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js20
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js33
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/scss/TimelinePanel.scss2
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js26
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js10
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.js2
-rwxr-xr-xjs/stage/stage.reel/stage.js4
-rwxr-xr-xjs/tools/ShapeTool.js34
20 files changed, 226 insertions, 179 deletions
diff --git a/js/clipboard/external-apps-clipboard-agent.js b/js/clipboard/external-apps-clipboard-agent.js
index 65410543..b82784d3 100644
--- a/js/clipboard/external-apps-clipboard-agent.js
+++ b/js/clipboard/external-apps-clipboard-agent.js
@@ -148,16 +148,12 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
148 data = htmlData ? htmlData : textData; 148 data = htmlData ? htmlData : textData;
149 149
150 if (data && data.length) { 150 if (data && data.length) {
151 //deselect current selections
152 this.application.ninja.selectedElements.length = 0;
153 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": true} );
154
155 divWrapper = document.application.njUtils.make("div", null, this.application.ninja.currentDocument); 151 divWrapper = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
156 this.application.ninja.elementMediator.addElements(divWrapper, {"height": "68px", 152 this.application.ninja.elementMediator.addElements(divWrapper, {"height": "68px",
157 "left": "0px", 153 "left": "0px",
158 "position": "absolute", 154 "position": "absolute",
159 "top": "0px", 155 "top": "0px",
160 "width": "161px"}, false); 156 "width": "161px"}, false/*notify*/, false/*callAddDelegate*/);
161 157
162 divWrapper.innerHTML = data; 158 divWrapper.innerHTML = data;
163 159
diff --git a/js/components/converter/node-name-converter.js b/js/components/converter/node-name-converter.js
new file mode 100644
index 00000000..fdca06e5
--- /dev/null
+++ b/js/components/converter/node-name-converter.js
@@ -0,0 +1,54 @@
1/* <copyright>
2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10
11* Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14
15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
18
19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29POSSIBILITY OF SUCH DAMAGE.
30</copyright> */
31var Montage = require("montage").Montage,
32 Converter = require("montage/core/converter/converter").Converter;
33
34exports.NodeNameConverter = Montage.create(Converter, {
35
36 convert: {
37 value: function(value) {
38 if(value) {
39 if(value.toLowerCase() === "ninja-content") {
40 value = "DIV";
41 }
42
43 return value;
44 }
45 }
46 },
47
48 revert: {
49 value: function(value) {
50 return value;
51 }
52 }
53
54});
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index 2c6d941f..2fff245c 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -44,13 +44,17 @@ POSSIBILITY OF SUCH DAMAGE.
44 } 44 }
45 }, 45 },
46 46
47 "nodeNameConverter": {
48 "prototype": "js/components/converter/node-name-converter"
49 },
50
47 "breadcrumbButton": { 51 "breadcrumbButton": {
48 "prototype": "js/components/layout/bread-crumb-button.reel", 52 "prototype": "js/components/layout/bread-crumb-button.reel",
49 "properties": { 53 "properties": {
50 "element": {"#": "breadcrumbButton"} 54 "element": {"#": "breadcrumbButton"}
51 }, 55 },
52 "bindings": { 56 "bindings": {
53 "label": {"<-": "@buttonsList.objectAtCurrentIteration.label"}, 57 "label": {"<-": "@buttonsList.objectAtCurrentIteration.label", "converter": {"@": "nodeNameConverter"}},
54 "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"} 58 "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"}
55 } 59 }
56 }, 60 },
diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js
index c3543c95..3eba1bec 100644
--- a/js/controllers/clipboard-controller.js
+++ b/js/controllers/clipboard-controller.js
@@ -82,16 +82,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
82 82
83 // Don't do anything if an input or other control is focused except the copy menu button 83 // Don't do anything if an input or other control is focused except the copy menu button
84 if(document.activeElement.nodeName !== "BODY") { 84 if(document.activeElement.nodeName !== "BODY") {
85 if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { 85 if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) {
86 return; 86 return;
87 } 87 }
88 } 88 }
89 89
90 //perform clipboard operations only if selection tool is selected
91 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
92 return;
93 }
94
95 if(this.clipboardContext === "stage"){ 90 if(this.clipboardContext === "stage"){
96 ElementsClipboardAgent.copy(clipboardEvent); 91 ElementsClipboardAgent.copy(clipboardEvent);
97 } 92 }
@@ -106,16 +101,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
106 101
107 // Don't do anything if an input or other control is focused 102 // Don't do anything if an input or other control is focused
108 if(document.activeElement.nodeName !== "BODY") { 103 if(document.activeElement.nodeName !== "BODY") {
109 if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { 104 if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) {
110 return; 105 return;
111 } 106 }
112 } 107 }
113 108
114 //perform clipboard operations only if selection tool is selected
115 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
116 return;
117 }
118
119 if(this.clipboardContext === "stage"){ 109 if(this.clipboardContext === "stage"){
120 ElementsClipboardAgent.cut(clipboardEvent); 110 ElementsClipboardAgent.cut(clipboardEvent);
121 } 111 }
@@ -137,16 +127,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component
137 127
138 // Don't do anything if an input or other control is focused 128 // Don't do anything if an input or other control is focused
139 if(document.activeElement.nodeName !== "BODY") { 129 if(document.activeElement.nodeName !== "BODY") {
140 if(!document.activeElement.getAttribute("data-montage-id") === "menuItemButton") { 130 if(!(document.activeElement.getAttribute("data-montage-id") === "menuItemButton")) {
141 return; 131 return;
142 } 132 }
143 } 133 }
144 134
145 //perform clipboard operations only if selection tool is selected
146 if(this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex].selected === false){
147 return;
148 }
149
150 //TODO: return if stage is not focussed 135 //TODO: return if stage is not focussed
151 136
152 if(this.clipboardContext === "stage"){ 137 if(this.clipboardContext === "stage"){
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 1d945066..6dabff47 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -841,10 +841,10 @@ exports.ShapesController = Montage.create(CanvasController, {
841 child.strokeMat = "Linear Gradient"; 841 child.strokeMat = "Linear Gradient";
842 } 842 }
843</