aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/components/tools-properties/tag-properties.reel/tag-properties.html12
-rwxr-xr-xjs/components/tools-properties/tag-properties.reel/tag-properties.js6
-rwxr-xr-xjs/controllers/elements/controller-factory.js2
-rwxr-xr-xjs/controllers/elements/element-controller.js7
-rwxr-xr-xjs/controllers/elements/shapes-controller.js2
-rwxr-xr-xjs/data/pi/pi-data.js6
-rwxr-xr-xjs/lib/NJUtils.js112
-rwxr-xr-xjs/mediators/drag-drop-mediator.js6
-rwxr-xr-xjs/models/element-model.js75
-rwxr-xr-xjs/ninja.reel/ninja.js7
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js64
-rwxr-xr-xjs/panels/properties.reel/properties.js6
-rwxr-xr-xjs/stage/stage.reel/stage.js11
-rw-r--r--js/tools/BrushTool.js10
-rwxr-xr-xjs/tools/EyedropperTool.js3
-rwxr-xr-xjs/tools/LineTool.js11
-rwxr-xr-xjs/tools/PenTool.js11
-rwxr-xr-xjs/tools/ShapeTool.js40
-rwxr-xr-xjs/tools/TagTool.js218
-rwxr-xr-xjs/tools/drawing-tool-base.js24
20 files changed, 261 insertions, 372 deletions
diff --git a/js/components/tools-properties/tag-properties.reel/tag-properties.html b/js/components/tools-properties/tag-properties.reel/tag-properties.html
index c80ba36e..4ea9c659 100755
--- a/js/components/tools-properties/tag-properties.reel/tag-properties.html
+++ b/js/components/tools-properties/tag-properties.reel/tag-properties.html
@@ -37,11 +37,11 @@
37 <body> 37 <body>
38 <div id="tagProperties" class="subToolHolderPanel"> 38 <div id="tagProperties" class="subToolHolderPanel">
39 <div id="tagToolContainer" class="tagRadioButtons"> 39 <div id="tagToolContainer" class="tagRadioButtons">
40 <input type="radio" id="divTool" class="tag-type" title="Div Element" name="TagRadios" checked/> 40 <input type="radio" id="divTool" data-montage-id="divTool" class="tag-type" title="Div Element" name="TagRadios" value="div" checked/>
41 <input type="radio" id="imageTool" class="tag-type" title="Image Element" name="TagRadios"/> 41 <input type="radio" id="imageTool" data-montage-id="imageTool" class="tag-type" title="Image Element" value="image" name="TagRadios"/>
42 <input type="radio" id="videoTool" class="tag-type" title="Video Element" name="TagRadios"/> 42 <input type="radio" id="videoTool" data-montage-id="videoTool" class="tag-type" title="Video Element" value="video" name="TagRadios"/>
43 <input type="radio" id="canvasTool" class="tag-type" title="Canvas Element" name="TagRadios"/> 43 <input type="radio" id="canvasTool" data-montage-id="canvasTool" class="tag-type" title="Canvas Element" value="canvas" name="TagRadios"/>
44 <input type="radio" id="customTool" class="tag-type" title="Custom Element" name="TagRadios"/> 44 <input type="radio" id="customTool" data-montage-id="customTool" class="tag-type" title="Custom Element" value="custom" name="TagRadios"/>
45 45
46 <div class="nj-divider divider-vertical">&nbsp;</div> 46 <div class="nj-divider divider-vertical">&nbsp;</div>
47 47
@@ -67,10 +67,10 @@
67 <label class="label"> Position:</label> 67 <label class="label"> Position:</label>
68 68
69 <select id="positionCB" class="nj-skinned"> 69 <select id="positionCB" class="nj-skinned">
70 <option>Static</option>
70 <option>Absolute</option> 71 <option>Absolute</option>
71 <option>Relative</option> 72 <option>Relative</option>
72 <option>Fixed</option> 73 <option>Fixed</option>
73 <option>Static</option>
74 <option>Inherit</option> 74 <option>Inherit</option>
75 </select> 75 </select>
76 76
diff --git a/js/components/tools-properties/tag-properties.reel/tag-properties.js b/js/components/tools-properties/tag-properties.reel/tag-properties.js
index 1caabc35..6519d5b8 100755
--- a/js/components/tools-properties/tag-properties.reel/tag-properties.js
+++ b/js/components/tools-properties/tag-properties.reel/tag-properties.js
@@ -33,9 +33,9 @@ exports.TagProperties = Montage.create(ToolProperties, {
33 33
34 handleClick: { 34 handleClick: {
35 value: function(event) { 35 value: function(event) {
36 this.selectedElement = event._event.target.id; 36 this.selectedElement = event._event.target.value;
37 37
38 if(this.selectedElement === "customTool") { 38 if(this.selectedElement === "custom") {
39 this.customName.style["display"] = ""; 39 this.customName.style["display"] = "";
40 this.customLabel.style["display"] = ""; 40 this.customLabel.style["display"] = "";
41 } else { 41 } else {
@@ -46,7 +46,7 @@ exports.TagProperties = Montage.create(ToolProperties, {
46 }, 46 },
47 47
48 _selectedElement: { 48 _selectedElement: {
49 value: "divTool", enumerable: false 49 value: "div", enumerable: false
50 }, 50 },
51 51
52 selectedElement: { 52 selectedElement: {
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js
index 1bbbbce0..3ac3fe14 100755
--- a/js/controllers/elements/controller-factory.js
+++ b/js/controllers/elements/controller-factory.js
@@ -42,6 +42,8 @@ exports.ControllerFactory = Montage.create(Montage, {
42 return ImageController; 42 return ImageController;
43 } else if(value.indexOf("video") !== -1) { 43 } else if(value.indexOf("video") !== -1) {
44 return VideoController; 44 return VideoController;
45 } else {
46 return BlockController;
45 } 47 }
46 } catch (err) { 48 } catch (err) {
47 console.log("Could not create Controller Factory " + err); 49 console.log("Could not create Controller Factory " + err);
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index ea5fe4af..45d78b33 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -15,16 +15,15 @@ exports.ElementController = Montage.create(Component, {
15 var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); 15 var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID);
16 16
17 if(selectedLayerIndex === 0) { 17 if(selectedLayerIndex === 0) {
18 this.application.ninja.currentDocument.documentRoot.appendChild(el); 18 this.application.ninja.currentDocument.currentSelectedContainer.appendChild(el);
19 } else { 19 } else {
20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; 20 var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0];
21 element.parentNode.insertBefore(el, element.nextSibling); 21 element.parentNode.insertBefore(el, element.nextSibling);
22 } 22 }
23 } else { 23 } else {
24 this.application.ninja.currentDocument.documentRoot.appendChild(el); 24 this.application.ninja.currentDocument.currentSelectedContainer.appendChild(el);
25 } 25 }
26 // Nested elements - TODO make sure the CSS is correct before nesting elements 26
27 // this.application.ninja.currentSelectedContainer.appendChild(el);
28 if(styles) { 27 if(styles) {
29 this.application.ninja.stylesController.setElementStyles(el, styles); 28 this.application.ninja.stylesController.setElementStyles(el, styles);
30 } 29 }
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 8d7b74f0..e9a5f865 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -129,7 +129,7 @@ exports.ShapesController = Montage.create(CanvasController, {
129 el.elementModel.shapeModel.GLWorld.render(); 129 el.elementModel.shapeModel.GLWorld.render();
130 break; 130 break;
131 case "useWebGl": 131 case "useWebGl":
132 canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); 132 canvas = njModule.NJUtils.make("canvas", el.className, this.application.ninja.currentDocument);
133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); 133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
134 canvas.width = el.width; 134 canvas.width = el.width;
135 canvas.height = el.height; 135 canvas.height = el.height;
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js
index 65161b4f..d1dc9f34 100755
--- a/js/data/pi/pi-data.js
+++ b/js/data/pi/pi-data.js
@@ -100,7 +100,7 @@ exports.PiData = Montage.create( Montage, {
100 } 100 }
101 ] 101 ]
102 }, 102 },
103 imagePi: { 103 imgPi: {
104 value: [ 104 value: [
105 { 105 {
106 label: "Image Properties", 106 label: "Image Properties",
@@ -807,8 +807,8 @@ exports.PiData = Montage.create( Montage, {
807 ] 807 ]
808 ] 808 ]
809 } 809 }
810 ] //value: [ 810 ]
811 } //BrushStrokePi: { 811 }
812}); 812});
813 813
814 814
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index dae128e4..5aaeb5f2 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -5,16 +5,15 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
5</copyright> */ 5</copyright> */
6 6
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component,
8 Uuid = require("montage/core/uuid").Uuid, 9 Uuid = require("montage/core/uuid").Uuid,
9 ElementModel = require("js/models/element-model").ElementModel, 10 ElementModel = require("js/models/element-model").ElementModel,
10 Properties3D = require("js/models/properties-3d").Properties3D, 11 Properties3D = require("js/models/properties-3d").Properties3D,
11 ShapeModel = require("js/models/shape-model").ShapeModel, 12 ShapeModel = require("js/models/shape-model").ShapeModel,
12 ControllerFactory = require("js/controllers/elements/controller-factory").ControllerFactory; 13 ControllerFactory = require("js/controllers/elements/controller-factory").ControllerFactory;
13 14
14exports.NJUtils = Object.create(Object.prototype, { 15exports.NJUtils = Montage.create(Component, {
15 16
16
17
18 /* =============== DOM Access ================ */ 17 /* =============== DOM Access ================ */
19 18
20 ///// Quick "getElementById" 19 ///// Quick "getElementById"
@@ -54,13 +53,25 @@ exports.NJUtils = Object.create(Object.prototype, {
54 return document.createTextNode(text); 53 return document.createTextNode(text);
55 } 54 }
56 }, 55 },
57 56
58 ///// Quick "createElement" function "attr" can be classname or object 57 ///// Quick "createElement" function "attr" can be classname or object
59 ///// with attribute key/values