1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Changed jumpto() JS function to be more fail-safe. (But #27635 - patch by peterkclee)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9466 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2009-04-17 16:05:25 +00:00
parent 77e21fc054
commit 4307a2c07f
5 changed files with 38 additions and 9 deletions

View File

@@ -28,9 +28,16 @@ function jumpto()
{
var page = prompt(jump_page, on_page);
if (page !== null && !isNaN(page) && page > 0)
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
{
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
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);
}
}
}

View File

@@ -39,9 +39,16 @@ function jumpto()
{
var page = prompt(jump_page, on_page);
if (page !== null && !isNaN(page) && page > 0)
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
{
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
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);
}
}
}