# HG changeset patch # User Matti Hamalainen # Date 1350471744 -10800 # Node ID d41b51cd4ae5d9688d3a344c18322dc01060541c # Parent ceca065769184a5913cff423cf7c2fe09a9d27aa Implement switchable CSS support and a new default style + very minor code cleanups. diff -r ceca06576918 -r d41b51cd4ae5 index.php --- a/index.php Sat Oct 13 12:01:08 2012 +0300 +++ b/index.php Wed Oct 17 14:02:24 2012 +0300 @@ -1,20 +1,20 @@ - "lukcss", "prefix" => $baseURI."luk"); +$altCSS = array("blue" => "1", "old" => "2"); + $hourStamps = array( array( 8, 15), array( 9, 15), @@ -100,13 +100,6 @@ } -function lukMatchClass($matches) -{ - global $baseURI; - return "".$matches[1]." ".$matches[2]; -} - - // Check for mini-info mode $miniMode = isset($_GET["nyt"]); @@ -126,18 +119,6 @@ } -if (isset($_GET["tila"])) { - $tila = $_GET["tila"]; - echo "Luokkatilan näyttömoodi ei vielä tuettu.
\n"; - exit; - - $fp = @fopen($roomFile, "rb"); - if ($fp) { - fclose($fp); - } -} - - if (isset($_GET["next"])) { $nextPeriod = TRUE; $dataFile = "cache-next/".$luokka.".data"; @@ -191,16 +172,6 @@ } -function lukPrintHourInfo($dayHours, $showDays) -{ - $out = " \n Tunteja
(ryhmä/vv)\n"; - for ($day = 0; $day < $showDays; $day++) { - $out .= " ".$dayHours[$day]["total"]."h (".$dayHours[$day]["grouped"]."h)\n"; - } - return $out." \n"; -} - - function lukResolveHours($start, $day, $cmp, $mark = FALSE) { global $classHourTable, $classInfo; @@ -405,8 +376,7 @@ $out .= " \n"; } - $out .= lukPrintHourInfo($dayHours, $classInfo["maxdays"]). - "\n"; + $out .= "\n"; } // haveData @@ -414,8 +384,6 @@ $pageTitle = $haveData ? $luokka." / ".join("; ", $classInfo["info"]) : $luokka; printPageHeader($pageTitle); -if ($miniMode) echo "
\n"; - echo "
@@ -459,12 +427,16 @@ echo $out; -echo "

