diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/data/panels-data.js | 8 | ||||
-rwxr-xr-x | js/document/views/base.js | 3 | ||||
-rwxr-xr-x | js/document/views/design.js | 29 | ||||
-rwxr-xr-x | js/lib/drawing/world.js | 1 | ||||
-rw-r--r-- | js/panels/Materials/materials-data.json | 5 | ||||
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.css | 18 | ||||
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.html | 25 | ||||
-rwxr-xr-x | js/panels/Materials/materials-library-panel.reel/materials-library-panel.js | 111 | ||||
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.css | 36 | ||||
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.html | 26 | ||||
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 378 |
11 files changed, 355 insertions, 285 deletions
diff --git a/js/data/panels-data.js b/js/data/panels-data.js index fd83d0c7..a1346ec4 100644 --- a/js/data/panels-data.js +++ b/js/data/panels-data.js | |||
@@ -39,12 +39,12 @@ exports.PanelsData = Montage.create(Montage, { | |||
39 | { | 39 | { |
40 | name: "Materials", | 40 | name: "Materials", |
41 | groups: ["default"], | 41 | groups: ["default"], |
42 | minHeight: 100, | 42 | minHeight: 270, |
43 | height: 100, | 43 | height: 270, |
44 | maxHeight: null, | 44 | maxHeight: null, |
45 | flexible: true, | 45 | flexible: false, |
46 | collapsed: true, | 46 | collapsed: true, |
47 | scrollable: true, | 47 | scrollable: false, |
48 | open: true, | 48 | open: true, |
49 | modulePath: "js/panels/Materials/materials-library-panel.reel", | 49 | modulePath: "js/panels/Materials/materials-library-panel.reel", |
50 | moduleName: "MaterialsLibraryPanel" | 50 | moduleName: "MaterialsLibraryPanel" |
diff --git a/js/document/views/base.js b/js/document/views/base.js index d13dce1a..89759195 100755 --- a/js/document/views/base.js +++ b/js/document/views/base.js | |||
@@ -40,6 +40,7 @@ exports.BaseDocumentView = Montage.create(Component, { | |||
40 | if (this.iframe) { | 40 | if (this.iframe) { |
41 | this.iframe.style.display = 'block'; | 41 | this.iframe.style.display = 'block'; |
42 | this.iframe.style.opacity = 1; | 42 | this.iframe.style.opacity = 1; |
43 | this.toggleWebGlAnimation(true); | ||
43 | } else { | 44 | } else { |
44 | console.log('Error: View has no iframe to show!'); | 45 | console.log('Error: View has no iframe to show!'); |
45 | } | 46 | } |
@@ -54,6 +55,8 @@ exports.BaseDocumentView = Montage.create(Component, { | |||
54 | if (this.iframe) { | 55 | if (this.iframe) { |
55 | this.iframe.style.display = 'none'; | 56 | this.iframe.style.display = 'none'; |
56 | this.iframe.style.opacity = 0; | 57 | this.iframe.style.opacity = 0; |
58 | this.pauseVideos(); | ||
59 | this.toggleWebGlAnimation(false); | ||
57 | } else { | 60 | } else { |
58 | console.log('Error: View has no iframe to hide!'); | 61 | console.log('Error: View has no iframe to hide!'); |
59 | } | 62 | } |
diff --git a/js/document/views/design.js b/js/document/views/design.js index b7c50a7c..f8020f2b 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -513,9 +513,11 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
513 | // | 513 | // |
514 | pauseVideos:{ | 514 | pauseVideos:{ |
515 | value:function(){ | 515 | value:function(){ |
516 | var i, videos = this.document.getElementsByTagName("video"); | 516 | if(this.document) { |
517 | for(i = 0; i < videos.length; i++){ | 517 | var i, videos = this.document.getElementsByTagName("video"); |
518 | if(!videos[i].paused) videos[i].pause(); | 518 | for(i = 0; i < videos.length; i++){ |
519 | if(!videos[i].paused) videos[i].pause(); | ||
520 | } | ||
519 | } | 521 | } |
520 | } | 522 | } |
521 | }, | 523 | }, |
@@ -539,9 +541,28 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
539 | videos[i].src = ""; | 541 | videos[i].src = ""; |
540 | } | 542 | } |
541 | } | 543 | } |
542 | } | 544 | }, |
543 | //////////////////////////////////////////////////////////////////// | 545 | //////////////////////////////////////////////////////////////////// |
544 | //////////////////////////////////////////////////////////////////// | 546 | //////////////////////////////////////////////////////////////////// |
547 | toggleWebGlAnimation: { | ||
548 | value: function(show) { | ||
549 | if(this.document) { | ||
550 | var glCanvases = this.document.querySelectorAll('[data-RDGE-id]'), | ||
551 | glShapeModel; | ||
552 | if(glCanvases) { | ||
553 | for(var i = 0, len = glCanvases.length; i<len; i++) { | ||
554 | glShapeModel = glCanvases[i].elementModel.shapeModel; | ||
555 | if(show) { | ||
556 | glShapeModel.GLWorld.restartRenderLoop(); | ||
557 | } else { | ||
558 | glShapeModel.GLWorld.stop(); | ||
559 | } | ||
560 | } | ||
561 | |||
562 | } | ||
563 | } | ||
564 | } | ||
565 | } | ||
545 | }); | 566 | }); |
546 | //////////////////////////////////////////////////////////////////////// | 567 | //////////////////////////////////////////////////////////////////////// |
547 | //////////////////////////////////////////////////////////////////////// \ No newline at end of file | 568 | //////////////////////////////////////////////////////////////////////// \ No newline at end of file |
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 8068284e..c8c5b95a 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -623,6 +623,7 @@ World.prototype.clearTree = function() | |||
623 | 623 | ||
624 | if (this._useWebGL) | 624 | if (this._useWebGL) |
625 | { | 625 | { |
626 | this.stop(); | ||
626 | var root = this._rootNode; | 627 | var root = this._rootNode; |
627 | root.children = new Array(); | 628 | root.children = new Array(); |
628 | RDGE.globals.engine.unregisterCanvas( this._canvas.rdgeid ); | 629 | RDGE.globals.engine.unregisterCanvas( this._canvas.rdgeid ); |
diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json index a5d8997b..fde82d3d 100644 --- a/js/panels/Materials/materials-data.json +++ b/js/panels/Materials/materials-data.json | |||
@@ -101,6 +101,11 @@ | |||
101 | "id" : "Z-Invert" | 101 | "id" : "Z-Invert" |
102 | } | 102 | } |
103 | ] | 103 | ] |
104 | }, | ||
105 | { | ||
106 | "label": "Custom Materials", | ||
107 | "children": [ | ||
108 | ] | ||
104 | } | 109 | } |
105 | ] | 110 | ] |
106 | } \ No newline at end of file | 111 | } \ No newline at end of file |
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css index bed3acfe..b5d36108 100755 --- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css +++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.css | |||
@@ -15,6 +15,12 @@ | |||
15 | margin: 4px 0 4px 0; | 15 | margin: 4px 0 4px 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | .materials_library_panel .ml_tree_holder { | ||
19 | height: 200px; | ||
20 | min-height: 200px; | ||
21 | max-height: 200px; | ||
22 | overflow-y: scroll; | ||
23 | } | ||
18 | 24 | ||
19 | .ml_buttons { | 25 | .ml_buttons { |
20 | clear:both; | 26 | clear:both; |
@@ -30,9 +36,19 @@ | |||
30 | cursor: pointer; | 36 | cursor: pointer; |
31 | margin: 0 1px; | 37 | margin: 0 1px; |
32 | float: left; | 38 | float: left; |
39 | width: 40px; | ||
40 | } | ||
41 | |||
42 | .ml_buttons .ml_duplicate_btn { | ||
33 | width: 60px; | 43 | width: 60px; |
34 | } | 44 | } |
35 | 45 | ||
36 | .ml_buttons .nj-skinned:last-child { | 46 | .ml_buttons .ml_delete_btn { |
47 | width: 50px; | ||
37 | float: right; | 48 | float: right; |
49 | } | ||
50 | |||
51 | .ml_buttons .nj-skinned:hover, | ||
52 | .ml_buttons .nj-skinned:active { | ||
53 | color: white; | ||
38 | } \ No newline at end of file | 54 | } \ No newline at end of file |
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html index 6fa54495..3adb2108 100755 --- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html +++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html | |||
@@ -10,12 +10,12 @@ | |||
10 | <link rel="stylesheet" type="text/css" href="materials-library-panel.css"> | 10 | <link rel="stylesheet" type="text/css" href="materials-library-panel.css"> |
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | "addButton": { | 13 | "duplicateButton": { |
14 | "prototype": "montage/ui/button.reel", | 14 | "prototype": "montage/ui/button.reel", |
15 | "properties": { | 15 | "properties": { |
16 | "element": {"#": "ml_add_btn"}, | 16 | "element": {"#": "ml_duplicate_btn"}, |
17 | "enabled": false | 17 | "enabled": true |
18 | }, | 18 | }, |
19 | "listeners": [ | 19 | "listeners": [ |
20 | { | 20 | { |
21 | "type": "action", | 21 | "type": "action", |
@@ -23,11 +23,10 @@ | |||
23 | } | 23 | } |
24 | ] | 24 | ] |
25 | }, | 25 | }, |
26 | "copyButton": { | 26 | "editButton": { |
27 | "prototype": "montage/ui/button.reel", | 27 | "prototype": "montage/ui/button.reel", |
28 | "properties": { | 28 | "properties": { |
29 | "element": {"#": "ml_copy_btn"}, | 29 | "element": {"#": "ml_edit_btn"} |
30 | "enabled": false | ||
31 | }, | 30 | }, |