aboutsummaryrefslogtreecommitdiff
path: root/js/stage/objects-tray.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/objects-tray.reel')
-rw-r--r--js/stage/objects-tray.reel/objects-tray.css41
-rw-r--r--js/stage/objects-tray.reel/objects-tray.html66
-rw-r--r--js/stage/objects-tray.reel/objects-tray.js140
3 files changed, 247 insertions, 0 deletions
diff --git a/js/stage/objects-tray.reel/objects-tray.css b/js/stage/objects-tray.reel/objects-tray.css
new file mode 100644
index 00000000..61d9ff1e
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.css
@@ -0,0 +1,41 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7/*
8
9<section data-montage-id="objects-panel" class="objects-panel">
10 <ul data-montage-id="list" class="objects-list">
11 <li data-montage-id="list-item" class="list-item"></li>
12 </ul>
13</section>
14
15*/
16
17.objects-list {
18 font-size: 11px;
19 margin: 10px 0 0 0;
20 padding: 0;
21 text-shadow: -1px -1px 0 #4D4D4D;
22}
23
24.objects-tray {
25 background-color: rgba(0,0,0,.6);
26 border-top-right-radius: 8px;
27 border-top-left-radius: 8px;
28 box-shadow: inset 0 0 3px #333;
29 padding: 0 10px 5px;
30 margin: 0 auto;
31 overflow: hidden;
32 -webkit-box-flex: 0;
33 -webkit-transition: -webkit-transform .5s cubic-bezier(.44,.19,0,.99);
34 -webkit-transform-origin: center bottom;
35
36}
37
38.hide-objects-tray {
39 /*-webkit-transform: scale(0);*/
40 -webkit-transform: translate3d(0, 100px, 0) scale(.5);
41} \ No newline at end of file
diff --git a/js/stage/objects-tray.reel/objects-tray.html b/js/stage/objects-tray.reel/objects-tray.html
new file mode 100644
index 00000000..901f3e58
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.html
@@ -0,0 +1,66 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html>
8<head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="objects-tray.css">
11
12 <script type="text/montage-serialization">
13 {
14 "owner": {
15 "prototype": "js/stage/objects-tray.reel",
16 "properties": {
17 "element": {"#": "objects-tray"},
18 "iconsRepetition": {"@": "repetition" },
19 "offStageObjectsController": {"@": "arrayController"}
20 }
21 },
22 "repetition" : {
23 "prototype": "montage/ui/repetition.reel",
24 "properties": {
25 "element": {"#": "list"},
26 "contentController": {"@": "arrayController"}
27 }
28 },
29 "arrayController": {
30 "prototype": "montage/ui/controller/array-controller",
31 "bindings": {
32 "content": {"<-": "@owner.objects"}
33 }
34 },
35 "objectComponent": {
36 "prototype": "js/panels/objects/object.reel",
37 "properties": {
38 "element": {"#": "list-item"}
39 },
40 "bindings": {
41 "sourceObject" : {"<-": "@repetition.objectAtCurrentIteration"},
42 "identifier" : {"<-": "@repetition.objectAtCurrentIteration.identifier"}
43 },
44 "listeners": [
45 {
46 "type": "click",
47 "listener": {"@": "owner"}
48 }
49 ]
50 }
51
52 }
53 </script>
54
55</head>
56<body>
57
58
59<section data-montage-id="objects-tray" class="objects-tray">
60 <ul data-montage-id="list" class="objects-list">
61 <li data-montage-id="list-item" class="list-item"></li>
62 </ul>
63</section>
64
65</body>
66</html>
diff --git a/js/stage/objects-tray.reel/objects-tray.js b/js/stage/objects-tray.reel/objects-tray.js
new file mode 100644
index 00000000..75ece4c3
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.js
@@ -0,0 +1,140 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7/**
8 @requires montage/core/core
9 @requires montage/ui/component
10 */
11var Montage = require("montage/core/core").Montage,
12 Component = require("montage/ui/component").Component;
13
14exports.ObjectsTray = Montage.create(Component, {
15 hideClass : { value: 'hide-objects-tray'},
16 _empty : { value: null },
17 _workspaceMode : { value: null },
18
19 iconsRepetition : {
20 value: null
21 },
22 offStageObjectsController : {
23 value: null
24 },
25
26 _showAllObjects : { value: null },
27 showAllObjects : {
28 get : function() { return this._showAllObjects; },
29 set : function(value) {
30 if(value === this._showAllObjects) { return; }
31
32 this._showAllObjects = value;
33
34 this.needsDraw = true;
35 }
36 },
37
38 workspaceMode : {
39 get : function() { return this._workspaceMode; },
40 set : function(value) {
41 if(value === this._workspaceMode) { return; }
42
43 var toHide = (value !== 'binding');
44
45 setTimeout(function() {
46 this.hide = toHide;
47 }.bind(this), 200);
48
49 this._workspaceMode = value;
50
51 this.needsDraw = true;
52 }
53 },
54
55 _objects: { value: null },
56 objects: {
57 get: function() {
58 return this._objects;
59 },
60 set: function(value) {
61 this._objects = value;
62 this.needsDraw = true;
63 }
64 },
65
66 offStageObjectFilter : {
67 value: function(obj) {
68 if(this.showAllObjects) {
69 return true;
70 }
71
72 return this.application.ninja.objectsController.isOffStageObject(obj);
73 }
74 },
75
76 _hide : { value: null },
77 hide : {
78 get : function() { return this._hide; },
79 set : function(value) {
80 if(value === this._hide) { return; }
81
82 this._hide = value;
83
84 this.needsDraw = true;
85 }
86 },
87
88 displayHUDForObject : {
89 value: function(object) {
90 this.parentComponent.boundComponents.push(object);
91 }
92 },
93
94 /* ---------------------
95 Draw Cycle
96 --------------------- */
97
98 templateDidLoad: {
99 value: function() {
100 this.offStageObjectsController.filterFunction = this.offStageObjectFilter.bind(this);
101 }
102 },
103
104 prepareForDraw : {
105 value: function() {
106
107 Object.defineBinding(this, 'workspaceMode', {
108 "boundObject": this.application.ninja,
109 "boundObjectPropertyPath": "workspaceMode",
110 "oneway": true
111 });
112
113 Object.defineBinding(this, 'objects', {
114 "boundObject": this.application.ninja.objectsController,
115 "boundObjectPropertyPath": "objects",
116 "oneway": true
117 });
118
119 }
120 },
121</