diff options
author | Valerio Virgillito | 2012-03-19 14:46:38 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-19 14:46:38 -0700 |
commit | e9244d5a0f681ddde5896392c17738add2948687 (patch) | |
tree | 06d1d6a65c2e9a05dd6063c1974f2174922c37d3 /node_modules/montage/ui | |
parent | e9c3c7d758fc59ad7b731730dd935170844d9538 (diff) | |
parent | dd382088b4990c4e39f77d793c1a6bd7e3c52aca (diff) | |
download | ninja-e9244d5a0f681ddde5896392c17738add2948687.tar.gz |
Merge branch 'master' of github.com:francoisfrisch/ninja-internal into montage-integration
Diffstat (limited to 'node_modules/montage/ui')
9 files changed, 194 insertions, 121 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-entry.reel/feed-entry.js b/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.js index 3d97eec7..72c5023e 100644 --- a/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.js +++ b/node_modules/montage/ui/feed-reader/feed-entry.reel/feed-entry.js | |||
@@ -8,6 +8,14 @@ var Montage = require("montage").Montage, | |||
8 | 8 | ||
9 | exports.FeedEntry = Montage.create(Component, { | 9 | exports.FeedEntry = Montage.create(Component, { |
10 | 10 | ||
11 | entry: {value: null} | 11 | _entry: {value: null}, |
12 | entry: { | ||
13 | get: function() { | ||
14 | return this._entry; | ||
15 | }, | ||
16 | set: function(value) { | ||
17 | this._entry = value; | ||
18 | } | ||
19 | } | ||
12 | 20 | ||
13 | }); | 21 | }); |
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..e5251e0a 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 | |||
@@ -23,17 +23,7 @@ | |||
23 | } | 23 | } |
24 | } | 24 | } |
25 | }, | 25 | }, |
26 | 26 | ||
27 | "repetition": { | ||
28 | "module": "montage/ui/repetition.reel", | ||
29 | "name": "Repetition", | ||
30 | "properties": { | ||
31 | "element": {"#": "entries"}, | ||
32 | "contentController": {"@": "entriesController"}, | ||
33 | "isSelectionEnabled": true, | ||
34 | "orientation": "vertical" | ||
35 | } | ||
36 | }, | ||
37 | "feedEntry": { | 27 | "feedEntry": { |
38 | "module": "montage/ui/feed-reader/feed-entry.reel", | 28 | "module": "montage/ui/feed-reader/feed-entry.reel", |
39 | "name": "FeedEntry", | 29 | "name": "FeedEntry", |
@@ -42,11 +32,11 @@ | |||
42 | }, | 32 | }, |
43 | "bindings": { | 33 | "bindings": { |
44 | "entry": { | 34 | "entry": { |
45 | "boundObject": {"@": "repetition"}, | 35 | "boundObject": {"@": "owner"}, |
46 | "boundObjectPropertyPath": "objectAtCurrentIteration", | 36 | "boundObjectPropertyPath": "activeFeedEntry", |
47 | "oneway": true | 37 | "oneway": true |
48 | } | 38 | } |
49 | } | 39 | } |
50 | }, | 40 | }, |
51 | 41 | ||
52 | "owner": { | 42 | "owner": { |
@@ -54,17 +44,21 @@ | |||
54 | "name": "FeedReader", | 44 | "name": "FeedReader", |
55 | "properties": { | 45 | "properties": { |
56 | "element": {"#": "feed-reader"} | 46 | "element": {"#": "feed-reader"} |
57 | } | 47 | } |
58 | } | 48 | } |
59 | 49 | ||
60 | } | 50 | } |
61 | </script> | 51 | </script> |
62 | 52 | ||
63 | <style> | 53 | <style> |
64 | .feed-reader { | 54 | div.feed-reader { |
65 | padding: 10px; | 55 | padding: 10px; |
66 | } | 56 | } |
67 | 57 | ||
58 | .feed-entry { | ||
59 | } | ||
60 | |||
61 | |||
68 | </style> | 62 | </style> |
69 | 63 | ||
70 | 64 | ||
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..8fd9ae22 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,43 +40,119 @@ 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: 3, distinct: true}, | ||
43 | 46 | ||
47 | maxEntries: {value: 10, distinct: true}, | ||
48 | |||
44 | entries: {value: null}, | 49 | entries: {value: null}, |
45 | 50 | ||
46 | 51 | _feedDisplayMode: {value: null}, | |
47 | _startLoading: { | 52 | feedDisplayMode: { |
48 | value: function() { | 53 | get: function() { |
49 | //Notifier.show('Loading ... please wait', null, {top: this.element.style.top, left: this.element.style.left + 20}); | 54 | return this._feedDisplayMode; |
55 | }, | ||
56 | set: function(value) { | ||
57 | this._feedDisplayMode = value; | ||
50 | } | 58 | } |
51 | }, | 59 | }, |
60 | |||
61 | |||
62 | feedEntryTimer: {enumerable: false, value: null}, | ||
52 | 63 | ||
53 | _stopLoading: { | 64 | |
54 | value: function() { | 65 | activeFeedEntry: {value: null}, |
55 | //Notifier.hide(); | 66 | _activeIndex: {value: null}, |
67 | activeIndex: { | ||
68 | get: function() { | ||
69 | return this._activeIndex || 0; | ||
70 | }, | ||
71 | set: function(index) { | ||
72 | if(this.entries) { | ||
73 | var max = this.entries.length-1; | ||
74 | if(index > max) { | ||
75 | index = 0; | ||
76 | } | ||
77 | if(index < 0) { | ||
78 | index = 0; | ||
79 | } | ||
80 | this._activeIndex = index; | ||
81 | this.activeFeedEntry = this.entries[this._activeIndex]; | ||
82 | } else { | ||
83 | this._activeIndex = 0; | ||
84 | } | ||
56 | } | 85 | } |
57 | }, | 86 | }, |
58 | 87 | ||
59 | _fetchFeed: { | 88 | _fetchFeed: { |
60 | value: function() { | 89 | value: function() { |
90 | |||
61 | var url = this.feedURL; | 91 | var url = this.feedURL; |
62 | var feed = new google.feeds.Feed(url); | 92 | var feed = new google.feeds.Feed(url); |
63 | feed.setNumEntries(10); | 93 | feed.setNumEntries(10); |
64 | 94 | ||
65 | var self = this; | 95 | var self = this; |
66 | |||
67 | this._startLoading(); | ||
68 | self.entries = []; | 96 | self.entries = []; |
69 | 97 | ||
70 | feed.load(function(result) { | 98 | feed.load(function(result) { |
71 | self._stopLoading(); | 99 | //self.removeEntryAnimation(); |
72 | if(result.error) { | 100 | if(result.error) { |
73 | self.entries = []; | 101 | self.entries = []; |
74 | } else { | 102 | } else { |
75 | //console.log('entries: ', result.feed.entries); | 103 | //console.log('entries: ', result.feed.entries); |