summaryrefslogtreecommitdiffstats
path: root/js/public/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/public/app.js')
-rw-r--r--js/public/app.js178
1 files changed, 103 insertions, 75 deletions
diff --git a/js/public/app.js b/js/public/app.js
index ea1974247..0f4912af6 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -1,4 +1,4 @@
-(function(angular, $, hex_md5, undefined){
+(function(angular, $, hex_md5, moment, undefined){
/**
* ownCloud News App - v0.0.1
@@ -218,45 +218,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
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);
- }
- ]);
-
- angular.module('News').controller('ItemController', [
- '$scope', '_ItemController', 'ItemBl', 'FeedModel', 'FeedLoading', 'FeedBl', function($scope, _ItemController, ItemBl, FeedModel, FeedLoading, FeedBl) {
- return new _ItemController($scope, ItemBl, FeedModel, FeedLoading, FeedBl);
- }
- ]);
-
-}).call(this);
-
-// Generated by CoffeeScript 1.6.2
-/*
-
-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', [
- '_ExistsError', function(_ExistsError) {
+ '$scope', '_ExistsError', 'Persistence', 'FolderBl', 'FeedBl', 'SubscriptionsBl', 'StarredBl', 'unreadCountFormatter', function($scope, _ExistsError, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter) {
var FeedController;
FeedController = (function() {
@@ -350,7 +312,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return FeedController;
})();
- return FeedController;
+ return new FeedController($scope, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter);
}
]);
@@ -380,40 +342,43 @@ 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, _itemBl, _feedModel, _feedLoading, _feedBl) {
- var _this = this;
-
- this._$scope = _$scope;
- this._itemBl = _itemBl;
- this._feedModel = _feedModel;
- this._feedLoading = _feedLoading;
- this._feedBl = _feedBl;
- this._$scope.itemBl = this._itemBl;
- this._$scope.feedBl = this._feedBl;
- this._$scope.isLoading = function() {
- return _this._feedLoading.isLoading();
- };
- this._$scope.getFeedTitle = function(feedId) {
- var feed;
+ angular.module('News').controller('ItemController', [
+ '$scope', 'ItemBl', 'FeedModel', 'FeedLoading', 'FeedBl', 'Language', function($scope, ItemBl, FeedModel, FeedLoading, FeedBl, Language) {
+ var ItemController;
- feed = _this._feedModel.getById(feedId);
- if (angular.isDefined(feed)) {
- return feed.title;
- } else {
- return '';
- }
- };
- }
+ ItemController = (function() {
+ function ItemController(_$scope, _itemBl, _feedModel, _feedLoading, _feedBl, _language) {
+ var _this = this;
- return ItemController;
+ this._$scope = _$scope;
+ this._itemBl = _itemBl;
+ this._feedModel = _feedModel;
+ this._feedLoading = _feedLoading;
+ this._feedBl = _feedBl;
+ this._language = _language;
+ this._$scope.itemBl = this._itemBl;
+ this._$scope.feedBl = this._feedBl;
+ this._$scope.isLoading = function() {
+ return _this._feedLoading.isLoading();
+ };
+ this._$scope.getFeedTitle = function(feedId) {
+ var feed;
- })();
- return ItemController;
- });
+ feed = _this._feedModel.getById(feedId);
+ if (angular.isDefined(feed)) {
+ return feed.title;
+ } else {
+ return '';
+ }
+ };
+ }
+
+ return ItemController;
+
+ })();
+ return new ItemController($scope, ItemBl, FeedModel, FeedLoading, FeedBl, Language);
+ }
+ ]);
}).call(this);
@@ -1427,6 +1392,54 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
+ angular.module('News').factory('Language', function() {
+ var Language;
+
+ Language = (function() {
+ function Language() {
+ this._language = 'en';
+ }
+
+ Language.prototype.handle = function(data) {
+ return this._language = data.language;
+ };
+
+ Language.prototype.getLanguage = function() {
+ return this._language;
+ };
+
+ return Language;
+
+ })();
+ return new Language();
+ });
+
+}).call(this);
+
+// Generated by CoffeeScript 1.6.2
+/*
+
+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() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
@@ -2082,7 +2095,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this.getAllFolders(triggerHideRead);
this.getAllFeeds(triggerHideRead);
this.userSettingsRead(triggerHideRead);
- return this.getStarredItems(triggerHideRead);
+ this.getStarredItems(triggerHideRead);
+ return this.userSettingsLanguage();
};
/*
@@ -2463,6 +2477,19 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return this._request.post('news_usersettings_read_hide', data);
};
+ Persistence.prototype.userSettingsLanguage = function(callback) {
+ var data;
+
+ if (callback == null) {
+ callback = null;
+ }
+ callback || (callback = function() {});
+ data = {
+ onSuccess: callback
+ };
+ return this._request.get('news_usersettings_language', data);
+ };
+
Persistence.prototype._triggerHideRead = function() {
return this._$rootScope.$broadcast('triggerHideRead');
};
@@ -2566,12 +2593,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
]);
angular.module('News').factory('Publisher', [
- '_Publisher', 'ActiveFeed', 'ShowAll', 'StarredCount', 'ItemModel', 'FolderModel', 'FeedModel', function(_Publisher, ActiveFeed, ShowAll, StarredCount, ItemModel, FolderModel, FeedModel) {
+ '_Publisher', 'ActiveFeed', 'ShowAll', 'StarredCount', 'ItemModel', 'FolderModel', 'FeedModel', 'Language', function(_Publisher, ActiveFeed, ShowAll, StarredCount, ItemModel, FolderModel, FeedModel, Language) {
var publisher;
publisher = new _Publisher();
publisher.subscribeObjectTo(ActiveFeed, 'activeFeed');
publisher.subscribeObjectTo(ShowAll, 'showAll');
+ publisher.subscribeObjectTo(Language, 'language');
publisher.subscribeObjectTo(StarredCount, 'starred');
publisher.subscribeObjectTo(FolderModel, 'folders');
publisher.subscribeObjectTo(FeedModel, 'feeds');
@@ -2756,4 +2784,4 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-})(window.angular, jQuery, hex_md5); \ No newline at end of file
+})(window.angular, jQuery, hex_md5, moment); \ No newline at end of file