aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-sheet.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/style-sheet.reel')
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.css49
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.html75
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.js61
3 files changed, 185 insertions, 0 deletions
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.css b/js/panels/css-panel/style-sheet.reel/style-sheet.css
new file mode 100644
index 00000000..41c5ab12
--- /dev/null
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.css
@@ -0,0 +1,49 @@
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.style-sheet-container {
7 border-bottom: 1px solid #505050;
8 display: -webkit-box;
9 -webkit-box-orient: horizontal;
10 padding: 4px 0 3px;
11 white-space: nowrap;
12}
13.style-sheet-container > * {
14 -webkit-box-flex: 1;
15 display:-webkit-box;
16}
17.style-sheet-container input[type="checkbox"] {
18 margin-right: 8px;
19 position: relative;
20 -webkit-box-flex: 0;
21}
22.style-sheet-container span {
23 min-width: 50px;
24 overflow: hidden;
25 padding: 2px 0;
26 text-overflow: ellipsis;
27 white-space: nowrap;
28}
29.style-sheet-container label {
30 -webkit-box-flex: 0;
31 margin: 0 5px;
32 padding: 2px 0;
33}
34.style-sheet-container input[type="text"] {
35 min-width: 30px;
36}
37.style-sheet-container button {
38 background: none;
39 color: #FFF;
40 cursor: pointer;
41}
42.style-sheet-container button:after {
43 content: "\2716";
44 opacity: 0.7;
45}
46
47.style-sheet-container button:hover:after {
48 opacity: 1;
49} \ No newline at end of file
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html
new file mode 100644
index 00000000..64b8e8ae
--- /dev/null
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html
@@ -0,0 +1,75 @@
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 href="style-sheet.css" rel="stylesheet" type="text/css">
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/panels/css-panel/style-sheet.reel",
15 "name" : "StyleSheet",
16 "properties" : {
17 "element" : {"#" : "style-sheet-container"},
18 "disableCheckbox": {"@": "disableCheckbox1"},
19 "nameText": {"@": "name1"},
20 "mediaInput": {"@": "mediaInput1"},
21 "deleteButton": {"@": "deleteButton1"}
22 }
23 },
24 "disableCheckbox1": {
25 "module": "js/components/checkbox.reel",
26 "name": "Checkbox",
27 "properties": {
28 "element": { "#": "disable-checkbox" },
29 "checked": true
30 }
31 },
32 "name1": {
33 "module": "montage/ui/dynamic-text.reel",
34 "name": "DynamicText",
35 "properties": {
36 "element": {"#": "sheet-name"},
37 "defaultText": "Style sheet"
38 },
39 "bindings": {
40 "value": {
41 "boundObject": {"@": "owner"},
42 "boundObjectPropertyPath": "name",
43 "onewway": true
44 }
45 }
46 },
47 "mediaInput1": {
48 "module": "js/components/textfield.reel",
49 "name": "TextField",
50 "properties": {
51 "element": {"#": "media-input"}
52 }
53 },
54 "deleteButton1": {
55 "module": "js/components/button.reel",
56 "name": "Button",
57 "properties": {
58 "element": {"#": "delete-button"},
59 "label": " "
60 }
61
62 }
63 }
64 </script>
65</head>
66<body>
67<div id="style-sheet-container" class="style-sheet-container">
68 <div id="disable-checkbox"></div>
69 <span id="sheet-name"></span>
70 <label>Media:</label>
71 <div id="media-input"></div>
72 <div id="delete-button"></div>
73</div>
74</body>
75</html> \ No newline at end of file
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js
new file mode 100644
index 00000000..5caf69a4
--- /dev/null
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -0,0 +1,61 @@
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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.StyleSheet = Montage.create(Component, {
11 deserializedFromTemplate : {
12 value: function() {
13 console.log("style sheet view - deserialized");
14 }
15 },
16 prepareForDraw : {
17 value: function() {
18 console.log("style sheet view - prepare for draw");
19 }
20 },
21 draw : {
22 value: function() {
23 console.log("styles sheet view - draw");
24
25 this.mediaInput.value = this._source.media.mediaText;
26 }
27 },
28
29 mediaInput: {
30 value: null
31 },
32
33 _name: {
34 value: null
35 },
36 name : {
37 get: function() {
38 return this._name;
39 },
40 set: function(text) {
41 this._name = text;
42 }
43 },
44 _source : {
45 value: null
46 },
47 source : {
48 get: function() {
49 return this._source;
50 },
51 set: function(sheet) {
52 console.log('sheet being set');
53 if(sheet.href) {
54 this.name = sheet.href.substring(sheet.href.lastIndexOf('/')+1);
55 } else {
56 this.name = 'Style Tag';
57 }
58 this._source = sheet;
59 }
60 }
61}); \ No newline at end of file