From b9de58c0c9da63f6a489df416df1819a40cb507d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 13 May 2014 22:10:02 +0200 Subject: remove more old code --- js/app/services/businesslayer/feedbusinesslayer.coffee | 2 +- js/app/services/businesslayer/folderbusinesslayer.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/app/services/businesslayer/feedbusinesslayer.coffee b/js/app/services/businesslayer/feedbusinesslayer.coffee index 713ce2657..2700caeb5 100644 --- a/js/app/services/businesslayer/feedbusinesslayer.coffee +++ b/js/app/services/businesslayer/feedbusinesslayer.coffee @@ -172,7 +172,7 @@ FeedModel, NewLoading, _ExistsError, Utils, $rootScope, NewestItem)-> onSuccess(response) failure = (response) -> - feed.error = response.msg + feed.error = response.message onFailure() @_persistence.createFeed(url, parentId, success, failure) diff --git a/js/app/services/businesslayer/folderbusinesslayer.coffee b/js/app/services/businesslayer/folderbusinesslayer.coffee index ceb406b59..60bde1c4e 100644 --- a/js/app/services/businesslayer/folderbusinesslayer.coffee +++ b/js/app/services/businesslayer/folderbusinesslayer.coffee @@ -145,7 +145,7 @@ FeedModel, $rootScope) -> onSuccess(response) failure = (response) -> - folder.error = response.msg + folder.error = response.message onFailure() @_persistence.createFolder folderName, 0, success, failure -- cgit v1.2.3 From f333f6b38f985c40247f7c82dd462f3016611dfe Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 13 May 2014 22:48:54 +0200 Subject: fix js tests --- js/public/app.js | 1067 ++++++++++---------- .../businesslayer/feedbusinesslayerSpec.coffee | 4 +- .../businesslayer/folderbusinesslayerSpec.coffee | 4 +- 3 files changed, 561 insertions(+), 514 deletions(-) (limited to 'js') diff --git a/js/public/app.js b/js/public/app.js index c1c2363be..608fdb4d7 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -10,7 +10,8 @@ */ -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -30,8 +31,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News', ['ui']).config([ @@ -69,7 +69,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -89,8 +90,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('newsAudio', function() { @@ -121,7 +121,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 (function() { angular.module('News').directive('newsAutoFocus', function() { var directive; @@ -137,7 +137,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -157,8 +158,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('newsBindHtmlUnsafe', function() { @@ -171,7 +171,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -191,8 +192,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('ocClickFocus', [ @@ -217,7 +217,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -237,8 +238,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('ocClickSlideToggle', [ @@ -298,7 +298,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -318,8 +319,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('ocDraggable', function() { @@ -336,7 +336,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -356,8 +357,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('droppable', [ @@ -387,7 +387,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -407,8 +408,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('ocForwardClick', function() { @@ -425,7 +425,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -445,8 +446,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('itemShortcuts', [ @@ -568,7 +568,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -588,8 +589,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('newsClickScroll', [ @@ -617,7 +617,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -637,8 +638,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var markingRead, scrolling; @@ -700,7 +700,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -720,8 +721,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('newsPullToRefresh', [ @@ -751,7 +751,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -771,15 +772,14 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ + */ /* This directive can be bound on an input element with type file When a file is input, the content will be passed to the given function as $fileContent parameter -*/ - + */ (function() { angular.module('News').directive('ocReadFile', [ @@ -802,7 +802,8 @@ $fileContent parameter }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -822,8 +823,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('ocTooltip', function() { @@ -834,7 +834,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -854,8 +855,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('newsTranslate', function() { @@ -872,7 +872,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -892,8 +893,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').directive('undoNotification', [ @@ -935,7 +935,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -955,8 +956,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').filter('trustUrl', [ @@ -969,7 +969,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -989,8 +990,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').controller('AppController', [ @@ -998,16 +998,17 @@ License along with this library. If not, see . var AppController; AppController = (function() { function AppController(_$scope, _persistence, _feedBusinessLayer) { - var successCallback, - _this = this; + var successCallback; this._$scope = _$scope; this._persistence = _persistence; this._feedBusinessLayer = _feedBusinessLayer; this._$scope.initialized = false; this._$scope.feedBusinessLayer = this._feedBusinessLayer; - successCallback = function() { - return _this._$scope.initialized = true; - }; + successCallback = (function(_this) { + return function() { + return _this._$scope.initialized = true; + }; + })(this); this._persistence.init().then(successCallback); } @@ -1020,7 +1021,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1040,8 +1042,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').controller('FeedController', [ @@ -1049,7 +1050,6 @@ License along with this library. If not, see . var FeedController; FeedController = (function() { function FeedController(_$scope, _persistence, _folderBusinessLayer, _feedBusinessLayer, _subscriptionsBusinessLayer, _starredBusinessLayer, _unreadCountFormatter, _activeFeed, _feedType, _$window) { - var _this = this; this._$scope = _$scope; this._persistence = _persistence; this._folderBusinessLayer = _folderBusinessLayer; @@ -1075,83 +1075,95 @@ License along with this library. If not, see . feed.editing = false; return feed.title = feed.originalValue; }; - this._$scope.getTotalUnreadCount = function() { - var appName, count, title, titleCount; - count = _this._subscriptionsBusinessLayer.getUnreadCount(0); - if (_this._$scope.translations && _this._$scope.translations.appName) { - appName = _this._$scope.translations.appName; - } else { - appName = ''; - } - if (count > 0) { - titleCount = _this._unreadCountFormatter(count); - title = appName + ' (' + titleCount + ') | ownCloud'; - } else { - title = appName + ' | ownCloud'; - } - if (_this._$window.document.title !== title) { - _this._$window.document.title = title; - } - return count; - }; - this._$scope.isAddingFolder = function() { - return _this._isAddingFolder; - }; - this._$scope.isAddingFeed = function() { - return _this._isAddingFeed; - }; - this._$scope.addFeed = function(feedUrl, parentFolderId) { - var error; - if (parentFolderId == null) { - parentFolderId = 0; - } - _this._$scope.feedExistsError = false; - try { - _this._isAddingFeed = true; - if (parentFolderId !== 0) { - _this._folderBusinessLayer.open(parentFolderId); + this._$scope.getTotalUnreadCount = (function(_this) { + return function() { + var appName, count, title, titleCount; + count = _this._subscriptionsBusinessLayer.getUnreadCount(0); + if (_this._$scope.translations && _this._$scope.translations.appName) { + appName = _this._$scope.translations.appName; + } else { + appName = ''; + } + if (count > 0) { + titleCount = _this._unreadCountFormatter(count); + title = appName + ' (' + titleCount + ') | ownCloud'; + } else { + title = appName + ' | ownCloud'; } - _this._$scope.feedUrl = ''; - return _this._feedBusinessLayer.create(feedUrl, parentFolderId, function(data) { - _this._isAddingFeed = false; - return _this._feedBusinessLayer.load(data['feeds'][0].id); - }, function() { + if (_this._$window.document.title !== title) { + _this._$window.document.title = title; + } + return count; + }; + })(this); + this._$scope.isAddingFolder = (function(_this) { + return function() { + return _this._isAddingFolder; + }; + })(this); + this._$scope.isAddingFeed = (function(_this) { + return function() { + return _this._isAddingFeed; + }; + })(this); + this._$scope.addFeed = (function(_this) { + return function(feedUrl, parentFolderId) { + var error; + if (parentFolderId == null) { + parentFolderId = 0; + } + _this._$scope.feedExistsError = false; + try { + _this._isAddingFeed = true; + if (parentFolderId !== 0) { + _this._folderBusinessLayer.open(parentFolderId); + } + _this._$scope.feedUrl = ''; + return _this._feedBusinessLayer.create(feedUrl, parentFolderId, function(data) { + _this._isAddingFeed = false; + return _this._feedBusinessLayer.load(data['feeds'][0].id); + }, function() { + return _this._isAddingFeed = false; + }); + } catch (_error) { + error = _error; + if (error instanceof _ExistsError) { + _this._$scope.feedExistsError = true; + } return _this._isAddingFeed = false; - }); - } catch (_error) { - error = _error; - if (error instanceof _ExistsError) { - _this._$scope.feedExistsError = true; } - return _this._isAddingFeed = false; - } - }; - this._$scope.addFolder = function(folderName) { - var error; - _this._$scope.folderExistsError = false; - try { - _this._isAddingFolder = true; - return _this._folderBusinessLayer.create(folderName, function(data) { - var activeId; - _this._$scope.folderName = ''; - _this._$scope.addNewFolder = false; - _this._isAddingFolder = false; - activeId = data['folders'][0].id; - return _this._$scope.folderId = _this._folderBusinessLayer.getById(activeId); - }, function() { + }; + })(this); + this._$scope.addFolder = (function(_this) { + return function(folderName) { + var error; + _this._$scope.folderExistsError = false; + try { + _this._isAddingFolder = true; + return _this._folderBusinessLayer.create(folderName, function(data) { + var activeId; + _this._$scope.folderName = ''; + _this._$scope.addNewFolder = false; + _this._isAddingFolder = false; + activeId = data['folders'][0].id; + return _this._$scope.folderId = _this._folderBusinessLayer.getById(activeId); + }, function() { + return _this._isAddingFolder = false; + }); + } catch (_error) { + error = _error; + if (error instanceof _ExistsError) { + _this._$scope.folderExistsError = true; + } return _this._isAddingFolder = false; - }); - } catch (_error) { - error = _error; - if (error instanceof _ExistsError) { - _this._$scope.folderExistsError = true; } - return _this._isAddingFolder = false; - } - }; - this._$scope.$on('moveFeedToFolder', function(scope, data) { - return _this._feedBusinessLayer.move(data.feedId, data.folderId); - }); + }; + })(this); + this._$scope.$on('moveFeedToFolder', (function(_this) { + return function(scope, data) { + return _this._feedBusinessLayer.move(data.feedId, data.folderId); + }; + })(this)); } return FeedController; @@ -1163,7 +1175,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1183,8 +1196,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').controller('ItemController', [ @@ -1192,7 +1204,6 @@ License along with this library. If not, see . var ItemController; ItemController = (function() { function ItemController(_$scope, _itemBusinessLayer, _feedModel, _feedLoading, _autoPageLoading, _feedBusinessLayer, _language, _compact) { - var _this = this; this._$scope = _$scope; this._itemBusinessLayer = _itemBusinessLayer; this._feedModel = _feedModel; @@ -1204,48 +1215,64 @@ License along with this library. If not, see . this._autoPaging = true; this._$scope.itemBusinessLayer = this._itemBusinessLayer; this._$scope.feedBusinessLayer = this._feedBusinessLayer; - this._$scope.isLoading = function() { - return _this._feedLoading.isLoading(); - }; - this._$scope.isAutoPaging = function() { - return _this._autoPageLoading.isLoading(); - }; - this._$scope.getFeedTitle = function(feedId) { - var feed; - feed = _this._feedModel.getById(feedId); - if (angular.isDefined(feed)) { - return feed.title; - } else { - return ''; - } - }; - this._$scope.getRelativeDate = function(date) { - if (date) { - return _this._language.getMomentFromTimestamp(date).fromNow(); - } else { - return ''; - } - }; - this._$scope.loadNew = function() { - _this._$scope.refresh = true; - return _this._itemBusinessLayer.loadNew(function() { - return _this._$scope.refresh = false; - }); - }; - this._$scope.$on('readItem', function(scope, data) { - return _this._itemBusinessLayer.setRead(data); - }); - this._$scope.$on('autoPage', function() { - if (_this._autoPaging) { - _this._autoPaging = false; - return _this._itemBusinessLayer.loadNext(function(data) { - return _this._autoPaging = true; + this._$scope.isLoading = (function(_this) { + return function() { + return _this._feedLoading.isLoading(); + }; + })(this); + this._$scope.isAutoPaging = (function(_this) { + return function() { + return _this._autoPageLoading.isLoading(); + }; + })(this); + this._$scope.getFeedTitle = (function(_this) { + return function(feedId) { + var feed; + feed = _this._feedModel.getById(feedId); + if (angular.isDefined(feed)) { + return feed.title; + } else { + return ''; + } + }; + })(this); + this._$scope.getRelativeDate = (function(_this) { + return function(date) { + if (date) { + return _this._language.getMomentFromTimestamp(date).fromNow(); + } else { + return ''; + } + }; + })(this); + this._$scope.loadNew = (function(_this) { + return function() { + _this._$scope.refresh = true; + return _this._itemBusinessLayer.loadNew(function() { + return _this._$scope.refresh = false; }); - } - }); - this._$scope.isCompactView = function() { - return _this._compact.isCompact(); - }; + }; + })(this); + this._$scope.$on('readItem', (function(_this) { + return function(scope, data) { + return _this._itemBusinessLayer.setRead(data); + }; + })(this)); + this._$scope.$on('autoPage', (function(_this) { + return function() { + if (_this._autoPaging) { + _this._autoPaging = false; + return _this._itemBusinessLayer.loadNext(function(data) { + return _this._autoPaging = true; + }); + } + }; + })(this)); + this._$scope.isCompactView = (function(_this) { + return function() { + return _this._compact.isCompact(); + }; + })(this); } return ItemController; @@ -1257,7 +1284,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1277,8 +1305,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').controller('SettingsController', [ @@ -1322,7 +1349,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1342,18 +1370,17 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('ActiveFeed', function() { var ActiveFeed; ActiveFeed = (function() { function ActiveFeed() { + /* Default value is all feeds - */ - + */ this._id = 0; this._type = 3; } @@ -1379,7 +1406,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1399,8 +1427,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_BusinessLayer', function() { @@ -1415,12 +1442,13 @@ License along with this library. If not, see . } BusinessLayer.prototype.load = function(id) { - var _this = this; this._$rootScope.$broadcast('loadingNewItems'); this._itemModel.clear(); - this._persistence.getItems(this._type, id, 0, function() { - return _this._$rootScope.$broadcast('loadedNewItems'); - }); + this._persistence.getItems(this._type, id, 0, (function(_this) { + return function() { + return _this._$rootScope.$broadcast('loadedNewItems'); + }; + })(this)); return this._activeFeed.handle({ id: id, type: this._type @@ -1439,7 +1467,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1459,8 +1488,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -1499,15 +1527,16 @@ License along with this library. If not, see . }; FeedBusinessLayer.prototype["delete"] = function(feedId) { - var data, feed, - _this = this; + var data, feed; feed = this._feedModel.removeById(feedId); data = { - undoCallback: function() { - return _this._persistence.restoreFeed(feedId, function() { - return _this._persistence.getAllFeeds(); - }); - }, + undoCallback: (function(_this) { + return function() { + return _this._persistence.restoreFeed(feedId, function() { + return _this._persistence.getAllFeeds(); + }); + }; + })(this), caption: feed.title }; this._$rootScope.$broadcast('undoMessage', data); @@ -1570,16 +1599,17 @@ License along with this library. If not, see . }; FeedBusinessLayer.prototype.setShowAll = function(showAll) { - var callback, - _this = this; + var callback; this._showAll.setShowAll(showAll); - callback = function() { - _this._itemModel.clear(); - _this._newLoading.increase(); - return _this._persistence.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() { - return _this._newLoading.decrease(); - }); - }; + callback = (function(_this) { + return function() { + _this._itemModel.clear(); + _this._newLoading.increase(); + return _this._persistence.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() { + return _this._newLoading.decrease(); + }); + }; + })(this); if (showAll) { return this._persistence.userSettingsReadShow(callback); } else { @@ -1639,7 +1669,7 @@ License along with this library. If not, see . return onSuccess(response); }; failure = function(response) { - feed.error = response.msg; + feed.error = response.message; return onFailure(); }; return this._persistence.createFeed(url, parentId, success, failure); @@ -1666,7 +1696,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1686,8 +1717,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -1715,8 +1745,7 @@ License along with this library. If not, see . }; FolderBusinessLayer.prototype["delete"] = function(folderId) { - var data, feed, feeds, folder, _i, _len, _ref, - _this = this; + var data, feed, feeds, folder, _i, _len, _ref; feeds = []; _ref = this._feedBusinessLayer.getFeedsOfFolder(folderId); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1725,12 +1754,14 @@ License along with this library. If not, see . } folder = this._folderModel.removeById(folderId); data = { - undoCallback: function() { - return _this._persistence.restoreFolder(folderId, function() { - _this._persistence.getAllFeeds(); - return _this._persistence.getAllFolders(); - }); - }, + undoCallback: (function(_this) { + return function() { + return _this._persistence.restoreFolder(folderId, function() { + _this._persistence.getAllFeeds(); + return _this._persistence.getAllFolders(); + }); + }; + })(this), caption: folder.name }; this._$rootScope.$broadcast('undoMessage', data); @@ -1841,7 +1872,7 @@ License along with this library. If not, see . return onSuccess(response); }; failure = function(response) { - folder.error = response.msg; + folder.error = response.message; return onFailure(); }; return this._persistence.createFolder(folderName, 0, success, failure); @@ -1879,40 +1910,41 @@ License along with this library. If not, see . }; FolderBusinessLayer.prototype._importElement = function(opml, parentFolderId) { - var item, _i, _len, _ref, _results, - _this = this; + var item, _i, _len, _ref, _results; _ref = opml.getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; - _results.push((function(item) { - var error, folder; - if (item.isFolder()) { - try { - return _this.create(item.getName(), function(data) { - return _this._importElement(item, data.folders[0].id); - }); - } catch (_error) { - error = _error; - if (error instanceof _ExistsError) { - folder = _this._folderModel.getByName(item.getName()); - _this.open(folder.id); - return _this._importElement(item, folder.id); - } else { - return console.info(error); + _results.push((function(_this) { + return function(item) { + var error, folder; + if (item.isFolder()) { + try { + return _this.create(item.getName(), function(data) { + return _this._importElement(item, data.folders[0].id); + }); + } catch (_error) { + error = _error; + if (error instanceof _ExistsError) { + folder = _this._folderModel.getByName(item.getName()); + _this.open(folder.id); + return _this._importElement(item, folder.id); + } else { + return console.info(error); + } } - } - } else { - try { - return _this._feedBusinessLayer.create(item.getUrl(), parentFolderId); - } catch (_error) { - error = _error; - if (!error instanceof _ExistsError) { - return console.info(error); + } else { + try { + return _this._feedBusinessLayer.create(item.getUrl(), parentFolderId); + } catch (_error) { + error = _error; + if (!error instanceof _ExistsError) { + return console.info(error); + } } } - } - })(item)); + }; + })(this)(item)); } return _results; }; @@ -1926,7 +1958,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -1946,8 +1979,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('ItemBusinessLayer', [ @@ -2075,7 +2107,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2095,8 +2128,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -2142,7 +2174,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2162,8 +2195,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -2227,7 +2259,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2247,8 +2280,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('Compact', function() { @@ -2274,7 +2306,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2294,8 +2327,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_ExistsError', function() { @@ -2313,7 +2345,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2333,8 +2366,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('FeedType', function() { @@ -2350,7 +2382,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2370,8 +2403,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; @@ -2411,7 +2443,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2431,8 +2464,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_Loading', function() { @@ -2466,7 +2498,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2486,8 +2519,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_Model', function() { @@ -2500,10 +2532,10 @@ License along with this library. If not, see . } Model.prototype.handle = function(data) { + /* Redirects to add method - */ - + */ var item, _i, _len, _results; _results = []; for (_i = 0, _len = data.length; _i < _len; _i++) { @@ -2517,10 +2549,10 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* Adds a new entry or updates an entry if the id exists already - */ - + */ if (clearCache) { this._invalidateCache(); } @@ -2537,10 +2569,10 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* Update an entry by searching for its id - */ - + */ if (clearCache) { this._invalidateCache(); } @@ -2558,18 +2590,18 @@ License along with this library. If not, see . }; Model.prototype.getById = function(id) { + /* Return an entry by its id - */ - + */ return this._dataMap[id]; }; Model.prototype.getAll = function() { + /* Returns all stored entries - */ - + */ return this._data; }; @@ -2578,10 +2610,10 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* Remove an entry by id - */ - + */ _ref = this._data; for (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) { entry = _ref[counter]; @@ -2598,10 +2630,10 @@ License along with this library. If not, see . }; Model.prototype.clear = function() { + /* Removes all cached elements - */ - + */ this._data.length = 0; this._dataMap = {}; return this._invalidateCache(); @@ -2612,10 +2644,10 @@ License along with this library. If not, see . }; Model.prototype.get = function(query) { + /* Calls, caches and returns filtered results - */ - + */ var hash; hash = query.hashCode(); if (!angular.isDefined(this._filterCache[hash])) { @@ -2625,10 +2657,10 @@ License along with this library. If not, see . }; Model.prototype.size = function() { + /* Return the number of all stored entries - */ - + */ return this._data.length; }; @@ -2640,7 +2672,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2660,8 +2693,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -2694,12 +2726,12 @@ License along with this library. If not, see . } else if (angular.isDefined(data.faviconLink) && data.faviconLink.indexOf('url(') !== 0) { data.faviconLink = 'url(' + data.faviconLink + ')'; } + /* We want to add a feed on the client side before we have an id from the server. Once the server returns an id, we have to update the existing item without id - */ - + */ item = this._url[data.url]; updateById = angular.isDefined(data.id) && angular.isDefined(this.getById(data.id)); updateByUrl = angular.isDefined(item) && angular.isUndefined(item.id); @@ -2800,10 +2832,10 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* Remove an entry by id - */ - + */ _ref = this._dataMap; for (key in _ref) { value = _ref[key]; @@ -2839,7 +2871,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -2859,8 +2892,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -2882,12 +2914,12 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* We want to add a folder on the client side before we have an id from the server. Once the server returns an id, we have to update the existing item without id - */ - + */ data.name = this._transformName(data.name); item = this._nameCache[data.name]; updateById = angular.isDefined(data.id) && angular.isDefined(this.getById(data.id)); @@ -2959,10 +2991,10 @@ License along with this library. If not, see . if (clearCache == null) { clearCache = true; } + /* Remove an entry by id - */ - + */ name = name.toLowerCase(); _ref = this._dataMap; for (key in _ref) { @@ -2999,7 +3031,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3019,8 +3052,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { var __hasProp = {}.hasOwnProperty, @@ -3144,7 +3176,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3164,8 +3197,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('NewestItem', function() { @@ -3191,7 +3223,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3211,8 +3244,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('Notification', function() { @@ -3221,7 +3253,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3241,8 +3274,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_NotImplementedError', function() { @@ -3264,7 +3296,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3284,8 +3317,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('OPMLParser', function() { @@ -3376,7 +3408,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -3396,8 +3429,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('Persistence', [ @@ -3417,33 +3449,35 @@ License along with this library. If not, see . } Persistence.prototype.init = function() { + /* Loads the initial data from the server - */ - - var successCallback, - _this = this; + */ + var successCallback; this.deferred = $q.defer(); this.getAllFolders(); - successCallback = function() { - return _this.deferred.resolve(); - }; + successCallback = (function(_this) { + return function() { + return _this.deferred.resolve(); + }; + })(this); this.getAllFeeds(successCallback); this.getSettings(); - this.getActiveFeed(function() { - return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId()); - }); + this.getActiveFeed((function(_this) { + return function() { + return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId()); + }; + })(this)); return this.deferred.promise; }; + /* ITEM CONTROLLER - */ - + */ Persistence.prototype.getItems = function(type, id, offset, onSuccess) { - var failureCallbackWrapper, lastChange, loading, params, successCallbackWrapper, - _this = this; + var failureCallbackWrapper, lastChange, loading, params, successCallbackWrapper; if (offset == null) { offset = 0; } @@ -3461,15 +3495,17 @@ License along with this library. If not, see . loading.increase(); successCallbackWrapper = function() {}; lastChange = this._lastFeedChange; - (function(lastChange, offset, loading, onSuccess) { - return successCallbackWrapper = function(data) { - if (data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { - _this._preventUselessAutoPageRequest = true; - } - onSuccess(data); - return loading.decrease(); - }; - })(lastChange, offset, loading, onSuccess); + (function(_this) { + return (function(lastChange, offset, loading, onSuccess) { + return successCallbackWrapper = function(data) { + if (data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { + _this._preventUselessAutoPageRequest = true; + } + onSuccess(data); + return loading.decrease(); + }; + }); + })(this)(lastChange, offset, loading, onSuccess); failureCallbackWrapper = function(data) { return loading.decrease(); }; @@ -3507,10 +3543,10 @@ License along with this library. If not, see . }; Persistence.prototype.starItem = function(feedId, guidHash) { + /* Stars an item - */ - + */ var params; params = { routeParams: { @@ -3522,10 +3558,10 @@ License along with this library. If not, see . }; Persistence.prototype.unstarItem = function(feedId, guidHash) { + /* Unstars an item - */ - + */ var params; params = { routeParams: { @@ -3537,10 +3573,10 @@ License along with this library. If not, see . }; Persistence.prototype.readItem = function(itemId) { + /* Sets an item as read - */ - + */ var params; params = { routeParams: { @@ -3551,10 +3587,10 @@ License along with this library. If not, see . }; Persistence.prototype.unreadItem = function(itemId) { + /* Sets an item as unread - */ - + */ var params; params = { routeParams: { @@ -3565,10 +3601,10 @@ License along with this library. If not, see . }; Persistence.prototype.setAllRead = function(highestItemId) { + /* sets all items as read - */ - + */ var params; params = { data: { @@ -3578,27 +3614,30 @@ License along with this library. If not, see . return this._request.post('/apps/news/items/read', params); }; + /* FEED CONTROLLER - */ - + */ Persistence.prototype.getAllFeeds = function(onSuccess, showLoading) { - var failureCallbackWrapper, params, successCallbackWrapper, - _this = this; + var failureCallbackWrapper, params, successCallbackWrapper; if (showLoading == null) { showLoading = true; } onSuccess || (onSuccess = function() {}); if (showLoading) { this._feedLoading.increase(); - successCallbackWrapper = function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - failureCallbackWrapper = function(data) { - return _this._feedLoading.decrease(); - }; + successCallbackWrapper = (function(_this) { + return function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + })(this); + failureCallbackWrapper = (function(_this) { + return function(data) { + return _this._feedLoading.decrease(); + }; + })(this); } else { successCallbackWrapper = function(data) { return onSuccess(); @@ -3613,16 +3652,19 @@ License along with this library. If not, see . }; Persistence.prototype.getActiveFeed = function(onSuccess) { - var failureCallbackWrapper, params, successCallbackWrapper, - _this = this; + var failureCallbackWrapper, params, successCallbackWrapper; this._feedLoading.increase(); - successCallbackWrapper = function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - failureCallbackWrapper = function(data) { - return _this._feedLoading.decrease(); - }; + successCallbackWrapper = (function(_this) { + return function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + })(this); + failureCallbackWrapper = (function(_this) { + return function(data) { + return _this._feedLoading.decrease(); + }; + })(this); params = { onSuccess: successCallbackWrapper, onFailure: failureCallbackWrapper @@ -3677,10 +3719,10 @@ License along with this library. If not, see . }; Persistence.prototype.moveFeed = function(feedId, folderId) { + /* moves a feed to a new folder - */ - + */ var params; params = { routeParams: { @@ -3694,10 +3736,10 @@ License along with this library. If not, see . }; Persistence.prototype.renameFeed = function(feedId, feedTitle) { + /* rename a feed - */ - + */ var params; params = { routeParams: { @@ -3711,10 +3753,10 @@ License along with this library. If not, see . }; Persistence.prototype.setFeedRead = function(feedId, highestItemId) { + /* sets all items of a feed as read - */ - + */ var params; params = { routeParams: { @@ -3728,10 +3770,10 @@ License along with this library. If not, see . }; Persistence.prototype.updateFeed = function(feedId) { + /* moves a feed to a new folder - */ - + */ var params; params = { routeParams: { @@ -3742,41 +3784,45 @@ License along with this library. If not, see . }; Persistence.prototype.importArticles = function(json, onSuccess) { - var params, - _this = this; + var params; params = { data: { json: json }, - onSuccess: function() { - _this.getAllFeeds(); - return onSuccess(); - } + onSuccess: (function(_this) { + return function() { + _this.getAllFeeds(); + return onSuccess(); + }; + })(this) }; return this._request.post('/apps/news/feeds/import/articles', params); }; + /* FOLDER CONTROLLER - */ - + */ Persistence.prototype.getAllFolders = function(onSuccess, showLoading) { - var failureCallbackWrapper, params, successCallbackWrapper, - _this = this; + var failureCallbackWrapper, params, successCallbackWrapper; if (showLoading == null) { showLoading = true; } onSuccess || (onSuccess = function() {}); if (showLoading) { this._feedLoading.increase(); - successCallbackWrapper = function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - failureCallbackWrapper = function(data) { - return _this._feedLoading.decrease(); - }; + successCallbackWrapper = (function(_this) { + return function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + })(this); + failureCallbackWrapper = (function(_this) { + return function(data) { + return _this._feedLoading.decrease(); + }; + })(this); } else { successCallbackWrapper = function(data) { return onSuccess(); @@ -3791,10 +3837,10 @@ License along with this library. If not, see . }; Persistence.prototype.openFolder = function(folderId) { + /* Save if a folder was opened - */ - + */ var params; params = { routeParams: { @@ -3805,10 +3851,10 @@ License along with this library. If not, see . }; Persistence.prototype.collapseFolder = function(folderId) { + /* Save if a folder was collapsed - */ - + */ var params; params = { routeParams: { @@ -3843,10 +3889,10 @@ License along with this library. If not, see . }; Persistence.prototype.deleteFolder = function(folderId) { + /* Save if a folder was collapsed - */ - + */ var params; params = { routeParams: { @@ -3872,10 +3918,10 @@ License along with this library. If not, see . }; Persistence.prototype.renameFolder = function(folderId, folderName) { + /* Save if a folder was collapsed - */ - + */ var params; params = { routeParams: { @@ -3889,10 +3935,10 @@ License along with this library. If not, see . }; Persistence.prototype.setFolderRead = function(folderId, highestItemId) { + /* sets all items of a folder as read - */ - + */ var params; params = { routeParams: { @@ -3905,29 +3951,29 @@ License along with this library. If not, see . return this._request.post('/apps/news/folders/{folderId}/read', params); }; + /* EXPORT CONTROLLER - */ - + */ Persistence.prototype.exportOPML = function() { + /* Prompts for an OPML download - */ - + */ return this._request.get('/apps/news/export/opml'); }; + /* USERSETTINGS CONTROLLER - */ - + */ Persistence.prototype.userSettingsReadShow = function(callback) { + /* Sets the reader mode to show all - */ - + */ var data; data = { showAll: true @@ -3936,10 +3982,10 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsReadHide = function(callback) { + /* Sets the reader mode to show only unread - */ - + */ var data; data = { showAll: false @@ -3948,10 +3994,10 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsSetCompact = function(isCompact) { + /* sets all items of a folder as read - */ - + */ var data; data = { compact: isCompact @@ -3986,7 +4032,8 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -4006,8 +4053,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU Affero General Public License along with this library. If not, see . -*/ - + */ (function() { angular.module('News').factory('_Publisher', function() { @@ -4042,7 +4088,8 @@ License along with this library. If not, see