diff options
author | Bernhard Posselt <Raydiation@users.noreply.github.com> | 2013-09-03 07:02:34 -0700 |
---|---|---|
committer | Bernhard Posselt <Raydiation@users.noreply.github.com> | 2013-09-03 07:02:34 -0700 |
commit | 6e6db11d207007ab4077f7baa2e5d8265fdfab57 (patch) | |
tree | 4f6a136560b65aca2accb0067547cd2b36afa988 | |
parent | 3d2d9e8258405443ded6981662981c0f94342e0a (diff) | |
parent | 778f7b2be62f5573fb437b1c586dad0e19a31ea1 (diff) |
Merge pull request #326 from owncloud/first-run
First run page
-rw-r--r-- | css/addnew.css | 1 | ||||
-rw-r--r-- | css/firstrun.css | 41 | ||||
-rw-r--r-- | js/app/app.coffee | 2 | ||||
-rw-r--r-- | js/app/controllers/appcontroller.coffee | 42 | ||||
-rw-r--r-- | js/app/services/businesslayer/feedbusinesslayer.coffee | 3 | ||||
-rw-r--r-- | js/app/services/persistence.coffee | 15 | ||||
-rw-r--r-- | js/public/app.js | 412 | ||||
-rw-r--r-- | templates/main.php | 11 | ||||
-rw-r--r-- | templates/part.addnew.php | 9 | ||||
-rw-r--r-- | templates/part.firstrun.php | 3 |
10 files changed, 490 insertions, 49 deletions
diff --git a/css/addnew.css b/css/addnew.css index 87b7185d4..bc819abc9 100644 --- a/css/addnew.css +++ b/css/addnew.css @@ -26,7 +26,6 @@ } .add-new-popup { - display: none; padding: 15px 10px; } diff --git a/css/firstrun.css b/css/firstrun.css new file mode 100644 index 000000000..7467a7b2b --- /dev/null +++ b/css/firstrun.css @@ -0,0 +1,41 @@ +/** +* ownCloud - News +* +* @author Alessandro Cosentino +* @author Bernhard Posselt +* @copyright 2013 Alessandro Cosentino cosenal@gmail.com +* @copyright 2013 Bernhard Posselt dev@bernhard-posselt.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* 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 <http://www.gnu.org/licenses/>. +* +*/ + +#firstrun { + height: 100%; + margin-left: 300px; + position: relative; +} + +#firstrun .message { + color: #888888; + font-size: 1.5em; + font-weight: bold; + text-shadow: 0 1px 0 #FFFFFF; + position: absolute; + top: 50%; + text-align: center; + width: 100%; + margin-top: -0.75em; +} + diff --git a/js/app/app.coffee b/js/app/app.coffee index 9b33812ad..03a25c6c4 100644 --- a/js/app/app.coffee +++ b/js/app/app.coffee @@ -37,8 +37,6 @@ angular.module('News', ['OC', 'ui']).config ($provide) -> angular.module('News').run ['Persistence', 'Config', (Persistence, Config) -> - Persistence.init() - setInterval -> Persistence.getAllFeeds(null, false) Persistence.getAllFolders(null, false) diff --git a/js/app/controllers/appcontroller.coffee b/js/app/controllers/appcontroller.coffee new file mode 100644 index 000000000..bcb256077 --- /dev/null +++ b/js/app/controllers/appcontroller.coffee @@ -0,0 +1,42 @@ +### + +ownCloud - News + +@author Alessandro Cosentino +@copyright 2013 Alessandro Cosentino cosenal@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 <http://www.gnu.org/licenses/>. + +### + + +angular.module('News').controller 'AppController', +['$scope', 'Persistence', 'FeedBusinessLayer', +($scope, Persistence, FeedBusinessLayer) -> + + class AppController + + constructor: (@_$scope, @_persistence, @_feedBusinessLayer) -> + + @_$scope.initialized = false + @_$scope.feedBusinessLayer = @_feedBusinessLayer + + successCallback = => + @_$scope.initialized = true + + @_persistence.init().then(successCallback) + + return new AppController($scope, Persistence, FeedBusinessLayer) + +]
\ No newline at end of file diff --git a/js/app/services/businesslayer/feedbusinesslayer.coffee b/js/app/services/businesslayer/feedbusinesslayer.coffee index b26806ac8..cff714ac0 100644 --- a/js/app/services/businesslayer/feedbusinesslayer.coffee +++ b/js/app/services/businesslayer/feedbusinesslayer.coffee @@ -81,6 +81,9 @@ FeedModel, NewLoading, _ExistsError, Utils, $rootScope, NewestItem)-> getNumberOfFeeds: -> return @_feedModel.size() + noFeeds: -> + return @getNumberOfFeeds() == 0 + isVisible: (feedId) -> if @isActive(feedId) or @_showAll.getShowAll() diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee index 59a28489c..e1562fc46 100644 --- a/js/app/services/persistence.coffee +++ b/js/app/services/persistence.coffee @@ -22,9 +22,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').factory 'Persistence', ['Request', 'FeedLoading', 'AutoPageLoading', 'NewLoading', 'Config', -'ActiveFeed', '$rootScope', +'ActiveFeed', '$rootScope', '$q' (Request, FeedLoading, AutoPageLoading, NewLoading, Config, ActiveFeed, -$rootScope) -> +$rootScope, $q) -> class Persistence @@ -37,15 +37,22 @@ $rootScope) -> Loads the initial data from the server ### + @deferred = $q.defer() + # items can only be loaded after the active feed is known @getActiveFeed => @getItems(@_activeFeed.getType(), @_activeFeed.getId()) - + @getAllFolders() - @getAllFeeds() + + successCallback = => + @deferred.resolve() + + @getAllFeeds(successCallback) @userSettingsRead() @userSettingsLanguage() + @deferred.promise ### ITEM CONTROLLER diff --git a/js/public/app.js b/js/public/app.js index a4dda620b..b7c4b1aa8 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -1,3 +1,4 @@ +(function(angular, $, moment, undefined){ /** * ownCloud News App - v0.0.1 @@ -10,7 +11,7 @@ */ -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -36,6 +37,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { angular.module('News', ['OC', 'ui']).config(function($provide) { var config; + return $provide.value('Config', config = { markReadTimeout: 500, scrollTimeout: 500, @@ -48,7 +50,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').run([ 'Persistence', 'Config', function(Persistence, Config) { - Persistence.init(); return setInterval(function() { Persistence.getAllFeeds(null, false); return Persistence.getAllFolders(null, false); @@ -67,7 +68,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -93,6 +94,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { angular.module('News').directive('newsAudio', function() { var directive; + return directive = { restrict: 'E', scope: { @@ -103,6 +105,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. template: '' + '<audio controls="controls" preload="none" ng-hide="cantPlay()">' + '<source src="{{ src }}">' + '</audio>' + '<a href="{{ src }}" class="button" ng-show="cantPlay()" ' + 'ng-transclude></a>', link: function(scope, elm, attrs) { var cantPlay, source; + source = elm.children().children('source')[0]; cantPlay = false; source.addEventListener('error', function() { @@ -119,7 +122,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -147,6 +150,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. '$rootScope', function($rootScope) { return function(scope, elm, attr) { var $elem, details; + $elem = $(elm); details = { accept: '.feed', @@ -154,6 +158,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. greedy: true, drop: function(event, ui) { var data; + $('.drag-and-drop').removeClass('drag-and-drop'); data = { folderId: parseInt($elem.data('id'), 10), @@ -170,7 +175,101 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 +/* + +ownCloud - News + +@author Alessandro Cosentino +@copyright 2013 Alessandro Cosentino cosenal@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 <http://www.gnu.org/licenses/>. +*/ + + +(function() { + angular.module('News').directive('globalShortcuts', [ + '$window', function($window) { + return function(scope, elm, attr) { + var jumpTo; + + jumpTo = function($scrollArea, $item) { + var position; + + position = $item.offset().top - $scrollArea.offset().top + $scrollArea.scrollTop(); + return $scrollArea.scrollTop(position); + }; + return $($window.document).keydown(function(e) { + var focused; + + focused = $(':focus'); + if (!(focused.is('input') || focused.is('select') || focused.is('textarea') || focused.is('checkbox') || focused.is('button'))) { + if (e.keyCode === 191) { + return jumpToNextItem(scrollArea); + } + } + }); + }; + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.2 +/* + +ownCloud - News + +@author Alessandro Cosentino +@copyright 2013 Alessandro Cosentino cosenal@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 <http://www.gnu.org/licenses/>. +*/ + + +(function() { + angular.module('News').directive('hideOnClick', function() { + return function(scope, elm, attr) { + var options; + + options = scope.$eval(attr.hideOnClick); + if (angular.isDefined(options) && angular.isDefined(options.selector)) { + return $(elm).click(function() { + return $(options.selector).fadeOut(); + }); + } else { + return $(elm).click(function() { + return $(elm).fadeOut(); + }); + } + }; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -198,13 +297,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. '$window', function($window) { return function(scope, elm, attr) { var getCurrentItem, jumpTo, jumpToNextItem, jumpToPreviousItem, keepUnreadCurrentItem, openCurrentItem, starCurrentItem; + jumpTo = function($scrollArea, $item) { var position; + position = $item.offset().top - $scrollArea.offset().top + $scrollArea.scrollTop(); return $scrollArea.scrollTop(position); }; jumpToPreviousItem = function(scrollArea) { var $item, $items, $previous, $scrollArea, item, notJumped, _i, _len; + $scrollArea = $(scrollArea); $items = $scrollArea.find('.feed_item'); notJumped = true; @@ -226,6 +328,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; jumpToNextItem = function(scrollArea) { var $item, $items, $scrollArea, item, jumped, _i, _len; + $scrollArea = $(scrollArea); $items = $scrollArea.find('.feed_item'); jumped = false; @@ -244,6 +347,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; getCurrentItem = function(scrollArea) { var $item, $items, $scrollArea, item, _i, _len; + $scrollArea = $(scrollArea); $items = $scrollArea.find('.feed_item'); for (_i = 0, _len = $items.length; _i < _len; _i++) { @@ -256,22 +360,26 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; keepUnreadCurrentItem = function(scrollArea) { var $item; + $item = getCurrentItem(scrollArea); return $item.find('.keep_unread').trigger('click'); }; starCurrentItem = function(scrollArea) { var $item; + $item = getCurrentItem(scrollArea); return $item.find('.star').trigger('click'); }; openCurrentItem = function(scrollArea) { var $item; + $item = getCurrentItem(scrollArea).find('.item_title a'); $item.trigger('click'); return window.open($item.attr('href'), '_blank'); }; return $($window.document).keydown(function(e) { var focused, scrollArea; + focused = $(':focus'); if (!(focused.is('input') || focused.is('select') || focused.is('textarea') || focused.is('checkbox') || focused.is('button'))) { scrollArea = elm; @@ -297,7 +405,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -325,13 +433,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. '$timeout', function($timeout) { return function(scope, elm, attr) { var options; + options = scope.$eval(attr.newsClickScroll); return elm.click(function() { var direction, scrollArea; + scrollArea = $(options.scrollArea); direction = options.direction; return $timeout(function() { var scrollPosition; + if (direction === 'top') { scrollPosition = 0; } else { @@ -346,7 +457,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -381,6 +492,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return function(scope, elm, attr) { return elm.bind('scroll', function() { var counter, item, _i, _ref, _results; + if (scrolling) { scrolling = false; setTimeout(function() { @@ -390,6 +502,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. markingRead = false; setTimeout(function() { var $elems, feedItem, id, offset, _i, _len, _results; + markingRead = true; $elems = elm.find('.feed_item:not(.read)'); _results = []; @@ -429,7 +542,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -457,16 +570,19 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. '$rootScope', '$timeout', 'Config', function($rootScope, $timeout, Config) { return function(scope, elm, attr) { var caption, timeout, undo; + undo = function() {}; caption = ''; timeout = null; $(elm).click(function() { var timout; + timout = null; return $(this).fadeOut(); }); $(elm).find('a').click(function() { var timout; + undo(); timout = null; $rootScope.$apply(); @@ -477,6 +593,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; return scope.$on('undoMessage', function(scope, data) { var _this = this; + if (timeout) { $timeout.cancel(timeout.promise); } @@ -493,7 +610,60 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 +/* + +ownCloud - News + +@author Alessandro Cosentino +@copyright 2013 Alessandro Cosentino cosenal@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 <http://www.gnu.org/licenses/>. +*/ + + +(function() { + angular.module('News').controller('AppController', [ + '$scope', 'Persistence', 'FeedBusinessLayer', function($scope, Persistence, FeedBusinessLayer) { + var AppController; + + AppController = (function() { + function AppController(_$scope, _persistence, _feedBusinessLayer) { + var successCallback, + _this = this; + + 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; + }; + this._persistence.init().then(successCallback); + } + + return AppController; + + })(); + return new AppController($scope, Persistence, FeedBusinessLayer); + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -520,9 +690,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').controller('FeedController', [ '$scope', '_ExistsError', 'Persistence', 'FolderBusinessLayer', 'FeedBusinessLayer', 'SubscriptionsBusinessLayer', 'StarredBusinessLayer', 'unreadCountFormatter', 'ActiveFeed', 'FeedType', '$window', function($scope, _ExistsError, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType, $window) { 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; @@ -542,6 +714,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. this._$scope.unreadCountFormatter = this._unreadCountFormatter; this._$scope.getTotalUnreadCount = function() { var count, title, titleCount; + count = _this._subscriptionsBusinessLayer.getUnreadCount(0); if (count > 0) { titleCount = _this._unreadCountFormatter(count); @@ -562,6 +735,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; this._$scope.addFeed = function(feedUrl, parentFolderId) { var error; + if (parentFolderId == null) { parentFolderId = 0; } @@ -588,11 +762,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; 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; @@ -623,7 +799,60 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 +/* + +ownCloud - News + +@_author Alessandro Cosentino +@copyright 2013 Alessandro Cosentino cosenal@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +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 <http://www.gnu.org/licenses/>. +*/ + + +(function() { + angular.module('News').controller('InitController', [ + '$scope', 'Persistence', 'FeedBusinessLayer', function($scope, Persistence, FeedBusinessLayer) { + var InitController; + + InitController = (function() { + function InitController(_$scope, _persistence, _feedBusinessLayer) { + var successCallback, + _this = this; + + 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; + }; + this._persistence.init().then(successCallback); + } + + return InitController; + + })(); + return new InitController($scope, Persistence, FeedBusinessLayer); + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -650,9 +879,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').controller('ItemController', [ '$scope', 'ItemBusinessLayer', 'FeedModel', 'FeedLoading', 'FeedBusinessLayer', 'Language', 'AutoPageLoading', function($scope, ItemBusinessLayer, FeedModel, FeedLoading, FeedBusinessLayer, Language, AutoPageLoading) { var ItemController; + ItemController = (function() { function ItemController(_$scope, _itemBusinessLayer, _feedModel, _feedLoading, _autoPageLoading, _feedBusinessLayer, _language) { var _this = this; + this._$scope = _$scope; this._itemBusinessLayer = _itemBusinessLayer; this._feedModel = _feedModel; @@ -671,6 +902,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; this._$scope.getFeedTitle = function(feedId) { var feed; + feed = _this._feedModel.getById(feedId); if (angular.isDefined(feed)) { return feed.title; @@ -707,7 +939,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -734,9 +966,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').controller('SettingsController', [ '$scope', 'FeedBusinessLayer', 'FolderBusinessLayer', 'ShowAll', function($scope, FeedBusinessLayer, FolderBusinessLayer, ShowAll) { var _this = this; + $scope.feedBusinessLayer = FeedBusinessLayer; $scope["import"] = function(fileContent) { var error; + $scope.error = false; ShowAll.setShowAll(true); try { @@ -749,6 +983,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }; return $scope.importGoogleReader = function(fileContent) { var error, parsedJSON; + $scope.jsonError = false; ShowAll.setShowAll(true); try { @@ -765,7 +1000,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -791,12 +1026,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { angular.module('News').factory('ActiveFeed', function() { var ActiveFeed; + ActiveFeed = (function() { function ActiveFeed() { /* Default value is all feeds */ - this._id = 0; this._type = 3; } @@ -822,7 +1057,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -848,6 +1083,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { angular.module('News').factory('_BusinessLayer', function() { var BusinessLayer; + BusinessLayer = (function() { function BusinessLayer(_activeFeed, _persistence, _itemModel, _type) { this._activeFeed = _activeFeed; @@ -877,7 +1113,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. }).call(this); -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.2 /* ownCloud - News @@ -907,6 +1143,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').factory('FeedBusinessLayer', [ '_BusinessLayer', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', 'FeedModel', 'NewLoading', '_ExistsError', 'Utils', '$rootScope', 'NewestItem', function(_BusinessLayer, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, NewLoading, _ExistsError, Utils, $rootScope, NewestItem) { var FeedBusinessLayer; + FeedBusinessLayer = (function(_super) { __extends(FeedBusinessLayer, _super); @@ -940,6 +1177,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype["delete"] = function(feedId) { var data, feed, _this = this; + feed = this._feedModel.removeById(feedId); data = { undoCallback: function() { @@ -954,6 +1192,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype.markRead = function(feedId) { var feed, item, newestItemId, _i, _len, _ref; + feed = this._feedModel.getById(feedId); newestItemId = this._newestItem.getId(); if (angular.isDefined(feed) && newestItemId !== 0) { @@ -973,6 +1212,10 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return this._feedModel.size(); }; + FeedBusinessLayer.prototype.noFeeds = function() { + return this.getNumberOfFeeds() === 0; + }; + FeedBusinessLayer.prototype.isVisible = function(feedId) { if (this.isActive(feedId) || this._showAll.getShowAll()) { return true; @@ -983,6 +1226,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype.move = function(feedId, folderId) { var feed; + feed = this._feedModel.getById(feedId); if (angular.isDefined(feed) && feed.folderId !== folderId) { this._feedModel.update({ @@ -997,6 +1241,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype.setShowAll = function(showAll) { var callback, _this = this; + this._showAll.setShowAll(showAll); callback = function() { _this._itemModel.clear(); @@ -1022,6 +1267,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype.getFeedLink = function(feedId) { var feed; + feed = this._feedModel.getById(feedId); if (angular.isDefined(feed)) { return feed.link; @@ -1031,6 +1277,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. FeedBusinessLayer.prototype.create = function( |