diff options
Diffstat (limited to 'js/panels/objects')
-rw-r--r-- | js/panels/objects/object.reel/object.css | 59 | ||||
-rw-r--r-- | js/panels/objects/object.reel/object.html | 44 | ||||
-rw-r--r-- | js/panels/objects/object.reel/object.js | 104 | ||||
-rw-r--r-- | js/panels/objects/objects-panel.reel/objects-panel.css | 20 | ||||
-rw-r--r-- | js/panels/objects/objects-panel.reel/objects-panel.html | 58 | ||||
-rw-r--r-- | js/panels/objects/objects-panel.reel/objects-panel.js | 53 |
6 files changed, 338 insertions, 0 deletions
diff --git a/js/panels/objects/object.reel/object.css b/js/panels/objects/object.reel/object.css new file mode 100644 index 00000000..79b7647c --- /dev/null +++ b/js/panels/objects/object.reel/object.css | |||
@@ -0,0 +1,59 @@ | |||
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 | margin: 0; | ||
19 | padding: 0; | ||
20 | } | ||
21 | |||
22 | .objects-list .list-item { | ||
23 | list-style-type: none; | ||
24 | float: left; | ||
25 | width: 70px; | ||
26 | overflow: hidden; | ||
27 | text-overflow: ellipsis; | ||
28 | } | ||
29 | |||
30 | /* ------------------ | ||
31 | Icon Styles | ||
32 | ------------------- */ | ||
33 | |||
34 | .object-icon { | ||
35 | background-color: rgba(0, 0, 0, 0.6); | ||
36 | /* red owner/crate */ | ||
37 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb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lDJvHMSHVZTKak80HtXW1hZVrK6V%2Ftb3TWVVVWYFh1cYYQBsfSHZ2dkw038P%2F4MCBH23dutWbQM%2FoOXmSuru7%2Fe3t7S%2BPj4%2B%2FDB30XKX%2BRhq4fjGBRbBhFhsvY75bCyYKPJ58DmO2cscdd1bDawEFRWIaAAvxoua9Jfe3tGxHk7FMXJ6g3jNnDMT6o46OjucR0rdx3giuxGcNCV8wsjOUcdSGeYhzEKEpQMzLoQu%2BoqIcmCQJdGanm9raWvf2pqZVmIK4k%2FD63LmziePHj7eeOnXqBThxDOf4mMhvZES4iY%2BXBITtx9w4AAXrALAJ1tF1RQp%2BAqC4uIRjxaqrq4vOnz8%2FjUH3DxDzawDdj%2F3h6yn%2F7BJv8gsqxubGoaGhIEqvP5NRf15Y6HVlaUIhunChn%2FUEDe2ZCe2PeMxUvvTfvP6yDFxdOvMGaxIZMocZYhMEmsM0MDc3F4D3f8Kn3Et4p%2FcToRlfycfpDRarnquQFdtaWloex3SkHzly5C8o4914PsdS%2BSv9Ov6C5YAeCljzQoawvI7crNfXr%2F8IMADlMDTD%2BOWcSAAAAABJRU5ErkJggg%3D%3D); | ||
38 | background-position: center center; | ||
39 | background-repeat: no-repeat; | ||
40 | border: 1px solid rgba(0, 0, 0, 0); | ||
41 | border-radius: 5px; | ||
42 | height: 50px; | ||
43 | margin: 0 auto 5px; | ||
44 | width: 50px; | ||
45 | } | ||
46 | .object-name { | ||
47 | color: #fff; | ||
48 | display: block; | ||
49 | text-align: center; | ||
50 | } | ||
51 | |||
52 | .object-icon:hover { | ||
53 | background-color: rgba(0, 0, 0, 0.4); | ||
54 | } | ||
55 | |||
56 | .object-icon-component.object-icon { | ||
57 | /* gray gear */ | ||
58 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAACE5JREFUWIWdV2tsHNUV%2Fu6989iHd9frtVeJsUNsEW8AOYSkTUgs9SVKoahSUdpKSC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yOsILACkUikwxhCGIUzTjI9y13XLrusGawHEp%2BHhw4ehlMLdd9%2F9q46OjkcAUEIIKKUwDAOMMdi2jZaWltiI1hqEEJimiWQyiWQyCa01onmCEBL%2Fbmpqarcsq6W7u%2Fv42bNn1wM4d%2B4cHn744W%2Fu37%2F%2F14wxFnkY7ZVzIA6rZVlIpVKwbRuMsXX13dg%2FVhoZaWtr27u0tHT%2Bo48%2BurxhDnDOL1Qqlb%2Bv8BZtvfYIjnLD9334vh%2F3%2FZWt19b%2BytxAFhcXL7mu%2B8mGFADA6dOnvYMHD36czWa%2FkUgkWimlGoCqVqsfCyGqlmW10oZ5vBHYSg5oKaWq1Wr%2FcBxn3LKs27TWRGtNHMeZmJqaerS%2Fv%2F9ftwQAAHv27Pm3lPJUOp0%2BkEqltszOzr7x%2BeefP1Eul4%2B5rntRKZVJJpNdjDHaCEAIoRYWFv46PT39wtTU1Auzs7O%2FY4zl8%2Fn8lyqVymdTU1OPzs%2FPf3bq1KlV9jYebwAMDg625vP5fTMzMx%2B8%2FPLL8SExMDDQ2tfXd7G9vb2j8f25ublrw8PDu44cORJfQJ5%2B%2BmlSKpUerNVqnzTKG9ct74YDAwNlAO%2BvlQdBEEopl9fmhZTSC4JANMpeffVVDeCDW9kA%2Fo%2B74eLiIvc8bzYMw0ApJbXWMgzDwPO8maWlJb5ZfZu%2BHS8tLXkXLlz44RdffHFbcmUu9zzPu379%2BtVyuexuVt9%2FAKVP%2BiORVHX0AAAAAElFTkSuQmCC); | ||
59 | } \ No newline at end of file | ||
diff --git a/js/panels/objects/object.reel/object.html b/js/panels/objects/object.reel/object.html new file mode 100644 index 00000000..f9de1499 --- /dev/null +++ b/js/panels/objects/object.reel/object.html | |||
@@ -0,0 +1,44 @@ | |||
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="object.css"> | ||
11 | |||
12 | <script type="text/montage-serialization"> | ||
13 | { | ||
14 | "owner": { | ||
15 | "prototype": "js/panels/objects/object.reel", | ||
16 | "properties": { | ||
17 | "element": {"#": "object"}, | ||
18 | "iconElement": { "#": "object-icon"} | ||
19 | } | ||
20 | }, | ||
21 | "labelText": { | ||
22 | "prototype": "montage/ui/dynamic-text.reel", | ||
23 | "properties": { | ||
24 | "element": {"#": "name" } | ||
25 | }, | ||
26 | "bindings": { | ||
27 | "value" : {"<-": "@owner.name"} | ||
28 | } | ||
29 | } | ||
30 | |||
31 | } | ||
32 | </script> | ||
33 | |||
34 | </head> | ||
35 | <body> | ||
36 | |||
37 | |||
38 | <li data-montage-id="object" draggable="true"> | ||
39 | <div data-montage-id="object-icon" class="object-icon"></div> | ||
40 | <span data-montage-id="name" class="object-name"></span> | ||
41 | </li> | ||
42 | |||
43 | </body> | ||
44 | </html> | ||
diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js new file mode 100644 index 00000000..6f8f5c92 --- /dev/null +++ b/js/panels/objects/object.reel/object.js | |||
@@ -0,0 +1,104 @@ | |||
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 | */ | ||
11 | var Montage = require("montage/core/core").Montage, | ||
12 | Component = require("montage/ui/component").Component; | ||
13 | |||
14 | exports.Object = Montage.create(Component, { | ||
15 | _needsPropertyInspection : { value: null }, | ||
16 | iconElement : { value: null }, | ||
17 | type : { value: null }, | ||
18 | |||
19 | _sourceObject : { value: null }, | ||
20 | sourceObject : { | ||
21 | get: function() { | ||
22 | return this._sourceObject; | ||
23 | }, | ||
24 | set: function(object) { | ||
25 | if(this._sourceObject === object) { return false; } | ||
26 | |||
27 | this._sourceObject = object; | ||
28 | |||
29 | if(object._montage_metadata) { | ||
30 | this.montageMetaData = object._montage_metadata; | ||
31 | this.type = this.application.ninja.objectsController.getObjectCategory(object); | ||
32 | } | ||
33 | |||
34 | this._needsPropertyInspection = this.needsDraw = true; | ||
35 | } | ||
36 | |||
37 | }, | ||
38 | |||
39 | _identifier : { | ||
40 | value: null | ||
41 | }, | ||
42 | identifier : { | ||
43 | get: function() { | ||
44 | return this._identifier; | ||
45 | }, | ||
46 | set: function(value) { | ||
47 | if(this._identifier === value || !value) { return false; } | ||
48 | |||
49 | this._identifier = value; | ||
50 | |||
51 | this.needsDraw = true; | ||
52 | } | ||
53 | |||
54 | }, | ||
55 | |||
56 | _montageMetaData : { | ||
57 | value: null | ||
58 | }, | ||
59 | montageMetaData : { | ||
60 | get: function() { | ||
61 | return this._montageLabel; | ||
62 | }, | ||
63 | set: function(data) { | ||
64 | if(this._montageMetaData === data) { return false; } | ||
65 | |||
66 | this._montageMetaData = data; | ||
67 | |||
68 | if(data.label) { | ||
69 | this.name = data.label; | ||
70 | this.needsDraw = true; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | }, | ||
75 | |||
76 | /* --------------------- | ||
77 | Event Handlers | ||
78 | --------------------- */ | ||
79 | |||
80 | handleClick: { | ||
81 | value: function(e) { | ||
82 | this.parentComponent.parentComponent.displayHUDForObject(this.sourceObject); | ||
83 | } | ||
84 | }, | ||
85 | |||
86 | prepareForDraw : { | ||
87 | value: function() { | ||
88 | this.iconElement.addEventListener('click', this, false); | ||
89 | } | ||
90 | }, | ||
91 | |||
92 | draw : { | ||
93 | value: function() { | ||