aboutsummaryrefslogtreecommitdiff
path: root/js/panels/presets
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/presets')
-rw-r--r--js/panels/presets/content.reel/content.css52
-rw-r--r--js/panels/presets/content.reel/content.html66
-rw-r--r--js/panels/presets/content.reel/content.js106
-rw-r--r--js/panels/presets/presets-panel.js15
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.css0
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.html58
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.js119
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.css0
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.html58
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js67
10 files changed, 541 insertions, 0 deletions
diff --git a/js/panels/presets/content.reel/content.css b/js/panels/presets/content.reel/content.css
new file mode 100644
index 00000000..d0c8a08a
--- /dev/null
+++ b/js/panels/presets/content.reel/content.css
@@ -0,0 +1,52 @@
1.presetsPanel {
2 display: -webkit-box;
3 text-shadow: 1px 1px 0 #000;
4 -webkit-box-orient: vertical;
5 -webkit-box-flex: 1;
6}
7.presetsPanel .treeRoot {
8 margin: 0 8px;
9}
10.tab-bar {
11 -webkit-box-flex: 0;
12 background-color: #282828;
13 color: #FFF;
14 display: -webkit-box;
15 font-size: 12px;
16 -webkit-box-orient: horizontal;
17}
18
19.tab-bar div {
20 -webkit-box-flex: 0;
21 border-top-right-radius: 2px;
22 border-top-left-radius: 2px;
23 background-color: #474747;
24 background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.2) 0,rgba(0,0,0,0) 3px);
25 border-top: 1px solid rgb(100, 100, 100);
26 border-left: 1px solid rgba(100, 100, 100, 0.3);
27 border-right: 1px solid rgba(100, 100, 100, 0.3);
28 padding: 4px 9px;
29 cursor: pointer;
30 opacity: 0.6;
31 white-space: nowrap;
32 text-overflow: ellipsis;
33 overflow: hidden;
34 position: relative;
35 z-index: 999;
36}
37.tab-bar div.active-tab {
38 background-image: none;
39 box-shadow: 0 -5px 2px 3px rgba(0,0,0,0.2);
40 position: relative;
41 opacity: 1;
42 text-overflow: clip;
43 z-index: 1001;
44}
45
46.librarySlot {
47 -webkit-box-flex: 1;
48 overflow: auto;
49 background-color: #474747;
50 position: relative;
51 z-index: 1000;
52} \ No newline at end of file
diff --git a/js/panels/presets/content.reel/content.html b/js/panels/presets/content.reel/content.html
new file mode 100644
index 00000000..38de2a6d
--- /dev/null
+++ b/js/panels/presets/content.reel/content.html
@@ -0,0 +1,66 @@
1<!DOCTYPE html>
2<!-- <copyright>
3This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4No 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 lang="en">
8<head>
9 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" href="content.css" type="text/css">
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/panels/presets/content.reel",
15 "name" : "Content",
16 "properties" : {
17 "element" : {"#" : "presetsPanel"},
18 "activeTabIndex": 0,
19 "tabBar" : {"#": "tab-bar" },
20 "tabs" : [
21 {"key":"styles", "tab": {"#": "styles" }},
22 {"key":"transitions", "tab": {"#": "transitions" }}
23 ]
24 }
25 },
26 "substitution": {
27 "module": "montage/ui/substitution.reel",
28 "name": "Substitution",
29 "properties": {
30 "element": {"#": "librarySlot"},
31 "switchComponents": {
32 "styles": {"@": "stylesLibrary"},
33 "transitions": {"@": "transitionsLibrary"}
34
35 }
36 },
37 "bindings": {
38 "switchValue": {
39 "boundObject": {"@": "owner"},
40 "boundObjectPropertyPath": "contentPanel",
41 "oneway": true
42 }
43 }
44 },
45 "stylesLibrary": {
46 "module": "js/panels/presets/style-presets.reel",
47 "name": "StylesLibrary"
48 },
49 "transitionsLibrary": {
50 "module": "js/panels/presets/transitions-presets.reel",
51 "name": "TransitionsLibrary"
52 }
53
54 }
55 </script>
56</head>
57<body>
58 <section id="presetsPanel" class="presetsPanel">
59 <nav id="tab-bar" class="tab-bar">
60 <div id="styles">Style Library</div>
61 <div id="transitions">Transitions Library</div>
62 </nav>
63 <div id="librarySlot" class="librarySlot"></div>
64 </section>
65</body>
66</html> \ No newline at end of file
diff --git a/js/panels/presets/content.reel/content.js b/js/panels/presets/content.reel/content.js
new file mode 100644
index 00000000..8ddb3757
--- /dev/null
+++ b/js/panels/presets/content.reel/content.js
@@ -0,0 +1,106 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.content = Montage.create(Component, {
11 hasTemplate: {
12 value: true
13 },
14 contentPanel : {
15 value: "presets" // get from local storage
16 },
17 templateDidLoad : {
18 value: function() {
19 console.log('deserialized');
20 }
21 },
22 prepareForDraw : {
23 value: function() {
24 this.activeTab = this.tabs[this.activeTabIndex];
25
26 this.tabBar.addEventListener('click', this, false);
27 }
28 },
29 handleClick : {
30 value: function(e) {
31 var tabObject = this.tabs.filter(function(item) {
32 return item.tab === e._event.target;
33 });
34
35 if(tabObject[0]) {
36 this.activeTab = tabObject[0];
37 }
38
39 }
40 },
41 _activeTab : {
42 value: null,
43 enumerable: false
44 },
45 activeTab : {
46 get: function() {
47 return this._activeTab;
48 },
49 set: function(tabObject) {
50 this.contentPanel = tabObject.key;
51
52 if(this.activeTab) {
53 this._activeTab.tab.classList.remove('active-tab');
54 }
55
56 tabObject.tab.classList.add('active-tab');
57 this._activeTab = tabObject;
58 }
59 },
60 treeList : {
61 value : null
62 },
63 data2: {
64 value: {
65 "meta": "Blah",
66 "status": "OK",
67 "text" : "Root",
68 "data" : {
69 "date": "1.1.01",
70 "text": "Root",
71 "children": [{
72 "date": "3.3.01",
73 "text": "Child 1"
74 },
75 {
76 "date": "3.3.01",
77 "text": "Child 2",
78 "children": [{
79 "date": "3.4.01",
80 "text": "Grand Child 1",
81 "children": [{
82 "date": "4.4.01",
83 "text": "Great Grand Child 1"
84 }]
85 }]
86
87 },{
88 "date": "5.5.01",
89 "text": "Child 3"
90 }]
91 }
92 }
93 },