Mikolaj Zalewski : Move some styles to CSS file.

Alexandre Julliard julliard at winehq.org
Fri Jun 19 08:36:22 CDT 2009


Module: tools
Branch: master
Commit: b8963059aee5dd26a9f38ee11d30c8e9e307f9a1
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=b8963059aee5dd26a9f38ee11d30c8e9e307f9a1

Author: Mikolaj Zalewski <mikolajz at tygrys.dom>
Date:   Sun Jun  7 12:20:47 2009 +0200

Move some styles to CSS file.

---

 php/index.php    |    4 ++--
 php/lib_res.php  |    2 +-
 php/resource.php |   12 ++++++------
 php/style.css    |   30 +++++++++++++++++++++++++++++-
 4 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/php/index.php b/php/index.php
index 379e10b..2993994 100644
--- a/php/index.php
+++ b/php/index.php
@@ -35,7 +35,7 @@ it needs to be found manually by the translators. If you would like to read abou
 improve Wine translations check <?php echo $WINE_WIKI_TRANSLATIONS ?>.
 </p>
 
-<table border="1">
+<table border="1" class="index">
 <tr><th></th><th>Language</th><th>Translated</th><th>Missing</th><th>Errors</th><th>&nbsp;</th></tr>
 <?php
 function draw_bar($tr, $err, $sum)
@@ -49,7 +49,7 @@ function draw_bar($tr, $err, $sum)
             $tr_len--;
     }
     $miss_len = 300 - $tr_len - $err_len;
-    echo '<td style="background-color: #D1DAF9">';
+    echo '<td class="bar">';
     if ($tr_len > 0)
 	echo "<img src=\"img/bar0.gif\" height=\"15\" width=\"$tr_len\">";
     if ($err_len > 0)
diff --git a/php/lib_res.php b/php/lib_res.php
index 9505c23..0f963ed 100644
--- a/php/lib_res.php
+++ b/php/lib_res.php
@@ -174,7 +174,7 @@ function dump_resource_row($id, &$resource, &$master, $method_name, $diff_method
     $extra = "";
     if ($master && $diff_method_name)
         if ($resource->$diff_method_name($master, $lparam, $master_lparam))
-            $extra = " style=\"background-color: #ffb8d0\"";
+            $extra = " class=\"diff\"";
 
     if ($master_lparam == NULL)
         $master_lparam = $lparam;
diff --git a/php/resource.php b/php/resource.php
index f1fe085..3a7eb72 100644
--- a/php/resource.php
+++ b/php/resource.php
@@ -58,25 +58,25 @@ if ($compare)
 
 ?>
 
-<table style="background-color: #f0f0ff" cellpadding="0" cellspacing="0">
-<tr style="background-color: #e0e0ff"><th colspan="5"><?php echo get_resource_name($type, $id) ?></th></tr>
+<table class="resource" cellpadding="0" cellspacing="0">
+<tr class="header"><th colspan="5"><?php echo get_resource_name($type, $id) ?></th></tr>
 <?php
 
 if (!$compare)
 {
-    echo "<tr style=\"background-color: #e8e8ff\"><td colspan=\"3\" style=\"text-align: right\">";
+    echo "<tr class=\"subheader\"><td colspan=\"3\" style=\"text-align: right\">";
     echo "<small>".gen_resource_a($lang, $resfile, $type, $id, TRUE);
     echo "Compare with ".$MASTER_LANGUAGE_NAME." &gt;&gt;</a></small>";
     echo "</td></tr>";
 }
 else
 {
-    echo "<tr style=\"background-color: #e8e8ff\"><td colspan=\"5\" style=\"text-align: right\">";
+    echo "<tr class=\"subheader\"><td colspan=\"5\" style=\"text-align: right\">";
     echo "<small>".gen_resource_a($lang, $resfile, $type, $id, FALSE);
-    echo "&lt;&lt; Hide compare with ".get_lang_name($MASTER_LANGUAGE)."</a></small>";
+    echo "&lt;&lt; Hide compare with ".$MASTER_LANGUAGE_NAME."</a></small>";
     echo "</td></tr>";
 
-    echo "<tr style=\"background-color: #e8e8ff\"><td>id</td><td>&nbsp;</td><td>".get_lang_name($lang)."</td><td>&nbsp;</td><td>".get_lang_name($MASTER_LANGUAGE)."</td></tr>";
+    echo "<tr class=\"subheader\"><td>id</td><td>&nbsp;</td><td>".get_lang_name($lang)."</td><td>&nbsp;</td><td>".get_lang_name($MASTER_LANGUAGE)."</td></tr>";
 }
 
 $res->dump($master_res);
diff --git a/php/style.css b/php/style.css
index ef053ce..808597a 100644
--- a/php/style.css
+++ b/php/style.css
@@ -20,4 +20,32 @@ p.note
     border-style: solid;
     border-color: black;
     padding: 2px;
-}
\ No newline at end of file
+}
+
+/* summary table on index page, bars column*/
+table.index td.bar
+{
+    background-color: #d1daf9;
+}
+
+/* table with a standard resource dump */
+table.resource
+{
+    background-color: #f0f0ff;
+}
+
+table.resource tr.header
+{
+    background-color: #e0e0ff;
+}
+
+table.resource tr.subheader
+{
+    background-color: #e8e8ff;
+}
+
+/* rows are different (in resource comparision mode) */
+table.resource tr.diff
+{
+    background-color: #ffb8d0;
+}




More information about the wine-cvs mailing list