Add the changelog pages.

This commit is contained in:
Lizbeth Rika committed 2014-11-18 16:44:29 +00:00
1 parent 7c1b20862b
commit aa91469f2d
4 files changed
+70 -4

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
<?php
$module = basename(__FILE__, ".php");
require_once 'botania.php';
?>
+14 -1
View File
@@ -1,3 +1,9 @@
hr {
height: 1px;
background-color: #ccc;
}
.navbar {
background-image: none;
background-color: #33691E;
@@ -60,7 +66,6 @@
}
.btn-group-first {
margin-bottom: -12px;
margin-top: 7px;
height: 46px;
}
@@ -175,3 +180,11 @@ iframe {
height: 150px;
z-index: -1;
}
.changelog-header {
font-size: 32px;
}
#changelog-container {
margin-bottom: 60px;
}
+2 -3
View File
@@ -23,15 +23,14 @@ $('.hide-div').click(function() {
} else {
div.show(300);
$(this).text('(hide)');
}
}
});
$(".hashlink").click(function() {
var hash = $(this).text();
if(hash == 'Back to top' || hash == '(back to top)')
$('html, body').animate({ scrollTop: 0 }, 500);
$('html, body').delay(hash == 'Back to top' ? 400 : 0).animate({ scrollTop: 0 }, 500);
else $('html, body').animate({ scrollTop: $("#" + hash + "-fake").offset().top - 100 }, 1000);
});
+50
View File
@@ -0,0 +1,50 @@
<div class='changelog-header'>Botania Changelog</div>
<div id="changelog-container">
<?php
$versions = array();
$file = file('changelog.txt');
$changelog = '';
$first = true;
foreach($file as $line) {
if(strpos($line, '*') !== 0) {
$key = trim(str_replace('.', '-', str_replace(' ', '-', $line)));
$version = ucfirst(trim($line));
array_push($versions, $key);
if(!$first)
add_buttons();
$changelog .= "<hr><div id='$key-fake'><h3>$version</h3></div>";
$first = false;
$href_version = trim(str_lreplace(' ', '-', $line));
} else {
$change = substr($line, 1);
$changelog .= "<li>$change</li>";
}
}
echo('<div class="btn-group"><button type="button" class="btn btn-material-lightgreen dropdown-toggle" data-toggle="dropdown">Version Index <span
class="caret"></span></button><ul class="dropdown-menu">');
foreach($versions as $version)
echo("<li class='hashlink'><a>$version</a></li>");
echo('</ul></div>');
add_buttons();
echo($changelog);
function add_buttons() {
global $changelog, $href_version;
$changelog .= "<br><div class='btn btn-flat btn-material-cyan hashlink'>Back to top</div><a href='dl.php?file=Botania%20$href_version.jar'><div class='btn btn-flat btn-material-lightgreen'>Download</div></a>";
}
function str_lreplace($search, $replace, $subject) {
$pos = strrpos($subject, $search);
if($pos != false)
$subject = substr_replace($subject, $replace, $pos, strlen($search));
return $subject;
}
?>
</div>