diff options
Diffstat (limited to 'js/public/app.js')
-rw-r--r-- | js/public/app.js | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/js/public/app.js b/js/public/app.js index 855bcd895..7422fc83a 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -545,7 +545,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. var _this = this; $scope.feedBusinessLayer = FeedBusinessLayer; - return $scope["import"] = function(fileContent) { + $scope["import"] = function(fileContent) { var error; $scope.error = false; @@ -558,6 +558,20 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return $scope.error = true; } }; + return $scope.importGoogleReader = function(fileContent) { + var error, parsedJSON; + + $scope.jsonError = false; + ShowAll.setShowAll(true); + try { + parsedJSON = JSON.parse(fileContent); + return FeedBusinessLayer.importGoogleReader(parsedJSON); + } catch (_error) { + error = _error; + console.error(error); + return $scope.jsonError = true; + } + }; } ]); @@ -898,6 +912,23 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return _results; }; + FeedBusinessLayer.prototype.importGoogleReader = function(json) { + var feed, url; + + url = 'http://owncloud/googlereader'; + if (angular.isUndefined(this._feedModel.getByUrl(url))) { + feed = { + title: 'Google Reader', + url: url, + folderId: 0, + unreadCount: 0, + faviconLink: 'url(' + this._utils.imagePath('core', 'loading.gif') + ')' + }; + this._feedModel.add(feed); + } + return this._persistence.importGoogleReader(json); + }; + return FeedBusinessLayer; })(_BusinessLayer); @@ -2516,6 +2547,17 @@ 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) { + var params; + + params = { + data: { + json: json + } + }; + return this._request.post('news_feeds_import_googlereader', params); + }; + /* FOLDER CONTROLLER */ |