diff options
-rw-r--r-- | css/bootstrap/tooltip.css | 114 | ||||
-rw-r--r-- | js/Gruntfile.js | 14 | ||||
-rw-r--r-- | js/bower.json | 4 | ||||
-rw-r--r-- | js/build/app.js | 3024 | ||||
-rw-r--r-- | js/directive/NewsTooltip.js | 17 | ||||
-rw-r--r-- | js/package.json | 28 | ||||
-rw-r--r-- | js/vendor/momentjs/.bower.json | 2 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/.bower.json | 10 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/bower.json | 2 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.js | 151 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.min.js | 4 | ||||
-rw-r--r-- | js/vendor/traceur-runtime/traceur-runtime.min.map | 2 | ||||
-rw-r--r-- | templates/main.php | 2 |
13 files changed, 1405 insertions, 1969 deletions
diff --git a/css/bootstrap/tooltip.css b/css/bootstrap/tooltip.css deleted file mode 100644 index a5bf30552..000000000 --- a/css/bootstrap/tooltip.css +++ /dev/null @@ -1,114 +0,0 @@ -/*! - * Bootstrap v2.3.1 - * - * Copyright 2012 Twitter, Inc - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Designed and built with all the love in the world @twitter by @mdo and @fat. - */ -.clearfix { - *zoom: 1; -} -.clearfix:before, -.clearfix:after { - display: table; - content: ""; - line-height: 0; -} -.clearfix:after { - clear: both; -} -.hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -.input-block-level { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.tooltip { - position: fixed; - z-index: 1030; - display: block; - visibility: visible; - font-size: 11px; - line-height: 1.4; - opacity: 0; - filter: alpha(opacity=0); - white-space: nowrap; - overflow: visible; -} -.tooltip.in { - opacity: 0.8; - filter: alpha(opacity=80); -} -.tooltip.top { - margin-top: -3px; - padding: 5px 0; -} -.tooltip.right { - margin-left: 3px; - padding: 0 5px; -} -.tooltip.bottom { - margin-top: 3px; - padding: 5px 0; -} -.tooltip.left { - margin-left: -3px; - padding: 0 5px; -} -.tooltip-inner { - max-width: 200px; - padding: 8px; - color: #ffffff; - text-align: center; - text-decoration: none; - background-color: #000000; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-width: 5px 5px 0; - border-top-color: #000000; -} -.tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-width: 5px 5px 5px 0; - border-right-color: #000000; -} -.tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-width: 5px 0 5px 5px; - border-left-color: #000000; -} -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000000; -} diff --git a/js/Gruntfile.js b/js/Gruntfile.js index 03a0c607c..d954d64c0 100644 --- a/js/Gruntfile.js +++ b/js/Gruntfile.js @@ -18,7 +18,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-phpunit'); grunt.loadNpmTasks('grunt-wrap'); grunt.loadNpmTasks('grunt-karma'); - grunt.loadNpmTasks('grunt-ngmin'); + grunt.loadNpmTasks('grunt-ng-annotate'); grunt.loadNpmTasks('grunt-traceur'); grunt.loadNpmTasks('grunt-protractor-runner'); grunt.loadNpmTasks('grunt-protractor-webdriver'); @@ -49,7 +49,7 @@ module.exports = function (grunt) { dest: '<%= meta.production %>app.js' } }, - ngmin: { + ngAnnotate: { app: { src: ['<%= meta.production %>app.js'], dest: '<%= meta.production %>app.js' @@ -57,13 +57,13 @@ module.exports = function (grunt) { }, traceur: { app: { - files: { - '<%= meta.production %>app.js': ['<%= meta.production %>app.js'] - } + files: [{ + src: ['<%= meta.production %>app.js'], + dest: '<%= meta.production %>app.js' + }] }, options: { blockBinding: true, - sourceMap: false, experimental: true, modules: 'inline' } @@ -166,7 +166,7 @@ module.exports = function (grunt) { }); // make tasks available under simpler commands - grunt.registerTask('default', ['jshint', 'concat', 'wrap', 'traceur', 'ngmin']); + grunt.registerTask('default', ['jshint', 'concat', 'wrap', 'traceur', 'ngAnnotate']); grunt.registerTask('dev', ['watch:concat']); grunt.registerTask('test', ['karma:unit']); grunt.registerTask('php', ['watch:phpunit']); diff --git a/js/bower.json b/js/bower.json index 75294baf9..3b0555c82 100644 --- a/js/bower.json +++ b/js/bower.json @@ -30,7 +30,7 @@ "angular-sanitize": "~1.3.*", "angular-animate": "~1.3.*", "jquery": "~2.*", - "momentjs": "~2.*", - "traceur-runtime": "~0.0.41" + "momentjs": "~2.8.*", + "traceur-runtime": "~0.0.60" } } diff --git a/js/build/app.js b/js/build/app.js index 427447d8d..dabda1d00 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -1,1837 +1,1395 @@ -var $__build_47_app__ = function () { +var $__app__ = (function() { + "use strict"; + var __moduleName = "app"; + (function(window, document, angular, $, OC, csrfToken, undefined) { 'use strict'; - var __moduleName = 'build/app'; - (function (window, document, angular, $, OC, csrfToken, undefined) { + var app = angular.module('News', ['ngRoute', 'ngSanitize', 'ngAnimate']); + app.config(function($routeProvider, $provide, $httpProvider) { 'use strict'; - var app = angular.module('News', [ - 'ngRoute', - 'ngSanitize', - 'ngAnimate' - ]); - app.config([ - '$routeProvider', - '$provide', - '$httpProvider', - function ($routeProvider, $provide, $httpProvider) { - 'use strict'; - var feedType = { - FEED: 0, - FOLDER: 1, - STARRED: 2, - SUBSCRIPTIONS: 3, - SHARED: 4 - }; - $provide.constant('REFRESH_RATE', 60); - $provide.constant('ITEM_BATCH_SIZE', 50); - $provide.constant('BASE_URL', OC.generateUrl('/apps/news')); - $provide.constant('FEED_TYPE', feedType); - $provide.factory('CSRFInterceptor', function ($q, BASE_URL) { - return { - request: function (config) { - if (config.url.indexOf(BASE_URL) === 0) { - config.headers.requesttoken = csrfToken; - } - return config || $q.when(config); - } - }; - }); - $httpProvider.interceptors.push('CSRFInterceptor'); - var getResolve = function (type) { - return { - data: [ - '$http', - '$route', - '$q', - 'BASE_URL', - 'ITEM_BATCH_SIZE', - function ($http, $route, $q, BASE_URL, ITEM_BATCH_SIZE) { - var parameters = { - type: type, - limit: ITEM_BATCH_SIZE - }; - if ($route.current.params.id !== undefined) { - parameters.id = $route.current.params.id; - } - var deferred = $q.defer(); - $http({ - url: BASE_URL + '/items', - method: 'GET', - params: parameters - }).success(function (data) { - deferred.resolve(data); - }); - return deferred.promise; - } - ] - }; - }; - $routeProvider.when('/items', { - controller: 'ContentController as Content', - templateUrl: 'content.html', - resolve: getResolve(feedType.SUBSCRIPTIONS), - type: feedType.SUBSCRIPTIONS - }).when('/items/starred', { - controller: 'ContentController as Content', - templateUrl: 'content.html', - resolve: getResolve(feedType.STARRED), - type: feedType.STARRED - }).when('/items/feeds/:id', { - controller: 'ContentController as Content', - templateUrl: 'content.html', - resolve: getResolve(feedType.FEED), - type: feedType.FEED - }).when('/items/folders/:id', { - controller: 'ContentController as Content', - templateUrl: 'content.html', - resolve: getResolve(feedType.FOLDER), - type: feedType.FOLDER - }); - } - ]); - app.run([ - '$rootScope', - '$location', - '$http', - '$q', - '$interval', - 'Loading', - 'ItemResource', - 'FeedResource', - 'FolderResource', - 'SettingsResource', - 'Publisher', - 'BASE_URL', - 'FEED_TYPE', - 'REFRESH_RATE', - function ($rootScope, $location, $http, $q, $interval, Loading, ItemResource, FeedResource, FolderResource, SettingsResource, Publisher, BASE_URL, FEED_TYPE, REFRESH_RATE) { - 'use strict'; - Loading.setLoading('global', true); - Publisher.subscribe(ItemResource).toChannels('items', 'newestItemId', 'starred'); - Publisher.subscribe(FolderResource).toChannels('folders'); - Publisher.subscribe(FeedResource).toChannels('feeds'); - Publisher.subscribe(SettingsResource).toChannels('settings'); - var settingsDeferred = $q.defer(); - $http.get(BASE_URL + '/settings').success(function (data) { - Publisher.publishAll(data); - settingsDeferred.resolve(); - }); - var activeFeedDeferred = $q.defer(); - var path = $location.path(); - $http.get(BASE_URL + '/feeds/active').success(function (data) { - var url; - switch (data.activeFeed.type) { - case FEED_TYPE.FEED: - url = '/items/feeds/' + data.activeFeed.id; - break; - case FEED_TYPE.FOLDER: - url = '/items/folders/' + data.activeFeed.id; - break; - case FEED_TYPE.STARRED: - url = '/items/starred'; - break; - default: - url = '/items'; + var feedType = { + FEED: 0, + FOLDER: 1, + STARRED: 2, + SUBSCRIPTIONS: 3, + SHARED: 4 + }; + $provide.constant('REFRESH_RATE', 60); + $provide.constant('ITEM_BATCH_SIZE', 50); + $provide.constant('BASE_URL', OC.generateUrl('/apps/news')); + $provide.constant('FEED_TYPE', feedType); + $provide.factory('CSRFInterceptor', (function($q, BASE_URL) { + return {request: (function(config) { + if (config.url.indexOf(BASE_URL) === 0) { + config.headers.requesttoken = csrfToken; } - if (!/^\/items(\/(starred|feeds\/\d+|folders\/\d+))?\/?$/.test(path)) { - $location.path(url); + return config || $q.when(config); + })}; + })); + $httpProvider.interceptors.push('CSRFInterceptor'); + var getResolve = (function(type) { + return {data: ['$http', '$route', '$q', 'BASE_URL', 'ITEM_BATCH_SIZE', (function($http, $route, $q, BASE_URL, ITEM_BATCH_SIZE) { + var parameters = { + type: type, + limit: ITEM_BATCH_SIZE + }; + if ($route.current.params.id !== undefined) { + parameters.id = $route.current.params.id; } - activeFeedDeferred.resolve(); - }); - var folderDeferred = $q.defer(); - $http.get(BASE_URL + '/folders').success(function (data) { - Publisher.publishAll(data); - folderDeferred.resolve(); - }); - var feedDeferred = $q.defer(); - $http.get(BASE_URL + '/feeds').success(function (data) { - Publisher.publishAll(data); - feedDeferred.resolve(); - }); - $q.all([ - settingsDeferred.promise, - activeFeedDeferred.promise, - feedDeferred.promise, - folderDeferred.promise - ]).then(function () { - Loading.setLoading('global', false); - }); - $interval(function () { - $http.get(BASE_URL + '/feeds'); - $http.get(BASE_URL + '/folders'); - }, REFRESH_RATE * 1000); - $rootScope.$on('$routeChangeStart', function () { - Loading.setLoading('content', true); - }); - $rootScope.$on('$routeChangeSuccess', function () { - Loading.setLoading('content', false); - }); - $rootScope.$on('$routeChangeError', function () { - $location.path('/items'); - }); + var deferred = $q.defer(); + $http({ + url: (BASE_URL + "/items"), + method: 'GET', + params: parameters + }).success((function(data) { + deferred.resolve(data); + })); + return deferred.promise; + })]}; + }); + $routeProvider.when('/items', { + controller: 'ContentController as Content', + templateUrl: 'content.html', + resolve: getResolve(feedType.SUBSCRIPTIONS), + type: feedType.SUBSCRIPTIONS + }).when('/items/starred', { + controller: 'ContentController as Content', + templateUrl: 'content.html', + resolve: getResolve(feedType.STARRED), + type: feedType.STARRED + }).when('/items/feeds/:id', { + controller: 'ContentController as Content', + templateUrl: 'content.html', + resolve: getResolve(feedType.FEED), + type: feedType.FEED + }).when('/items/folders/:id', { + controller: 'ContentController as Content', + templateUrl: 'content.html', + resolve: getResolve(feedType.FOLDER), + type: feedType.FOLDER + }); + }); + app.run((function($rootScope, $location, $http, $q, $interval, Loading, ItemResource, FeedResource, FolderResource, SettingsResource, Publisher, BASE_URL, FEED_TYPE, REFRESH_RATE) { + 'use strict'; + Loading.setLoading('global', true); + Publisher.subscribe(ItemResource).toChannels('items', 'newestItemId', 'starred'); + Publisher.subscribe(FolderResource).toChannels('folders'); + Publisher.subscribe(FeedResource).toChannels('feeds'); + Publisher.subscribe(SettingsResource).toChannels('settings'); + var settingsDeferred = $q.defer(); + $http.get((BASE_URL + "/settings")).success((function(data) { + Publisher.publishAll(data); + settingsDeferred.resolve(); + })); + var activeFeedDeferred = $q.defer(); + var path = $location.path(); + $http.get((BASE_URL + "/feeds/active")).success((function(data) { + var url; + switch (data.activeFeed.type) { + case FEED_TYPE.FEED: + url = ("/items/feeds/" + data.activeFeed.id); + break; + case FEED_TYPE.FOLDER: + url = ("/items/folders/" + data.activeFeed.id); + break; + case FEED_TYPE.STARRED: + url = '/items/starred'; + break; + default: + url = '/items'; } - ]); - app.controller('AppController', [ - 'Loading', - 'FeedResource', - 'FolderResource', - function (Loading, FeedResource, FolderResource) { - 'use strict'; - this.loading = Loading; - this.isFirstRun = function () { - return FeedResource.size() === 0 && FolderResource.size() === 0; - }; + if (!/^\/items(\/(starred|feeds\/\d+|folders\/\d+))?\/?$/.test(path)) { + $location.path(url); } - ]); - app.controller('ContentController', [ - 'Publisher', - 'FeedResource', - 'ItemResource', - 'SettingsResource', - 'data', - '$route', - '$routeParams', - function (Publisher, FeedResource, ItemResource, SettingsResource, data, $route, $routeParams) { - 'use strict'; - var $__0 = this; - ItemResource.clear(); - Publisher.publishAll(data); - this.isAutoPagingEnabled = true; - this.getItems = function () { - return ItemResource.getAll(); - }; - this.toggleStar = function (itemId) { - ItemResource.toggleStar(itemId); - }; - this.markRead = function (itemId) { - var item = ItemResource.get(itemId); - if (!item.keepUnread) { - ItemResource.markItemRead(itemId); - FeedResource.markItemOfFeedRead(item.feedId); - } - }; - this.getFeed = function (feedId) { - return FeedResource.getById(feedId); - }; - this.toggleKeepUnread = function (itemId) { - var item = ItemResource.get(itemId); - if (!item.unread) { - FeedResource.markItemOfFeedUnread(item.feedId); - ItemResource.markItemRead(itemId, false); - } - item.keepUnread = !item.keepUnread; - }; - this.orderBy = function () { - if (SettingsResource.get('oldestFirst')) { - return '-id'; - } else { - return 'id'; - } - }; - this.isCompactView = function () { - return SettingsResource.get('compact'); - }; - this.autoPagingEnabled = function () { - return $__0.isAutoPagingEnabled; - }; - this.markReadEnabled = function () { - return !SettingsResource.get('preventReadOnScroll'); - }; - this.scrollRead = function (itemIds) { - var ids = []; - var feedIds = []; - for (var $__3 = itemIds[$traceurRuntime.toProperty(Symbol.iterator)](), $__4; !($__4 = $__3.next()).done;) { - try { - throw undefined; - } catch (itemId) { - itemId = $__4.value; - { - try { - throw undefined; - } catch (item) { - item = ItemResource.get(itemId); - if (!item.keepUnread) { - ids.push(itemId); - feedIds.push(item.feedId); - } - } - } - } - } - FeedResource.markItemsOfFeedsRead(feedIds); - ItemResource.markItemsRead(ids); - }; - this.autoPage = function () { - $__0.isAutoPagingEnabled = false; - var type = $route.current.$$route.type; - var id = $routeParams.id; - ItemResource.autoPage(type, id).success(function (data) { - Publisher.publishAll(data); - if (data.items.length > 0) { - $__0.isAutoPagingEnabled = true; - } - }).error(function () { - $__0.isAutoPagingEnabled = true; - }); - }; - this.getRelativeDate = function (timestamp) { - if (timestamp !== undefined && timestamp !== '') { - try { - throw undefined; - } catch (date) { - try { - throw undefined; - } catch (languageCode) { - languageCode = SettingsResource.get('language'); - date = moment.unix(timestamp).locale(languageCode).fromNow() + ''; - return date; - } - } - } else { - return ''; - } - }; + activeFeedDeferred.resolve(); + })); + var folderDeferred = $q.defer(); + $http.get((BASE_URL + "/folders")).success((function(data) { + Publisher.publishAll(data); + folderDeferred.resolve(); + })); + var feedDeferred = $q.defer(); + $http.get((BASE_URL + "/feeds")).success((function(data) { + Publisher.publishAll(data); + feedDeferred.resolve(); + })); + $q.all([settingsDeferred.promise, activeFeedDeferred.promise, feedDeferred.promise, folderDeferred.promise]).then((function() { + Loading.setLoading('global', false); + })); + $interval((function() { + $http.get((BASE_URL + "/feeds")); + $http.get((BASE_URL + "/folders")); + }), REFRESH_RATE * 1000); + $rootScope.$on('$routeChangeStart', (function() { + Loading.setLoading('content', true); + })); + $rootScope.$on('$routeChangeSuccess', (function() { + Loading.setLoading('content', false); + })); + $rootScope.$on('$routeChangeError', (function() { + $location.path('/items'); + })); + })); + app.controller('AppController', function(Loading, FeedResource, FolderResource) { + 'use strict'; + this.loading = Loading; + this.isFirstRun = (function() { + return FeedResource.size() === 0 && FolderResource.size() === 0; + }); + }); + app.controller('ContentController', function(Publisher, FeedResource, ItemResource, SettingsResource, data, $route, $routeParams) { + 'use strict'; + var $__0 = this; + ItemResource.clear(); + Publisher.publishAll(data); + this.isAutoPagingEnabled = true; + this.getItems = (function() { + return ItemResource.getAll(); + }); + this.toggleStar = (function(itemId) { + ItemResource.toggleStar(itemId); + }); + this.markRead = (function(itemId) { + var item = ItemResource.get(itemId); + if (!item.keepUnread) { + ItemResource.markItemRead(itemId); + FeedResource.markItemOfFeedRead(item.feedId); } - ]); - app.controller('NavigationController', [ - '$route', - 'FEED_TYPE', - 'FeedResource', - 'FolderResource', - 'ItemResource', - 'SettingsResource', - function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, SettingsResource) { - 'use strict'; - var $__0 = this; - this.feedError = ''; - this.folderError = ''; - this.getFeeds = function () { - return FeedResource.getAll(); - }; - this.getFolders = function () { - return FolderResource.getAll(); - }; - this.markFolderRead = function (folderId) { - FeedResource.markFolderRead(folderId); - for (var $__3 = FeedResource.getByFolderId(folderId)[$traceurRuntime.toProperty(Symbol.iterator)](), $__4; !($__4 = $__3.next()).done;) { - try { - throw undefined; - } catch (feed) { - feed = $__4.value; - { - ItemResource.markFeedRead(feed.id); - } - } - } - }; - this.markFeedRead = function (feedId) { - ItemResource.markFeedRead(feedId); - FeedResource.markFeedRead(feedId); - }; - this.markRead = function () { - ItemResource.markRead(); - FeedResource.markRead(); - }; - this.isShowAll = function () { - return SettingsResource.get('showAll'); - }; - this.getFeedsOfFolder = function (folderId) { - return FeedResource.getByFolderId(folderId); - }; - this.getUnreadCount = function () { - return FeedResource.getUnreadCount(); - }; - this.getFeedUnreadCount = function (feedId) { - return FeedResource.getById(feedId).unreadCount; - }; - this.getFolderUnreadCount = function (folderId) { - return FeedResource.getFolderUnreadCount(folderId); - }; - this.getStarredCount = function () { - return ItemResource.getStarredCount(); - }; - this.toggleFolder = function (folderName) { - FolderResource.toggleOpen(folderName); - }; - this.hasFeeds = function (folderId) { - return FeedResource.getFolderUnreadCount(folderId) !== undefined; - }; - this.subFeedActive = function (folderId) { - var type = $route.current.$$route.type; - if (type === FEED_TYPE.FEED) { - try { - throw undefined; - } catch (feed) { - feed = FeedResource.getById($route.current.params.id); - if (feed.folderId === folderId) { - return true; - } - } - } - return false; - }; - this.isSubscriptionsActive = function () { - return $route.current && $route.current.$$route.type === FEED_TYPE.SUBSCRIPTIONS; - }; - this.isStarredActive = function () { - return $route.current && $route.current.$$route.type === FEED_TYPE.STARRED; - }; - this.isFolderActive = function (folderId) { - var currentId = parseInt($route.current.params.id, 10); - return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && currentId === folderId; - }; - this.isFeedActive = function (feedId) { - var currentId = parseInt($route.current.params.id, 10); - return $route.current && $route.current.$$route.type === FEED_TYPE.FEED && currentId === feedId; - }; - this.folderNameExists = function (folderName) { - return FolderResource.get(folderName) !== undefined; - }; - this.isAddingFolder = function () { - return true; - }; - this.createFolder = function (folder) { - console.log(folder.name); - folder.name = ''; - }; - this.createFeed = function (feed) { - $__0.newFolder = false; - console.log(feed.url + feed.folder); - feed.url = ''; - }; - this.cancelRenameFolder = function (folderId) { - console.log(folderId); - }; - this.renameFeed = function (feedId, feedTitle) { - console.log(feedId + feedTitle); - }; - this.cancelRenameFeed = function (feedId) { - console.log(feedId); - }; - this.renameFolder = function () { - console.log('TBD'); - }; - this.deleteFeed = function (feedUrl) { - console.log(feedUrl); - }; - this.deleteFolder = function (folderName) { - console.log(folderName); - }; - this.moveFeed = function (feedId, folderId) { - console.log(feedId + folderId); - }; + }); + this.getFeed = (function(feedId) { + return FeedResource.getById(feedId); + }); + this.toggleKeepUnread = (function(itemId) { + var item = ItemResource.get(itemId); + if (!item.unread) { + FeedResource.markItemOfFeedUnread(item.feedId); + ItemResource.markItemRead(itemId, false); } - ]); - app.controller('SettingsController', [ - '$route', - 'SettingsResource', - 'FeedResource', - function ($route, SettingsResource, FeedResource) { - 'use strict'; - var $__0 = this; - this.importing = false; - this.opmlImportError = false; - this.articleImportError = false; - var set = function (key, value) { - SettingsResource.set(key, value); - if ([ - 'showAll', - 'oldestFirst' - ].indexOf(key) >= 0) { - $route.reload(); + item.keepUnread = !item.keepUnread; + }); + this.orderBy = (function() { + if (SettingsResource.get('oldestFirst')) { + return '-id'; + } else { + return 'id'; + } + }); + this.isCompactView = (function() { + return SettingsResource.get('compact'); + }); + this.autoPagingEnabled = (function() { + return $__0.isAutoPagingEnabled; + }); + this.markReadEnabled = (function() { + return !SettingsResource.get('preventReadOnScroll'); + }); + this.scrollRead = (function(itemIds) { + var itemId$__9; + var item$__10; + var ids = []; + var feedIds = []; + for (var $__3 = itemIds[$traceurRuntime.toProperty(Symbol.iterator)](), + $__4; !($__4 = $__3.next()).done; ) { + itemId$__9 = $__4.value; + { + item$__10 = ItemResource.get(itemId$__9); + if (!item$__10.keepUnread) { + ids.push(itemId$__9); + feedIds.push(item$__10.feedId); } - }; - this.toggleSetting = function (key) { - set(key, !$__0.getSetting(key)); - }; - this.getSetting = function (key) { - return SettingsResource.get(key); - }; - this.feedSize = function () { - return FeedResource.size(); - }; - this.importOpml = function (content) { - console.log(content); - }; - this.importArticles = function (content) { - console.log(content); - }; + } } - ]); - app.filter('trustUrl', [ - '$sce', - function ($sce) { - 'use strict'; - return function (url) { - return $sce.trustAsResourceUrl(url); - }; + FeedResource.markItemsOfFeedsRead(feedIds); + ItemResource.markItemsRead(ids); + }); + this.autoPage = (function() { + $__0.isAutoPagingEnabled = false; + var type = $route.current.$$route.type; + var id = $routeParams.id; + ItemResource.autoPage(type, id).success((function(data) { + Publisher.publishAll(data); + if (data.items.length > 0) { |