NEW FEATURE: add two buttons to move forward and backwards through the tricks
authorArun Persaud <arun@nubati.net>
Sun, 25 May 2008 18:08:04 +0000 (11:08 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 25 May 2008 18:16:42 +0000 (11:16 -0700)
makes navigation through the games easier

Signed-off-by: Arun Persaud <arun@nubati.net>
include/game.php
include/output.php

index 55ce7a6149680150c1307ef601f0ffbb7185afe6..3bbfccd6d7096e5e2829859f65b019e362110ce3 100644 (file)
@@ -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);
index 62ab2643f8485c5de99871c64d6f8d2c30fe6582..28489a08a50fabd1829b422d81dd1f1a29c03a2d 100644 (file)
@@ -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();">