+echo "
Yhteydenotot ccr @ IRCNet tai ccr at tnsp dot org. En vastaa mahdollisista virheistä tiedoissa!
+
+Style: "; +foreach ($altCSS as $name => $id) + echo "".$name.""; +echo " +
"; - -if ($miniMode) echo "
\n"; printPageFooter(); diff -r ceca06576918 -r d41b51cd4ae5 luk.css --- a/luk.css Sat Oct 13 12:01:08 2012 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -body { - margin: 1em; - background-color: black; - color: white; - - font-family: Verdana, Arial, helvetica, sans-serif; - font-size: 10pt; -} - -a, a:visited, a:active { - text-decoration: underline; - color: white; -} - -a:hover { - text-decoration: underline; - color: #555; -} - -.noborder { - border: none; - padding: 0pt; -} - -.icenter { - text-align: center; -} - -h1, h2, h3 { - font-family: Arial, sans-serif; - font-weight: normal; - color: #eee; - background: #888; - padding: 4px; - padding-bottom: 8px; - text-shadow: 2px 2px 2px #000; -} - - -table { - border: 0px; - padding: 0px; - margin: 0px; -} - -tr { - border: 0px; - padding: 0px; - margin: 0px; -} - -table.timetable th { - padding: 2px; - margin: 2px; - background: #444; - text-align: center; -} - -td { - padding: 4px; - margin: 2px; - background: #555; - color: #ccc; -} - -table.timetable { - font-size: 10pt; -} - -table.timetable td > a, table.timetable td > a:visited, table.timetable td > a:active { - text-decoration: none; - text-shadow: 2px 2px 2px #000; - color: #fff; -} - -table.timetable td > a:hover { - color: yellow; -} - - -th.hours { - white-space: nowrap; -} - -table.timetable * table { - width: 100%; - height: 100%; -} - -table.timetable tr:hover th { - color: red; -} - -td.clgrouped, td.clgrouped * td { - background: #454; -} - -td.clnothing { - background: #222; -} - -td.clnormal { -} - -div.nhours { - text-align: right; -} - -div.nhours span { - background: black; - padding: 2pt; - border: 1px solid gray; -} - - - -#controls { - padding: 0px; - margin: 0px; -} - -#controls table * { - padding: 0px; - margin: 0px; -} - -#controls a { - padding: 3pt; - margin-bottom: 30pt; - border: 1px solid white; - -moz-border-radius: 8px; - border-radius: 8px; - text-decoration: none; - color: white; - background: #657; -} - -#controls a:hover { - background: white; - color: black; -} - -#controls select { - background: white; - border: 1px solid black; - - padding: 5pt; - -moz-border-radius: 8px; - border-radius: 8px; -} - -#controls input.submit { - color: white; - background: #686; - border: 1px solid white; - - padding: 5pt; - -moz-border-radius: 8px; - border-radius: 8px; -} - -#controls input.submit:hover { - background: white; - color: black; -} - -#mini { -} diff -r ceca06576918 -r d41b51cd4ae5 luk1.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/luk1.css Wed Oct 17 14:02:24 2012 +0300 @@ -0,0 +1,202 @@ +body { + margin: 1em; + background: black; + color: white; + + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 10pt; +} + +a, a:visited, a:active { + text-decoration: underline; + color: white; +} + +a:hover { + text-decoration: underline; + color: #555; +} + +h1, h2, h3 { + font-family: Arial, sans-serif; +// font-family: impact; + font-weight: normal; + color: white; + background: rgb(10,114,133); + padding: 5pt; + padding-bottom: 8px; + text-shadow: 2px 2px 2px #000; + -moz-border-radius: 8pt; + border-radius: 8pt; +} + +#csssel { + position: absolute; + right: 1em; + top: 1em; + font-size: 5pt; + background: rgb(10,114,133); + padding: 5pt; + -moz-border-radius: 5pt; + border-radius: 5pt; +} + +#csssel a { + padding: 2pt; + color: #ccc; + text-decoration: none; +} + +#csssel a:hover { + text-decoration: underline; +} + +#contents { + z-index: 5; + position: absolute; + right: 0.5em; + left: 0.5em; + background: rgba(10,114,133,0.6); + padding: 10pt; + -moz-border-radius: 10pt; + border-radius: 10pt; + text-shadow: 1px 1px 1px rgba(0,0,0,0.4); +} + + +table { + border: 0px; + padding: 0px; + margin: 0px; +} + +tr { + border: 0px; + padding: 0px; + margin: 0px; +} + +table.timetable th { + padding: 2px; + margin: 2px; + background: #444; + text-align: center; + + background: rgba(10,114,133,0.6); + color: #ccc; + -moz-border-radius: 5pt; + border-radius: 5pt; +} + +td { + padding: 4px; + margin: 2px; + background: rgba(0,84,103,0.7); + color: #ccc; + -moz-border-radius: 5pt; + border-radius: 5pt; +} + +table.timetable { + font-size: 10pt; +} + +table.timetable td > a, table.timetable td > a:visited, table.timetable td > a:active { + text-decoration: none; + text-shadow: 2px 2px 2px #000; + color: #fff; +} + +table.timetable td > a:hover { + color: yellow; +} + + +th.hours { + white-space: nowrap; +} + +table.timetable * table { + width: 100%; + height: 100%; +} + +table.timetable tr:hover th { + color: red; +} + +td.clgrouped, td.clgrouped * td { + background: rgb(63,80,63); +} + +td.clnothing { + background: rgb(0,84,103); +} + +td.clnormal { +} + +div.nhours { + text-align: right; +} + +div.nhours span { + background: black; + padding: 2pt; + border: 1px solid gray; +} + +#footer { + padding-top: 5pt; + font-size: 5pt; +} + +#controls { + padding: 0px; + margin: 0px; +} + +#controls table * { + padding: 0px; + margin: 0px; +} + +#controls a { + padding: 5pt; + margin-bottom: 30pt; +// border: 1px solid rgba(10,114,133,0.3); + -moz-border-radius: 8px; + border-radius: 8px; + text-decoration: none; + color: white; + background: rgba(255,255,255,0.2); +} + +#controls a:hover { + color: white; + background: rgba(255,255,255,0.5); +} + +#controls select { + background: white; + border: 1px solid black; + + padding: 5pt; + -moz-border-radius: 8px; + border-radius: 8px; +} + +#controls input.submit { + color: white; + background: rgba(200,255,200,0.2); + border: 1px solid rgba(255,255,255,0.3); + + padding: 5pt; + -moz-border-radius: 8px; + border-radius: 8px; +} + +#controls input.submit:hover { + color: white; + background: rgba(200,255,200,0.5); +} diff -r ceca06576918 -r d41b51cd4ae5 luk2.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/luk2.css Wed Oct 17 14:02:24 2012 +0300 @@ -0,0 +1,181 @@ +body { + margin: 1em; + background-color: black; + color: white; + + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 10pt; +} + +a, a:visited, a:active { + text-decoration: underline; + color: white; +} + +a:hover { + text-decoration: underline; + color: #555; +} + +h1, h2, h3 { + font-family: Arial, sans-serif; + font-weight: normal; + color: #eee; + background: #888; + padding: 4px; + padding-bottom: 8px; + text-shadow: 2px 2px 2px #000; +} + + +#csssel { + position: absolute; + right: 1em; + top: 1em; + font-size: 5pt; + background: rgb(10,114,133); + padding: 5pt; + -moz-border-radius: 5pt; + border-radius: 5pt; +} + +#csssel a { + padding: 2pt; + color: #ccc; + text-decoration: none; +} + +#csssel a:hover { + text-decoration: underline; +} + + +table { + border: 0px; + padding: 0px; + margin: 0px; +} + +tr { + border: 0px; + padding: 0px; + margin: 0px; +} + +table.timetable th { + padding: 2px; + margin: 2px; + background: #444; + text-align: center; +} + +td { + padding: 4px; + margin: 2px; + background: #555; + color: #ccc; +} + +table.timetable { + font-size: 10pt; +} + +table.timetable td > a, table.timetable td > a:visited, table.timetable td > a:active { + text-decoration: none; + text-shadow: 2px 2px 2px #000; + color: #fff; +} + +table.timetable td > a:hover { + color: yellow; +} + + +th.hours { + white-space: nowrap; +} + +table.timetable * table { + width: 100%; + height: 100%; +} + +table.timetable tr:hover th { + color: red; +} + +td.clgrouped, td.clgrouped * td { + background: #454; +} + +td.clnothing { + background: #222; +} + +td.clnormal { +} + +div.nhours { + text-align: right; +} + +div.nhours span { + background: black; + padding: 2pt; + border: 1px solid gray; +} + +#footer { + padding-top: 5pt; + font-size: 5pt; +} + +#controls { + padding: 0px; + margin: 0px; +} + +#controls table * { + padding: 0px; + margin: 0px; +} + +#controls a { + padding: 3pt; + margin-bottom: 30pt; + border: 1px solid white; + -moz-border-radius: 8px; + border-radius: 8px; + text-decoration: none; + color: white; + background: #657; +} + +#controls a:hover { + background: white; + color: black; +} + +#controls select { + background: white; + border: 1px solid black; + + padding: 5pt; + -moz-border-radius: 8px; + border-radius: 8px; +} + +#controls input.submit { + color: white; + background: #686; + border: 1px solid white; + + padding: 5pt; + -moz-border-radius: 8px; + border-radius: 8px; +} + +#controls input.submit:hover { + background: white; + color: black; +}