diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-22 18:24:31 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-22 18:24:31 +0200 |
commit | df18314b32b05f10720936831ed43573e1792ae6 (patch) | |
tree | a2b8e28e165727e7a88d7ac3529f64d5f6b938e2 /js/public | |
parent | 366c1b15545b4da69bc8e236ba4350c28ad24e77 (diff) |
added import from google reader, fix #80
Diffstat (limited to 'js/public')
-rw-r--r-- | js/public/app.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/js/public/app.js b/js/public/app.js index ca7124ad7..f0c783ba1 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -961,7 +961,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; FeedBusinessLayer.prototype.importGoogleReader = function(json) { - var feed, url; + var feed, onSuccess, url, + _this = this; url = 'http://owncloud/googlereader'; if (angular.isUndefined(this._feedModel.getByUrl(url))) { @@ -974,7 +975,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; this._feedModel.add(feed); } - return this._persistence.importGoogleReader(json); + onSuccess = function(response) { + var id; + + id = response.data.feeds[0].id; + return _this.load(id); + }; + return this._persistence.importGoogleReader(json, onSuccess); }; return FeedBusinessLayer; @@ -2617,13 +2624,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return this._request.post('news_feeds_update', params); }; - Persistence.prototype.importGoogleReader = function(json) { + Persistence.prototype.importGoogleReader = function(json, onSuccess) { var params; params = { data: { json: json - } + }, + onSuccess: onSuccess }; return this._request.post('news_feeds_import_googlereader', params); }; |