diff www/loc.php @ 1677:9d51b4138e7d

CSS updates and related code changes.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 Apr 2017 17:30:08 +0300
parents 828a20694fcc
children 4fde474ea43e
line wrap: on
line diff
--- a/www/loc.php	Tue Apr 25 17:29:42 2017 +0300
+++ b/www/loc.php	Tue Apr 25 17:30:08 2017 +0300
@@ -3,6 +3,7 @@
 require "world.inc.php";
 require "common.inc.php";
 
+
 // Wizard info box special formatting tags
 $specTags = [
   "b"     => "<b>",
@@ -248,11 +249,9 @@
       $s = $wizImageURL."unknown.png";
 
     echo
-      "<div class=\"wizinfo\">\n".
-      " <table>\n".
-      "  <tr>\n".
-      "   <td class=\"img\"><img src=\"".$s."\" alt=\"".$coderName."\" /></td>\n".
-      "   <td class=\"info\">\n".
+      "<div class=\"wizInfoBox\">\n".
+      "   <div class=\"wizImage\"><img src=\"".$s."\" alt=\"".$coderName."\" /></div>\n".
+      "   <div class=\"wizInfo\">\n".
       "    <h2>".$coderName."</h2>\n";
 
     // Description block
@@ -279,9 +278,7 @@
     }
 
     echo
-      "   </td>\n".
-      "  </tr>\n".
-      " </table>\n".
+      "   </div>\n".
       "</div>\n";
   }
   else
@@ -326,21 +323,18 @@
     echo
       "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n".
       mpSpecialDate("loc", 2).
-      "<table class=\"loc\">\n";
+      "<div class=\"locTable\">\n";
  
     $n = 0;
     foreach ($alphaLocs as $ik => $iv)
     {
-      if ($n == 0)
-        echo " <tr>\n";
-        
       $totalLoc++;
 
       // Print location entry
-      printf("  <td class=\"%s\" style=\"width: %d%%\">",
-        $iv["continent"], (100 / $maxColumns));
-        
-      echo mpGetMapLink($iv, $continentList[$iv["continent"]][4]);
+      echo
+        "  <div class=\"locCell ".$iv["continent"]."\">".
+        "<div class=\"locHeader\">".
+        "<span class=\"locTitle\">".mpGetMapLink($iv, $continentList[$iv["continent"]][4])."</span>";
       
       // If either freeform desc or URL field are set, we add those
       if (isset($iv["url"]) || isset($iv["freeform"]))
@@ -356,7 +350,7 @@
           $urlEnd = "</a>";
           if (strlen($iv["url"]) > 40)
             $urlEnt = substr($urlEnt, 0, 40)."...";
-          $desc .= "<br /><br /><b>".chentities($urlEnt)."</b>";
+          $desc .= "<div class=\"locURL\">".chentities($urlEnt)."</div>";
         }
         else
         {
@@ -364,15 +358,17 @@
         }
           
         echo
-          " ".$urlBegin."<img class=\"noborder\" src=\"img/question.png\" onmouseover=\"stt(".$totalLoc.
-          ");\" onmouseout=\"htt();\" alt=\"(?)\" />".$urlEnd."\n";
+          " ".$urlBegin."<img src=\"img/question.png\" onmouseover=\"stt(".$totalLoc.
+          ");\" onmouseout=\"htt();\" alt=\"(?)\" />".$urlEnd;
           
         $locationTips[$totalLoc] = [
           "title" => $iv["name"],
           "desc" => $desc
         ];
-      }        
-        
+      }
+
+      echo "</div>"; // locHeader        
+
       // Alternative names
       if (($nnames = count($iv["names"])) > 1)
       {
@@ -385,7 +381,7 @@
             chentities($iv["names"][$nname]["name"]).
             ($norig ? "</b>" : "");
         }
-        echo "<br />".implode(" | ", $fs);
+        echo "<div class=\"locAltNames\">".implode(" | ", $fs)."</div>";
       }
         
       // Coder / society names
@@ -411,26 +407,13 @@
             else
               $fs[] = $name["name"];
           }
-          echo "<br />[".implode(", ", $fs)."]";
+          echo "<div class=\"locCoders\">".implode(", ", $fs)."</div>";
         }
       }
         
-      echo "</td>\n";
-
-      if (++$n >= $maxColumns)
-      {
-        echo " </tr>\n";
-        $n = 0;
-      }      
+      echo "</div>\n";
     }
-
-    if ($n > 0)
-    {
-      while ($n++ < $maxColumns)
-        echo "  <td></td>\n";
-      echo " </tr>\n";
-    }
-    echo "</table>\n";
+    echo "</div>\n";
   }
   
   echo