summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-06-05 23:26:20 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-06-05 23:26:20 +0200
commita19aedbec8749c0e944728d4c8d024a50e6d9d0d (patch)
tree7fb0fc0ac596d65ca9a63de4428f410043c2649b /js
parenta5b1c6370588635ced856468ee3b8756e1390af6 (diff)
updated build tools, testacular is now named karma
Diffstat (limited to 'js')
-rw-r--r--js/Gruntfile.coffee34
-rw-r--r--js/Makefile12
-rw-r--r--js/config/karma.js (renamed from js/config/testacular_conf.js)0
-rw-r--r--js/package.json20
-rw-r--r--js/public/app.js181
5 files changed, 64 insertions, 183 deletions
diff --git a/js/Gruntfile.coffee b/js/Gruntfile.coffee
index 02bb03d7d..c76c34152 100644
--- a/js/Gruntfile.coffee
+++ b/js/Gruntfile.coffee
@@ -22,16 +22,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
module.exports = (grunt) ->
-
+
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-wrap');
grunt.loadNpmTasks('grunt-phpunit');
- grunt.loadNpmTasks('gruntacular');
+ grunt.loadNpmTasks('grunt-karma');
grunt.initConfig
-
+
meta:
pkg: grunt.file.readJSON('package.json')
version: '<%= meta.pkg.version %>'
@@ -43,16 +43,16 @@ module.exports = (grunt) ->
' *\n' +
' * This file is licensed under the Affero General Public License version 3 or later.\n' +
' * See the COPYING file\n' +
- ' *\n' +
+ ' *\n' +
' */\n\n'
build: 'build/'
production: 'public/'
concat:
- app:
+ app:
options:
banner: '<%= meta.banner %>\n'
- stripBanners:
+ stripBanners:
options: 'block'
src: [
'<%= meta.build %>app/app.js'
@@ -83,7 +83,7 @@ module.exports = (grunt) ->
'no_trailing_whitespace':
'level': 'warn'
- watch:
+ watch:
concat:
files: [
'<%= meta.build %>app/**/*.js'
@@ -94,20 +94,20 @@ module.exports = (grunt) ->
files: '../**/*.php'
tasks: 'phpunit'
- testacular:
- unit:
- configFile: 'config/testacular_conf.js'
+ karma:
+ unit:
+ configFile: 'config/karma.js'
continuous:
- configFile: 'config/testacular_conf.js'
+ configFile: 'config/karma.js'
singleRun: true
browsers: ['PhantomJS']
reporters: ['progress', 'junit']
junitReporter:
outputFile: 'test-results.xml'
- unit_phantom:
- configFile: 'config/testacular_conf.js'
- browsers: ['PhantomJS']
-
+ unit_phantom:
+ configFile: 'config/karma.js'
+ browsers: ['PhantomJS']
+
phpunit:
classes:
@@ -118,5 +118,5 @@ module.exports = (grunt) ->
grunt.registerTask('run', ['watch:concat'])
grunt.registerTask('compile', ['concat', 'wrap', 'coffeelint'])
- grunt.registerTask('ci', ['testacular:continuous'])
- grunt.registerTask('testphp', ['watch:phpunit']) \ No newline at end of file
+ grunt.registerTask('ci', ['karma:continuous'])
+ grunt.registerTask('testphp', ['watch:phpunit'])
diff --git a/js/Makefile b/js/Makefile
index 4b3bc39ae..f9cf87dec 100644
--- a/js/Makefile
+++ b/js/Makefile
@@ -33,16 +33,16 @@ watch: compile
$(coffee) --compile --watch --output $(CURDIR)/build/tests $(CURDIR)/tests/ & \
$(grunt) --config $(CURDIR)/Gruntfile.coffee run
-testacular: deps
+karma: deps
export CHROME_BIN=$(chrome_bin) && export FIREFOX_BIN=$(firefox_bin) && \
- $(grunt) --config $(CURDIR)/Gruntfile.coffee testacular
-
-testacular_phantom: deps
+ $(grunt) --config $(CURDIR)/Gruntfile.coffee karma
+
+karma_phantom: deps
export PHANTOMJS_BIN=$(phantomjs) && \
- $(grunt) --config $(CURDIR)/Gruntfile.coffee testacular:unit_phantom
+ $(grunt) --config $(CURDIR)/Gruntfile.coffee karma:unit_phantom
phpunit: deps
- $(grunt) --config $(CURDIR)/Gruntfile.coffee testphp
+ $(grunt) --config $(CURDIR)/Gruntfile.coffee testphp
compile: deps
mkdir -p $(CURDIR)/build/app
diff --git a/js/config/testacular_conf.js b/js/config/karma.js
index d5cb87ba0..d5cb87ba0 100644
--- a/js/config/testacular_conf.js
+++ b/js/config/karma.js
diff --git a/js/package.json b/js/package.json
index f78278f6e..9c7bf2dda 100644
--- a/js/package.json
+++ b/js/package.json
@@ -16,16 +16,16 @@
"contributors": [],
"dependencies": {},
"devDependencies": {
- "grunt": "~0.4",
- "grunt-cli": "~0.1.6",
- "coffee-script": "~1.6",
- "grunt-contrib-concat": "~0.1",
- "grunt-contrib-watch": "~0.2",
- "grunt-coffeelint": "0.0.6",
- "gruntacular": "~0.3",
- "grunt-wrap": "~0.2",
- "phantomjs": "~1.9",
- "grunt-phpunit": "0.2"
+ "grunt": "*",
+ "grunt-cli": "*",
+ "coffee-script": "*",
+ "grunt-contrib-concat": "*",
+ "grunt-contrib-watch": "*",
+ "grunt-coffeelint": "*",
+ "grunt-karma": "*",
+ "grunt-wrap": "*",
+ "phantomjs": "*",
+ "grunt-phpunit": "*"
},
"engine": "node >= 0.8"
}
diff --git a/js/public/app.js b/js/public/app.js
index 411814bcc..7a2da9d99 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -11,7 +11,7 @@
*/
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -37,7 +37,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News', ['OC', 'ui']).config(function($provide) {
var config;
-
return $provide.value('Config', config = {
markReadTimeout: 500,
scrollTimeout: 500,
@@ -69,7 +68,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -97,7 +96,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
'$rootScope', function($rootScope) {
return function(scope, elm, attr) {
var $elem, details;
-
$elem = $(elm);
details = {
accept: '.feed',
@@ -105,7 +103,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
greedy: true,
drop: function(event, ui) {
var data;
-
$('.drag-and-drop').removeClass('drag-and-drop');
data = {
folderId: parseInt($elem.data('id'), 10),
@@ -122,7 +119,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -150,16 +147,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
'$window', function($window) {
return function(scope, elm, attr) {
var getCurrentItem, jumpTo, jumpToNextItem, jumpToPreviousItem, keepUnreadCurrentItem, starCurrentItem;
-
jumpTo = function($scrollArea, $item) {
var position;
-
position = $item.offset().top - $scrollArea.offset().top + $scrollArea.scrollTop();
return $scrollArea.scrollTop(position);
};
jumpToPreviousItem = function(scrollArea) {
var $item, $items, $previous, $scrollArea, item, notJumped, _i, _len;
-
$scrollArea = $(scrollArea);
$items = $scrollArea.find('.feed_item');
notJumped = true;
@@ -181,7 +175,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
jumpToNextItem = function(scrollArea) {
var $item, $items, $scrollArea, item, _i, _len, _results;
-
$scrollArea = $(scrollArea);
$items = $scrollArea.find('.feed_item');
_results = [];
@@ -199,7 +192,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
getCurrentItem = function(scrollArea) {
var $item, $items, $scrollArea, item, _i, _len;
-
$scrollArea = $(scrollArea);
$items = $scrollArea.find('.feed_item');
for (_i = 0, _len = $items.length; _i < _len; _i++) {
@@ -212,19 +204,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
keepUnreadCurrentItem = function(scrollArea) {
var $item;
-
$item = getCurrentItem(scrollArea);
return $item.find('.keep_unread').trigger('click');
};
starCurrentItem = function(scrollArea) {
var $item;
-
$item = getCurrentItem(scrollArea);
return $item.find('.star').trigger('click');
};
return $($window.document).keydown(function(e) {
var focused, scrollArea;
-
focused = $(':focus');
if (!(focused.is('input') || focused.is('select') || focused.is('textarea') || focused.is('checkbox') || focused.is('button'))) {
scrollArea = elm;
@@ -248,7 +237,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -283,7 +272,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return function(scope, elm, attr) {
return elm.bind('scroll', function() {
var counter, item, _i, _ref, _results;
-
if (scrolling) {
scrolling = false;
setTimeout(function() {
@@ -293,7 +281,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
markingRead = false;
setTimeout(function() {
var $elems, feedItem, id, offset, _i, _len, _results;
-
markingRead = true;
$elems = elm.find('.feed_item:not(.read)');
_results = [];
@@ -333,7 +320,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -361,19 +348,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
'$rootScope', '$timeout', 'Config', function($rootScope, $timeout, Config) {
return function(scope, elm, attr) {
var caption, timeout, undo;
-
undo = function() {};
caption = '';
timeout = null;
$(elm).click(function() {
var timout;
-
timout = null;
return $(this).fadeOut();
});
$(elm).find('a').click(function() {
var timout;
-
undo();
timout = null;
$rootScope.$apply();
@@ -384,7 +368,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
return scope.$on('undoMessage', function(scope, data) {
var _this = this;
-
if (timeout) {
$timeout.cancel(timeout.promise);
}
@@ -401,7 +384,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -428,11 +411,9 @@ 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', function($scope, _ExistsError, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType, $window) {
var FeedController;
-
FeedController = (function() {
function FeedController(_$scope, _persistence, _folderBusinessLayer, _feedBusinessLayer, _subscriptionsBusinessLayer, _starredBusinessLayer, _unreadCountFormatter, _activeFeed, _feedType, _$window) {
var _this = this;
-
this._$scope = _$scope;
this._persistence = _persistence;
this._folderBusinessLayer = _folderBusinessLayer;
@@ -452,7 +433,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._$scope.unreadCountFormatter = this._unreadCountFormatter;
this._$scope.getTotalUnreadCount = function() {
var count, title, titleCount;
-
count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
if (count > 0) {
titleCount = _this._unreadCountFormatter(count);
@@ -473,7 +453,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
this._$scope.addFeed = function(feedUrl, parentFolderId) {
var error;
-
if (parentFolderId == null) {
parentFolderId = 0;
}
@@ -500,13 +479,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
this._$scope.addFolder = function(folderName) {
var error;
-
_this._$scope.folderExistsError = false;
try {
_this._isAddingFolder = true;
return _this._folderBusinessLayer.create(folderName, function(data) {
var activeId;
-
_this._$scope.folderName = '';
_this._$scope.addNewFolder = false;
_this._isAddingFolder = false;
@@ -537,7 +514,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -564,11 +541,9 @@ 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', function($scope, ItemBusinessLayer, FeedModel, FeedLoading, FeedBusinessLayer, Language, AutoPageLoading) {
var ItemController;
-
ItemController = (function() {
function ItemController(_$scope, _itemBusinessLayer, _feedModel, _feedLoading, _autoPageLoading, _feedBusinessLayer, _language) {
var _this = this;
-
this._$scope = _$scope;
this._itemBusinessLayer = _itemBusinessLayer;
this._feedModel = _feedModel;
@@ -587,7 +562,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
this._$scope.getFeedTitle = function(feedId) {
var feed;
-
feed = _this._feedModel.getById(feedId);
if (angular.isDefined(feed)) {
return feed.title;
@@ -624,7 +598,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -651,11 +625,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').controller('SettingsController', [
'$scope', 'FeedBusinessLayer', 'FolderBusinessLayer', 'ShowAll', function($scope, FeedBusinessLayer, FolderBusinessLayer, ShowAll) {
var _this = this;
-
$scope.feedBusinessLayer = FeedBusinessLayer;
$scope["import"] = function(fileContent) {
var error;
-
$scope.error = false;
ShowAll.setShowAll(true);
try {
@@ -668,7 +640,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
return $scope.importGoogleReader = function(fileContent) {
var error, parsedJSON;
-
$scope.jsonError = false;
ShowAll.setShowAll(true);
try {
@@ -685,7 +656,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -711,12 +682,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('ActiveFeed', function() {
var ActiveFeed;
-
ActiveFeed = (function() {
function ActiveFeed() {
/*
Default value is all feeds
*/
+
this._id = 0;
this._type = 3;
}
@@ -742,7 +713,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -768,7 +739,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('_BusinessLayer', function() {
var BusinessLayer;
-
BusinessLayer = (function() {
function BusinessLayer(_activeFeed, _persistence, _itemModel, _type) {
this._activeFeed = _activeFeed;
@@ -798,7 +768,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -828,7 +798,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('FeedBusinessLayer', [
'_BusinessLayer', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', 'FeedModel', 'NewLoading', '_ExistsError', 'Utils', '$rootScope', 'NewestItem', function(_BusinessLayer, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, NewLoading, _ExistsError, Utils, $rootScope, NewestItem) {
var FeedBusinessLayer;
-
FeedBusinessLayer = (function(_super) {
__extends(FeedBusinessLayer, _super);
@@ -862,7 +831,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype["delete"] = function(feedId) {
var data, feed,
_this = this;
-
feed = this._feedModel.removeById(feedId);
data = {
undoCallback: function() {
@@ -877,7 +845,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.markRead = function(feedId) {
var feed, item, newestItemId, _i, _len, _ref;
-
feed = this._feedModel.getById(feedId);
newestItemId = this._newestItem.getId();
if (angular.isDefined(feed) && newestItemId !== 0) {
@@ -907,7 +874,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.move = function(feedId, folderId) {
var feed;
-
feed = this._feedModel.getById(feedId);
if (angular.isDefined(feed) && feed.folderId !== folderId) {
this._feedModel.update({
@@ -922,7 +888,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.setShowAll = function(showAll) {
var callback,
_this = this;
-
this._showAll.setShowAll(showAll);
callback = function() {
_this._itemModel.clear();
@@ -948,7 +913,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.getFeedLink = function(feedId) {
var feed;
-
feed = this._feedModel.getById(feedId);
if (angular.isDefined(feed)) {
return feed.link;
@@ -958,7 +922,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.create = function(url, parentId, onSuccess, onFailure) {
var feed, success,
_this = this;
-
if (parentId == null) {
parentId = 0;
}
@@ -1007,7 +970,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedBusinessLayer.prototype.importGoogleReader = function(json) {
var feed, onSuccess, url,
_this = this;
-
url = 'http://owncloud/googlereader';
if (angular.isUndefined(this._feedModel.getByUrl(url))) {
feed = {
@@ -1021,7 +983,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
onSuccess = function(response) {
var id;
-
id = response.data.feeds[0].id;
return _this.load(id);
};
@@ -1037,7 +998,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1067,7 +1028,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('FolderBusinessLayer', [
'_BusinessLayer', 'FolderModel', 'FeedBusinessLayer', 'Persistence', 'FeedType', 'ActiveFeed', 'ItemModel', 'ShowAll', '_ExistsError', 'OPMLParser', 'NewestItem', 'FeedModel', '$rootScope', function(_BusinessLayer, FolderModel, FeedBusinessLayer, Persistence, FeedType, ActiveFeed, ItemModel, ShowAll, _ExistsError, OPMLParser, NewestItem, FeedModel, $rootScope) {
var FolderBusinessLayer;
-
FolderBusinessLayer = (function(_super) {
__extends(FolderBusinessLayer, _super);
@@ -1090,7 +1050,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype["delete"] = function(folderId) {
var data, feed, feeds, folder, _i, _len, _ref,
_this = this;
-
feeds = [];
_ref = this._feedBusinessLayer.getFeedsOfFolder(folderId);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1117,7 +1076,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype.open = function(folderId) {
var folder;
-
folder = this._folderModel.getById(folderId);
if (angular.isDefined(folder)) {
if (!folder.opened) {
@@ -1129,7 +1087,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype.toggleFolder = function(folderId) {
var folder;
-
folder = this._folderModel.getById(folderId);
if (angular.isDefined(folder)) {
folder.opened = !folder.opened;
@@ -1143,7 +1100,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype.markRead = function(folderId) {
var feed, folder, item, newestItemId, _i, _j, _len, _len1, _ref, _ref1;
-
newestItemId = this._newestItem.getId();
folder = this._folderModel.getById(folderId);
if (newestItemId !== 0 && angular.isDefined(folder)) {
@@ -1169,7 +1125,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype.isVisible = function(folderId) {
var feed, _i, _len, _ref;
-
if (this._showAll.getShowAll()) {
return true;
} else {
@@ -1196,7 +1151,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype.create = function(folderName, onSuccess, onFailure) {
var folder, success,
_this = this;
-
if (onSuccess == null) {
onSuccess = null;
}
@@ -1234,7 +1188,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype["import"] = function(xml) {
var opml;
-
opml = this._opmlParser.parseXML(xml);
return this._importElement(opml, 0);
};
@@ -1242,14 +1195,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FolderBusinessLayer.prototype._importElement = function(opml, parentFolderId) {
var item, _i, _len, _ref, _results,
_this = this;
-
_ref = opml.getItems();
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
item = _ref[_i];
_results.push((function(item) {
var error, folder;
-
if (item.isFolder()) {
try {
return _this.create(item.getName(), function(data) {
@@ -1289,7 +1240,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1316,7 +1267,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('ItemBusinessLayer', [
'ItemModel', 'FeedModel', 'Persistence', 'ActiveFeed', 'FeedType', 'StarredBusinessLayer', 'NewestItem', function(ItemModel, FeedModel, Persistence, ActiveFeed, FeedType, StarredBusinessLayer, NewestItem) {
var ItemBusinessLayer;
-
ItemBusinessLayer = (function() {
function ItemBusinessLayer(_itemModel, _feedModel, _persistence, _activeFeed, _feedType, _starredBusinessLayer, _newestItem) {
this._itemModel = _itemModel;
@@ -1338,7 +1288,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.isKeptUnread = function(itemId) {
var item;
-
item = this._itemModel.getById(itemId);
if (angular.isDefined(item) && angular.isDefined(item.keptUnread)) {
return item.keptUnread;
@@ -1348,7 +1297,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.toggleKeepUnread = function(itemId) {
var item;
-
item = this._itemModel.getById(itemId);
if (angular.isDefined(item) && !item.keptUnread) {
item.keptUnread = true;
@@ -1362,7 +1310,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.toggleStarred = function(itemId) {
var item;
-
item = this._itemModel.getById(itemId);
if (item.isStarred()) {
item.setUnstarred();
@@ -1377,7 +1324,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.setRead = function(itemId) {
var feed, item, keptUnread;
-
item = this._itemModel.getById(itemId);
if (angular.isDefined(item)) {
keptUnread = angular.isDefined(item.keptUnread) && item.keptUnread;
@@ -1394,7 +1340,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.setUnread = function(itemId) {
var feed, item;
-
item = this._itemModel.getById(itemId);
if (angular.isDefined(item)) {
if (item.isRead()) {
@@ -1410,7 +1355,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.getFeedTitle = function(itemId) {
var feed, item;
-
item = this._itemModel.getById(itemId);
if (angular.isDefined(item)) {
feed = this._feedModel.getById(item.feedId);
@@ -1422,7 +1366,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ItemBusinessLayer.prototype.loadNext = function(callback) {
var lowestItemId;
-
lowestItemId = this._itemModel.getLowestId();
if (lowestItemId !== 0) {
return this._persistence.getItems(this._activeFeed.getType(), this._activeFeed.getId(), lowestItemId, callback);
@@ -1442,7 +1385,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1472,7 +1415,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('StarredBusinessLayer', [
'_BusinessLayer', 'StarredCount', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', function(_BusinessLayer, StarredCount, Persistence, ActiveFeed, FeedType, ItemModel) {
var StarredBusinessLayer;
-
StarredBusinessLayer = (function(_super) {
__extends(StarredBusinessLayer, _super);
@@ -1510,7 +1452,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1540,7 +1482,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('SubscriptionsBusinessLayer', [
'_BusinessLayer', 'FeedBusinessLayer', 'Persistence', 'ShowAll', 'ActiveFeed', 'FeedType', 'ItemModel', 'FeedModel', 'NewestItem', function(_BusinessLayer, FeedBusinessLayer, Persistence, ShowAll, ActiveFeed, FeedType, ItemModel, FeedModel, NewestItem) {
var SubscriptionsBusinessLayer;
-
SubscriptionsBusinessLayer = (function(_super) {
__extends(SubscriptionsBusinessLayer, _super);
@@ -1554,7 +1495,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
SubscriptionsBusinessLayer.prototype.isVisible = function() {
var visible;
-
if (this.isActive(0) && this._feedBusinessLayer.getNumberOfFeeds() > 0) {
return true;
}
@@ -1568,7 +1508,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
SubscriptionsBusinessLayer.prototype.markRead = function() {
var feed, item, newestItemId, _i, _j, _len, _len1, _ref, _ref1;
-
newestItemId = this._newestItem.getId();
if (newestItemId !== 0) {
_ref = this._feedModel.getAll();
@@ -1598,7 +1537,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1624,7 +1563,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('_ExistsError', function() {
var ExistsError;
-
ExistsError = (function() {
function ExistsError(message) {
this.message = message;
@@ -1638,7 +1576,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1664,7 +1602,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('FeedType', function() {
var feedType;
-
return feedType = {
Feed: 0,
Folder: 1,
@@ -1676,7 +1613,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1704,7 +1641,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('Language', function() {
var Language;
-
Language = (function() {
function Language() {
this._language = 'en';
@@ -1738,7 +1674,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1768,7 +1704,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
angular.module('News').factory('FeedModel', [
'_Model', '_EqualQuery', 'Utils', function(_Model, _EqualQuery, Utils) {
var FeedModel;
-
FeedModel = (function(_super) {
__extends(FeedModel, _super);
@@ -1785,7 +1720,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.add = function(data, clearCache) {
var item, updateById, updateByUrl;
-
if (clearCache == null) {
clearCache = true;
}
@@ -1822,7 +1756,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.update = function(data, clearCache) {
var item, itemWithId;
-
if (clearCache == null) {
clearCache = true;
}
@@ -1847,7 +1780,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.removeById = function(id) {
var item;
-
item = this.getById(id);
delete this._url[item.url];
return FeedModel.__super__.removeById.call(this, id);
@@ -1859,7 +1791,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.getUnreadCount = function() {
var count, feed, _i, _len, _ref;
-
count = 0;
_ref = this.getAll();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@@ -1871,7 +1802,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.getFeedUnreadCount = function(feedId) {
var count, feed;
-
feed = this.getById(feedId);
count = 0;
if (angular.isDefined(feed)) {
@@ -1883,7 +1813,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.getFolderUnreadCount = function(folderId) {
var count, feed, query, _i, _len, _ref;
-
query = new _EqualQuery('folderId', parseInt(folderId));
count = 0;
_ref = this.get(query);
@@ -1896,14 +1825,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
FeedModel.prototype.getAllOfFolder = function(folderId) {
var query;
-
query = new _EqualQuery('folderId', parseInt(folderId));
return this.get(query);
};
FeedModel.prototype.removeByUrl = function(url, clearCache) {
var counter, entry, key, value, _i, _len, _ref, _ref1, _results;
-
if (clearCache == null) {
clearCache = true;
}
@@ -1946,7 +1873,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.6.3
/*