summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-12 14:53:02 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-12 14:53:02 +0200
commita069add71e642f37c6309c3bd7af74761acef929 (patch)
tree59b3326de202dd5a8bb5e29ae1a626794fb6b349 /js
parente8767f75116ff7ef2b7a349480151c9f66bbade0 (diff)
implement export, needs proper unittests though, fix 31
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/controllers.coffee8
-rw-r--r--js/app/controllers/settingscontroller.coffee15
-rw-r--r--js/app/services/opmlparser.coffee2
-rw-r--r--js/public/app.js35
4 files changed, 16 insertions, 44 deletions
diff --git a/js/app/controllers/controllers.coffee b/js/app/controllers/controllers.coffee
index 02d5f5e6c..8a73549cf 100644
--- a/js/app/controllers/controllers.coffee
+++ b/js/app/controllers/controllers.coffee
@@ -20,14 +20,6 @@ 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', 'Persistence', 'FolderBl', 'FeedBl',
'SubscriptionsBl', 'StarredBl', 'unreadCountFormatter',
diff --git a/js/app/controllers/settingscontroller.coffee b/js/app/controllers/settingscontroller.coffee
index ec94b843c..07cf7360a 100644
--- a/js/app/controllers/settingscontroller.coffee
+++ b/js/app/controllers/settingscontroller.coffee
@@ -21,15 +21,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
###
-angular.module('News').factory '_SettingsController', ->
+angular.module('News').controller 'SettingsController',
+['$scope', 'FeedBl', ($scope, FeedBl) ->
- class SettingsController
+ $scope.import = (fileContent) ->
+ console.log fileContent
- constructor: (@$scope) ->
+ $scope.feedBl = FeedBl
- @$scope.import = (fileContent) =>
- console.log 'hi'
- console.log fileContent
-
-
- return SettingsController \ No newline at end of file
+] \ No newline at end of file
diff --git a/js/app/services/opmlparser.coffee b/js/app/services/opmlparser.coffee
index 5154e423c..9586cbaf2 100644
--- a/js/app/services/opmlparser.coffee
+++ b/js/app/services/opmlparser.coffee
@@ -66,7 +66,7 @@ angular.module('News').factory '_OPMLParser', ->
_recursivelyParse: ($xml, structure) ->
for outline in $xml.children('outline')
$outline = $(outline)
- if angular.isDefined($outline.attr('type'))
+ if angular.isDefined($outline.attr('xmlUrl'))
feed = new Feed($outline.attr('text'), $outline.attr('xmlUrl'))
structure.add(feed)
else
diff --git a/js/public/app.js b/js/public/app.js
index e11c2e976..741188cb4 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -217,12 +217,6 @@ 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', 'Persistence', 'FolderBl', 'FeedBl', 'SubscriptionsBl', 'StarredBl', 'unreadCountFormatter', function($scope, _FeedController, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter) {
return new _FeedController($scope, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter);
@@ -460,25 +454,14 @@ 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) {
- var _this = this;
-
- this.$scope = $scope;
- this.$scope["import"] = function(fileContent) {
- console.log('hi');
- return console.log(fileContent);
- };
- }
-
- return SettingsController;
-
- })();
- return SettingsController;
- });
+ angular.module('News').controller('SettingsController', [
+ '$scope', 'FeedBl', function($scope, FeedBl) {
+ $scope["import"] = function(fileContent) {
+ return console.log(fileContent);
+ };
+ return $scope.feedBl = FeedBl;
+ }
+ ]);
}).call(this);
@@ -1966,7 +1949,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
outline = _ref[_i];
$outline = $(outline);
- if (angular.isDefined($outline.attr('type'))) {
+ if (angular.isDefined($outline.attr('xmlUrl'))) {
feed = new Feed($outline.attr('text'), $outline.attr('xmlUrl'));
_results.push(structure.add(feed));
} else {