summaryrefslogtreecommitdiffstats
path: root/js/build/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/build/app.js')
-rw-r--r--js/build/app.js61
1 files changed, 44 insertions, 17 deletions
diff --git a/js/build/app.js b/js/build/app.js
index 9dd7e321a..e3c800890 100644
--- a/js/build/app.js
+++ b/js/build/app.js
@@ -533,23 +533,34 @@ app.controller('ContentController',
}]);
app.controller('ExploreController', ["sites", "$rootScope", "FeedResource", function (sites, $rootScope, FeedResource) {
- 'use strict';
-
- this.sites = sites;
-
- this.feedExists = function (location) {
- return FeedResource.getByLocation(location) !== undefined;
- };
-
- this.subscribeTo = function (location) {
- $rootScope.$broadcast('addFeed', location);
- };
-
- this.isCategoryShown = function (data) {
- return data.filter(function (element) {
- return FeedResource.getByLocation(element.feed) === undefined;
- }).length > 0;
- };
+ 'use strict';
+
+ this.sites = sites;
+ // join all sites
+ this.feeds = Object.keys(sites).map(function (key) {
+ return [key, sites[key]];
+ }).reduce(function (xs, x) {
+ var category = x[0];
+ var feedList = x[1];
+ feedList.forEach(function (feed) {
+ feed.category = category;
+ });
+ return xs.concat(feedList);
+ }, []);
+
+ this.feedExists = function (location) {
+ return FeedResource.getByLocation(location) !== undefined;
+ };
+
+ this.subscribeTo = function (location) {
+ $rootScope.$broadcast('addFeed', location);
+ };
+
+ this.isCategoryShown = function (data) {
+ return data.filter(function (element) {
+ return FeedResource.getByLocation(element.feed) === undefined;
+ }).length > 0;
+ };
}]);
app.controller('NavigationController',
@@ -2848,6 +2859,22 @@ app.directive('newsReadFile', function () {
});
};
});
+app.directive('newsRefreshMasonry', function () {
+ 'use strict';
+ return function (scope, elem) {
+ if (scope.$last) {
+ var $grid = elem.parent().masonry({
+ itemSelector: '.explore-feed',
+ gutter: 25,
+ columnWidth: 300
+ });
+
+ $grid.imagesLoaded().progress( function() {
+ $grid.masonry('layout');
+ });
+ }
+ };
+});
app.directive('newsScroll', ["$timeout", "ITEM_AUTO_PAGE_SIZE", "MARK_READ_TIMEOUT", "SCROLL_TIMEOUT", function ($timeout, ITEM_AUTO_PAGE_SIZE,
MARK_READ_TIMEOUT, SCROLL_TIMEOUT) {
'use strict';