This commit is contained in:
Jeremie Panzer
2013-03-25 14:58:15 +01:00
parent 0443fbf267
commit 5b9e12a101
12 changed files with 177 additions and 37 deletions

View File

@@ -1,11 +1,38 @@
.sidebar-nav-fixed {
padding: 9px 0;
position:fixed;
left:20px;
top:60px;
width:250px;
}
.row-fluid > .span-fixed-sidebar {
margin-left: 290px;
}
.css-treeview {
font-size: inherit;
white-space: nowrap;
}
.css-treeview .selected {
color: #d14836;
}
.css-treeview .unread {
font-weight: bold;
}
.css-treeview a {
cursor: pointer;
color: black;
}
.accordion-heading .unread {
.css-treeview a:hover {
cursor: pointer;
color: black;
}
.entry-heading .unread {
font-weight: bold;
}

View File

@@ -5,7 +5,7 @@
<ul>
<li ng-repeat="feed in node.feeds">
<a ng-click="feedClick({id: feed.id})"
ng-class="{selected: (feed.id == selectedId && selectedType == 'feed')}">{{formatFeedName({feed:feed})}}
ng-class="{selected: (feed.id == selectedId && selectedType == 'feed'), unread: feed.unread }">{{formatFeedName({feed:feed})}}
</a>
<div class="dropdown pull-right">
<a dropdown-toggle class="pull-right feed-menu-icon"><i class="icon icon-chevron-down"></i> </a>

View File

@@ -61,7 +61,7 @@
</div>
</div>
<div class="modal-footer">
<button class="btn btn-warning cancel" ng-click="closeImport()">Cancel</button>
<button type="button" class="btn btn-warning cancel" ng-click="closeImport()">Cancel</button>
<button class="btn btn-primary ok" type="submit" upload-submit="uploadComplete(contents, completed)">Import</button>
</div>
</form>

View File

@@ -6,6 +6,15 @@
<button type="button" class="btn" ng-model="settings.readingMode" btn-radio="'all'">All</button>
</div>
<button type="button" class="btn" ng-click="refresh()"><i class="icon icon-refresh"></i> Refresh</button>
<button type="button" class="btn"><i class="icon icon-ok"></i> Mark all as read</button>
<button type="button" class="btn" ng-click="refresh()"><i class="icon-refresh"></i> Refresh</button>
<button type="button" class="btn"><i class="icon-ok"></i> Mark all as read</button>
<div class="btn-group pull-right">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="settings"><i class="icon-cog"></i><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="settings"><i class="icon-wrench"></i> Settings</a></li>
<li class="divider"></li>
<li><a href="logout"><i class="icon-user"></i> Logout</a></li>
</ul>
</div>
</div>

View File

@@ -102,11 +102,8 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
$scope.refreshList();
});
$scope.offset = 0;
$scope.limit = 10;
$scope.busy = false;
$scope.hasMore = true;
$scope.refreshList = function() {
if ($scope.settings.readingMode) {
@@ -114,14 +111,14 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : $scope.settings.readingMode,
offset : $scope.offset,
limit : 30
offset : 0,
limit : $scope.limit
});
}
};
$scope.loadMoreEntries = function() {
if ($scope.busy || !$scope.hasMore)
if ($scope.busy)
return;
if (!$scope.settings.readingMode)
return;
@@ -130,15 +127,17 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : $scope.settings.readingMode,
offset : $scope.offset,
offset : $scope.entryList.entries.length,
limit : $scope.limit
}, function(data) {
for ( var i = 0; i < data.entries.length; i++) {
$scope.entryList.entries.push(data.entries[i]);
console.log(data)
var entries = data.entries
for ( var i = 0; i < entries.length; i++) {
$scope.entryList.entries.push(entries[i]);
}
$scope.offset = $scope.offset + data.entries.length;
console.log(entries.length)
console.log($scope.limit)
$scope.busy = false;
$scope.hasMore = data.entries.length == $scope.limit;
});
}

View File

@@ -2,9 +2,9 @@
{{readType}}
<span>{{entryList.name}}</span><span
ng-show="selectedType == 'category'"> &#187;</span>
<div class="accordion" id="feed-accordion" infinite-scroll="loadMoreEntries()" infinite-scroll-disabled="busy" infinite-scroll-distance="1">
<div class="accordion-group" ng-repeat="entry in entryList.entries">
<div class="accordion-heading">
<div id="feed-accordion" infinite-scroll="loadMoreEntries()" infinite-scroll-disabled="busy" infinite-scroll-distance="1">
<div ng-repeat="entry in entryList.entries">
<div class="entry-heading">
<a class="accordion-toggle" data-toggle="collapse"
ng-click="mark(entry, true)"
ng-class="{unread: entry.read == false}"
@@ -13,8 +13,15 @@
- </span>{{entry.title}} <span class="pull-right">{{entry.date}}</span>
</a>
</div>
<div id="{{'feed-body' + $index}}" class="accordion-body collapse">
<div class="accordion-inner" ng-bind-html="entry.content"></div>
<div id="{{'feed-body' + $index}}" class="collapse">
<div>
<div>
<h4>
<a href="{{entry.url}}" target="_blank">{{entry.title}}</a>
</h4>
</div>
<div ng-bind-html="entry.content"></div>
</div>
</div>
</div>
<div ng-show="busy">Loading data...</div>