summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-05-25 11:08:04 -0700
committerArun Persaud <arun@nubati.net>2008-05-25 11:16:42 -0700
commit1132ca2ccda76df5ed2b1bea6b64015d4dc86880 (patch)
treea44800d7a15e7bde7d2ba7246899716ed37b00f0 /include
parentcff9193689fb8396795004606c0e05d81a4467c8 (diff)
downloade-DoKo-1132ca2ccda76df5ed2b1bea6b64015d4dc86880.tar.gz
e-DoKo-1132ca2ccda76df5ed2b1bea6b64015d4dc86880.tar.bz2
e-DoKo-1132ca2ccda76df5ed2b1bea6b64015d4dc86880.zip
NEW FEATURE: add two buttons to move forward and backwards through the tricks
makes navigation through the games easier Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'include')
-rw-r--r--include/game.php4
-rw-r--r--include/output.php13
2 files changed, 15 insertions, 2 deletions
diff --git a/include/game.php b/include/game.php
index 55ce7a6..3bbfccd 100644
--- a/include/game.php
+++ b/include/game.php
@@ -1735,8 +1735,8 @@ switch($mystatus)
echo " </div>\n </li>\n"; /* end div trick, end li trick */
}
-
- echo "</ul>\n"; /* end ul tricks*/
+ echo " <li onclick=\"hl_prev();\" class=\"old\"><a href=\"#\">prev</a></li>\n";
+ echo " <li onclick=\"hl_next();\" class=\"old\"><a href=\"#\">next</a></li>\n</ul>\n"; /* end ul tricks*/
echo "<div class=\"notes\"> Personal notes: <br />\n";
$notes = DB_get_notes_by_userid_and_gameid($myid,$gameid);
diff --git a/include/output.php b/include/output.php
index 62ab264..28489a0 100644
--- a/include/output.php
+++ b/include/output.php
@@ -230,6 +230,7 @@ function output_header()
<link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" />
<link rel="stylesheet" type="text/css" href="css/standard003.css" />
<script type="text/javascript">
+ var current=0;
function hl(num) {
if(document.getElementById){
var i;
@@ -238,6 +239,7 @@ function output_header()
document.getElementById("trick"+i).style.display = 'none';
}
document.getElementById("trick"+num).style.display = 'block';
+ current=num;
}
}
function high_last(){
@@ -247,11 +249,22 @@ function output_header()
if(document.getElementById("trick"+i))
{
hl(i);
+ current=i;
break;
}
}
}
}
+ function hl_next()
+ {
+ if(document.getElementById("trick"+(current+1)))
+ hl(current+1);
+ }
+ function hl_prev()
+ {
+ if(document.getElementById("trick"+(current-1)))
+ hl(current-1);
+ }
</script>
</head>
<body onload="high_last();">