1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-02 13:47:55 +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);
}
}
}

View File

@ -150,6 +150,7 @@
<li>[Change] Add unique key to ACL options table to prevent duplicate permission options. (Bug #41835)</li>
<li>[Change] Redirect to relevant MCP page of multi-page topic if accessing quickmod tools (Split option for example)</li>
<li>[Change] Performance improvements for native fulltext search (patch by Paul)</li>
<li>[Change] Changed jumpto() JS function to be more fail-safe. (But #27635 - patch by peterkclee)</li>
<li>[Feature] Added new options for visual confirmation.</li>
<li>[Feature] Allow download of conflicting file for later reference in automatic updater</li>
<li>[Feature] Allow translation of custom BBCode help messages. (Patch by bantu)</li>

View File

@ -23,9 +23,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(/&amp;/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(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
}
}
}

View File

@ -39,12 +39,19 @@ function popup(url, width, height, name)
function jumpto()
{
var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
var perpage = '{PER_PAGE}';
var per_page = '{PER_PAGE}';
var base_url = '{A_BASE_URL}';
if (page !== null && !isNaN(page) && page > 0)
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
{
document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * perpage);
if (base_url.indexOf('?') == -1)
{
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
}
else
{
document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
}
}
}