summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-03-26 01:21:47 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-03-26 01:34:51 +0100
commitfc958460946a69acea6731a7d428e9dce1ef36da (patch)
tree4d465c649d0c17bd2c4d7daaccaf021a43ab7afe
parente6cf6a2dfc42fff1078ceeb3aa4272fb5c367b0b (diff)
fix tests
-rw-r--r--js/public/app.js900
1 files changed, 423 insertions, 477 deletions
diff --git a/js/public/app.js b/js/public/app.js
index 77eeca182..2b8965484 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -10,8 +10,7 @@
*/
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -31,7 +30,8 @@ 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', ['OC', 'ui']).config(function($provide) {
@@ -66,8 +66,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -87,7 +86,8 @@ 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').directive('newsAudio', function() {
@@ -118,6 +118,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
+// Generated by CoffeeScript 1.6.3
(function() {
angular.module('News').directive('newsAutoFocus', function() {
var directive;
@@ -133,7 +134,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -153,7 +154,8 @@ 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').directive('droppable', [
@@ -183,8 +185,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -204,7 +205,8 @@ 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').directive('itemShortcuts', [
@@ -326,8 +328,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -347,7 +348,8 @@ 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').directive('newsClickScroll', [
@@ -375,8 +377,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -396,7 +397,8 @@ 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() {
var markingRead, scrolling;
@@ -458,8 +460,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -479,7 +480,8 @@ 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').directive('newsPullToRefresh', [
@@ -509,8 +511,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -530,7 +531,8 @@ 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').directive('newsTranslate', function() {
@@ -547,8 +549,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -568,7 +569,8 @@ 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').directive('undoNotification', [
@@ -610,8 +612,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -631,7 +632,8 @@ 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').controller('AppController', [
@@ -639,17 +641,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var AppController;
AppController = (function() {
function AppController(_$scope, _persistence, _feedBusinessLayer) {
- var successCallback;
+ var successCallback,
+ _this = this;
this._$scope = _$scope;
this._persistence = _persistence;
this._feedBusinessLayer = _feedBusinessLayer;
this._$scope.initialized = false;
this._$scope.feedBusinessLayer = this._feedBusinessLayer;
- successCallback = (function(_this) {
- return function() {
- return _this._$scope.initialized = true;
- };
- })(this);
+ successCallback = function() {
+ return _this._$scope.initialized = true;
+ };
this._persistence.init().then(successCallback);
}
@@ -662,8 +663,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -683,7 +683,8 @@ 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').controller('FeedController', [
@@ -691,6 +692,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
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;
@@ -708,95 +710,83 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._$scope.subscriptionsBusinessLayer = this._subscriptionsBusinessLayer;
this._$scope.starredBusinessLayer = this._starredBusinessLayer;
this._$scope.unreadCountFormatter = this._unreadCountFormatter;
- this._$scope.getTotalUnreadCount = (function(_this) {
- return function() {
- var appName, count, title, titleCount;
- count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
- if (_this._$scope.translations && _this._$scope.translations.appName) {
- appName = _this._$scope.translations.appName;
- } else {
- appName = '';
- }
- if (count > 0) {
- titleCount = _this._unreadCountFormatter(count);
- title = appName + ' (' + titleCount + ') | ownCloud';
- } else {
- title = appName + ' | ownCloud';
- }
- if (_this._$window.document.title !== title) {
- _this._$window.document.title = title;
- }
- return count;
- };
- })(this);
- this._$scope.isAddingFolder = (function(_this) {
- return function() {
- return _this._isAddingFolder;
- };
- })(this);
- this._$scope.isAddingFeed = (function(_this) {
- return function() {
- return _this._isAddingFeed;
- };
- })(this);
- this._$scope.addFeed = (function(_this) {
- return function(feedUrl, parentFolderId) {
- var error;
- if (parentFolderId == null) {
- parentFolderId = 0;
+ this._$scope.getTotalUnreadCount = function() {
+ var appName, count, title, titleCount;
+ count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
+ if (_this._$scope.translations && _this._$scope.translations.appName) {
+ appName = _this._$scope.translations.appName;
+ } else {
+ appName = '';
+ }
+ if (count > 0) {
+ titleCount = _this._unreadCountFormatter(count);
+ title = appName + ' (' + titleCount + ') | ownCloud';
+ } else {
+ title = appName + ' | ownCloud';
+ }
+ if (_this._$window.document.title !== title) {
+ _this._$window.document.title = title;
+ }
+ return count;
+ };
+ this._$scope.isAddingFolder = function() {
+ return _this._isAddingFolder;
+ };
+ this._$scope.isAddingFeed = function() {
+ return _this._isAddingFeed;
+ };
+ this._$scope.addFeed = function(feedUrl, parentFolderId) {
+ var error;
+ if (parentFolderId == null) {
+ parentFolderId = 0;
+ }
+ _this._$scope.feedExistsError = false;
+ try {
+ _this._isAddingFeed = true;
+ if (parentFolderId !== 0) {
+ _this._folderBusinessLayer.open(parentFolderId);
}
- _this._$scope.feedExistsError = false;
- try {
- _this._isAddingFeed = true;
- if (parentFolderId !== 0) {
- _this._folderBusinessLayer.open(parentFolderId);
- }
- _this._$scope.feedUrl = '';
- return _this._feedBusinessLayer.create(feedUrl, parentFolderId, function(data) {
- _this._isAddingFeed = false;
- return _this._feedBusinessLayer.load(data['feeds'][0].id);
- }, function() {
- return _this._isAddingFeed = false;
- });
- } catch (_error) {
- error = _error;
- if (error instanceof _ExistsError) {
- _this._$scope.feedExistsError = true;
- }
+ _this._$scope.feedUrl = '';
+ return _this._feedBusinessLayer.create(feedUrl, parentFolderId, function(data) {
+ _this._isAddingFeed = false;
+ return _this._feedBusinessLayer.load(data['feeds'][0].id);
+ }, function() {
return _this._isAddingFeed = false;
+ });
+ } catch (_error) {
+ error = _error;
+ if (error instanceof _ExistsError) {
+ _this._$scope.feedExistsError = true;
}
- };
- })(this);
- this._$scope.addFolder = (function(_this) {
- return 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;
- activeId = data['folders'][0].id;
- return _this._$scope.folderId = _this._folderBusinessLayer.getById(activeId);
- }, function() {
- return _this._isAddingFolder = false;
- });
- } catch (_error) {
- error = _error;
- if (error instanceof _ExistsError) {
- _this._$scope.folderExistsError = true;
- }
+ return _this._isAddingFeed = false;
+ }
+ };
+ 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;
+ activeId = data['folders'][0].id;
+ return _this._$scope.folderId = _this._folderBusinessLayer.getById(activeId);
+ }, function() {
return _this._isAddingFolder = false;
+ });
+ } catch (_error) {
+ error = _error;
+ if (error instanceof _ExistsError) {
+ _this._$scope.folderExistsError = true;
}
- };
- })(this);
- this._$scope.$on('moveFeedToFolder', (function(_this) {
- return function(scope, data) {
- return _this._feedBusinessLayer.move(data.feedId, data.folderId);
- };
- })(this));
+ return _this._isAddingFolder = false;
+ }
+ };
+ this._$scope.$on('moveFeedToFolder', function(scope, data) {
+ return _this._feedBusinessLayer.move(data.feedId, data.folderId);
+ });
}
return FeedController;
@@ -808,8 +798,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -829,7 +818,8 @@ 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').controller('ItemController', [
@@ -837,6 +827,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var ItemController;
ItemController = (function() {
function ItemController(_$scope, _itemBusinessLayer, _feedModel, _feedLoading, _autoPageLoading, _feedBusinessLayer, _language, _compact) {
+ var _this = this;
this._$scope = _$scope;
this._itemBusinessLayer = _itemBusinessLayer;
this._feedModel = _feedModel;
@@ -848,80 +839,60 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._autoPaging = true;
this._$scope.itemBusinessLayer = this._itemBusinessLayer;
this._$scope.feedBusinessLayer = this._feedBusinessLayer;
- this._$scope.edit = (function(_this) {
- return function(feedId) {
- var feed;
- feed = _this._feedModel.getById(feedId);
- feed.editing = true;
- return feed.originalValue = feed.title;
- };
- })(this);
- this._$scope.cancel = (function(_this) {
- return function(feedId) {
- var feed;
- feed = _this._feedModel.getById(feedId);
- feed.editing = false;
- return feed.title = feed.originalValue;
- };
- })(this);
- this._$scope.isLoading = (function(_this) {
- return function() {
- return _this._feedLoading.isLoading();
- };
- })(this);
- this._$scope.isAutoPaging = (function(_this) {
- return function() {
- return _this._autoPageLoading.isLoading();
- };
- })(this);
- this._$scope.getFeedTitle = (function(_this) {
- return function(feedId) {
- var feed;
- feed = _this._feedModel.getById(feedId);
- if (angular.isDefined(feed)) {
- return feed.title;
- } else {
- return '';
- }
- };
- })(this);
- this._$scope.getRelativeDate = (function(_this) {
- return function(date) {
- if (date) {
- return _this._language.getMomentFromTimestamp(date).fromNow();
- } else {
- return '';
- }
- };
- })(this);
- this._$scope.loadNew = (function(_this) {
- return function() {
- _this._$scope.refresh = true;
- return _this._itemBusinessLayer.loadNew(function() {
- return _this._$scope.refresh = false;
+ this._$scope.edit = function(feedId) {
+ var feed;
+ feed = _this._feedModel.getById(feedId);
+ feed.editing = true;
+ return feed.originalValue = feed.title;
+ };
+ this._$scope.cancel = function(feedId) {
+ var feed;
+ feed = _this._feedModel.getById(feedId);
+ feed.editing = false;
+ return feed.title = feed.originalValue;
+ };
+ this._$scope.isLoading = function() {
+ return _this._feedLoading.isLoading();
+ };
+ this._$scope.isAutoPaging = function() {
+ return _this._autoPageLoading.isLoading();
+ };
+ this._$scope.getFeedTitle = function(feedId) {
+ var feed;
+ feed = _this._feedModel.getById(feedId);
+ if (angular.isDefined(feed)) {
+ return feed.title;
+ } else {
+ return '';
+ }
+ };
+ this._$scope.getRelativeDate = function(date) {
+ if (date) {
+ return _this._language.getMomentFromTimestamp(date).fromNow();
+ } else {
+ return '';
+ }
+ };
+ this._$scope.loadNew = function() {
+ _this._$scope.refresh = true;
+ return _this._itemBusinessLayer.loadNew(function() {
+ return _this._$scope.refresh = false;
+ });
+ };
+ this._$scope.$on('readItem', function(scope, data) {
+ return _this._itemBusinessLayer.setRead(data);
+ });
+ this._$scope.$on('autoPage', function() {
+ if (_this._autoPaging) {
+ _this._autoPaging = false;
+ return _this._itemBusinessLayer.loadNext(function(data) {
+ return _this._autoPaging = true;
});
- };
- })(this);
- this._$scope.$on('readItem', (function(_this) {
- return function(scope, data) {
- return _this._itemBusinessLayer.setRead(data);
- };
- })(this));
- this._$scope.$on('autoPage', (function(_this) {
- return function() {
- if (_this._autoPaging) {
- _this._autoPaging = false;
- return _this._itemBusinessLayer.loadNext(function(data) {
- return _this._autoPaging = true;
- });
- }
- };
- })(this));
- this._$scope.isCompactView = (function(_this) {
- return function() {
- return _this._compact.isCompact();
- };
- })(this);
+ }
+ });
+ this._$scope.isCompactView = function() {
+ return _this._compact.isCompact();
+ };
}
return ItemController;
@@ -933,8 +904,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -954,7 +924,8 @@ 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').controller('SettingsController', [
@@ -998,8 +969,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1019,17 +989,18 @@ 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() {
function ActiveFeed() {
-
/*
Default value is all feeds
- */
+ */
+
this._id = 0;
this._type = 3;
}
@@ -1055,8 +1026,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1076,7 +1046,8 @@ 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('_BusinessLayer', function() {
@@ -1091,13 +1062,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
BusinessLayer.prototype.load = function(id) {
+ var _this = this;
this._$rootScope.$broadcast('loadingNewItems');
this._itemModel.clear();
- this._persistence.getItems(this._type, id, 0, (function(_this) {
- return function() {
- return _this._$rootScope.$broadcast('loadedNewItems');
- };
- })(this));
+ this._persistence.getItems(this._type, id, 0, function() {
+ return _this._$rootScope.$broadcast('loadedNewItems');
+ });
return this._activeFeed.handle({
id: id,
type: this._type
@@ -1116,8 +1086,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1137,7 +1106,8 @@ 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() {
var __hasProp = {}.hasOwnProperty,
@@ -1176,16 +1146,15 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
FeedBusinessLayer.prototype["delete"] = function(feedId) {
- var data, feed;
+ var data, feed,
+ _this = this;
feed = this._feedModel.removeById(feedId);
data = {
- undoCallback: (function(_this) {
- return function() {
- return _this._persistence.restoreFeed(feedId, function() {
- return this._persistence.getAllFeeds();
- });
- };
- })(this),
+ undoCallback: function() {
+ return _this._persistence.restoreFeed(feedId, function() {
+ return this._persistence.getAllFeeds();
+ });
+ },
caption: feed.title
};
this._$rootScope.$broadcast('undoMessage', data);
@@ -1248,17 +1217,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
};
FeedBusinessLayer.prototype.setShowAll = function(showAll) {
- var callback;
+ var callback,
+ _this = this;
this._showAll.setShowAll(showAll);
- callback = (function(_this) {
- return function() {
- _this._itemModel.clear();
- _this._newLoading.increase();
- return _this._persistence.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() {
- return _this._newLoading.decrease();
- });
- };
- })(this);
+ callback = function() {
+ _this._itemModel.clear();
+ _this._newLoading.increase();
+ return _this._persistence.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() {
+ return _this._newLoading.decrease();
+ });
+ };
if (showAll) {
return this._persistence.userSettingsReadShow(callback);
} else {
@@ -1346,8 +1314,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1367,7 +1334,8 @@ 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() {
var __hasProp = {}.hasOwnProperty,
@@ -1395,7 +1363,8 @@ 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;
+ 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++) {
@@ -1404,14 +1373,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
folder = this._folderModel.removeById(folderId);
data = {
- undoCallback: (function(_this) {
- return function() {
- return _this._persistence.restoreFolder(folderId, function() {
- _this._persistence.getAllFeeds();
- return _this._persistence.getAllFolders();
- });
- };
- })(this),
+ undoCallback: function() {
+ return _this._persistence.restoreFolder(folderId, function() {
+ _this._persistence.getAllFeeds();
+ return _this._persistence.getAllFolders();
+ });
+ },
caption: folder.name
};
this._$rootScope.$broadcast('undoMessage', data);
@@ -1561,41 +1528,40 @@ 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;
+ 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(_this) {
- return function(item) {
- var error, folder;
- if (item.isFolder()) {
- try {
- return _this.create(item.getName(), function(data) {
- return _this._importElement(item, data.folders[0].id);
- });
- } catch (_error) {
- error = _error;
- if (error instanceof _ExistsError) {
- folder = _this._folderModel.getByName(item.getName());
- _this.open(folder.id);
- return _this._importElement(item, folder.id);
- } else {
- return console.info(error);
- }
+ _results.push((function(item) {
+ var error, folder;
+ if (item.isFolder()) {
+ try {
+ return _this.create(item.getName(), function(data) {
+ return _this._importElement(item, data.folders[0].id);
+ });
+ } catch (_error) {
+ error = _error;
+ if (error instanceof _ExistsError) {
+ folder = _this._folderModel.getByName(item.getName());
+ _this.open(folder.id);
+ return _this._importElement(item, folder.id);
+ } else {
+ return console.info(error);
}
- } else {
- try {
- return _this._feedBusinessLayer.create(item.getUrl(), parentFolderId);
- } catch (_error) {
- error = _error;
- if (!error instanceof _ExistsError) {
- return console.info(error);
- }
+ }
+ } else {
+ try {
+ return _this._feedBusinessLayer.create(item.getUrl(), parentFolderId);
+ } catch (_error) {
+ error = _error;
+ if (!error instanceof _ExistsError) {
+ return console.info(error);
}
}
- };
- })(this)(item));
+ }
+ })(item));
}
return _results;
};
@@ -1609,8 +1575,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1630,7 +1595,8 @@ 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('ItemBusinessLayer', [
@@ -1758,8 +1724,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1779,7 +1744,8 @@ 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() {
var __hasProp = {}.hasOwnProperty,
@@ -1825,8 +1791,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1846,7 +1811,8 @@ 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() {
var __hasProp = {}.hasOwnProperty,
@@ -1910,8 +1876,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1931,7 +1896,8 @@ 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('Compact', function() {
@@ -1957,8 +1923,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -1978,7 +1943,8 @@ 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('_ExistsError', function() {
@@ -1996,8 +1962,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -2017,7 +1982,8 @@ 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('FeedType', function() {
@@ -2033,8 +1999,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-// Generated by CoffeeScript 1.7.1
-
+// Generated by CoffeeScript 1.6.3
/*
ownCloud - News
@@ -2054,7 +2019,8 @@ 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() {
var __indexOf = [].inde