aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui')
-rw-r--r--node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.html1
-rw-r--r--node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html26
-rw-r--r--node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js51
-rw-r--r--node_modules/montage/ui/map.reel/map.html31
-rw-r--r--node_modules/montage/ui/map.reel/map.js41
5 files changed, 89 insertions, 61 deletions
diff --git a/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.html b/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.html
index 213b4602..6c3a5298 100644
--- a/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.html
+++ b/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.html
@@ -61,7 +61,6 @@
61 .feed-entry { 61 .feed-entry {
62 padding: 10px; 62 padding: 10px;
63 margin: 3px 0; 63 margin: 3px 0;
64 border: 1px solid #aaa;
65 } 64 }
66 .feed-entry h2 { 65 .feed-entry h2 {
67 font-size: 24px; 66 font-size: 24px;
diff --git a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
index a3523001..646fd01e 100644
--- a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
+++ b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
@@ -53,7 +53,15 @@
53 "module": "montage/ui/feed-reader/feed-reader.reel", 53 "module": "montage/ui/feed-reader/feed-reader.reel",
54 "name": "FeedReader", 54 "name": "FeedReader",
55 "properties": { 55 "properties": {
56 "element": {"#": "feed-reader"} 56 "element": {"#": "feed-reader"},
57 "repetition": {"@": "repetition"}
58 },
59 "bindings": {
60 "items": {
61 "boundObject": {"@": "repetition"},
62 "boundObjectPropertyPath": "objects",
63 "oneway": true
64 }
57 } 65 }
58 } 66 }
59 67
@@ -61,8 +69,20 @@
61 </script> 69 </script>
62 70
63 <style> 71 <style>
64 .feed-reader { 72 div.feed-reader {
65 padding: 10px; 73 padding: 10px;
74 }
75
76 .feed-entry {
77 display: none;
78 }
79
80 .montage-hidden {
81 display: none;
82 }
83
84 .active {
85 display: block;
66 } 86 }
67 87
68 </style> 88 </style>
diff --git a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
index 838a957d..d5c9ca17 100644
--- a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
+++ b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
@@ -40,7 +40,13 @@ exports.FeedReader = Montage.create(Component, {
40 this._fetchFeed(); 40 this._fetchFeed();
41 } 41 }
42 }, 42 },
43
44 // time in ms between slides
45 interval: {value: 3000, distinct: true},
46
47 repetition: {enumerable: false, value: null},
43 48
49 maxEntries: {value: 10, distinct: true},
44 entries: {value: null}, 50 entries: {value: null},
45 51
46 52
@@ -55,6 +61,51 @@ exports.FeedReader = Montage.create(Component, {
55 //Notifier.hide(); 61 //Notifier.hide();
56 } 62 }
57 }, 63 },
64
65
66 feedEntryTimer: {enumerable: false, value: null},
67 _items: {
68 value: null
69 },
70 items: {
71 get: function() {
72 return this._items;
73 },
74 set: function(value) {
75 this._items = value;
76 // reset the counter
77 console.log('got items');
78 this.activeIndex = 0;
79
80 if(this.feedEntryTimer) {
81 window.clearInterval(this.feedEntryTimer);
82 }
83 var self = this, maxEntries = self.maxEntries;
84
85 this.feedEntryTimer = setInterval(function() {
86 var index = self.activeIndex + 1;
87 if(index > maxEntries) {
88 index = 0;
89 }
90 if(index < 0) {
91 index = 0;
92 }
93 self.activeIndex = index;
94
95 }, this.interval);
96 }
97 },
98
99 _activeIndex: {value: null},
100 activeIndex: {
101 get: function() {
102 return this._activeIndex || 0;
103 },
104 set: function(value) {
105 this._activeIndex = value;
106 this.repetition.activeIndexes = [value];
107 }
108 },
58 109
59 _fetchFeed: { 110 _fetchFeed: {
60 value: function() { 111 value: function() {
diff --git a/node_modules/montage/ui/map.reel/map.html b/node_modules/montage/ui/map.reel/map.html
index 5cd3a5b5..b255ac1e 100644
--- a/node_modules/montage/ui/map.reel/map.html
+++ b/node_modules/montage/ui/map.reel/map.html
@@ -13,24 +13,13 @@
13 13
14 <script type="text/montage-serialization"> 14 <script type="text/montage-serialization">
15 { 15 {
16 "types": { 16
17 "prototype": "montage/ui/select-input.reel",
18 "properties": {
19 "element": {"#": "types"}
20 }
21 },
22 "owner": { 17 "owner": {
23 "prototype": "montage/ui/map.reel", 18 "prototype": "montage/ui/map.reel",
24 "properties": { 19 "properties": {
25 "element": {"#": "map-container"}, 20 "element": {"#": "map-container"},
26 "mapEl": {"#": "map"} 21 "mapEl": {"#": "map"}
27 }, 22 }
28 "bindings": {
29 "category": {
30 "boundObject": {"@": "types"},
31 "boundObjectPropertyPath": "value"
32 }
33 }
34 } 23 }
35 } 24 }
36 </script> 25 </script>
@@ -49,20 +38,8 @@
49</head> 38</head>
50<body> 39<body>
51 40
52 <div data-montage-id="map-container"> 41 <div data-montage-id="map-container">
53 <div> 42 <div data-montage-id="map" id="map" class="montage-google-map">MAP</div>
54 Show:
55 <select data-montage-id="types">
56 <option value=''>Select a Category</option>
57 <option value='cafe'>Coffee</option>
58 <option value='hospital'>Hospitals</option>
59 <option value='museum'>Museums</option>
60 <option value='restaurant'>Restaurants</option>
61
62 </select>
63 </div>
64 <div data-montage-id="map" id="map" class="montage-google-map">MAP</div>
65
66 </div> 43 </div>
67 44
68</body> 45</body>
diff --git a/node_modules/montage/ui/map.reel/map.js b/node_modules/montage/ui/map.reel/map.js
index c03d51c5..305ae181 100644
--- a/node_modules/montage/ui/map.reel/map.js
+++ b/node_modules/montage/ui/map.reel/map.js
@@ -42,34 +42,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
42 enumerable: false, 42 enumerable: false,
43 value: false 43 value: false
44 }, 44 },
45 _latitude: { 45
46 enumerable: false,
47 value: -34.397
48 },
49 latitude: {
50 enumerable: false,
51 set: function(value) {
52 this._latitude = value;
53 this.needsDraw = true;
54 },
55 get: function() {
56 return this._latitude;
57 }
58 },
59 _longitude: {
60 enumerable: false,
61 value: -34.397