diff options
Diffstat (limited to 'coffee/controllers')
-rw-r--r-- | coffee/controllers/addnewcontroller.coffee | 2 | ||||
-rw-r--r-- | coffee/controllers/feedcontroller.coffee | 106 | ||||
-rw-r--r-- | coffee/controllers/settingscontroller.coffee | 4 |
3 files changed, 56 insertions, 56 deletions
diff --git a/coffee/controllers/addnewcontroller.coffee b/coffee/controllers/addnewcontroller.coffee index 348b1ecb1..27fd071b7 100644 --- a/coffee/controllers/addnewcontroller.coffee +++ b/coffee/controllers/addnewcontroller.coffee @@ -15,6 +15,6 @@ angular.module('News').factory '_AddNewController', ['Controller', (Controller) -> - class AddNewController extends Controller + class AddNewController extends Controller ]
\ No newline at end of file diff --git a/coffee/controllers/feedcontroller.coffee b/coffee/controllers/feedcontroller.coffee index 4717a6594..9f3e733ee 100644 --- a/coffee/controllers/feedcontroller.coffee +++ b/coffee/controllers/feedcontroller.coffee @@ -26,60 +26,60 @@ angular.module('News').factory '_FeedController', ['Controller', (Controller) -> @$scope.folders = @folderModel.getItems() @$scope.feedType = @feedType - @$scope.getShowAll = => - return @showAll.showAll - - @$scope.setShowAll = (value) => - @showAll.showAll = value - @persistence.showAll(value) - @$rootScope.$broadcast('triggerHideRead') - - @$scope.addFeed = (url, folder) => - @$scope.feedEmptyError = false - @$scope.feedExistsError = false - @$scope.feedError = false + @$scope.getShowAll = => + return @showAll.showAll + + @$scope.setShowAll = (value) => + @showAll.showAll = value + @persistence.showAll(value) + @$rootScope.$broadcast('triggerHideRead') + + @$scope.addFeed = (url, folder) => + @$scope.feedEmptyError = false + @$scope.feedExistsError = false + @$scope.feedError = false - if url == undefined or url.trim() == '' - @$scope.feedEmptyError = true - else - url = url.trim() - for feed in @feedModel.getItems() - if url == feed.url # FIXME: can we really compare this - @$scope.feedExistsError = true - - if not (@$scope.feedEmptyError or @$scope.feedExistsError) - if folder == undefined - folderId = 0 - else - folderId = folder.id - @addingFeed = true - onSuccess = => - @$scope.feedUrl = '' - @addingFeed = false - onError = => - @$scope.feedError = true - @addingFeed = false - @persistence.createFeed(url, folderId, onSuccess, onError) - - - @$scope.addFolder = (name) => - @$scope.folderEmptyError = false - @$scope.folderExistsError = false - - if name == undefined or name.trim() == '' - @$scope.folderEmptyError = true - else - name = name.trim() - for folder in @folderModel.getItems() - if name.toLowerCase() == folder.name.toLowerCase() - @$scope.folderExistsError = true - - if not (@$scope.folderEmptyError or @$scope.folderExistsError) - @addingFolder = true - onSuccess = => - @$scope.folderName = '' - @addingFolder = false - @persistence.createFolder(name, onSuccess) + if url == undefined or url.trim() == '' + @$scope.feedEmptyError = true + else + url = url.trim() + for feed in @feedModel.getItems() + if url == feed.url # FIXME: can we really compare this + @$scope.feedExistsError = true + + if not (@$scope.feedEmptyError or @$scope.feedExistsError) + if folder == undefined + folderId = 0 + else + folderId = folder.id + @addingFeed = true + onSuccess = => + @$scope.feedUrl = '' + @addingFeed = false + onError = => + @$scope.feedError = true + @addingFeed = false + @persistence.createFeed(url, folderId, onSuccess, onError) + + + @$scope.addFolder = (name) => + @$scope.folderEmptyError = false + @$scope.folderExistsError = false + + if name == undefined or name.trim() == '' + @$scope.folderEmptyError = true + else + name = name.trim() + for folder in @folderModel.getItems() + if name.toLowerCase() == folder.name.toLowerCase() + @$scope.folderExistsError = true + + if not (@$scope.folderEmptyError or @$scope.folderExistsError) + @addingFolder = true + onSuccess = => + @$scope.folderName = '' + @addingFolder = false + @persistence.createFolder(name, onSuccess) @$scope.toggleFolder = (folderId) => folder = @folderModel.getItemById(folderId) diff --git a/coffee/controllers/settingscontroller.coffee b/coffee/controllers/settingscontroller.coffee index 9afda5407..ef862b77e 100644 --- a/coffee/controllers/settingscontroller.coffee +++ b/coffee/controllers/settingscontroller.coffee @@ -18,7 +18,7 @@ angular.module('News').factory '_SettingsController', ['Controller', class SettingsController extends Controller - constructor: (@$scope, @$rootScope, @persistence, @opmlParser) -> + constructor: (@$scope, @$rootScope, @persistence, @opmlParser) -> @add = false @settings = false @@ -27,7 +27,7 @@ angular.module('News').factory '_SettingsController', ['Controller', @$scope.$on 'readFile', (scope, fileContent) => structure = @opmlParser.parseXML(fileContent) - @parseOPMLStructure(structure) + @parseOPMLStructure(structure) @$scope.$on 'hidesettings', => @add = false |