summaryrefslogtreecommitdiffstats
path: root/js/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/app/controllers')
-rw-r--r--js/app/controllers/appcontroller.coffee42
-rw-r--r--js/app/controllers/feedcontroller.coffee147
-rw-r--r--js/app/controllers/itemcontroller.coffee84
-rw-r--r--js/app/controllers/settingscontroller.coffee63
4 files changed, 0 insertions, 336 deletions
diff --git a/js/app/controllers/appcontroller.coffee b/js/app/controllers/appcontroller.coffee
deleted file mode 100644
index bcb256077..000000000
--- a/js/app/controllers/appcontroller.coffee
+++ /dev/null
@@ -1,42 +0,0 @@
-###
-
-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/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee
deleted file mode 100644
index 43186e689..000000000
--- a/js/app/controllers/feedcontroller.coffee
+++ /dev/null
@@ -1,147 +0,0 @@
-###
-
-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 <http://www.gnu.org/licenses/>.
-
-###
-
-
-angular.module('News').controller 'FeedController',
-['$scope', '_ExistsError', 'Persistence', 'FolderBusinessLayer',
-'FeedBusinessLayer', 'SubscriptionsBusinessLayer', 'StarredBusinessLayer',
-'unreadCountFormatter', 'ActiveFeed', 'FeedType', '$window',
-($scope, _ExistsError, Persistence, FolderBusinessLayer, FeedBusinessLayer,
-SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter,
-ActiveFeed, FeedType, $window) ->
-
-
- class FeedController
-
- constructor: (@_$scope, @_persistence, @_folderBusinessLayer,
- @_feedBusinessLayer, @_subscriptionsBusinessLayer,
- @_starredBusinessLayer, @_unreadCountFormatter,
- @_activeFeed, @_feedType, @_$window) ->
-
- @_isAddingFolder = false
- @_isAddingFeed = false
-
- # bind internal stuff to scope
- @_$scope.folderBusinessLayer = @_folderBusinessLayer
- @_$scope.feedBusinessLayer = @_feedBusinessLayer
- @_$scope.subscriptionsBusinessLayer = @_subscriptionsBusinessLayer
- @_$scope.starredBusinessLayer = @_starredBusinessLayer
- @_$scope.unreadCountFormatter = @_unreadCountFormatter
-
- @_$scope.edit = (feed) ->
- feed.editing = true
- feed.originalValue = feed.title
-
- @_$scope.cancel = (feed) ->
- feed.editing = false
- feed.title = feed.originalValue
-
- @_$scope.getTotalUnreadCount = =>
- # also update title based on unreadcount
- count = @_subscriptionsBusinessLayer.getUnreadCount(0)
-
- # dont do this for other dom elements
- # the title is some kind of exception since its always there
- # and it has nothing to do with the body structure
- if @_$scope.translations and @_$scope.translations.appName
- appName = @_$scope.translations.appName
- else
- appName = ''
-
- if count > 0
- titleCount = @_unreadCountFormatter(count)
- title = appName + ' (' + titleCount + ') | ownCloud'
- else
- title = appName + ' | ownCloud'
-
- # only update title when it changed to prevent highlighting the
- # tab
- if @_$window.document.title != title
- @_$window.document.title = title
-
- return count
-
- @_$scope.isAddingFolder = =>
- return @_isAddingFolder
-
- @_$scope.isAddingFeed = =>
- return @_isAddingFeed
-
- @_$scope.addFeed = (feedUrl, parentFolderId=0) =>
- @_$scope.feedExistsError = false
-
- try
- @_isAddingFeed = true
- # set folder to open
- if parentFolderId != 0
- @_folderBusinessLayer.open(parentFolderId)
- @_$scope.feedUrl = ''
- @_feedBusinessLayer.create feedUrl, parentFolderId
- # on success
- , (data) =>
- @_isAddingFeed = false
- @_feedBusinessLayer.load(data['feeds'][0].id)
- # on error
- , =>
- @_isAddingFeed = false
-
- catch error
- if error instanceof _ExistsError
- @_$scope.feedExistsError = true
- @_isAddingFeed = false
-
-
- @_$scope.addFolder = (folderName) =>
- @_$scope.folderExistsError = false
-
- try
- @_isAddingFolder = true
- @_folderBusinessLayer.create folderName
-
- # on success
- , (data) =>
- @_$scope.folderName = ''
- @_$scope.addNewFolder = false
- @_isAddingFolder = false
- activeId = data['folders'][0].id
- @_$scope.folderId = @_folderBusinessLayer.getById(activeId)
- # on error
- , =>
- @_isAddingFolder = false
-
- catch error
- if error instanceof _ExistsError
- @_$scope.folderExistsError = true
- @_isAddingFolder = false
-
-
- @_$scope.$on 'moveFeedToFolder', (scope, data) =>
- @_feedBusinessLayer.move(data.feedId, data.folderId)
-
-
-
- return new FeedController($scope, Persistence, FolderBusinessLayer,
- FeedBusinessLayer, SubscriptionsBusinessLayer,
- StarredBusinessLayer, unreadCountFormatter,
- ActiveFeed, FeedType, $window)
-
-] \ No newline at end of file
diff --git a/js/app/controllers/itemcontroller.coffee b/js/app/controllers/itemcontroller.coffee
deleted file mode 100644
index f381baede..000000000
--- a/js/app/controllers/itemcontroller.coffee
+++ /dev/null
@@ -1,84 +0,0 @@
-###
-
-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 <http://www.gnu.org/licenses/>.
-
-###
-
-
-angular.module('News').controller 'ItemController',
-['$scope', 'ItemBusinessLayer', 'FeedModel', 'FeedLoading', 'FeedBusinessLayer',
-'Language', 'AutoPageLoading', 'Compact',
-($scope, ItemBusinessLayer, FeedModel, FeedLoading, FeedBusinessLayer,
-Language, AutoPageLoading, Compact) ->
-
- class ItemController
-
- constructor: (@_$scope, @_itemBusinessLayer, @_feedModel,
- @_feedLoading, @_autoPageLoading, @_feedBusinessLayer,
- @_language, @_compact) ->
- @_autoPaging = true
-
- @_$scope.itemBusinessLayer = @_itemBusinessLayer
- @_$scope.feedBusinessLayer = @_feedBusinessLayer
-
- @_$scope.isLoading = =>
- return @_feedLoading.isLoading()
-
- @_$scope.isAutoPaging = =>
- return @_autoPageLoading.isLoading()
-
- @_$scope.getFeedTitle = (feedId) =>
- feed = @_feedModel.getById(feedId)
- if angular.isDefined(feed)
- return feed.title
- else
- return ''
-
-
- @_$scope.getRelativeDate = (date) =>
- if date
- return @_language.getMomentFromTimestamp(date).fromNow()
- else
- return ''
-
- @_$scope.loadNew = =>
- @_$scope.refresh = true
- @_itemBusinessLayer.loadNew =>
- @_$scope.refresh = false
-
-
- @_$scope.$on 'readItem', (scope, data) =>
- @_itemBusinessLayer.setRead(data)
-
- @_$scope.$on 'autoPage', =>
- if @_autoPaging
- # prevent multiple autopaging requests
- @_autoPaging = false
- @_itemBusinessLayer.loadNext (data) =>
- @_autoPaging = true
-
-
- @_$scope.isCompactView = =>
- return @_compact.isCompact()
-
-
- return new ItemController($scope, ItemBusinessLayer, FeedModel, FeedLoading,
- AutoPageLoading, FeedBusinessLayer, Language,
- Compact)
-] \ No newline at end of file
diff --git a/js/app/controllers/settingscontroller.coffee b/js/app/controllers/settingscontroller.coffee
deleted file mode 100644
index 66f7f8824..000000000
--- a/js/app/controllers/settingscontroller.coffee
+++ /dev/null
@@ -1,63 +0,0 @@
-###
-
-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 <http://www.gnu.org/licenses/>.
-
-###
-
-
-angular.module('News').controller 'SettingsController',
-['$scope', 'FeedBusinessLayer', 'FolderBusinessLayer', 'ShowAll',
-'Persistence', 'Compact',
-($scope, FeedBusinessLayer, FolderBusinessLayer, ShowAll, Persistence,
-Compact) ->
-
- $scope.feedBusinessLayer = FeedBusinessLayer
-
- $scope.import = (fileContent) ->
- $scope.error = false
- ShowAll.setShowAll(true)
-
- try
- FolderBusinessLayer.import(fileContent)
- catch error
- $scope.error = true
-
-
- $scope.importArticles = (fileContent) ->
- $scope.jsonError = false
- $scope.loading = true
-
- try
- parsedJSON = JSON.parse(fileContent)
- FeedBusinessLayer.importArticles parsedJSON, ->
- $scope.loading = false
- catch error
- $scope.jsonError = true
- $scope.loading = false
-
-
- $scope.setCompactView = (isCompact) ->
- Compact.handle(!Compact.isCompact())
-
- Persistence.userSettingsSetCompact(Compact.isCompact())
-
- $scope.isCompactView = ->
- return Compact.isCompact()
-
-] \ No newline at end of file