aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-22 16:26:02 -0700
committerJose Antonio Marquez2012-03-22 16:26:02 -0700
commit748a5c55e15809add748a15a87cd730e3fcee4bf (patch)
tree688f3ee299b2985fa5617426a5789d86f518b877 /js
parent7fbda862c62f37d4c67e4d5a619b7e3cffc309ff (diff)
parentb25195d010417417bb5b2e5362385078d68d9a84 (diff)
downloadninja-748a5c55e15809add748a15a87cd730e3fcee4bf.tar.gz
Merge branch 'refs/heads/Ninja-Montage-Integration' into FileIO-Montage-Components
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/tools-properties/rect-properties.reel/rect-properties.css19
-rwxr-xr-xjs/components/tools-properties/rect-properties.reel/rect-properties.html16
-rwxr-xr-xjs/components/tools-properties/rect-properties.reel/rect-properties.js16
-rwxr-xr-xjs/controllers/selection-controller.js9
-rwxr-xr-xjs/document/html-document.js108
-rwxr-xr-xjs/helper-classes/RDGE/rdge-compiled.js6
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/engine.js7
-rw-r--r--js/io/system/ninjalibrary.json2
-rwxr-xr-xjs/lib/drawing/world.js147
-rwxr-xr-xjs/lib/geom/circle.js54
-rwxr-xr-xjs/lib/geom/geom-obj.js154
-rwxr-xr-xjs/lib/geom/line.js44
-rwxr-xr-xjs/lib/geom/rectangle.js63
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js40
-rw-r--r--js/lib/rdge/materials/cloud-material.js300
-rwxr-xr-xjs/lib/rdge/materials/flat-material.js21
-rw-r--r--js/lib/rdge/materials/julia-material.js6
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js53
-rw-r--r--js/lib/rdge/materials/mandel-material.js6
-rw-r--r--js/lib/rdge/materials/plasma-material.js18
-rw-r--r--js/lib/rdge/materials/pulse-material.js44
-rw-r--r--js/lib/rdge/materials/radial-blur-material.js57
-rwxr-xr-xjs/lib/rdge/materials/radial-gradient-material.js54
-rw-r--r--js/lib/rdge/materials/taper-material.js27
-rw-r--r--js/lib/rdge/materials/twist-vert-material.js28
-rwxr-xr-xjs/lib/rdge/materials/uber-material.js180
-rw-r--r--js/lib/rdge/materials/water-material.js103
-rwxr-xr-xjs/models/materials-model.js90
28 files changed, 1500 insertions, 172 deletions
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.css b/js/components/tools-properties/rect-properties.reel/rect-properties.css
index 74509555..cbd9dde8 100755
--- a/js/components/tools-properties/rect-properties.reel/rect-properties.css
+++ b/js/components/tools-properties/rect-properties.reel/rect-properties.css
@@ -4,16 +4,15 @@
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6
7.rectProperties .button { 7#lockButton {
8 border:none; 8 float:left;
9 cursor:default; 9 border: none;
10 text-align:center; 10 background-color: transparent;
11 -webkit-user-select:none; 11 top: 2px;
12 opacity:0.8; 12 opacity: 0.7;
13 display:table-cell; 13 width: 17px;
14 vertical-align:middle; 14 height: 18px;
15 background-color:#333333; 15 margin-right: 10px;
16 color:white;
17} 16}
18 17
19.rectProperties .subToolButton { 18.rectProperties .subToolButton {
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html
index 214ff1d5..ceb761b9 100755
--- a/js/components/tools-properties/rect-properties.reel/rect-properties.html
+++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html
@@ -50,12 +50,23 @@
50 } 50 }
51 }, 51 },
52 52
53 "lockButton": {
54 "prototype": "montage/ui/toggle-button.reel",
55 "properties": {
56 "element": {"#": "lockButton"},
57 "pressed": true,
58 "pressedClass": "lockUp",
59 "preventFocus": true,
60 "identifier": "ratio"
61 }
62 },
63
53 "owner": { 64 "owner": {
54 "module": "js/components/tools-properties/rect-properties.reel", 65 "module": "js/components/tools-properties/rect-properties.reel",
55 "name": "RectProperties", 66 "name": "RectProperties",
56 "properties": { 67 "properties": {
57 "element": {"#": "rectProperties"}, 68 "element": {"#": "rectProperties"},
58 "lockButton": {"#": "lockButton"}, 69 "lockButton": {"@": "lockButton"},
59 "TLRadiusControl": {"@": "hottext1"}, 70 "TLRadiusControl": {"@": "hottext1"},
60 "TRRadiusControl": {"@": "hottext2"}, 71 "TRRadiusControl": {"@": "hottext2"},
61 "BLRadiusControl": {"@": "hottext3"}, 72 "BLRadiusControl": {"@": "hottext3"},
@@ -69,7 +80,8 @@
69 80
70 <body> 81 <body>
71 <div id="rectProperties" class="rectProperties"> 82 <div id="rectProperties" class="rectProperties">
72 <button id="lockButton" class="unselectable subToolButton button LockToolUp" style=" margin-left:20px"></button> 83 <!--<button id="lockButton" class="unselectable subToolButton button LockToolUp" style=" margin-left:20px"></button>-->
84 <button id="lockButton" class="unlock" style="margin-left:20px"></button>
73 <div id="TLRadiusLabel" class="unselectable subToolButton cornerRadius topLeft"></div> 85 <div id="TLRadiusLabel" class="unselectable subToolButton cornerRadius topLeft"></div>
74 <div id="TLRadiusControl" class="label"></div> 86 <div id="TLRadiusControl" class="label"></div>
75 <div id="TRRadiusLabel" class="unselectable subToolButton cornerRadius topRight"></div> 87 <div id="TRRadiusLabel" class="unselectable subToolButton cornerRadius topRight"></div>
diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js
index b2de6ff7..b4085eea 100755
--- a/js/components/tools-properties/rect-properties.reel/rect-properties.js
+++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js
@@ -19,7 +19,8 @@ exports.RectProperties = Montage.create(ToolProperties, {
19 19
20 _subPrepare: { 20 _subPrepare: {
21 value: function() { 21 value: function() {
22 this.lockButton.addEventListener("click", this, false); 22 this.lockButton.identifier = "lockButton";
23 this.lockButton.addEventListener("action", this, false);
23 24
24 this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); 25 this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]);
25 this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); 26 this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]);
@@ -27,21 +28,16 @@ exports.RectProperties = Montage.create(ToolProperties, {
27 } 28 }
28 }, 29 },
29 30
30 handleClick: { 31 handleLockButtonAction: {
31 value: function(event) { 32 value: function(event) {
32 this._unlocked = !this._unlocked; 33 this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed;
33 34
34 this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = this._unlocked; 35 if(this.lockButton.pressed) {
35
36 if(this._unlocked) {
37 this.lockButton.classList.remove("LockToolUp");
38 this.lockButton.classList.add("UnLockToolUp");
39 this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); 36 this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]);
40 } else { 37 } else {
41 this.lockButton.classList.remove("UnLockToolUp");
42 this.lockButton.classList.add("LockToolUp");
43 this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); 38 this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]);
44 } 39 }
40
45 } 41 }
46 }, 42 },
47 43
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 9b0e638a..53cca029 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -112,6 +112,15 @@ exports.SelectionController = Montage.create(Component, {
112 if(!this._isDocument) { 112 if(!this._isDocument) {
113 if(this.findSelectedElement(event.detail) !== -1) { 113 if(this.findSelectedElement(event.detail) !== -1) {
114 this.executeSelectElement(); 114 this.executeSelectElement();
115 var element = event.detail;
116 if (element) {
117 if (element.elementModel) {
118 if (element.elementModel.shapeModel) {
119 if (element.elementModel.shapeModel.GLWorld)
120 element.elementModel.shapeModel.GLWorld.clearTree();
121 }
122 }
123 }
115 } 124 }
116 } 125 }
117 } 126 }
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 9de2d8d6..7ab4272b 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -9,7 +9,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
9var Montage = require("montage/core/core").Montage, 9var Montage = require("montage/core/core").Montage,
10 TextDocument = require("js/document/text-document").TextDocument, 10 TextDocument = require("js/document/text-document").TextDocument,
11 NJUtils = require("js/lib/NJUtils").NJUtils, 11 NJUtils = require("js/lib/NJUtils").NJUtils,
12 GLWorld = require("js/lib/drawing/world").World; 12 GLWorld = require("js/lib/drawing/world").World,
13 MaterialsModel = require("js/models/materials-model").MaterialsModel;
13//////////////////////////////////////////////////////////////////////// 14////////////////////////////////////////////////////////////////////////
14// 15//
15exports.HTMLDocument = Montage.create(TextDocument, { 16exports.HTMLDocument = Montage.create(TextDocument, {
@@ -193,12 +194,9 @@ exports.HTMLDocument = Montage.create(TextDocument, {
193 var elt = this.iframe.contentWindow.document.getElementById("UserContent"); 194 var elt = this.iframe.contentWindow.document.getElementById("UserContent");
194 // 195 //
195 if (elt) {