diff options
author | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
commit | 8592cfb89db05f0e52d8c1b8c7046e6f49e3522d (patch) | |
tree | a6f9b5adfe16fd6232708f8a2345cd79056caca9 /node_modules/montage-user/ui/scroller.reel | |
parent | c6d1a1da9e7cdf477daf32410d80691eb1e828d5 (diff) | |
download | ninja-8592cfb89db05f0e52d8c1b8c7046e6f49e3522d.tar.gz |
Adding a montage framework copy for the user document
Adding a new montage copy containing the latest version of montage to use the new native widgets
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage-user/ui/scroller.reel')
-rw-r--r-- | node_modules/montage-user/ui/scroller.reel/scroller.html | 112 | ||||
-rw-r--r-- | node_modules/montage-user/ui/scroller.reel/scroller.js | 253 |
2 files changed, 365 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/scroller.reel/scroller.html b/node_modules/montage-user/ui/scroller.reel/scroller.html new file mode 100644 index 00000000..34e4bc0a --- /dev/null +++ b/node_modules/montage-user/ui/scroller.reel/scroller.html | |||
@@ -0,0 +1,112 @@ | |||
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 | <title></title> | ||
10 | <script type="text/montage-serialization"> | ||
11 | { | ||
12 | "scrollbars": { | ||
13 | "module": "montage/ui/scroll-bars.reel", | ||
14 | "name": "ScrollBars", | ||
15 | "properties": { | ||
16 | "element": { | ||
17 | "#": "scrollbars" | ||
18 | } | ||
19 | } | ||
20 | }, | ||
21 | "translateComposer1": { | ||
22 | "module": "montage/ui/composer/translate-composer", | ||
23 | "name": "TranslateComposer", | ||
24 | "properties": { | ||
25 | "component": {"@": "owner"} | ||
26 | }, | ||
27 | "bindings": { | ||
28 | "translateX": { | ||
29 | "boundObject": {"@": "owner"}, | ||
30 | "boundObjectPropertyPath": "scrollX", | ||
31 | "oneway": false | ||
32 | }, | ||
33 | "translateY": { | ||
34 | "boundObject": {"@": "owner"}, | ||
35 | "boundObjectPropertyPath": "scrollY", | ||
36 | "oneway": false | ||
37 | }, | ||
38 | "maxTranslateY": { | ||
39 | "boundObject": {"@": "owner"}, | ||
40 | "boundObjectPropertyPath": "_maxTranslateY" | ||
41 | }, | ||
42 | "maxTranslateX": { | ||
43 | "boundObject": {"@": "owner"}, | ||
44 | "boundObjectPropertyPath": "_maxTranslateX" | ||
45 | }, | ||
46 | "axis": { | ||
47 | "boundObject": {"@": "owner"}, | ||
48 | "boundObjectPropertyPath": "axis" | ||
49 | }, | ||
50 | "hasBouncing": { | ||
51 | "boundObject": {"@": "owner"}, | ||
52 | "boundObjectPropertyPath": "hasBouncing" | ||
53 | }, | ||
54 | "hasMomentum": { | ||
55 | "boundObject": {"@": "owner"}, | ||
56 | "boundObjectPropertyPath": "hasMomentum" | ||
57 | }, | ||
58 | "bouncingDuration": { | ||
59 | "boundObject": {"@": "owner"}, | ||
60 | "boundObjectPropertyPath": "bouncingDuration" | ||
61 | }, | ||
62 | "momentumDuration": { | ||
63 | "boundObject": {"@": "owner"}, | ||
64 | "boundObjectPropertyPath": "momentumDuration" | ||
65 | } | ||
66 | }, | ||
67 | "listeners": [ | ||
68 | { | ||
69 | "type": "translateStart", | ||
70 | "listener": {"@": "owner"} | ||
71 | }, | ||
72 | { | ||
73 | "type": "translateEnd", | ||
74 | "listener": {"@": "owner"} | ||
75 | } | ||
76 | ] | ||
77 | }, | ||
78 | "owner": { | ||
79 | "module": "montage/ui/scroller.reel", | ||
80 | "name": "Scroller", | ||
81 | "properties": { | ||
82 | "_content": { | ||
83 | "#": "content" | ||
84 | }, | ||
85 | "element": { | ||
86 | "#": "montage-scroller" | ||
87 | }, | ||
88 | "_scrollBars": { | ||
89 | "@": "scrollbars" | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | </script> | ||
95 | <style> | ||
96 | .montage-scroller { | ||
97 | position: relative; | ||
98 | display: block; | ||
99 | overflow: hidden; | ||
100 | } | ||
101 | .montage-scroller .content { | ||
102 | float: left; | ||
103 | } | ||
104 | </style> | ||
105 | </head> | ||
106 | <body> | ||
107 | <div id="montage-scroller" class="montage-scroller"> | ||
108 | <div id="scrollbars"></div> | ||
109 | <div id="content" class="content"></div> | ||
110 | </div> | ||
111 | </body> | ||
112 | </html> | ||
diff --git a/node_modules/montage-user/ui/scroller.reel/scroller.js b/node_modules/montage-user/ui/scroller.reel/scroller.js new file mode 100644 index 00000000..32df2906 --- /dev/null +++ b/node_modules/montage-user/ui/scroller.reel/scroller.js | |||
@@ -0,0 +1,253 @@ | |||
1 | var Montage = require("montage").Montage, | ||
2 | Component = require("ui/component").Component | ||
3 | TranslateComposer = require("ui/composer/translate-composer").TranslateComposer; | ||
4 | |||
5 | exports.Scroller = Montage.create(Component, { | ||
6 | |||
7 | _scrollX: { | ||
8 | enumerable: false, | ||
9 | value: 0 | ||
10 | }, | ||
11 | |||
12 | scrollX: { | ||
13 | get: function () { | ||
14 | return this._scrollX; | ||
15 | }, | ||
16 | set: function (value) { | ||
17 | this._scrollX = value; | ||
18 | this.needsDraw = true; | ||
19 | } | ||
20 | }, | ||
21 | |||
22 | _scrollY: { | ||
23 | enumerable: false, | ||
24 | value: 0 | ||
25 | }, | ||
26 | |||
27 | scrollY: { | ||
28 | get: function () { | ||
29 | return this._scrollY; | ||
30 | }, | ||
31 | set: function (value) { | ||
32 | this._scrollY = value; | ||
33 | this.needsDraw = true; | ||
34 | } | ||
35 | }, | ||
36 | |||
37 | _maxTranslateX: { | ||
38 | value: 0 | ||
39 | }, | ||
40 | |||
41 | _maxTranslateY: { | ||
42 | value: 0 | ||
43 | }, | ||
44 | |||
45 | _axis: { | ||
46 | enumerable: false, | ||
47 | value: "auto" | ||
48 | }, | ||
49 | |||
50 | axis: { | ||
51 | get: function () { | ||
52 | return this._axis; | ||
53 | }, | ||
54 | set: function (value) { | ||
55 | this._axis = value; | ||
56 | this.needsDraw = true; | ||
57 | } | ||
58 | }, | ||
59 | |||
60 | _displayScrollbars: { | ||
61 | enumerable: false, | ||
62 | value: "auto" | ||
63 | }, | ||
64 | |||
65 | displayScrollbars: { | ||
66 | get: function () { | ||
67 | return this._displayScrollbars; | ||
68 | }, | ||
69 | set: function (value) { | ||
70 | switch (value) { | ||
71 | case "vertical": | ||
72 | case "horizontal": | ||
73 | case "both": | ||
74 | case "auto": | ||
75 | this._displayScrollbars = value; | ||
76 | break; | ||
77 | default: | ||
78 | this._displayScrollbars = "none"; | ||
79 | break; | ||
80 | } | ||
81 | this.needsDraw = true; | ||
82 | } | ||
83 | }, | ||
84 | |||
85 | _hasMomentum: { | ||
86 | enumerable: false, | ||
87 | value: true | ||
88 | }, | ||
89 | |||
90 | hasMomentum: { | ||
91 | get: function () { | ||
92 | return this._hasMomentum; | ||
93 | }, | ||
94 | set: function (value) { | ||
95 | this._hasMomentum = value; | ||
96 | } | ||
97 | }, | ||
98 | |||
99 | _hasBouncing: { | ||