1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge pull request #2092 from nickvergessen/ticket/12090

[ticket/12090] Pass route name to url() instead of the url itself
This commit is contained in:
Nathan Guse
2014-03-10 20:50:08 -05:00
21 changed files with 305 additions and 251 deletions

View File

@@ -37,17 +37,14 @@ function jumpto(item) {
on_page = item.attr('data-on-page'),
per_page = item.attr('data-per-page'),
base_url = item.attr('data-base-url'),
start_name = item.attr('data-start-name'),
page = prompt(jump_page, on_page);
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) {
if (base_url.indexOf('%d') === -1) {
if (base_url.indexOf('?') === -1) {
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
} else {
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
}
if (base_url.indexOf('?') === -1) {
document.location.href = base_url + '?' + start_name + '=' + ((page - 1) * per_page);
} else {
document.location.href = base_url.replace('%d', page);
document.location.href = base_url.replace(/&/g, '&') + '&' + start_name + '=' + ((page - 1) * per_page);
}
}
}

View File

@@ -1,4 +1,8 @@
<a href="#" class="pagination-trigger" title="{L_JUMP_TO_PAGE}" data-lang-jump-page="{L_JUMP_PAGE|e('html_attr')}{L_COLON}" data-on-page="{CURRENT_PAGE}" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}">{PAGE_NUMBER}</a> &bull;
<!-- IF BASE_URL -->
<a href="#" class="pagination-trigger" title="{L_JUMP_TO_PAGE}" data-lang-jump-page="{L_JUMP_PAGE|e('html_attr')}{L_COLON}" data-on-page="{CURRENT_PAGE}" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-base-is-route="{BASE_IS_ROUTE}" data-start-name="{START_NAME}">{PAGE_NUMBER}</a> &bull;
<!-- ELSE -->
{PAGE_NUMBER} &bull;
<!-- ENDIF -->
<ul>
<!-- BEGIN pagination -->
<!-- IF pagination.S_IS_PREV -->