From 88b8803e65c3383244591cbbde33b96fac761ecc Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 18 Mar 2014 20:20:57 +0100 Subject: fix autofocus when loading unread articles and initial view --- js/public/app.js | 916 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 494 insertions(+), 422 deletions(-) (limited to 'js/public/app.js') diff --git a/js/public/app.js b/js/public/app.js index d77220b72..344303d60 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', ['OC', 'ui']).config(function($provide) { @@ -66,7 +66,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 @@ -86,8 +87,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() { @@ -118,7 +118,24 @@ 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; + return directive = { + restrict: 'A', + link: function(scope, elm, attrs) { + return $(window).load(function() { + return $(elm).focus(); + }); + } + }; + }); + +}).call(this); + +// Generated by CoffeeScript 1.7.1 + /* ownCloud - News @@ -138,8 +155,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', [ @@ -169,7 +185,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 @@ -189,8 +206,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', [ @@ -312,7 +328,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 @@ -332,8 +349,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', [ @@ -361,7 +377,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 @@ -381,8 +398,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; @@ -444,7 +460,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 @@ -464,8 +481,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', [ @@ -495,7 +511,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 @@ -515,8 +532,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() { @@ -533,7 +549,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 @@ -553,8 +570,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', [ @@ -596,7 +612,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 @@ -616,8 +633,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', [ @@ -625,16 +641,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); } @@ -647,7 +664,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 @@ -667,8 +685,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', [ @@ -676,7 +693,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; @@ -694,83 +710,95 @@ 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() { - 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; @@ -782,7 +810,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 @@ -802,8 +831,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', [ @@ -811,7 +839,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; @@ -823,60 +850,80 @@ 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(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._$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.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; @@ -888,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 @@ -908,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').controller('SettingsController', [ @@ -953,7 +1000,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 @@ -973,18 +1021,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; } @@ -1010,7 +1057,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 @@ -1030,8 +1078,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() { @@ -1046,12 +1093,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 @@ -1070,7 +1118,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 @@ -1090,8 +1139,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, @@ -1130,15 +1178,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); @@ -1201,16 +1250,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 { @@ -1298,7 +1348,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 @@ -1318,8 +1369,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, @@ -1347,8 +1397,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++) { @@ -1357,12 +1406,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); @@ -1512,40 +1563,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; }; @@ -1559,7 +1611,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 @@ -1579,8 +1632,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', [ @@ -1708,7 +1760,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 @@ -1728,8 +1781,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, @@ -1775,7 +1827,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 @@ -1795,8 +1848,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, @@ -1860,7 +1912,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 @@ -1880,8 +1933,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() { @@ -1907,7 +1959,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 @@ -1927,8 +1980,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() { @@ -1946,7 +1998,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 @@ -1966,8 +2019,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() { @@ -1983,7 +2035,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 @@ -2003,8 +2056,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; }; @@ -2044,7 +2096,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 @@ -2064,8 +2117,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, @@ -2098,12 +2150,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); @@ -2204,10 +2256,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]; @@ -2243,7 +2295,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 @@ -2263,8 +2316,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, @@ -2286,12 +2338,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)); @@ -2363,10 +2415,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) { @@ -2403,7 +2455,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 @@ -2423,8 +2476,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, @@ -2548,7 +2600,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 @@ -2568,8 +2621,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() { @@ -2595,7 +2647,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 @@ -2615,8 +2668,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() { @@ -2707,7 +2759,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 @@ -2727,8 +2780,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', [ @@ -2748,35 +2800,37 @@ 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.userSettingsRead(); this.userSettingsLanguage(); this.userSettingsIsCompact(); - 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; } @@ -2794,15 +2848,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.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.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(); }; @@ -2840,10 +2896,10 @@ License along with this library. If not, see . }; Persistence.prototype.starItem = function(feedId, guidHash) { + /* Stars an item - */ - + */ var params; params = { routeParams: { @@ -2855,10 +2911,10 @@ License along with this library. If not, see . }; Persistence.prototype.unstarItem = function(feedId, guidHash) { + /* Unstars an item - */ - + */ var params; params = { routeParams: { @@ -2870,10 +2926,10 @@ License along with this library. If not, see . }; Persistence.prototype.readItem = function(itemId) { + /* Sets an item as read - */ - + */ var params; params = { routeParams: { @@ -2884,10 +2940,10 @@ License along with this library. If not, see . }; Persistence.prototype.unreadItem = function(itemId) { + /* Sets an item as unread - */ - + */ var params; params = { routeParams: { @@ -2898,10 +2954,10 @@ License along with this library. If not, see . }; Persistence.prototype.setAllRead = function(highestItemId) { + /* sets all items as read - */ - + */ var params; params = { data: { @@ -2911,27 +2967,30 @@ 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, - _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(); @@ -2946,16 +3005,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 @@ -3010,10 +3072,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: { @@ -3027,10 +3089,10 @@ License along with this library. If not, see . }; Persistence.prototype.renameFeed = function(feedId, feedTitle) { + /* rename a feed - */ - + */ var params; params = { routeParams: { @@ -3044,10 +3106,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: { @@ -3061,10 +3123,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: { @@ -3075,41 +3137,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('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(); @@ -3124,10 +3190,10 @@ License along with this library. If not, see . }; Persistence.prototype.openFolder = function(folderId) { + /* Save if a folder was opened - */ - + */ var params; params = { routeParams: { @@ -3138,10 +3204,10 @@ License along with this library. If not, see . }; Persistence.prototype.collapseFolder = function(folderId) { + /* Save if a folder was collapsed - */ - + */ var params; params = { routeParams: { @@ -3176,10 +3242,10 @@ License along with this library. If not, see . }; Persistence.prototype.deleteFolder = function(folderId) { + /* Save if a folder was collapsed - */ - + */ var params; params = { routeParams: { @@ -3205,10 +3271,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: { @@ -3222,10 +3288,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: { @@ -3238,43 +3304,46 @@ License along with this library. If not, see . return this._request.post('news_folders_read', params); }; + /* EXPORT CONTROLLER - */ - + */ 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, - _this = this; + var failureCallbackWrapper, params, successCallbackWrapper; if (onSuccess == null) { onSuccess = null; } + /* Gets the configs for read settings - */ - + */ onSuccess || (onSuccess = function() {}); 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 @@ -3283,10 +3352,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 @@ -3295,10 +3364,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 @@ -3307,20 +3376,23 @@ License along with this library. If not, see . }; Persistence.prototype.userSettingsLanguage = function(onSuccess) { - var data, failureCallbackWrapper, successCallbackWrapper, - _this = this; + var data, failureCallbackWrapper, successCallbackWrapper; if (onSuccess == null) { onSuccess = null; } onSuccess || (onSuccess = function() {}); 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); data = { onSuccess: successCallbackWrapper, onFailure: failureCallbackWrapper @@ -3333,10 +3405,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: { @@ -3359,7 +3431,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 @@ -3379,8 +3452,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('Request', [ @@ -3426,7 +3498,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 @@ -3446,8 +3519,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('ShowAll', function() { @@ -3477,7 +3549,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 @@ -3497,8 +3570,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('StarredCount', function() { @@ -3528,7 +3600,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 @@ -3548,8 +3621,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('StatusFlag', function() { @@ -3563,7 +3635,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 @@ -3583,8 +3656,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('unreadCountFormatter', function() { -- cgit v1.2.3