Add RSS links for tags and feed
[blerg.git] / www / jssrc / blerg / Feed.js
1 enyo.kind({
2     name: "blerg.Feed",
3     kind: "blerg.Pager",
4     listKind: "blerg.TagRecord",
5     published: {
6     },
7     components: [
8         {classes: "blerg-user-controls", components: [
9             {name: "rssLink", href: "/rss/feed", kind: "blerg.Link", components: [
10                 {tag: null, content: "["},
11                 {kind: "Image", src: "/images/rss.png", attributes: {width: 16, height: 16}},
12                 {tag: null, content: "RSS]"}
13             ]}
14         ]},
15         {name: "records"},
16         {name: "spinner", kind: "OldSchoolSpinner", showing: false},
17         {name: "api", kind: "blerg.API",
18          onItemsLoaded: "itemsLoaded"}
19     ],
20     statics: {
21         locationDetect: function(l) {
22             var m = l.hash.match(/^#\/feed$/);
23             if (m) {
24                 return {kind: "blerg.Feed"};
25             }
26         }
27     },
28     create: function() {
29         this.inherited(arguments);
30         this.loadMore();
31     },
32     loadItems: function(from, to) {
33         this.inherited(arguments);
34         this.$.api.loadFeed();
35     },
36     itemsLoaded: function(inSender, inEvent) {
37         this.addItems(inEvent.entries);
38         this.bubble('onClearFeedStatus');
39     }
40 });