From d65fa8090469286396342ff2299b58b79d83f8f3 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 23 Mar 2013 16:08:39 +0100 Subject: fixed dicontainer and added basic controllers --- js/app/controllers/controllers.coffee | 43 ++++++++++++++++++++++++++++ js/app/controllers/feedcontroller.coffee | 31 ++++++++++++++++++++ js/app/controllers/itemcontroller.coffee | 31 ++++++++++++++++++++ js/app/controllers/settingscontroller.coffee | 31 ++++++++++++++++++++ js/app/services/services.coffee | 11 +++++-- 5 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 js/app/controllers/controllers.coffee create mode 100644 js/app/controllers/feedcontroller.coffee create mode 100644 js/app/controllers/itemcontroller.coffee create mode 100644 js/app/controllers/settingscontroller.coffee (limited to 'js/app') diff --git a/js/app/controllers/controllers.coffee b/js/app/controllers/controllers.coffee new file mode 100644 index 000000000..55566f7d0 --- /dev/null +++ b/js/app/controllers/controllers.coffee @@ -0,0 +1,43 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@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 . + +### + +angular.module('News').controller 'SettingsController', +['$scope', '_SettingsController', +($scope, _SettingsController)-> + + return new _SettingsController($scope) +] + + +angular.module('News').controller 'FeedController', +['$scope', '_FeedController', 'FolderModel', 'FeedModel', +($scope, _FeedController, FolderModel, FeedModel)-> + + return new _FeedController($scope, FolderModel, FeedModel) +] + +angular.module('News').controller 'ItemController', +['$scope', '_ItemController', 'ItemModel', +($scope, _ItemController, ItemModel)-> + + return new _ItemController($scope, ItemModel) +] \ No newline at end of file diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee new file mode 100644 index 000000000..a641a8a9c --- /dev/null +++ b/js/app/controllers/feedcontroller.coffee @@ -0,0 +1,31 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@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 . + +### + + +angular.module('News').factory '_FeedController', -> + + class FeedController + + constructor: (@$scope, @folderModel, @feedModel) -> + + + return FeedController \ No newline at end of file diff --git a/js/app/controllers/itemcontroller.coffee b/js/app/controllers/itemcontroller.coffee new file mode 100644 index 000000000..3350c674e --- /dev/null +++ b/js/app/controllers/itemcontroller.coffee @@ -0,0 +1,31 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@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 . + +### + + +angular.module('News').factory '_ItemController', -> + + class ItemController + + constructor: (@$scope, @itemModel) -> + + + return ItemController \ No newline at end of file diff --git a/js/app/controllers/settingscontroller.coffee b/js/app/controllers/settingscontroller.coffee new file mode 100644 index 000000000..0383b13fe --- /dev/null +++ b/js/app/controllers/settingscontroller.coffee @@ -0,0 +1,31 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@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 . + +### + + +angular.module('News').factory '_SettingsController', -> + + class SettingsController + + constructor: (@$scope) -> + + + return SettingsController \ No newline at end of file diff --git a/js/app/services/services.coffee b/js/app/services/services.coffee index 31b33871c..08d4d6274 100644 --- a/js/app/services/services.coffee +++ b/js/app/services/services.coffee @@ -23,9 +23,9 @@ License along with this library. If not, see . # request related stuff angular.module('News').factory 'Persistence', ['_Persistence', 'Request', -'Loading', 'Config', '$rootScope', 'ActiveFeed', -(_Persistence, Request, Loading, Config, ActiveFeed, $rootScope) -> - return new _Persistence(Request, Loading, Config, ActiveFeed, $rootScope) +'FeedLoading', 'Config', '$rootScope', 'ActiveFeed', +(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) -> + return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope) ] angular.module('News').factory 'Request', @@ -34,6 +34,11 @@ angular.module('News').factory 'Request', return new _Request($http, Publisher, Router) ] +# loading helpers +angular.module('News').factory 'FeedLoading', +['_Loading', (_Loading) -> + return new _Loading() +] # models angular.module('News').factory 'ActiveFeed', ['_ActiveFeed', (_ActiveFeed) -> -- cgit v1.2.3