Skip to content

Commit

Permalink
Updates to make page= 1-index based 1, 2, 3, etc
Browse files Browse the repository at this point in the history
If anything outside page range  now goes to page 1

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@507 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
JohnSmith-LT committed Nov 16, 2012
1 parent 415ba49 commit c868559
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Expand Up @@ -595,7 +595,7 @@ function x_setUp() {
x_mediaText.push(mediaTextObj);
}

x_navigateToPage({type:'page', ID:0});
x_navigateToPage({type:'page', ID:1});
x_navigateToPage(x_startPage);
}

Expand Down Expand Up @@ -956,16 +956,20 @@ function x_addPageLinks(pageText, returnMethod) {
}

function x_navigateToPage(pageInfo) { // {type, ID}
var page;
if (pageInfo.type == "linkID" || pageInfo.type == "pageID") {
var page = x_lookupPage(pageInfo.type, pageInfo.ID);
page = x_lookupPage(pageInfo.type, pageInfo.ID);
if (page != null)
{
x_currentPage = page;
x_changePage();
}
}
else {
x_currentPage = parseInt(pageInfo.ID);
page = parseInt(pageInfo.ID);
if (page > 0 && page <= x_pages.length) {
x_currentPage = page - 1;
}
x_changePage();
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/xerte/play_html5.php
Expand Up @@ -71,7 +71,7 @@ function show_template($row_play){
echo "page\", ID : ".mysql_real_escape_string($_GET['page']);
}
else {
echo "page\", ID : 0";
echo "page\", ID : 1";
}
?>};
</script>
Expand Down
2 changes: 1 addition & 1 deletion modules/xerte/preview_html5.php
Expand Up @@ -88,7 +88,7 @@ function show_preview_code($row, $row_username){
echo "page\", ID : ".mysql_real_escape_string($_GET['page']);
}
else {
echo "page\", ID : 0";
echo "page\", ID : 1";
}
?>};
</script>
Expand Down

0 comments on commit c868559

Please sign in to comment.