re-add the CSS file and rework the UA tests not to rely on outdated non-public includes
authorRobert Kaiser <kairo@kairo.at>
Tue, 29 Nov 2016 16:59:55 +0000 (17:59 +0100)
committerRobert Kaiser <kairo@kairo.at>
Tue, 29 Nov 2016 16:59:55 +0000 (17:59 +0100)
tests/test.css [new file with mode: 0755]
tests/ua_list.php
tests/ua_test.php

diff --git a/tests/test.css b/tests/test.css
new file mode 100755 (executable)
index 0000000..7a26387
--- /dev/null
@@ -0,0 +1,73 @@
+/* general styles */
+
+body {
+/*  font-family: Arial,Helvetica,sans-serif; */
+  color: black;
+  font-size: medium;
+  margin: 3px;
+  padding: 0px;
+  border: 0px;
+  background-color: white;
+}
+
+h1 {
+  font-size: xx-large;
+  font-weight: bold;
+  text-align: center;
+}
+
+a:link { color: #0000EE; }
+a:visited { color: #551A8B; }
+a:active { color: #FF0000; }
+
+img {
+  border: 0px;
+}
+
+table {
+  color: black;
+  margin: 0px;
+  padding: 0px;
+  border: 0px;
+}
+
+td, th {
+  font-family: Arial,Helvetica,sans-serif;
+  color: black;
+  margin: 0px;
+  padding: 2px;
+  border: 0px;
+}
+
+th {
+  font-weight: bold;
+}
+
+table.border {
+  border: 1px solid #c0c0c0;
+}
+
+table.border td,
+table.border th {
+  border: 1px solid #c0c0c0;
+}
+
+#ualist th { font-size: 0.75em; }
+#ualist td.comment {
+  font-size: 0.75em;
+  text-align: center;
+  font-weight: bold;
+}
+#ualist td.ua { font-size: 0.75em; }
+
+
+
+/* other general elements */
+
+div#valid {
+  display: none;
+}
+
+div#copyright {
+  display: none;
+}
index 3b417afd30053ccb5a604cd721e05b179fddb10e..795c7abb5ec6cb9b90b8020e7e6c54bef5fa7ee7 100644 (file)
@@ -1,23 +1,22 @@
 <?php
-$inc_class_util = true;
-$inc_class_ua = true;
-include('inchandler.inc');
+include('../classes/useragent.php-class');
 
 // read string from this file
 $uafile = 'ua_list_raw.txt';
 
-$mycss = "th { font-size: 0.75em; }\n";
-$mycss .= "td.comment { font-size: 0.75em; text-align: center; font-weight: bold; }\n";
-$mycss .= "td.ua { font-size: 0.75em; }\n";
-
-$wrapper->pgtop('User Agents', $mycss);
+print("<!DOCTYPE html>\n");
+print("<html>\n<head>\n");
+print("  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
+print("  <link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">\n");
+print("  <title>".'User Agents'."</title>\n");
+print("</head>\n<body>\n");
 
 print('<h1>User Agents</h1>'."\n");
 
 $ualist = is_readable($uafile)?file($uafile):array();
 
 if (count($ualist)) {
-  print('<table class="border">'."\n");
+  print('<table class="border" id="ualist">'."\n");
   print(' <tr>'."\n");
   print('  <th>User Agent string</th>'."\n");
   print('  <th>Brand</th>'."\n");
@@ -61,5 +60,8 @@ else {
   print('No User Agent strings found in file "'.$uafile.'".'."\n");
 }
 
-$wrapper->pgbottom();
+print("<div id=\"copyright\">\n");
+print("Page code under Mozilla Public License, code available at <a href=\"https://github.com/KaiRo-at/php-utility-classes\">GitHub</a>.\n");
+print("</div>\n");
+print("</body></html>\n");
 ?>
index 97309b3b84102bbcfa2b93d37603a335544bf793..95234d9620102c1940fa1fa9a8a5fbc7732b84b8 100644 (file)
@@ -1,22 +1,24 @@
 <?php
-$inc_class_util = true;
-$inc_class_ua = true;
-include("inchandler.inc");
-
-$wrapper->pgtop("KaiRo's Browser-Test");
+include('../classes/useragent.php-class');
 
 // set default time zone - right now, always the one the server is in!
 date_default_timezone_set('Europe/Vienna');
 
-$httpvars = $util->getHTTPvars();
-if (strlen($httpvars["ua"])) {
-  $ua = new userAgent($httpvars["ua"]);
+print("<!DOCTYPE html>\n");
+print("<html>\n<head>\n");
+print("  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
+print("  <link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">\n");
+print("  <title>".'User Agent Test'."</title>\n");
+print("</head>\n<body>\n");
+
+if (strlen($_REQUEST["ua"])) {
+  $ua = new userAgent($_REQUEST["ua"]);
 }
 else {
   $ua = new userAgent;
 }
 
-print("<h1>KaiRo's Browser-Test</h1>\n");
+print("<h1>User Agent Test</h1>\n");
 
 print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>");
 print("<b>".$ua->getUAString()."</b>\n");
@@ -44,5 +46,9 @@ print("<br><br>Test the following UA string (leave empty to read it from your br
 print("<form method=\"POST\" action=\"\"><p>\n");
 print("<input type=\"text\" name=\"ua\" value=\"".htmlentities($ua->getUAString())."\" size=\"80\" maxlength=\"150\">\n");
 print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");
-$wrapper->pgbottom();
+
+print("<div id=\"copyright\">\n");
+print("Page code under Mozilla Public License, code available at <a href=\"https://github.com/KaiRo-at/php-utility-classes\">GitHub</a>.\n");
+print("</div>\n");
+print("</body></html>\n");
 ?>