improved jquery on user home page
authorArun Persaud <arun@nubati.net>
Wed, 5 May 2010 04:44:30 +0000 (21:44 -0700)
committerArun Persaud <arun@nubati.net>
Wed, 5 May 2010 04:44:30 +0000 (21:44 -0700)
the text will now say either show or hide not both depending on the situation.

css/standard027.css [moved from css/standard026.css with 99% similarity]
include/output.php
include/user.php

similarity index 99%
rename from css/standard026.css
rename to css/standard027.css
index 7f9d145abdb9d4fdaf59d719c6e2bf78c7d8d8b2..0af0e3b971dbf507ae26ab84647a5eb272d6480c 100644 (file)
@@ -531,10 +531,6 @@ div.user ul li:first-child {
 .gamessession {
     display:none;
 }
 .gamessession {
     display:none;
 }
-.link {
-    text-decoration:underline;
-    color: blue;
-}
 
 .user .gameid {
     float: left;
 
 .user .gameid {
     float: left;
@@ -545,7 +541,12 @@ div.user ul li:first-child {
     float: left;
     width: 20em;
 }
     float: left;
     width: 20em;
 }
+
 .user .gameshidesession {
 .user .gameshidesession {
+  display: none;
+}
+
+.user .gameshidesession , .user .gamesshowsession {
     float:right;
     width: 10em;
 }
     float:right;
     width: 10em;
 }
@@ -596,7 +597,7 @@ caption {
   margin-bottom: 0;
  }
 
   margin-bottom: 0;
  }
 
-table.stats { 
+table.stats {
   margin: 0.5em 1em;
   border: solid 0.2em #aeaeae;
   -moz-border-radius: 0.5em ;
   margin: 0.5em 1em;
   border: solid 0.2em #aeaeae;
   -moz-border-radius: 0.5em ;
@@ -698,7 +699,7 @@ table.openid td, table.openid th{
     background-color: #fc3;
 }
 
     background-color: #fc3;
 }
 
-div.table div img.gravatar, img.gravatar  { 
+div.table div img.gravatar, img.gravatar  {
     width:  4em;
     height: 4em;
     border: 3px solid #aaa;
     width:  4em;
     height: 4em;
     border: 3px solid #aaa;
index 729452aceed350db79d4e78e45d987e139fe274b..13bc6f78afe7f7b7e20df445f8f25ec1ab2ebfb2 100644 (file)
@@ -376,24 +376,36 @@ function output_header()
      <title>e-Doko</title>
      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
      <link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" />
      <title>e-Doko</title>
      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
      <link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" />
-     <link rel="stylesheet" type="text/css" href="css/standard026.css" />
-     <script type="text/javascript" src="include/game.js"> </script>
+     <link rel="stylesheet" type="text/css" href="css/standard027.css" />
      <script type="text/javascript" src="include/jquery.js"> </script>
      <script type="text/javascript" src="include/jquery.tablesorter.js"></script>
      <script type="text/javascript" src="include/jquery.js"> </script>
      <script type="text/javascript" src="include/jquery.tablesorter.js"></script>
+     <script type="text/javascript" src="include/game.js"> </script>
      <script type="text/javascript">
         $(document).ready(function()
           {
               $("#ScoreTable").tablesorter({ widgets: ['zebra']});
 
              $(".gameshidesession").click( function () {
      <script type="text/javascript">
         $(document).ready(function()
           {
               $("#ScoreTable").tablesorter({ widgets: ['zebra']});
 
              $(".gameshidesession").click( function () {
-                 $(this).parent().children(".gamessession").toggle(300);
+                 $(this).parent().children(".gamessession").hide(300);
+                 $(this).parent().children(".gamesshowsession").show();
+                 $(this).hide();
+               });
+
+             $(".gamesshowsession").click( function () {
+                 $(this).parent().children(".gamessession").show(300);
+                 $(this).parent().children(".gameshidesession").show();
+                 $(this).hide();
                });
 
              $(".gameshowall").click( function () {
                  $(".gamessession").show(300);
                });
 
              $(".gameshowall").click( function () {
                  $(".gamessession").show(300);
+                 $(".gamesshowsession").hide();
+                 $(".gameshidesession").show();
                });
              $(".gamehideall").click( function () {
                  $(".gamessession").hide(300);
                });
              $(".gamehideall").click( function () {
                  $(".gamessession").hide(300);
+                 $(".gamesshowsession").show();
+                 $(".gameshidesession").hide();
                });
 
 
                });
 
 
index 9ac127a98290e994f30a1ff9ab456aa71afb511a..3046b346e483015be7675830d08e9b9c9174f297 100644 (file)
@@ -255,7 +255,8 @@ else
 
                        if($maxgame>1)
                          {
 
                        if($maxgame>1)
                          {
-                           $output_active .= ' <span class="gameshidesession link">'._('(hide/show) old').'</span><br />'."\n";
+                           $output_active .= ' <span class="gamesshowsession"><a href="#">'._('show old').'</a></span>'.
+                             '  <span class="gameshidesession"><a href="#">'._('hide old').'</a></span><br />'."\n";
                            $output_active .= ' <span class="gamessession">'.$sessionoutput.'</span>';
                          }
 
                            $output_active .= ' <span class="gamessession">'.$sessionoutput.'</span>';
                          }
 
@@ -296,9 +297,9 @@ else
          }
 
        echo "<ul>\n ";
          }
 
        echo "<ul>\n ";
-       echo ' <li><span class="gameshowall link">'._('show all').'</span> <span class="gamehideall link">'._('hide all')."</span></li>\n";
+       echo ' <li><span class="gameshowall"><a href="#">'._('show all').'</a></span> <span class="gamehideall"><a href="#">'._('hide all')."</a></span></li>\n";
        echo $output_active;
        echo $output_active;
-       echo ' <li><span class="gameshidesession link">'._('hide/show inactive').'</span><ul class="gamessession">'."$output_inactive </ul></li>";
+       echo ' <li><span class="gamesshowsession"><a href="#">'._('show inactive').'</a></span><span class="gameshidesession"><a href="#">'._('hide inactive').'</a></span><ul class="gamessession">'."$output_inactive </ul></li>";
        echo "</ul>\n";
 
        /* give a hint for new players */
        echo "</ul>\n";
 
        /* give a hint for new players */