summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-23 16:08:39 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-23 16:08:39 +0100
commitd65fa8090469286396342ff2299b58b79d83f8f3 (patch)
treec1364cc456f556205d8e14f729b38ba745b3ba06
parent1f670b3180cfd71b8085c4ef0fe414a6a78e7d44 (diff)
fixed dicontainer and added basic controllers
-rw-r--r--dependencyinjection/dicontainer.php1
-rw-r--r--js/app/controllers/controllers.coffee43
-rw-r--r--js/app/controllers/feedcontroller.coffee31
-rw-r--r--js/app/controllers/itemcontroller.coffee31
-rw-r--r--js/app/controllers/settingscontroller.coffee31
-rw-r--r--js/app/services/services.coffee11
-rw-r--r--js/public/app.js185
-rw-r--r--js/tests/controllers/feedcontrollerSpec.coffee27
-rw-r--r--js/tests/controllers/itemcontrollerSpec.coffee27
-rw-r--r--js/tests/controllers/settingscontrollerSpec.coffee27
-rw-r--r--templates/main.php29
11 files changed, 434 insertions, 9 deletions
diff --git a/dependencyinjection/dicontainer.php b/dependencyinjection/dicontainer.php
index 319517ba1..b162adeee 100644
--- a/dependencyinjection/dicontainer.php
+++ b/dependencyinjection/dicontainer.php
@@ -43,6 +43,7 @@ use OCA\News\Db\FeedMapper;
use OCA\News\Db\ItemMapper;
use OCA\News\Db\StatusFlag;
+use OCA\News\Utility\FeedFetcher;
require_once __DIR__ . '/../3rdparty/SimplePie/autoloader.php';
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 <http://www.gnu.org/licenses/>.
+
+###
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+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 <http://www.gnu.org/licenses/>.
# 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) ->
diff --git a/js/public/app.js b/js/public/app.js
index 84953edac..d7b0d2f2a 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -90,6 +90,181 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
+ angular.module('News').controller('SettingsController', [
+ '$scope', '_SettingsController', function($scope, _SettingsController) {
+ return new _SettingsController($scope);
+ }
+ ]);
+
+ angular.module('News').controller('FeedController', [
+ '$scope', '_FeedController', 'FolderModel', 'FeedModel', function($scope, _FeedController, FolderModel, FeedModel) {
+ return new _FeedController($scope, FolderModel, FeedModel);
+ }
+ ]);
+
+ angular.module('News').controller('ItemController', [
+ '$scope', '_ItemController', 'ItemModel', function($scope, _ItemController, ItemModel) {
+ return new _ItemController($scope, ItemModel);
+ }
+ ]);
+
+}).call(this);
+
+// Generated by CoffeeScript 1.4.0
+
+/*
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+
+(function() {
+
+ angular.module('News').factory('_FeedController', function() {
+ var FeedController;
+ FeedController = (function() {
+
+ function FeedController($scope, folderModel, feedModel) {
+ this.$scope = $scope;
+ this.folderModel = folderModel;
+ this.feedModel = feedModel;
+ }
+
+ return FeedController;
+
+ })();
+ return FeedController;
+ });
+
+}).call(this);
+
+// Generated by CoffeeScript 1.4.0
+
+/*
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+
+(function() {
+
+ angular.module('News').factory('_ItemController', function() {
+ var ItemController;
+ ItemController = (function() {
+
+ function ItemController($scope, itemModel) {
+ this.$scope = $scope;
+ this.itemModel = itemModel;
+ }
+
+ return ItemController;
+
+ })();
+ return ItemController;
+ });
+
+}).call(this);
+
+// Generated by CoffeeScript 1.4.0
+
+/*
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+
+(function() {
+
+ angular.module('News').factory('_SettingsController', function() {
+ var SettingsController;
+ SettingsController = (function() {
+
+ function SettingsController($scope) {
+ this.$scope = $scope;
+ }
+
+ return SettingsController;
+
+ })();
+ return SettingsController;
+ });
+
+}).call(this);
+
+// Generated by CoffeeScript 1.4.0
+
+/*
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+
+(function() {
+
angular.module('News').factory('_ActiveFeed', function() {
var ActiveFeed;
ActiveFeed = (function() {
@@ -857,8 +1032,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('Persistence', [
- '_Persistence', 'Request', 'Loading', 'Config', '$rootScope', 'ActiveFeed', function(_Persistence, Request, Loading, Config, ActiveFeed, $rootScope) {
- return new _Persistence(Request, Loading, Config, ActiveFeed, $rootScope);
+ '_Persistence', 'Request', 'FeedLoading', 'Config', '$rootScope', 'ActiveFeed', function(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) {
+ return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope);
}
]);
@@ -868,6 +1043,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
]);
+ angular.module('News').factory('FeedLoading', [
+ '_Loading', function(_Loading) {
+ return new _Loading();
+ }
+ ]);
+
angular.module('News').factory('ActiveFeed', [
'_ActiveFeed', function(_ActiveFeed) {
return new _ActiveFeed();
diff --git a/js/tests/controllers/feedcontrollerSpec.coffee b/js/tests/controllers/feedcontrollerSpec.coffee
new file mode 100644
index 000000000..a8b1df227
--- /dev/null
+++ b/js/tests/controllers/feedcontrollerSpec.coffee
@@ -0,0 +1,27 @@
+###
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+describe '_FeedController', ->
+
+
+ beforeEach module 'News' \ No newline at end of file
diff --git a/js/tests/controllers/itemcontrollerSpec.coffee b/js/tests/controllers/itemcontrollerSpec.coffee
new file mode 100644
index 000000000..32d6651a7
--- /dev/null
+++ b/js/tests/controllers/itemcontrollerSpec.coffee
@@ -0,0 +1,27 @@
+###
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+describe '_ItemController', ->
+
+
+ beforeEach module 'News' \ No newline at end of file
diff --git a/js/tests/controllers/settingscontrollerSpec.coffee b/js/tests/controllers/settingscontrollerSpec.coffee
new file mode 100644
index 000000000..aa66b6878
--- /dev/null
+++ b/js/tests/controllers/settingscontrollerSpec.coffee
@@ -0,0 +1,27 @@
+###
+
+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 <http://www.gnu.org/licenses/>.
+
+###
+
+
+describe '_SettingsController', ->
+
+
+ beforeEach module 'News' \ No newline at end of file
diff --git a/templates/main.php b/templates/main.php
index 5a62a0a92..422259c64 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -1,5 +1,26 @@
+<?php
+
+\OCP\Util::addScript('core', 'multiselect');
+
+\OCP\Util::addScript('appframework', 'vendor/angular/angular');
+\OCP\Util::addScript('appframework', 'public/app');
+
+\OCP\Util::addScript('news', 'vendor/angular-ui/angular-ui');
+\OCP\Util::addScript('news', 'vendor/momentjs/moment');
+\OCP\Util::addScript('news', 'public/app');
+
+\OCP\Util::addStyle('news', 'owncloud');
+\OCP\Util::addStyle('news', 'addnew');
+\OCP\Util::addStyle('news', 'feeds');
+\OCP\Util::addStyle('news', 'items');
+\OCP\Util::addStyle('news', 'settings');
+\OCP\Util::addStyle('news', 'addnew');
+\OCP\Util::addStyle('news', 'showall');
+
+?>
+
<div id="app" ng-app="News">
- <div id="app-navigation" ng-controller="FeedController">
+ <div id="left-content" ng-controller="FeedController">
<ul class="with-icon" data-id="0" droppable>
<?php print_unescaped($this->inc('part.addnew')) ?>
@@ -14,7 +35,7 @@
<div id="app-settings-header">
<button name="app settings"
class="settings-button"
- click-slide-toggle="{
+ oc-click-slide-toggle="{
selector: '#app-settings-content',
hideOnFocusLost: true
}"></button>
@@ -26,9 +47,9 @@
</div>
- <div id="app-content" ng-class="{loading: loading.loading>0}"
+ <div id="right-content" ng-class="{loading: loading.loading>0}"
ng-controller="ItemController" when-scrolled="scroll()" feed-navigation>
<?php print_unescaped($this->inc("part.items")); ?>
</div>
-</div>
+</div> \ No newline at end of file