Renamed PagedCollectionPresenter to PagerPresenter

This commit is contained in:
Marcin Kurczewski 2014-10-01 23:22:20 +02:00
parent 14325b4338
commit da41fd7a96
5 changed files with 12 additions and 13 deletions

1
TODO
View file

@ -26,7 +26,6 @@ everything related to posts:
- single post view - single post view
- previous and next post (difficult) - previous and next post (difficult)
- rename PagedCollectionPresenter to PagerPresenter
- remember last search - remember last search
- take care of pages - take care of pages
- add A/D hotkeys - add A/D hotkeys

View file

@ -79,7 +79,7 @@
<script type="text/javascript" src="/js/PresenterManager.js"></script> <script type="text/javascript" src="/js/PresenterManager.js"></script>
<script type="text/javascript" src="/js/Presenters/TopNavigationPresenter.js"></script> <script type="text/javascript" src="/js/Presenters/TopNavigationPresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/PagedCollectionPresenter.js"></script> <script type="text/javascript" src="/js/Presenters/PagerPresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/MessagePresenter.js"></script> <script type="text/javascript" src="/js/Presenters/MessagePresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/LoginPresenter.js"></script> <script type="text/javascript" src="/js/Presenters/LoginPresenter.js"></script>

View file

@ -1,7 +1,7 @@
var App = App || {}; var App = App || {};
App.Presenters = App.Presenters || {}; App.Presenters = App.Presenters || {};
App.Presenters.PagedCollectionPresenter = function( App.Presenters.PagerPresenter = function(
_, _,
jQuery, jQuery,
util, util,
@ -208,4 +208,4 @@ App.Presenters.PagedCollectionPresenter = function(
}; };
App.DI.register('pagedCollectionPresenter', ['_', 'jQuery', 'util', 'promise', 'api', 'keyboard', 'router', 'pager', 'presenterManager', 'browsingSettings'], App.Presenters.PagedCollectionPresenter); App.DI.register('pagerPresenter', ['_', 'jQuery', 'util', 'promise', 'api', 'keyboard', 'router', 'pager', 'presenterManager', 'browsingSettings'], App.Presenters.PagerPresenter);

View file

@ -9,7 +9,7 @@ App.Presenters.PostListPresenter = function(
auth, auth,
router, router,
keyboard, keyboard,
pagedCollectionPresenter, pagerPresenter,
topNavigationPresenter, topNavigationPresenter,
messagePresenter) { messagePresenter) {
@ -31,7 +31,7 @@ App.Presenters.PostListPresenter = function(
render(); render();
loaded(); loaded();
pagedCollectionPresenter.init({ pagerPresenter.init({
baseUri: '#/posts', baseUri: '#/posts',
backendUri: '/posts', backendUri: '/posts',
$target: $el.find('.pagination-target'), $target: $el.find('.pagination-target'),
@ -54,7 +54,7 @@ App.Presenters.PostListPresenter = function(
loaded(); loaded();
var searchArgs = util.parseComplexRouteArgs(args.searchArgs); var searchArgs = util.parseComplexRouteArgs(args.searchArgs);
pagedCollectionPresenter.reinit({page: searchArgs.page, searchParams: {query: searchArgs.query, order: searchArgs.order}}); pagerPresenter.reinit({page: searchArgs.page, searchParams: {query: searchArgs.query, order: searchArgs.order}});
} }
function render() { function render() {
@ -90,4 +90,4 @@ App.Presenters.PostListPresenter = function(
}; };
App.DI.register('postListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'router', 'keyboard', 'pagedCollectionPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.PostListPresenter); App.DI.register('postListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'router', 'keyboard', 'pagerPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.PostListPresenter);

View file

@ -7,7 +7,7 @@ App.Presenters.UserListPresenter = function(
util, util,
promise, promise,
auth, auth,
pagedCollectionPresenter, pagerPresenter,
topNavigationPresenter, topNavigationPresenter,
messagePresenter) { messagePresenter) {
@ -29,7 +29,7 @@ App.Presenters.UserListPresenter = function(
render(); render();
loaded(); loaded();
pagedCollectionPresenter.init({ pagerPresenter.init({
baseUri: '#/users', baseUri: '#/users',
backendUri: '/users', backendUri: '/users',
$target: $el.find('.pagination-target'), $target: $el.find('.pagination-target'),
@ -55,7 +55,7 @@ App.Presenters.UserListPresenter = function(
searchArgs.order = searchArgs.order || 'name,asc'; searchArgs.order = searchArgs.order || 'name,asc';
updateActiveOrder(searchArgs.order); updateActiveOrder(searchArgs.order);
pagedCollectionPresenter.reinit({ pagerPresenter.reinit({
page: searchArgs.page, page: searchArgs.page,
searchParams: { searchParams: {
order: searchArgs.order}}); order: searchArgs.order}});
@ -93,7 +93,7 @@ App.Presenters.UserListPresenter = function(
e.preventDefault(); e.preventDefault();
var $orderLink = jQuery(this); var $orderLink = jQuery(this);
var activeSearchOrder = $orderLink.attr('data-order'); var activeSearchOrder = $orderLink.attr('data-order');
pagedCollectionPresenter.setSearchParams({order: activeSearchOrder}); pagerPresenter.setSearchParams({order: activeSearchOrder});
} }
return { return {
@ -104,4 +104,4 @@ App.Presenters.UserListPresenter = function(
}; };
App.DI.register('userListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'pagedCollectionPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.UserListPresenter); App.DI.register('userListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'pagerPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.UserListPresenter);