summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/itemmapper.php6
-rw-r--r--js/app/services/persistence.coffee4
-rw-r--r--js/app/services/services.coffee2
-rw-r--r--js/public/app.js15
-rw-r--r--templates/main.php12
-rw-r--r--tests/db/ItemMapperTest.php7
6 files changed, 26 insertions, 20 deletions
diff --git a/db/itemmapper.php b/db/itemmapper.php
index e4ebee433..0d9469c9d 100644
--- a/db/itemmapper.php
+++ b/db/itemmapper.php
@@ -52,10 +52,10 @@ class ItemMapper extends Mapper implements IMapper {
private function makeSelectQuery($prependTo){
- return 'SELECT `*PREFIX*news_items`.* FROM `*PREFIX*news_items` ' .
- 'JOIN `*PREFIX*news_feeds` ' .
+ return 'SELECT `*PREFIX*news_items`.* FROM `*PREFIX*news_items` `items` '.
+ 'JOIN `*PREFIX*news_feeds` `feeds` ' .
'ON `*PREFIX*news_feeds`.`id` = `*PREFIX*news_items`.`feed_id` '.
- 'AND `*PREFIX*news_feeds`.`user_id` = ? ' . $prependTo;
+ 'AND `*PREFIX*news_feeds`.`user_id` = ? ' . $prependTo;
}
private function makeSelectQueryStatus($prependTo) {
diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee
index 80d8d391d..6f75d4601 100644
--- a/js/app/services/persistence.coffee
+++ b/js/app/services/persistence.coffee
@@ -37,7 +37,7 @@ angular.module('News').factory '_Persistence', ->
# items can only be loaded after the active feed is known
@getActiveFeed =>
- @getItems @_activeFeed.getType(), @_activeFeed.getId(), null, =>
+ @getItems @_activeFeed.getType(), @_activeFeed.getId(), 0, =>
@_loading.decrease()
@getAllFolders(@_triggerHideRead)
@@ -50,7 +50,7 @@ angular.module('News').factory '_Persistence', ->
ITEM CONTROLLER
###
getItems: (type, id, offset, onSuccess, updatedSince=null) ->
- # TODO
+
if updatedSince != null
data =
updatedSince: updatedSince
diff --git a/js/app/services/services.coffee b/js/app/services/services.coffee
index 08d4d6274..dac4206a9 100644
--- a/js/app/services/services.coffee
+++ b/js/app/services/services.coffee
@@ -23,7 +23,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
# request related stuff
angular.module('News').factory 'Persistence', ['_Persistence', 'Request',
-'FeedLoading', 'Config', '$rootScope', 'ActiveFeed',
+'FeedLoading', 'Config', 'ActiveFeed', '$rootScope',
(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) ->
return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope)
]
diff --git a/js/public/app.js b/js/public/app.js
index d7b0d2f2a..f57367fa0 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -103,8 +103,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
]);
angular.module('News').controller('ItemController', [
- '$scope', '_ItemController', 'ItemModel', function($scope, _ItemController, ItemModel) {
- return new _ItemController($scope, ItemModel);
+ '$scope', '_ItemController', 'ItemModel', 'FeedLoading', function($scope, _ItemController, ItemModel, FeedLoading) {
+ return new _ItemController($scope, ItemModel, FeedLoading);
}
]);
@@ -184,9 +184,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var ItemController;
ItemController = (function() {
- function ItemController($scope, itemModel) {
+ function ItemController($scope, itemModel, feedLoading) {
+ var _this = this;
this.$scope = $scope;
this.itemModel = itemModel;
+ this.feedLoading = feedLoading;
+ this.$scope.isLoading = function() {
+ return _this.feedLoading.isLoading();
+ };
}
return ItemController;
@@ -651,7 +656,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var _this = this;
this._loading.increase();
this.getActiveFeed(function() {
- return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), null, function() {
+ return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() {
return _this._loading.decrease();
});
});
@@ -1032,7 +1037,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').factory('Persistence', [
- '_Persistence', 'Request', 'FeedLoading', 'Config', '$rootScope', 'ActiveFeed', function(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) {
+ '_Persistence', 'Request', 'FeedLoading', 'Config', 'ActiveFeed', '$rootScope', function(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) {
return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope);
}
]);
diff --git a/templates/main.php b/templates/main.php
index 9690e3cbe..2de7c0fba 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -24,11 +24,11 @@
<ul class="with-icon" data-id="0" droppable>
<?php print_unescaped($this->inc('part.addnew')) ?>
- <?php print_unescaped($this->inc('part.feed.unread')) ?>
- <?php print_unescaped($this->inc('part.feed.starred')) ?>
- <?php print_unescaped($this->inc('part.listfolder')) ?>
- <?php print_unescaped($this->inc('part.listfeed', array('folderId' => '0'))) ?>
- <?php print_unescaped($this->inc('part.showall')); ?>
+ <?php // print_unescaped($this->inc('part.feed.unread')) ?>
+ <?php // print_unescaped($this->inc('part.feed.starred')) ?>
+ <?php // print_unescaped($this->inc('part.listfolder')) ?>
+ <?php // print_unescaped($this->inc('part.listfeed', array('folderId' => '0'))) ?>
+ <?php // print_unescaped($this->inc('part.showall')); ?>
</ul>
<div id="app-settings" ng-controller="SettingsController">
@@ -49,7 +49,7 @@
<div id="right-content" ng-class="{loading: isLoading()}"
ng-controller="ItemController" when-scrolled="scroll()" feed-navigation>
- <?php print_unescaped($this->inc("part.items")); ?>
+ <?php //print_unescaped($this->inc("part.items")); ?>
</div>
</div> \ No newline at end of file
diff --git a/tests/db/ItemMapperTest.php b/tests/db/ItemMapperTest.php
index b792daac3..626ac2cd0 100644
--- a/tests/db/ItemMapperTest.php
+++ b/tests/db/ItemMapperTest.php
@@ -72,12 +72,13 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility {
private function makeSelectQuery($prependTo){
- return 'SELECT `*PREFIX*news_items`.* FROM `*PREFIX*news_items` ' .
- 'JOIN `*PREFIX*news_feeds` ' .
+ return 'SELECT `*PREFIX*news_items`.* FROM `*PREFIX*news_items` `items` '.
+ 'JOIN `*PREFIX*news_feeds` `feeds` ' .
'ON `*PREFIX*news_feeds`.`id` = `*PREFIX*news_items`.`feed_id` '.
- 'AND `*PREFIX*news_feeds`.`user_id` = ? ' . $prependTo;
+ 'AND `*PREFIX*news_feeds`.`user_id` = ? ' . $prependTo;
}
+
private function makeSelectQueryStatus($prependTo) {
return $this->makeSelectQuery(
'AND ((`*PREFIX*news_items`.`status` & ?) > 0) ' .