From d54475fb0f168845bf14b0d16088da97d473187a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 9 Sep 2013 16:38:08 +0200 Subject: log --- .gitignore | 3 +- build/news.zip | Bin 0 -> 1561495 bytes js/build/app/app.js | 55 -- js/build/app/controllers/appcontroller.js | 50 -- js/build/app/controllers/feedcontroller.js | 129 ----- js/build/app/controllers/itemcontroller.js | 83 --- js/build/app/controllers/settingscontroller.js | 55 -- js/build/app/directives/audio.js | 51 -- js/build/app/directives/droppable.js | 50 -- js/build/app/directives/itemshortcuts.js | 126 ----- js/build/app/directives/newsclickscroll.js | 48 -- js/build/app/directives/newsitemscroll.js | 82 --- js/build/app/directives/undonotification.js | 63 --- js/build/app/services/activefeed.js | 56 -- .../app/services/businesslayer/businesslayer.js | 54 -- .../services/businesslayer/feedbusinesslayer.js | 233 --------- .../services/businesslayer/folderbusinesslayer.js | 241 --------- .../services/businesslayer/itembusinesslayer.js | 144 ----- .../services/businesslayer/starredbusinesslayer.js | 66 --- .../businesslayer/subscriptionsbusinesslayer.js | 84 --- js/build/app/services/existserror.js | 38 -- js/build/app/services/feedtype.js | 36 -- js/build/app/services/language.js | 60 --- js/build/app/services/models/feedmodel.js | 198 ------- js/build/app/services/models/foldermodel.js | 159 ------ js/build/app/services/models/itemmodel.js | 133 ----- js/build/app/services/newestitem.js | 46 -- js/build/app/services/opmlparser.js | 111 ---- js/build/app/services/persistence.js | 577 --------------------- js/build/app/services/services.js | 65 --- js/build/app/services/showall.js | 50 -- js/build/app/services/starredcount.js | 50 -- js/build/app/services/statusflag.js | 34 -- js/build/app/services/unreadcountformatter.js | 34 -- js/build/tests/controllers/feedcontrollerSpec.js | 233 --------- js/build/tests/controllers/itemcontrollerSpec.js | 194 ------- .../tests/controllers/settingscontrollerSpec.js | 86 --- js/build/tests/services/activefeedSpec.js | 49 -- .../services/businesslayer/businesslayerSpec.js | 88 ---- .../businesslayer/feedbusinesslayerSpec.js | 478 ----------------- .../businesslayer/folderbusinesslayerSpec.js | 577 --------------------- .../businesslayer/itembusinesslayerSpec.js | 330 ------------ .../businesslayer/starredbusinesslayerSpec.js | 69 --- .../businesslayer/subsriptionsbusinesslayerSpec.js | 130 ----- js/build/tests/services/feedtypeSpec.js | 48 -- js/build/tests/services/languageSpec.js | 61 --- js/build/tests/services/models/feedmodelSpec.js | 175 ------- js/build/tests/services/models/foldermodelSpec.js | 140 ----- js/build/tests/services/models/itemmodelSpec.js | 160 ------ js/build/tests/services/newestitemSpec.js | 41 -- js/build/tests/services/opmlparserSpec.js | 167 ------ js/build/tests/services/persistenceSpec.js | 398 -------------- js/build/tests/services/showallSpec.js | 46 -- js/build/tests/services/starredcountSpec.js | 44 -- js/build/tests/services/statusflagSpec.js | 39 -- js/build/tests/services/unreadcountformaterSpec.js | 39 -- 56 files changed, 2 insertions(+), 6854 deletions(-) create mode 100644 build/news.zip delete mode 100644 js/build/app/app.js delete mode 100644 js/build/app/controllers/appcontroller.js delete mode 100644 js/build/app/controllers/feedcontroller.js delete mode 100644 js/build/app/controllers/itemcontroller.js delete mode 100644 js/build/app/controllers/settingscontroller.js delete mode 100644 js/build/app/directives/audio.js delete mode 100644 js/build/app/directives/droppable.js delete mode 100644 js/build/app/directives/itemshortcuts.js delete mode 100644 js/build/app/directives/newsclickscroll.js delete mode 100644 js/build/app/directives/newsitemscroll.js delete mode 100644 js/build/app/directives/undonotification.js delete mode 100644 js/build/app/services/activefeed.js delete mode 100644 js/build/app/services/businesslayer/businesslayer.js delete mode 100644 js/build/app/services/businesslayer/feedbusinesslayer.js delete mode 100644 js/build/app/services/businesslayer/folderbusinesslayer.js delete mode 100644 js/build/app/services/businesslayer/itembusinesslayer.js delete mode 100644 js/build/app/services/businesslayer/starredbusinesslayer.js delete mode 100644 js/build/app/services/businesslayer/subscriptionsbusinesslayer.js delete mode 100644 js/build/app/services/existserror.js delete mode 100644 js/build/app/services/feedtype.js delete mode 100644 js/build/app/services/language.js delete mode 100644 js/build/app/services/models/feedmodel.js delete mode 100644 js/build/app/services/models/foldermodel.js delete mode 100644 js/build/app/services/models/itemmodel.js delete mode 100644 js/build/app/services/newestitem.js delete mode 100644 js/build/app/services/opmlparser.js delete mode 100644 js/build/app/services/persistence.js delete mode 100644 js/build/app/services/services.js delete mode 100644 js/build/app/services/showall.js delete mode 100644 js/build/app/services/starredcount.js delete mode 100644 js/build/app/services/statusflag.js delete mode 100644 js/build/app/services/unreadcountformatter.js delete mode 100644 js/build/tests/controllers/feedcontrollerSpec.js delete mode 100644 js/build/tests/controllers/itemcontrollerSpec.js delete mode 100644 js/build/tests/controllers/settingscontrollerSpec.js delete mode 100644 js/build/tests/services/activefeedSpec.js delete mode 100644 js/build/tests/services/businesslayer/businesslayerSpec.js delete mode 100644 js/build/tests/services/businesslayer/feedbusinesslayerSpec.js delete mode 100644 js/build/tests/services/businesslayer/folderbusinesslayerSpec.js delete mode 100644 js/build/tests/services/businesslayer/itembusinesslayerSpec.js delete mode 100644 js/build/tests/services/businesslayer/starredbusinesslayerSpec.js delete mode 100644 js/build/tests/services/businesslayer/subsriptionsbusinesslayerSpec.js delete mode 100644 js/build/tests/services/feedtypeSpec.js delete mode 100644 js/build/tests/services/languageSpec.js delete mode 100644 js/build/tests/services/models/feedmodelSpec.js delete mode 100644 js/build/tests/services/models/foldermodelSpec.js delete mode 100644 js/build/tests/services/models/itemmodelSpec.js delete mode 100644 js/build/tests/services/newestitemSpec.js delete mode 100644 js/build/tests/services/opmlparserSpec.js delete mode 100644 js/build/tests/services/persistenceSpec.js delete mode 100644 js/build/tests/services/showallSpec.js delete mode 100644 js/build/tests/services/starredcountSpec.js delete mode 100644 js/build/tests/services/statusflagSpec.js delete mode 100644 js/build/tests/services/unreadcountformaterSpec.js diff --git a/.gitignore b/.gitignore index f48fe4abd..5b631c87e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ coffee/build/ node_modules/ *.log -build/ +./build/ +js/build/ js/*.xml .rvm diff --git a/build/news.zip b/build/news.zip new file mode 100644 index 000000000..980b39ead Binary files /dev/null and b/build/news.zip differ diff --git a/js/build/app/app.js b/js/build/app/app.js deleted file mode 100644 index 0e05ba545..000000000 --- a/js/build/app/app.js +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News', ['OC', 'ui']).config(function($provide) { - var config; - return $provide.value('Config', config = { - markReadTimeout: 500, - scrollTimeout: 500, - feedUpdateInterval: 1000 * 60 * 3, - itemBatchSize: 40, - undoTimeout: 1000 * 10, - autoPageFactor: 30 - }); - }); - - angular.module('News').run([ - 'Persistence', 'Config', function(Persistence, Config) { - return setInterval(function() { - Persistence.getAllFeeds(null, false); - return Persistence.getAllFolders(null, false); - }, Config.feedUpdateInterval); - } - ]); - - $(document).ready(function() { - return $(this).keyup(function(e) { - if ((e.which === 116) || (e.which === 82 && e.ctrlKey)) { - document.location.reload(true); - return false; - } - }); - }); - -}).call(this); diff --git a/js/build/app/controllers/appcontroller.js b/js/build/app/controllers/appcontroller.js deleted file mode 100644 index 17fba2182..000000000 --- a/js/build/app/controllers/appcontroller.js +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -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 . -*/ - - -(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); diff --git a/js/build/app/controllers/feedcontroller.js b/js/build/app/controllers/feedcontroller.js deleted file mode 100644 index 08fa1c4c2..000000000 --- a/js/build/app/controllers/feedcontroller.js +++ /dev/null @@ -1,129 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - 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; - this._feedBusinessLayer = _feedBusinessLayer; - this._subscriptionsBusinessLayer = _subscriptionsBusinessLayer; - this._starredBusinessLayer = _starredBusinessLayer; - this._unreadCountFormatter = _unreadCountFormatter; - this._activeFeed = _activeFeed; - this._feedType = _feedType; - this._$window = _$window; - this._isAddingFolder = false; - this._isAddingFeed = false; - this._$scope.folderBusinessLayer = this._folderBusinessLayer; - this._$scope.feedBusinessLayer = this._feedBusinessLayer; - this._$scope.subscriptionsBusinessLayer = this._subscriptionsBusinessLayer; - this._$scope.starredBusinessLayer = this._starredBusinessLayer; - 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); - title = 'News (' + titleCount + ') | ownCloud'; - } else { - title = 'News | 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); - } - return _this._feedBusinessLayer.create(feedUrl, parentFolderId, function(data) { - _this._$scope.feedUrl = ''; - _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; - } - }; - 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; - } - return _this._isAddingFolder = false; - } - }; - this._$scope.$on('moveFeedToFolder', function(scope, data) { - return _this._feedBusinessLayer.move(data.feedId, data.folderId); - }); - } - - return FeedController; - - })(); - return new FeedController($scope, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType, $window); - } - ]); - -}).call(this); diff --git a/js/build/app/controllers/itemcontroller.js b/js/build/app/controllers/itemcontroller.js deleted file mode 100644 index 1412aeb78..000000000 --- a/js/build/app/controllers/itemcontroller.js +++ /dev/null @@ -1,83 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@_author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - 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; - this._feedLoading = _feedLoading; - this._autoPageLoading = _autoPageLoading; - this._feedBusinessLayer = _feedBusinessLayer; - this._language = _language; - this._autoPaging = true; - this._$scope.itemBusinessLayer = this._itemBusinessLayer; - this._$scope.feedBusinessLayer = this._feedBusinessLayer; - this._$scope.isLoading = function() { - return _this._feedLoading.isLoading(); - }; - this._$scope.isAutoPaging = function() { - return _this._autoPageLoading.isLoading(); - }; - this._$scope.getFeedTitle = function(feedId) { - var feed; - feed = _this._feedModel.getById(feedId); - if (angular.isDefined(feed)) { - return feed.title; - } else { - return ''; - } - }; - this._$scope.getRelativeDate = function(date) { - if (date) { - return _this._language.getMomentFromTimestamp(date).fromNow(); - } else { - return ''; - } - }; - this._$scope.$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; - }); - } - }); - } - - return ItemController; - - })(); - return new ItemController($scope, ItemBusinessLayer, FeedModel, FeedLoading, AutoPageLoading, FeedBusinessLayer, Language); - } - ]); - -}).call(this); diff --git a/js/build/app/controllers/settingscontroller.js b/js/build/app/controllers/settingscontroller.js deleted file mode 100644 index 9c2beaaf9..000000000 --- a/js/build/app/controllers/settingscontroller.js +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - 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 { - return FolderBusinessLayer["import"](fileContent); - } catch (_error) { - error = _error; - return $scope.error = true; - } - }; - return $scope.importGoogleReader = function(fileContent) { - var error, parsedJSON; - $scope.jsonError = false; - ShowAll.setShowAll(true); - try { - parsedJSON = JSON.parse(fileContent); - return FeedBusinessLayer.importGoogleReader(parsedJSON); - } catch (_error) { - error = _error; - return $scope.jsonError = true; - } - }; - } - ]); - -}).call(this); diff --git a/js/build/app/directives/audio.js b/js/build/app/directives/audio.js deleted file mode 100644 index 2dfc0aa37..000000000 --- a/js/build/app/directives/audio.js +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').directive('newsAudio', function() { - var directive; - return directive = { - restrict: 'E', - scope: { - src: '@', - type: '@' - }, - transclude: true, - template: '' + '' + '', - link: function(scope, elm, attrs) { - var cantPlay, source; - source = elm.children().children('source')[0]; - cantPlay = false; - source.addEventListener('error', function() { - return scope.$apply(function() { - return cantPlay = true; - }); - }); - return scope.cantPlay = function() { - return cantPlay; - }; - } - }; - }); - -}).call(this); diff --git a/js/build/app/directives/droppable.js b/js/build/app/directives/droppable.js deleted file mode 100644 index 30335232b..000000000 --- a/js/build/app/directives/droppable.js +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').directive('droppable', [ - '$rootScope', function($rootScope) { - return function(scope, elm, attr) { - var $elem, details; - $elem = $(elm); - details = { - accept: '.feed', - hoverClass: 'drag-and-drop', - greedy: true, - drop: function(event, ui) { - var data; - $('.drag-and-drop').removeClass('drag-and-drop'); - data = { - folderId: parseInt($elem.data('id'), 10), - feedId: parseInt($(ui.draggable).data('id'), 10) - }; - $rootScope.$broadcast('moveFeedToFolder', data); - return scope.$apply(attr.droppable); - } - }; - return $elem.droppable(details); - }; - } - ]); - -}).call(this); diff --git a/js/build/app/directives/itemshortcuts.js b/js/build/app/directives/itemshortcuts.js deleted file mode 100644 index b23599c61..000000000 --- a/js/build/app/directives/itemshortcuts.js +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').directive('itemShortcuts', [ - '$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; - for (_i = 0, _len = $items.length; _i < _len; _i++) { - item = $items[_i]; - $item = $(item); - if ($item.position().top >= 0) { - $previous = $item.prev(); - if ($previous.length > 0) { - jumpTo($scrollArea, $previous); - } - notJumped = false; - break; - } - } - if ($items.length > 0 && notJumped) { - return jumpTo($scrollArea, $items.last()); - } - }; - jumpToNextItem = function(scrollArea) { - var $item, $items, $scrollArea, item, jumped, _i, _len; - $scrollArea = $(scrollArea); - $items = $scrollArea.find('.feed_item'); - jumped = false; - for (_i = 0, _len = $items.length; _i < _len; _i++) { - item = $items[_i]; - $item = $(item); - if ($item.position().top > 1) { - jumped = true; - jumpTo($scrollArea, $item); - break; - } - } - if (jumped === false) { - return $scrollArea.scrollTop($scrollArea.prop('scrollHeight')); - } - }; - 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++) { - item = $items[_i]; - $item = $(item); - if (($item.height() + $item.position().top) > 110) { - return $item; - } - } - }; - 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; - if (e.keyCode === 74 || e.keyCode === 39 || e.keyCode === 78) { - return jumpToNextItem(scrollArea); - } else if (e.keyCode === 75 || e.keyCode === 37 || e.keyCode === 80) { - return jumpToPreviousItem(scrollArea); - } else if (e.keyCode === 85) { - return keepUnreadCurrentItem(scrollArea); - } else if (e.keyCode === 73 || e.keyCode === 83 || e.keyCode === 76) { - return starCurrentItem(scrollArea); - } else if (e.keyCode === 72) { - starCurrentItem(scrollArea); - return jumpToNextItem(scrollArea); - } else if (e.keyCode === 79) { - return openCurrentItem(scrollArea); - } - } - }); - }; - } - ]); - -}).call(this); diff --git a/js/build/app/directives/newsclickscroll.js b/js/build/app/directives/newsclickscroll.js deleted file mode 100644 index f6e9e666c..000000000 --- a/js/build/app/directives/newsclickscroll.js +++ /dev/null @@ -1,48 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').directive('newsClickScroll', [ - '$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 { - scrollPosition = scrollArea.prop('scrollHeight'); - } - return scrollArea.scrollTop(scrollPosition); - }, 10); - }); - }; - } - ]); - -}).call(this); diff --git a/js/build/app/directives/newsitemscroll.js b/js/build/app/directives/newsitemscroll.js deleted file mode 100644 index 9fc58156a..000000000 --- a/js/build/app/directives/newsitemscroll.js +++ /dev/null @@ -1,82 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - var markingRead, scrolling; - - scrolling = true; - - markingRead = true; - - angular.module('News').directive('newsItemScroll', [ - '$rootScope', 'Config', function($rootScope, Config) { - return function(scope, elm, attr) { - return elm.bind('scroll', function() { - var counter, item, _i, _ref, _results; - if (scrolling) { - scrolling = false; - setTimeout(function() { - return scrolling = true; - }, Config.ScrollTimeout); - if (markingRead && elm.attr('news-item-scroll') === 'true') { - markingRead = false; - setTimeout(function() { - var $elems, feedItem, id, offset, _i, _len, _results; - markingRead = true; - $elems = elm.find('.feed_item:not(.read)'); - _results = []; - for (_i = 0, _len = $elems.length; _i < _len; _i++) { - feedItem = $elems[_i]; - offset = $(feedItem).position().top; - if (offset <= -50) { - id = parseInt($(feedItem).data('id'), 10); - _results.push($rootScope.$broadcast('readItem', id)); - } else { - break; - } - } - return _results; - }, Config.MarkReadTimeout); - } - counter = 0; - _ref = elm.find('.feed_item'); - _results = []; - for (_i = _ref.length - 1; _i >= 0; _i += -1) { - item = _ref[_i]; - if (counter >= Config.autoPageFactor) { - break; - } - if ($(item).position().top < 0) { - $rootScope.$broadcast('autoPage'); - break; - } - _results.push(counter += 1); - } - return _results; - } - }); - }; - } - ]); - -}).call(this); diff --git a/js/build/app/directives/undonotification.js b/js/build/app/directives/undonotification.js deleted file mode 100644 index 924cfb1c6..000000000 --- a/js/build/app/directives/undonotification.js +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').directive('undoNotification', [ - '$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(); - return elm.fadeOut(); - }); - scope.getCaption = function() { - return caption; - }; - return scope.$on('undoMessage', function(scope, data) { - var _this = this; - if (timeout) { - $timeout.cancel(timeout.promise); - } - timeout = $timeout(function() { - return $(elm).fadeOut(); - }, Config.undoTimeout); - undo = data.undoCallback; - caption = data.caption; - return $(elm).fadeIn().css("display", "inline"); - }); - }; - } - ]); - -}).call(this); diff --git a/js/build/app/services/activefeed.js b/js/build/app/services/activefeed.js deleted file mode 100644 index eb1c1e0bb..000000000 --- a/js/build/app/services/activefeed.js +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').factory('ActiveFeed', function() { - var ActiveFeed; - ActiveFeed = (function() { - function ActiveFeed() { - /* - Default value is all feeds - */ - - this._id = 0; - this._type = 3; - } - - ActiveFeed.prototype.handle = function(data) { - this._id = data.id; - return this._type = data.type; - }; - - ActiveFeed.prototype.getType = function() { - return this._type; - }; - - ActiveFeed.prototype.getId = function() { - return this._id; - }; - - return ActiveFeed; - - })(); - return new ActiveFeed(); - }); - -}).call(this); diff --git a/js/build/app/services/businesslayer/businesslayer.js b/js/build/app/services/businesslayer/businesslayer.js deleted file mode 100644 index 71056c0aa..000000000 --- a/js/build/app/services/businesslayer/businesslayer.js +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').factory('_BusinessLayer', function() { - var BusinessLayer; - BusinessLayer = (function() { - function BusinessLayer(_activeFeed, _persistence, _itemModel, _type) { - this._activeFeed = _activeFeed; - this._persistence = _persistence; - this._itemModel = _itemModel; - this._type = _type; - } - - BusinessLayer.prototype.load = function(id) { - this._itemModel.clear(); - this._persistence.getItems(this._type, id, 0); - return this._activeFeed.handle({ - id: id, - type: this._type - }); - }; - - BusinessLayer.prototype.isActive = function(id) { - return this._activeFeed.getType() === this._type && this._activeFeed.getId() === id; - }; - - return BusinessLayer; - - })(); - return BusinessLayer; - }); - -}).call(this); diff --git a/js/build/app/services/businesslayer/feedbusinesslayer.js b/js/build/app/services/businesslayer/feedbusinesslayer.js deleted file mode 100644 index 31a04adb5..000000000 --- a/js/build/app/services/businesslayer/feedbusinesslayer.js +++ /dev/null @@ -1,233 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - 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); - - function FeedBusinessLayer(_showAll, _feedModel, persistence, activeFeed, feedType, itemModel, _newLoading, _utils, _$rootScope, _newestItem) { - this._showAll = _showAll; - this._feedModel = _feedModel; - this._newLoading = _newLoading; - this._utils = _utils; - this._$rootScope = _$rootScope; - this._newestItem = _newestItem; - FeedBusinessLayer.__super__.constructor.call(this, activeFeed, persistence, itemModel, feedType.Feed); - this._feedType = feedType; - } - - FeedBusinessLayer.prototype.getUnreadCount = function(feedId) { - return this._feedModel.getFeedUnreadCount(feedId); - }; - - FeedBusinessLayer.prototype.getFeedsOfFolder = function(folderId) { - return this._feedModel.getAllOfFolder(folderId); - }; - - FeedBusinessLayer.prototype.getFolderUnreadCount = function(folderId) { - return this._feedModel.getFolderUnreadCount(folderId); - }; - - FeedBusinessLayer.prototype.getAllUnreadCount = function() { - return this._feedModel.getUnreadCount(); - }; - - FeedBusinessLayer.prototype["delete"] = function(feedId) { - var data, feed, - _this = this; - feed = this._feedModel.removeById(feedId); - data = { - undoCallback: function() { - _this._persistence.restoreFeed(feedId, function() {}); - return _this._persistence.getAllFeeds(); - }, - caption: feed.title - }; - this._$rootScope.$broadcast('undoMessage', data); - return this._persistence.deleteFeed(feedId); - }; - - 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) { - feed.unreadCount = 0; - _ref = this._itemModel.getAll(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - item = _ref[_i]; - if (item.feedId === feed.id) { - item.setRead(); - } - } - return this._persistence.setFeedRead(feedId, newestItemId); - } - }; - - FeedBusinessLayer.prototype.getNumberOfFeeds = function() { - 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; - } else { - return this._feedModel.getFeedUnreadCount(feedId) > 0; - } - }; - - FeedBusinessLayer.prototype.move = function(feedId, folderId) { - var feed; - feed = this._feedModel.getById(feedId); - if (angular.isDefined(feed) && feed.folderId !== folderId) { - this._feedModel.update({ - id: feedId, - folderId: folderId, - url: feed.url - }); - return this._persistence.moveFeed(feedId, folderId); - } - }; - - FeedBusinessLayer.prototype.setShowAll = function(showAll) { - var callback, - _this = this; - 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(); - }); - }; - if (showAll) { - return this._persistence.userSettingsReadShow(callback); - } else { - return this._persistence.userSettingsReadHide(callback); - } - }; - - FeedBusinessLayer.prototype.isShowAll = function() { - return this._showAll.getShowAll(); - }; - - FeedBusinessLayer.prototype.getAll = function() { - return this._feedModel.getAll(); - }; - - FeedBusinessLayer.prototype.getFeedLink = function(feedId) { - var feed; - feed = this._feedModel.getById(feedId); - if (angular.isDefined(feed)) { - return feed.link; - } - }; - - FeedBusinessLayer.prototype.create = function(url, parentId, onSuccess, onFailure) { - var feed, success, - _this = this; - if (parentId == null) { - parentId = 0; - } - if (onSuccess == null) { - onSuccess = null; - } - if (onFailure == null) { - onFailure = null; - } - onSuccess || (onSuccess = function() {}); - onFailure || (onFailure = function() {}); - parentId = parseInt(parentId, 10); - if (angular.isUndefined(url) || url.trim() === '') { - throw new Error('Url must not be empty'); - } - url = url.trim(); - if (url.indexOf('http') !== 0) { - url = 'http://' + url; - } - if (this._feedModel.getByUrl(url)) { - throw new _ExistsError('Exists already'); - } - feed = { - title: url, - url: url, - folderId: parentId, - unreadCount: 0, - faviconLink: 'url(' + this._utils.imagePath('core', 'loading.gif') + ')' - }; - this._feedModel.add(feed); - success = function(response) { - if (response.status === 'error') { - feed.error = response.msg; - return onFailure(); - } else { - return onSuccess(response.data); - } - }; - return this._persistence.createFeed(url, parentId, success); - }; - - FeedBusinessLayer.prototype.markErrorRead = function(url) { - return this._feedModel.removeByUrl(url); - }; - - FeedBusinessLayer.prototype.importGoogleReader = function(json) { - var feed, onSuccess, url, - _this = this; - url = 'http://owncloud/googlereader'; - if (angular.isUndefined(this._feedModel.getByUrl(url))) { - feed = { - title: 'Google Reader', - url: url, - folderId: 0, - unreadCount: 0, - faviconLink: 'url(' + this._utils.imagePath('core', 'loading.gif') + ')' - }; - this._feedModel.add(feed); - } - onSuccess = function(response) { - var id; - id = response.data.feeds[0].id; - return _this.load(id); - }; - return this._persistence.importGoogleReader(json, onSuccess); - }; - - return FeedBusinessLayer; - - })(_BusinessLayer); - return new FeedBusinessLayer(ShowAll, FeedModel, Persistence, ActiveFeed, FeedType, ItemModel, NewLoading, Utils, $rootScope, NewestItem); - } - ]); - -}).call(this); diff --git a/js/build/app/services/businesslayer/folderbusinesslayer.js b/js/build/app/services/businesslayer/folderbusinesslayer.js deleted file mode 100644 index 126198429..000000000 --- a/js/build/app/services/businesslayer/folderbusinesslayer.js +++ /dev/null @@ -1,241 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - var __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - angular.module('News').factory('FolderBusinessLayer', [ - '_BusinessLayer', 'FolderModel', 'FeedBusinessLayer', 'Persistence', 'FeedType', 'ActiveFeed', 'ItemModel', 'ShowAll', '_ExistsError', 'OPMLParser', 'NewestItem', 'FeedModel', '$rootScope', function(_BusinessLayer, FolderModel, FeedBusinessLayer, Persistence, FeedType, ActiveFeed, ItemModel, ShowAll, _ExistsError, OPMLParser, NewestItem, FeedModel, $rootScope) { - var FolderBusinessLayer; - FolderBusinessLayer = (function(_super) { - __extends(FolderBusinessLayer, _super); - - function FolderBusinessLayer(_folderModel, _feedBusinessLayer, _showAll, activeFeed, persistence, _feedType, itemModel, _opmlParser, _newestItem, _feedModel, _$rootScope) { - this._folderModel = _folderModel; - this._feedBusinessLayer = _feedBusinessLayer; - this._showAll = _showAll; - this._feedType = _feedType; - this._opmlParser = _opmlParser; - this._newestItem = _newestItem; - this._feedModel = _feedModel; - this._$rootScope = _$rootScope; - FolderBusinessLayer.__super__.constructor.call(this, activeFeed, persistence, itemModel, this._feedType.Folder); - } - - FolderBusinessLayer.prototype.getById = function(folderId) { - return this._folderModel.getById(folderId); - }; - - FolderBusinessLayer.prototype["delete"] = function(folderId) { - 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++) { - feed = _ref[_i]; - feeds.push(this._feedModel.removeById(feed.id)); - } - folder = this._folderModel.removeById(folderId); - data = { - undoCallback: function() { - return _this._persistence.restoreFolder(folderId, function() { - _this._persistence.getAllFeeds(); - return _this._persistence.getAllFolders(); - }); - }, - caption: folder.name - }; - this._$rootScope.$broadcast('undoMessage', data); - return this._persistence.deleteFolder(folderId); - }; - - FolderBusinessLayer.prototype.hasFeeds = function(folderId) { - return this._feedBusinessLayer.getFeedsOfFolder(folderId).length; - }; - - FolderBusinessLayer.prototype.open = function(folderId) { - var folder; - folder = this._folderModel.getById(folderId); - if (angular.isDefined(folder)) { - if (!folder.opened) { - folder.opened = true; - return this._persistence.openFolder(folder.id); - } - } - }; - - FolderBusinessLayer.prototype.toggleFolder = function(folderId) { - var folder; - folder = this._folderModel.getById(folderId); - if (angular.isDefined(folder)) { - folder.opened = !folder.opened; - if (folder.opened) { - return this._persistence.openFolder(folder.id); - } else { - return this._persistence.collapseFolder(folder.id); - } - } - }; - - FolderBusinessLayer.prototype.markRead = function(folderId) { - var feed, folder, item, newestItemId, _i, _j, _len, _len1, _ref, _ref1; - newestItemId = this._newestItem.getId(); - folder = this._folderModel.getById(folderId); - if (newestItemId !== 0 && angular.isDefined(folder)) { - _ref = this._feedBusinessLayer.getFeedsOfFolder(folderId); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - feed = _ref[_i]; - feed.unreadCount = 0; - _ref1 = this._itemModel.getAll(); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - item = _ref1[_j]; - if (item.feedId === feed.id) { - item.setRead(); - } - } - } - return this._persistence.setFolderRead(folderId, newestItemId); - } - }; - - FolderBusinessLayer.prototype.getUnreadCount = function(folderId) { - return this._feedBusinessLayer.getFolderUnreadCount(folderId); - }; - - FolderBusinessLayer.prototype.isVisible = function(folderId) { - var feed, _i, _len, _ref; - if (this._showAll.getShowAll()) { - return true; - } else { - if (this.isActive(folderId) || this._feedBusinessLayer.getFolderUnreadCount(folderId) > 0) { - return true; - } - if (this._activeFeed.getType() === this._feedType.Feed) { - _ref = this._feedBusinessLayer.getFeedsOfFolder(folderId); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - feed = _ref[_i]; - if (feed.id === this._activeFeed.getId()) { - return true; - } - } - } - return false; - } - }; - - FolderBusinessLayer.prototype.getAll = function() { - return this._folderModel.getAll(); - }; - - FolderBusinessLayer.prototype.create = function(folderName, onSuccess, onFailure) { - var folder, success, - _this = this; - if (onSuccess == null) { - onSuccess = null; - } - if (onFailure == null) { - onFailure = null; - } - onSuccess || (onSuccess = function() {}); - onFailure || (onFailure = function() {}); - if (angular.isUndefined(folderName) || folderName.trim() === '') { - throw new Error('Folder name must not be empty'); - } - folderName = folderName.trim(); - if (this._folderModel.getByName(folderName)) { - throw new _ExistsError('Exists already'); - } - folder = { - name: folderName, - opened: true - }; - this._folderModel.add(folder); - success = function(response) { - if (response.status === 'error') { - folder.error = response.msg; - return onFailure(); - } else { - return onSuccess(response.data); - } - }; - return this._persistence.createFolder(folderName, 0, success); - }; - - FolderBusinessLayer.prototype.markErrorRead = function(folderName) { - return this._folderModel.removeByName(folderName); - }; - - FolderBusinessLayer.prototype["import"] = function(xml) { - var opml; - opml = this._opmlParser.parseXML(xml); - return this._importElement(opml, 0); - }; - - FolderBusinessLayer.prototype._importElement = function(opml, parentFolderId) { - 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(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); - } - } - } - })(item)); - } - return _results; - }; - - return FolderBusinessLayer; - - })(_BusinessLayer); - return new FolderBusinessLayer(FolderModel, FeedBusinessLayer, ShowAll, ActiveFeed, Persistence, FeedType, ItemModel, OPMLParser, NewestItem, FeedModel, $rootScope); - } - ]); - -}).call(this); diff --git a/js/build/app/services/businesslayer/itembusinesslayer.js b/js/build/app/services/businesslayer/itembusinesslayer.js deleted file mode 100644 index 2c482408a..000000000 --- a/js/build/app/services/businesslayer/itembusinesslayer.js +++ /dev/null @@ -1,144 +0,0 @@ -// Generated by CoffeeScript 1.6.3 -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 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 . -*/ - - -(function() { - angular.module('News').factory('ItemBusinessLayer', [ - 'ItemModel', 'FeedModel', 'Persistence', 'ActiveFeed', 'FeedType', 'StarredBusinessLayer', 'NewestItem', function(ItemModel, FeedModel, Persistence, ActiveFeed, FeedType, StarredBusinessLayer, NewestItem) { - var ItemBusinessLayer; - ItemBusinessLayer = (function() { - function ItemBusinessLayer(_itemModel, _feedModel, _persistence, _activeFeed, _feedType, _starredBusinessLayer, _newestItem) { - this._itemModel = _itemModel; - this._feedModel = _feedModel; - this._persistence = _persistence; - this._activeFeed = _activeFeed; - this._feedType = _feedType; - this._starredBusinessLayer = _starredBusinessLayer; - this._newestItem = _newestItem; - } - - ItemBusinessLayer.prototype.getAll = function() { - return this._itemModel.getAll(); - }; - - ItemBusinessLayer.prototype.noFeedActive = function() { - return this._activeFeed.getType() !== this._feedType.Feed; - }; - - ItemBusinessLayer.prototype.isKeptUnread = function(itemId) { - var item; - item = this._itemModel.getById(itemId); - if (angular.isDefined(item) && angular.isDefined(item.keptUnread)) { - return item.keptUnread; - } - return false; - }; - - ItemBusinessLayer.prototype.toggleKeepUnread = function(itemId) { - var item; - item = this._itemModel.getById(itemId); - if (angular.isDefined(item) && !item.keptUnread) { - item.keptUnread = true; - if (item.isRead()) { - return this.setUnread(itemId); - } - } else { - return item.keptUnread = false; - } - }; - - ItemBusinessLayer.prototype.toggleStarred = function(itemId) { - var item; - item = this._itemModel.getById(itemId); - if (item.i