X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FAPI.js;fp=www%2Fjssrc%2Fblerg%2FAPI.js;h=203706a674da60477844ccca4312302ecb89885d;hb=04a4fdf9d85e0d0b193300abe0c0e433449cd285;hp=13702340187a451afe08a43ae881a6f409e9c0ea;hpb=123d2723395955bf2121e0bfeb6c864b70a33448;p=blerg.git diff --git a/www/jssrc/blerg/API.js b/www/jssrc/blerg/API.js index 1370234..203706a 100644 --- a/www/jssrc/blerg/API.js +++ b/www/jssrc/blerg/API.js @@ -68,11 +68,6 @@ enyo.kind({ }); enyo.setCookie('username', '', {"Max-Age": 0}); }, - requestFeedStatus: function() { - if (!blerg.API.loggedIn) - throw new Error('Cannot request feed status when not logged in'); - // TODO - }, loadUserRecords: function(username, from ,to) { var url; if (from != undefined && to != undefined) { @@ -123,6 +118,39 @@ enyo.kind({ }.bind(this)); req.go(); }, + getFeedInfo: function() { + if (!blerg.API.loggedIn) + throw new Error('Cannot request feed status when not logged in'); + + var req = new enyo.Ajax({ + url: baseURL + '/feedinfo', + method: 'POST' + }); + req.response(function(inSender, inResponse) { + this.bubble('onFeedInfo', inResponse); + }.bind(this)); + req.go({ + username: blerg.API.username + }); + }, + loadFeed: function() { + if (!blerg.API.loggedIn) + throw new Error('Cannot request feed status when not logged in'); + + var req = new enyo.Ajax({ + url: baseURL + '/feed', + method: 'POST' + }); + req.response(function(inSender, inResponse) { + this.bubble('onItemsLoaded', { + type: "feed", + entries: inResponse + }); + }.bind(this)); + req.go({ + username: blerg.API.username + }); + }, getSubscriptionStatus: function(username) { var req = new enyo.Ajax({ url: baseURL + '/feedinfo/' + username,