r20151014

This commit is contained in:
flash 2015-10-14 16:14:30 +02:00
parent 7f64894882
commit 81ab5c14fe
8 changed files with 81 additions and 3401 deletions

File diff suppressed because it is too large Load diff

View file

@ -71,10 +71,6 @@ class Urls
'/authenticate.php', '/authenticate.php',
'/activate', '/activate',
], ],
'CHANGELOG' => [
'/changelog.php',
'/changelog',
],
'INFO_PAGE' => [ 'INFO_PAGE' => [
'/index.php?p=%s', '/index.php?p=%s',
'/p/%s', '/p/%s',

View file

@ -8,7 +8,7 @@
namespace Sakura; namespace Sakura;
// Define Sakura version // Define Sakura version
define('SAKURA_VERSION', '20151012'); define('SAKURA_VERSION', '20151014');
define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_COLOUR', '#6C3082');
define('SAKURA_STABLE', false); define('SAKURA_STABLE', false);

View file

@ -1,120 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sakura Changelog</title>
<style type="text/css">
@import url('/content/fonts/segoeui-light/font.css');
body {
background: #000;
color: #FFF;
font: 300 12px/20px "SegoeUI-Light", sans-serif;
margin: 45px 30px;
padding: 0;
}
a {
color: inherit;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1, h3 {
font-weight: 100;
}
h1 {
font-size: 5em;
}
.changecont {
background: #FFF;
position: fixed;
bottom: 45px;
left: 30px;
right: 30px;
top: 130px;
border: 1px solid #333;
background: #111;
overflow: auto;
}
.footer {
position: fixed;
bottom: 25px;
left: 30px;
right: 30px;
text-align: center;
}
.release > div > span.tag {
display: inline-block;
min-width: 100px;
text-align: center;
background: #222;
font-weight: 500;
letter-spacing: 2px;
border-right: 1px solid #222;
box-shadow: inset 0 0 .5em rgba(255, 255, 255, .4);
}
.release > div > span.addition-tag {
background: #2A2;
}
.release > div > span.removal-tag {
background: #A22;
}
.release > div > span.fixed-tag {
background: #2AA;
}
.release > div > span.update-tag {
background: #2AA;
}
.release > div > span.changedesc {
padding: 0 5px;
}
.release > div > a.changeuser {
float: right;
margin-right: 10px;
}
.release > div {
border-bottom: 1px #222 solid;
}
.release > div:first-child,
.release:last-child > div:last-child {
border-bottom: 0;
}
.release > .title {
font-size: 1.5em;
line-height: 1.5em;
background: #222;
box-shadow: inset 0 0 .5em #444;
padding: 0 5px 2px;
display: block;
}
.release:not(:first-child) {
margin-top: 5px;
}
</style>
</head>
<body>
<h1 style="color: {{ colour }};">Sakura {{ version_label }}</h1>
<h3>Installed version: {{ version }} ({{ version_type }})</h3>
<div class="changecont">
{{ changeloghtml }}
</div>
<div class="footer">
<a href="http://flash.moe">Flashwave</a> /
<a href="http://circlestorm.net">Circlestorm</a> /
<a href="http://sakura.flashii.net">Sakura</a> /
<a href="https://bitbucket.org/circlestorm/sakura">BitBucket</a>
</div>
</body>
</html>

View file

@ -1,3 +1,4 @@
<div id="indexPanel">
{% if session.checkLogin %} {% if session.checkLogin %}
<div class="head">Hi, {{ user.data.username }}!</div> <div class="head">Hi, {{ user.data.username }}!</div>
<a href="{{ urls.format('SETTING_MODE', ['appearance', 'avatar']) }}"><img src="{{ urls.format('IMAGE_AVATAR', [user.data.user_id]) }}" class="default-avatar-setting homepage-menu-avatar" /></a> <a href="{{ urls.format('SETTING_MODE', ['appearance', 'avatar']) }}"><img src="{{ urls.format('IMAGE_AVATAR', [user.data.user_id]) }}" class="default-avatar-setting homepage-menu-avatar" /></a>
@ -35,3 +36,4 @@ it has been <b>{{ stats.lastRegDate }}</b> since the last user registered and th
{% else %} {% else %}
There were no online users in the past 5 minutes. There were no online users in the past 5 minutes.
{% endif %} {% endif %}
</div>

View file

@ -233,14 +233,14 @@
</div> </div>
<div class="footer"> <div class="footer">
<div class="ftsections"> <div class="ftsections">
<div class="copycentre">{% if not sakura.versionInfo.stable %}<a href="{{ urls.format('CHANGELOG') }}#r{{ sakura.versionInfo.version }}" target="_blank">Sakura Revision {{ sakura.versionInfo.version }} Development</a>{% endif %} &copy; 2013-2015 <a href="//flash.moe/" target="_blank">Flashwave</a>, <a href="http://circlestorm.net/">et al</a>. </div> <div class="copycentre">{% if not sakura.versionInfo.stable %}<a href="https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}" target="_blank">Sakura Revision {{ sakura.versionInfo.version }} Development</a>{% endif %} &copy; 2013-2015 <a href="https://flash.moe/" target="_blank">Flashwave</a>, <a href="https://circlestorm.net/">et al</a>. </div>
<ul class="ftsection"> <ul class="ftsection">
<li class="fthead">General</li> <li class="fthead">General</li>
<li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li> <li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li>
<li><a href="{{ urls.format('SITE_NEWS') }}" title="Flashii News &amp; Updates">News</a></li> <li><a href="{{ urls.format('SITE_NEWS') }}" title="Flashii News &amp; Updates">News</a></li>
<li><a href="{{ urls.format('SITE_SEARCH') }}" title="Do full-site search requests">Search</a></li> <li><a href="{{ urls.format('SITE_SEARCH') }}" title="Do full-site search requests">Search</a></li>
<li><a href="{{ urls.format('INFO_PAGE', ['contact']) }}" title="Contact our Staff">Contact</a></li> <li><a href="{{ urls.format('INFO_PAGE', ['contact']) }}" title="Contact our Staff">Contact</a></li>
<li><a href="{{ urls.format('CHANGELOG') }}" title="All the changes made to Sakura are listed here">Changelog</a></li> <li><a href="https://sakura.flash.moe" target="_blank" title="All the changes made to Sakura are listed here">Changelog</a></li>
<li><a href="{{ urls.format('SITE_PREMIUM') }}" title="Get Tenshi and help us pay the bills">Support us</a></li> <li><a href="{{ urls.format('SITE_PREMIUM') }}" title="Get Tenshi and help us pay the bills">Support us</a></li>
</ul> </ul>
<ul class="ftsection"> <ul class="ftsection">
@ -262,5 +262,46 @@
</div> </div>
</div> </div>
</div> </div>
{% if not sakura.versionInfo.stable and php.self == '/index.php' and not page.id %}
<script type="text/javascript" src="https://sakura.flash.moe/?get={{ sakura.versionInfo.version|slice(0, 4) }}-{{ sakura.versionInfo.version|slice(4, 2) }}-{{ sakura.versionInfo.version|slice(6, 2) }}&amp;variable=true"></script>
<script type="text/javascript">
window.addEventListener("load", function() {
// Check if the changelog variable is an object
if(typeof changelog === 'object') {
// Grab the index panel
var indexPanel = document.getElementById('indexPanel');
// Create the head container
var changelogTitle = document.createElement('div');
changelogTitle.className = 'head';
changelogTitle.style.marginBottom = '1px';
// Create a link
var changelogLink = document.createElement('a');
changelogLink.className = 'underline';
changelogLink.target = '_blank';
changelogLink.href = 'https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}';
// Create the text container
var changelogTitleText = document.createTextNode('Changelog');
// Append everything
changelogLink.appendChild(changelogTitleText);
changelogTitle.appendChild(changelogLink);
indexPanel.appendChild(changelogTitle);
// Create and append all changelog entries
for (var i in changelog) {
var entry = document.createElement('div');
entry.style.fontSize = '.8em';
entry.style.lineHeight = '1.5em';
var text = document.createTextNode('[' + changelog[i]['change_action']['action_name'] + '] ' + changelog[i]['change_message']);
entry.appendChild(text);
indexPanel.appendChild(entry);
}
}
});
</script>
{% endif %}
</body> </body>
</html> </html>

View file

@ -13,7 +13,6 @@ RewriteRule ^login/?$|^logout/?$|^activate/?$|^register/?$|^forgotpassword/?|^au
RewriteRule ^support/?$ support.php [L,QSA] RewriteRule ^support/?$ support.php [L,QSA]
RewriteRule ^support/tracker/?$ support.php?tracker=true [L,QSA] RewriteRule ^support/tracker/?$ support.php?tracker=true [L,QSA]
RewriteRule ^support/tracker/([0-9]+)/?$ support.php?tracker=true&page=$1 [L,QSA] RewriteRule ^support/tracker/([0-9]+)/?$ support.php?tracker=true&page=$1 [L,QSA]
RewriteRule ^changelog/?$ changelog.php [L,QSA]
RewriteRule ^faq/?$ faq.php [L,QSA] RewriteRule ^faq/?$ faq.php [L,QSA]
RewriteRule ^search/?$ search.php [L,QSA] RewriteRule ^search/?$ search.php [L,QSA]

View file

@ -1,88 +0,0 @@
<?php
/*
* Sakura Main Index
*/
// Declare Namespace
namespace Sakura;
// We don't use twig here
define('SAKURA_NO_TPL', true);
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
// Path the changelog JSON
$changelog = json_decode(file_get_contents(ROOT . '_sakura/changelog.json'), true);
// Create variable to store HTML in
$changelogHTML = null;
// Format HTML
foreach (array_reverse($changelog['changelog'], true) as $revisionId => $revisionData) {
$changelogHTML .= '<div class="release" id="r' . $revisionId . '">';
$changelogHTML .= '<a href="#r'
. $revisionId
. '" class="title" style="color: '
. $changelog['versions'][$revisionData[0]]
. ';">Revision '
. $revisionId
. ' ('
. ucfirst($revisionData[0])
. ')</a>';
unset($revisionData[0]);
foreach (array_reverse($revisionData) as $id => $changeData) {
$changelogHTML .= '<div id="r' . $revisionId . 'c' . $id . '">';
switch ($changeData['type']) {
case 'ADD':
$changelogHTML .= '<span class="tag addition-tag">Added</span>';
break;
case 'REM':
$changelogHTML .= '<span class="tag removal-tag">Removed</span>';
break;
case 'FIX':
$changelogHTML .= '<span class="tag fixed-tag">Fixed</span>';
break;
case 'UPD':
$changelogHTML .= '<span class="tag update-tag">Updated</span>';
break;
default:
$changelogHTML .= '<span class="tag">Unknown</span>';
}
$changelogHTML .= '<span class="changedesc">';
$changelogHTML .= $changeData['change'];
$changelogHTML .= '</span>';
$changelogHTML .= '<a class="changeuser" target="_blank" href="http://bitbucket.org/'
. strtolower($changeData['user'])
. '">';
$changelogHTML .= $changeData['user'];
$changelogHTML .= '</a>';
$changelogHTML .= '</div>';
}
$changelogHTML .= '</div>';
}
// Get special template file
$tpl = file_get_contents(ROOT . '_sakura/templates/changeLog.tpl');
// Parse tags
$tpl = str_replace('{{ version }}', SAKURA_VERSION, $tpl);
$tpl = str_replace('{{ version_label }}', SAKURA_VLABEL, $tpl);
$tpl = str_replace('{{ version_type }}', SAKURA_STABLE ? 'Stable' : 'Development', $tpl);
$tpl = str_replace('{{ colour }}', SAKURA_COLOUR, $tpl);
$tpl = str_replace('{{ changeloghtml }}', $changelogHTML, $tpl);
// Print template
print $tpl;