diff options
author | Pierre Frisch | 2011-12-22 07:25:50 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-01-27 11:18:17 -0800 |
commit | b89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch) | |
tree | 0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/components/layout/document-entry.reel | |
parent | 2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff) | |
download | ninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz |
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/components/layout/document-entry.reel')
-rw-r--r-- | js/components/layout/document-entry.reel/close_button.gif | bin | 0 -> 139 bytes | |||
-rw-r--r-- | js/components/layout/document-entry.reel/document-entry.css | 38 | ||||
-rw-r--r-- | js/components/layout/document-entry.reel/document-entry.html | 34 | ||||
-rw-r--r-- | js/components/layout/document-entry.reel/document-entry.js | 110 |
4 files changed, 182 insertions, 0 deletions
diff --git a/js/components/layout/document-entry.reel/close_button.gif b/js/components/layout/document-entry.reel/close_button.gif new file mode 100644 index 00000000..00b5904b --- /dev/null +++ b/js/components/layout/document-entry.reel/close_button.gif | |||
Binary files differ | |||
diff --git a/js/components/layout/document-entry.reel/document-entry.css b/js/components/layout/document-entry.reel/document-entry.css new file mode 100644 index 00000000..ce173cd6 --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.css | |||
@@ -0,0 +1,38 @@ | |||
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 | .documentEntry span | ||
8 | { | ||
9 | /*display: inline-block;*/ | ||
10 | white-space: nowrap; | ||
11 | overflow: hidden; | ||
12 | text-overflow: ellipsis; /* Causes ... to appear ?? */ | ||
13 | max-width:100px; | ||
14 | } | ||
15 | |||
16 | .documentEntry img { | ||
17 | opacity: 0.5; /* 50% */ | ||
18 | padding-left: 5px; | ||
19 | width: 12px; | ||
20 | height: 12px; | ||
21 | -webkit-transition: opacity 0.2s ease; | ||
22 | transition: opacity 0.2s ease; | ||
23 | } | ||
24 | |||
25 | .documentEntry:hover, | ||
26 | .documentEntry:active, | ||
27 | .documentEntry.activeTab { | ||
28 | /*background-color: #7f7f7f; *//* rgb(127, 127, 127); */ | ||
29 | } | ||
30 | |||
31 | .documentEntry img:hover { | ||
32 | opacity: 1.0; /* 100% */ | ||
33 | } | ||
34 | |||
35 | |||
36 | .documentEntry span.dirty:before{ | ||
37 | content: "*"; | ||
38 | } | ||
diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html new file mode 100644 index 00000000..ba17449a --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.html | |||
@@ -0,0 +1,34 @@ | |||
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="document-entry.css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | |||
14 | "owner": { | ||
15 | "module": "js/components/layout/document-entry.reel", | ||
16 | "name": "DocumentEntry", | ||
17 | "properties": { | ||
18 | "element": {"#": "documentEntry"}, | ||
19 | "label": {"#": "name"}, | ||
20 | "activeBack": {"#": "isActive"} | ||
21 | } | ||
22 | } | ||
23 | } | ||
24 | </script> | ||
25 | </head> | ||
26 | <body> | ||
27 | <li id="documentEntry" class="documentEntry"> | ||
28 | <div id="isActive"></div> | ||
29 | <div id="dirtyFlag"></div> | ||
30 | <span id="name"></span> | ||
31 | <img src="js/components/layout/document-entry.reel/close_button.gif"> | ||
32 | </li> | ||
33 | </body> | ||
34 | </html> \ No newline at end of file | ||
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js new file mode 100644 index 00000000..6f265c91 --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.js | |||
@@ -0,0 +1,110 @@ | |||
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 | var Montage = require("montage/core/core").Montage; | ||
8 | var Component = require("montage/ui/component").Component; | ||
9 | |||
10 | //var documentManagerModule = ("js/document/documentManager"); | ||
11 | |||
12 | exports.DocumentEntry = Montage.create(Component, { | ||
13 | |||
14 | dirty: { value: null }, | ||
15 | |||
16 | _uuid: { | ||
17 | value: null, | ||
18 | enumerable: false | ||
19 | }, | ||
20 | |||
21 | _document: { | ||
22 | enumerable: false, | ||
23 | value: null | ||
24 | }, | ||
25 | |||
26 | document: { | ||
27 | enumerable: false, | ||
28 | get: function() { | ||
29 | return this._document; | ||
30 | }, | ||
31 | set: function(value) { | ||
32 | |||
33 | if (this._document === value) { | ||
34 | return; | ||
35 | } | ||
36 | |||
37 | this._document = value; | ||
38 | this._uuid = value.uuid; | ||
39 | //this.needsDraw = true; | ||
40 | } | ||
41 | }, | ||
42 | |||
43 | _name: { value: null }, | ||
44 | |||
45 | name: { | ||
46 | enumerable: false, | ||
47 | get: function() { | ||
48 | return this._name; | ||
49 | }, | ||
50 | set: function(value) { | ||
51 | |||
52 | if (this._name === value) { | ||
53 | return; | ||
54 | } | ||
55 | |||
56 | this._name = value; | ||
57 | this.needsDraw = true; | ||
58 | } | ||
59 | }, | ||
60 | |||
61 | _active: { | ||
62 | enumerable: false, | ||
63 | value: null | ||
64 | }, | ||
65 | |||
66 | active: { | ||
67 | get: function() { | ||
68 | return this._active; | ||
69 | }, | ||
70 | set: function(value) { | ||
71 | var previousValue = this._active; | ||
72 | this._active = value; | ||
73 | |||
74 | if (previousValue !== this._active) { | ||
75 | this.needsDraw = true; | ||
76 | } | ||
77 | } | ||
78 | }, | ||
79 | |||
80 | |||
81 | prepareForDraw: { | ||
82 | enumerable: false, | ||
83 | value: function() { | ||
84 | //this.element.addEventListener("click", this, false); | ||
85 | } | ||
86 | }, | ||
87 | |||
88 | |||
89 | draw: { | ||
90 | enumerable: false, | ||
91 | value: function() { | ||
92 | this.label.innerText = this._name ? this._name : ""; | ||
93 | |||
94 | this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); | ||
95 | } | ||
96 | }, | ||
97 | |||
98 | handleClick: { | ||
99 | value: function(event) { | ||
100 | if(event._event.target.nodeName === "IMG") { | ||
101 | documentManagerModule.DocumentManager.closeDocument(this._uuid); | ||
102 | } else { | ||
103 | if(!this._document.isActive) { | ||
104 | documentManagerModule.DocumentManager.switchDocument(this._uuid); | ||
105 | } | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | |||
110 | }); | ||