From ee3776b3673b94266a39bcc4751cfcd7f57e2cc6 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 26 Mar 2014 01:33:40 +0100 Subject: fix tests --- js/public/app.js | 899 ++++++++++++++++++++++++++----------------------------- 1 file changed, 423 insertions(+), 476 deletions(-) (limited to 'js/public/app.js') diff --git a/js/public/app.js b/js/public/app.js index 980078780..2b8965484 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -10,8 +10,7 @@ */ -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -31,7 +30,8 @@ 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', ['OC', 'ui']).config(function($provide) { @@ -66,8 +66,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -87,7 +86,8 @@ 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() { @@ -118,6 +118,7 @@ License along with this library. If not, see . }).call(this); +// Generated by CoffeeScript 1.6.3 (function() { angular.module('News').directive('newsAutoFocus', function() { var directive; @@ -133,6 +134,7 @@ License along with this library. If not, see . }).call(this); +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -152,7 +154,8 @@ 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', [ @@ -182,8 +185,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -203,7 +205,8 @@ 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', [ @@ -325,8 +328,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -346,7 +348,8 @@ 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', [ @@ -374,8 +377,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -395,7 +397,8 @@ 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; @@ -457,8 +460,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -478,7 +480,8 @@ 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', [ @@ -508,8 +511,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -529,7 +531,8 @@ 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() { @@ -546,8 +549,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -567,7 +569,8 @@ 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', [ @@ -609,8 +612,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -630,7 +632,8 @@ 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', [ @@ -638,17 +641,16 @@ License along with this library. If not, see . var AppController; AppController = (function() { function AppController(_$scope, _persistence, _feedBusinessLayer) { - var successCallback; + var successCallback, + _this = this; this._$scope = _$scope; this._persistence = _persistence; this._feedBusinessLayer = _feedBusinessLayer; this._$scope.initialized = false; this._$scope.feedBusinessLayer = this._feedBusinessLayer; - successCallback = (function(_this) { - return function() { - return _this._$scope.initialized = true; - }; - })(this); + successCallback = function() { + return _this._$scope.initialized = true; + }; this._persistence.init().then(successCallback); } @@ -661,8 +663,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -682,7 +683,8 @@ 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', [ @@ -690,6 +692,7 @@ 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; @@ -707,95 +710,83 @@ License along with this library. If not, see . this._$scope.subscriptionsBusinessLayer = this._subscriptionsBusinessLayer; this._$scope.starredBusinessLayer = this._starredBusinessLayer; this._$scope.unreadCountFormatter = this._unreadCountFormatter; - 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'; - } - 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.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.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; - } + _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; } - }; - })(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._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() { return _this._isAddingFolder = false; + }); + } catch (_error) { + error = _error; + if (error instanceof _ExistsError) { + _this._$scope.folderExistsError = true; } - }; - })(this); - this._$scope.$on('moveFeedToFolder', (function(_this) { - return function(scope, data) { - return _this._feedBusinessLayer.move(data.feedId, data.folderId); - }; - })(this)); + return _this._isAddingFolder = false; + } + }; + this._$scope.$on('moveFeedToFolder', function(scope, data) { + return _this._feedBusinessLayer.move(data.feedId, data.folderId); + }); } return FeedController; @@ -807,8 +798,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -828,7 +818,8 @@ 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', [ @@ -836,6 +827,7 @@ 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; @@ -847,80 +839,60 @@ License along with this library. If not, see . this._autoPaging = true; this._$scope.itemBusinessLayer = this._itemBusinessLayer; this._$scope.feedBusinessLayer = this._feedBusinessLayer; - this._$scope.edit = (function(_this) { - return function(feedId) { - var feed; - feed = _this._feedModel.getById(feedId); - feed.editing = true; - return feed.originalValue = feed.title; - }; - })(this); - this._$scope.cancel = (function(_this) { - return function(feedId) { - var feed; - feed = _this._feedModel.getById(feedId); - feed.editing = false; - return feed.title = feed.originalValue; - }; - })(this); - 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.edit = function(feedId) { + var feed; + feed = _this._feedModel.getById(feedId); + feed.editing = true; + return feed.originalValue = feed.title; + }; + this._$scope.cancel = function(feedId) { + var feed; + feed = _this._feedModel.getById(feedId); + feed.editing = false; + return feed.title = feed.originalValue; + }; + 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); - 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); + } + }); + this._$scope.isCompactView = function() { + return _this._compact.isCompact(); + }; } return ItemController; @@ -932,8 +904,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -953,7 +924,8 @@ 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', [ @@ -997,8 +969,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1018,17 +989,18 @@ 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; } @@ -1054,8 +1026,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1075,7 +1046,8 @@ 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() { @@ -1090,13 +1062,12 @@ 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(_this) { - return function() { - return _this._$rootScope.$broadcast('loadedNewItems'); - }; - })(this)); + this._persistence.getItems(this._type, id, 0, function() { + return _this._$rootScope.$broadcast('loadedNewItems'); + }); return this._activeFeed.handle({ id: id, type: this._type @@ -1115,8 +1086,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1136,7 +1106,8 @@ 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, @@ -1175,16 +1146,15 @@ License along with this library. If not, see . }; FeedBusinessLayer.prototype["delete"] = function(feedId) { - var data, feed; + var data, feed, + _this = this; feed = this._feedModel.removeById(feedId); data = { - undoCallback: (function(_this) { - return function() { - return _this._persistence.restoreFeed(feedId, function() { - return this._persistence.getAllFeeds(); - }); - }; - })(this), + undoCallback: function() { + return _this._persistence.restoreFeed(feedId, function() { + return this._persistence.getAllFeeds(); + }); + }, caption: feed.title }; this._$rootScope.$broadcast('undoMessage', data); @@ -1247,17 +1217,16 @@ License along with this library. If not, see . }; FeedBusinessLayer.prototype.setShowAll = function(showAll) { - var callback; + var callback, + _this = this; this._showAll.setShowAll(showAll); - 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); + callback = function() { + _this._itemModel.clear(); + _this._newLoading.increase(); + return _this._persistence.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() { + return _this._newLoading.decrease(); + }); + }; if (showAll) { return this._persistence.userSettingsReadShow(callback); } else { @@ -1345,8 +1314,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1366,7 +1334,8 @@ 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, @@ -1394,7 +1363,8 @@ License along with this library. If not, see . }; FolderBusinessLayer.prototype["delete"] = function(folderId) { - var data, feed, feeds, folder, _i, _len, _ref; + var data, feed, feeds, folder, _i, _len, _ref, + _this = this; feeds = []; _ref = this._feedBusinessLayer.getFeedsOfFolder(folderId); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1403,14 +1373,12 @@ License along with this library. If not, see . } folder = this._folderModel.removeById(folderId); data = { - undoCallback: (function(_this) { - return function() { - return _this._persistence.restoreFolder(folderId, function() { - _this._persistence.getAllFeeds(); - return _this._persistence.getAllFolders(); - }); - }; - })(this), + undoCallback: function() { + return _this._persistence.restoreFolder(folderId, function() { + _this._persistence.getAllFeeds(); + return _this._persistence.getAllFolders(); + }); + }, caption: folder.name }; this._$rootScope.$broadcast('undoMessage', data); @@ -1560,41 +1528,40 @@ License along with this library. If not, see . }; FolderBusinessLayer.prototype._importElement = function(opml, parentFolderId) { - var item, _i, _len, _ref, _results; + var item, _i, _len, _ref, _results, + _this = this; _ref = opml.getItems(); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; - _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); - } + _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); } - } 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); } } - }; - })(this)(item)); + } + })(item)); } return _results; }; @@ -1608,8 +1575,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1629,7 +1595,8 @@ 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', [ @@ -1757,8 +1724,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1778,7 +1744,8 @@ 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, @@ -1824,8 +1791,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1845,7 +1811,8 @@ 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, @@ -1909,8 +1876,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1930,7 +1896,8 @@ 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() { @@ -1956,8 +1923,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -1977,7 +1943,8 @@ 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() { @@ -1995,8 +1962,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2016,7 +1982,8 @@ 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() { @@ -2032,8 +1999,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2053,7 +2019,8 @@ 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; }; @@ -2093,8 +2060,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2114,7 +2080,8 @@ 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, @@ -2147,12 +2114,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); @@ -2253,10 +2220,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]; @@ -2292,8 +2259,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2313,7 +2279,8 @@ 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, @@ -2335,12 +2302,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)); @@ -2412,10 +2379,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) { @@ -2452,8 +2419,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2473,7 +2439,8 @@ 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, @@ -2597,8 +2564,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2618,7 +2584,8 @@ 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() { @@ -2644,8 +2611,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2665,7 +2631,8 @@ 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() { @@ -2756,8 +2723,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -2777,7 +2743,8 @@ 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', [ @@ -2797,37 +2764,35 @@ License along with this library. If not, see . } Persistence.prototype.init = function() { - /* Loads the initial data from the server - */ - var successCallback; + */ + + var successCallback, + _this = this; this.deferred = $q.defer(); this.getAllFolders(); - successCallback = (function(_this) { - return function() { - return _this.deferred.resolve(); - }; - })(this); + successCallback = function() { + return _this.deferred.resolve(); + }; this.getAllFeeds(successCallback); this.userSettingsRead(); this.userSettingsLanguage(); this.userSettingsIsCompact(); - this.getActiveFeed((function(_this) { - return function() { - return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId()); - }; - })(this)); + this.getActiveFeed(function() { + return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId()); + }); return this.deferred.promise; }; - /* ITEM CONTROLLER - */ + */ + Persistence.prototype.getItems = function(type, id, offset, onSuccess) { - var failureCallbackWrapper, lastChange, loading, params, successCallbackWrapper; + var failureCallbackWrapper, lastChange, loading, params, successCallbackWrapper, + _this = this; if (offset == null) { offset = 0; } @@ -2845,17 +2810,15 @@ License along with this library. If not, see . loading.increase(); successCallbackWrapper = function() {}; lastChange = this._lastFeedChange; - (function(_this) { - return (function(lastChange, offset, loading, onSuccess) { - return successCallbackWrapper = function(data) { - if (data.data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { - _this._preventUselessAutoPageRequest = true; - } - onSuccess(data); - return loading.decrease(); - }; - }); - })(this)(lastChange, offset, loading, onSuccess); + (function(lastChange, offset, loading, onSuccess) { + return successCallbackWrapper = function(data) { + if (data.data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { + _this._preventUselessAutoPageRequest = true; + } + onSuccess(data); + return loading.decrease(); + }; + })(lastChange, offset, loading, onSuccess); failureCallbackWrapper = function(data) { return loading.decrease(); }; @@ -2893,10 +2856,10 @@ License along with this library. If not, see . }; Persistence.prototype.starItem = function(feedId, guidHash) { - /* Stars an item - */ + */ + var params; params = { routeParams: { @@ -2908,10 +2871,10 @@ License along with this library. If not, see . }; Persistence.prototype.unstarItem = function(feedId, guidHash) { - /* Unstars an item - */ + */ + var params; params = { routeParams: { @@ -2923,10 +2886,10 @@ License along with this library. If not, see . }; Persistence.prototype.readItem = function(itemId) { - /* Sets an item as read - */ + */ + var params; params = { routeParams: { @@ -2937,10 +2900,10 @@ License along with this library. If not, see . }; Persistence.prototype.unreadItem = function(itemId) { - /* Sets an item as unread - */ + */ + var params; params = { routeParams: { @@ -2951,10 +2914,10 @@ License along with this library. If not, see . }; Persistence.prototype.setAllRead = function(highestItemId) { - /* sets all items as read - */ + */ + var params; params = { data: { @@ -2964,30 +2927,27 @@ License along with this library. If not, see . return this._request.post('news_items_all_read', params); }; - /* FEED CONTROLLER - */ + */ + Persistence.prototype.getAllFeeds = function(onSuccess, showLoading) { - var failureCallbackWrapper, params, successCallbackWrapper; + var failureCallbackWrapper, params, successCallbackWrapper, + _this = this; if (showLoading == null) { showLoading = true; } onSuccess || (onSuccess = function() {}); if (showLoading) { this._feedLoading.increase(); - successCallbackWrapper = (function(_this) { - return function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - })(this); - failureCallbackWrapper = (function(_this) { - return function(data) { - return _this._feedLoading.decrease(); - }; - })(this); + successCallbackWrapper = function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + failureCallbackWrapper = function(data) { + return _this._feedLoading.decrease(); + }; } else { successCallbackWrapper = function(data) { return onSuccess(); @@ -3002,19 +2962,16 @@ License along with this library. If not, see . }; Persistence.prototype.getActiveFeed = function(onSuccess) { - var failureCallbackWrapper, params, successCallbackWrapper; + var failureCallbackWrapper, params, successCallbackWrapper, + _this = this; this._feedLoading.increase(); - successCallbackWrapper = (function(_this) { - return function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - })(this); - failureCallbackWrapper = (function(_this) { - return function(data) { - return _this._feedLoading.decrease(); - }; - })(this); + successCallbackWrapper = function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + failureCallbackWrapper = function(data) { + return _this._feedLoading.decrease(); + }; params = { onSuccess: successCallbackWrapper, onFailure: failureCallbackWrapper @@ -3069,10 +3026,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: { @@ -3086,10 +3043,10 @@ License along with this library. If not, see . }; Persistence.prototype.renameFeed = function(feedId, feedTitle) { - /* rename a feed - */ + */ + var params; params = { routeParams: { @@ -3103,10 +3060,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: { @@ -3120,10 +3077,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: { @@ -3134,45 +3091,41 @@ License along with this library. If not, see . }; Persistence.prototype.importArticles = function(json, onSuccess) { - var params; + var params, + _this = this; params = { data: { json: json }, - onSuccess: (function(_this) { - return function() { - _this.getAllFeeds(); - return onSuccess(); - }; - })(this) + onSuccess: function() { + _this.getAllFeeds(); + return onSuccess(); + } }; return this._request.post('news_feeds_import_articles', params); }; - /* FOLDER CONTROLLER - */ + */ + Persistence.prototype.getAllFolders = function(onSuccess, showLoading) { - var failureCallbackWrapper, params, successCallbackWrapper; + var failureCallbackWrapper, params, successCallbackWrapper, + _this = this; if (showLoading == null) { showLoading = true; } onSuccess || (onSuccess = function() {}); if (showLoading) { this._feedLoading.increase(); - successCallbackWrapper = (function(_this) { - return function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - })(this); - failureCallbackWrapper = (function(_this) { - return function(data) { - return _this._feedLoading.decrease(); - }; - })(this); + successCallbackWrapper = function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + failureCallbackWrapper = function(data) { + return _this._feedLoading.decrease(); + }; } else { successCallbackWrapper = function(data) { return onSuccess(); @@ -3187,10 +3140,10 @@ License along with this library. If not, see . }; Persistence.prototype.openFolder = function(folderId) { - /* Save if a folder was opened - */ + */ + var params; params = { routeParams: { @@ -3201,10 +3154,10 @@ License along with this library. If not, see . }; Persistence.prototype.collapseFolder = function(folderId) { - /* Save if a folder was collapsed - */ + */ + var params; params = { routeParams: { @@ -3239,10 +3192,10 @@ License along with this library. If not, see . }; Persistence.prototype.deleteFolder = function(folderId) { - /* Save if a folder was collapsed - */ + */ + var params; params = { routeParams: { @@ -3268,10 +3221,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: { @@ -3285,10 +3238,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: { @@ -3301,46 +3254,43 @@ License along with this library. If not, see . return this._request.post('news_folders_read', params); }; - /* EXPORT CONTROLLER - */ + */ - Persistence.prototype.exportOPML = function() { + Persistence.prototype.exportOPML = function() { /* Prompts for an OPML download - */ + */ + return this._request.get('news_export_opml'); }; - /* USERSETTINGS CONTROLLER - */ + */ + Persistence.prototype.userSettingsRead = function(onSuccess) { - var failureCallbackWrapper, params, successCallbackWrapper; + var failureCallbackWrapper, params, successCallbackWrapper, + _this = this; if (onSuccess == null) { onSuccess = null; } - /* Gets the configs for read settings - */ + */ + onSuccess || (onSuccess = function() {}); this._feedLoading.increase(); - successCallbackWrapper = (function(_this) { - return function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - })(this); - failureCallbackWrapper = (function(_this) { - return function(data) { - return _this._feedLoading.decrease(); - }; - })(this); + successCallbackWrapper = function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + failureCallbackWrapper = function(data) { + return _this._feedLoading.decrease(); + }; params = { onSuccess: successCallbackWrapper, onFailure: failureCallbackWrapper @@ -3349,10 +3299,10 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsReadShow = function(callback) { - /* Sets the reader mode to show all - */ + */ + var data; data = { onSuccess: callback @@ -3361,10 +3311,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 = { onSuccess: callback @@ -3373,23 +3323,20 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsLanguage = function(onSuccess) { - var data, failureCallbackWrapper, successCallbackWrapper; + var data, failureCallbackWrapper, successCallbackWrapper, + _this = this; if (onSuccess == null) { onSuccess = null; } onSuccess || (onSuccess = function() {}); this._feedLoading.increase(); - successCallbackWrapper = (function(_this) { - return function(data) { - onSuccess(); - return _this._feedLoading.decrease(); - }; - })(this); - failureCallbackWrapper = (function(_this) { - return function(data) { - return _this._feedLoading.decrease(); - }; - })(this); + successCallbackWrapper = function(data) { + onSuccess(); + return _this._feedLoading.decrease(); + }; + failureCallbackWrapper = function(data) { + return _this._feedLoading.decrease(); + }; data = { onSuccess: successCallbackWrapper, onFailure: failureCallbackWrapper @@ -3402,10 +3349,10 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsSetCompact = function(isCompact) { - /* sets all items of a folder as read - */ + */ + var params; params = { data: { @@ -3428,8 +3375,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -3449,7 +3395,8 @@ 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('Request', [ @@ -3495,8 +3442,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -3516,7 +3462,8 @@ 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('ShowAll', function() { @@ -3546,8 +3493,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -3567,7 +3513,8 @@ 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('StarredCount', function() { @@ -3597,8 +3544,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -3618,7 +3564,8 @@ 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('StatusFlag', function() { @@ -3632,8 +3579,7 @@ License along with this library. If not, see . }).call(this); -// Generated by CoffeeScript 1.7.1 - +// Generated by CoffeeScript 1.6.3 /* ownCloud - News @@ -3653,7 +3599,8 @@ 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('unreadCountFormatter', function() { -- cgit v1.2.3