2015-04-06 21:23:54 +00:00
<!DOCTYPE html>
<html>
<head>
<!-- META -->
<meta charset=" { { sakura . charset } } " />
<title> { { page . title } } </title>
2015-05-24 22:06:53 +00:00
<meta name="description" content=" { { sakura . sitedesc } } " />
<meta name="keywords" content=" { { sakura . sitetags } } " />
2015-04-06 21:23:54 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
2015-04-08 17:18:19 +00:00
{ % if page . redirect % }
2015-04-08 19:27:51 +00:00
<meta http-equiv="refresh" content="3; URL= { { page . redirect } } " />
2015-04-08 17:18:19 +00:00
{ % endif % }
2015-04-06 21:23:54 +00:00
<!-- CSS -->
2015-04-27 00:41:59 +00:00
<link rel="stylesheet" type="text/css" href=" { { sakura . resources } } /css/yuuno.css" />
2015-05-03 21:43:25 +00:00
{ % if page . style % }
<style type="text/css">
{ % for element , properties in page . style % }
{ { element | raw } } {
{ % for property , value in properties % }
{ { property | raw } } : { { value | raw } } ;
{ % endfor % }
}
{ % endfor % }
</style>
{ % endif % }
2015-04-06 21:23:54 +00:00
<!-- JS -->
2015-04-27 00:41:59 +00:00
<script type="text/javascript" src=" { { sakura . resources } } /js/yuuno.js"></script>
2015-04-06 21:23:54 +00:00
<script type="text/javascript">
2015-05-09 00:56:55 +00:00
// Create an object so we can access certain settings from remote JavaScript files
var sakuraVars = {
"cookie": {
"prefix": " { { sakura . cookieprefix } } ",
"domain": " { { sakura . cookiedomain } } ",
"path": " { { sakura . cookiepath } } "
},
"resources": " { { sakura . resources } } ",
"urls": {
{ % for name , url in sakura . urls % }
" { { name } } ": " { { url } } " { % if loop . index ! = sakura . urls | length % } , { % endif % }
{ % endfor % }
},
2015-05-25 18:18:56 +00:00
"minUserLen": { { sakura . minusernamelength } } ,
"maxUserLen": { { sakura . maxusernamelength } } ,
"minPwdEntropy": { { sakura . minpwdentropy } } ,
"checklogin": { % if user . checklogin % } true { % else % } false { % endif % }
2015-05-09 00:56:55 +00:00
};
2015-04-24 19:31:09 +00:00
{ % if not user . checklogin and not sakura . lockauth % }
2015-04-20 19:39:49 +00:00
2015-04-06 21:23:54 +00:00
// Setting the shit so clicking the login link doesn't redirect to /login
2015-04-20 19:39:49 +00:00
function initHeaderLoginForm() {
2015-04-06 21:23:54 +00:00
2015-04-20 19:39:49 +00:00
var headerLoginForm = document.getElementById('headerLoginForm');
var createInput = document.createElement('input');
2015-06-19 16:12:44 +00:00
var submit = headerLoginForm.querySelector('[type="submit"]');
2015-04-20 19:39:49 +00:00
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
headerLoginForm.appendChild(createInput);
2015-06-19 16:12:44 +00:00
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\'headerLoginForm\', true, \'Logging in...\');');
2015-04-06 21:23:54 +00:00
}
2015-04-24 19:31:09 +00:00
{ % elseif user . checklogin % }
2015-04-20 19:39:49 +00:00
// Prepare header logout stuff
function initHeaderLoginForm() {
var headerLogoutLink = document.getElementById('headerLogoutLink');
headerLogoutLink.setAttribute('href', 'javascript:void(0);');
headerLogoutLink.setAttribute('onclick', 'doHeaderLogout();');
}
2015-05-09 00:56:55 +00:00
2015-04-20 19:39:49 +00:00
function doHeaderLogout() {
2015-05-09 00:56:55 +00:00
generateForm("headerLogoutForm", {
"class": "hidden",
"method": "post",
"action": "// { { sakura . urls . main } } /logout"
},
{
"mode": "logout",
"ajax": "true",
"time": " { { php . time } } ",
"session": " { { php . sessionid } } ",
"redirect": " { { sakura . currentpage } } "
}, "contentwrapper");
2015-04-20 19:39:49 +00:00
setTimeout(function() {
submitPost("headerLogoutForm", true, "Logging out...")
}, 10);
}
2015-04-06 21:23:54 +00:00
{ % endif % }
2015-06-20 16:06:07 +00:00
{ % if php . self = = '/profile.php' and user . checklogin and user . data . id ! = profile . user . id % }
// Prepare friend toggle
function initFriendToggle() {
var profileFriendToggle = document.getElementById('profileFriendToggle');
profileFriendToggle.setAttribute('href', 'javascript:void(0);');
profileFriendToggle.setAttribute('onclick', 'doFriendToggle();');
}
function doFriendToggle() {
generateForm("doFriendToggle", {
"class": "hidden",
"method": "post",
"action": "// { { sakura . urls . main } } /friends"
},
{
" { % if profile . friend = = 0 % } add { % else % } remove { % endif % } ": " { { profile . user . id } } ",
"ajax": "true",
"time": " { { php . time } } ",
"session": " { { php . sessionid } } ",
"redirect": " { { sakura . currentpage } } "
}, "contentwrapper");
setTimeout(function() {
submitPost("doFriendToggle", true, " { % if profile . friend = = 0 % } Adding { % else % } Removing { % endif % } friend...")
}, 10);
}
{ % endif % }
2015-04-20 19:39:49 +00:00
// Space for things that need to happen onload
window.onload = function() {
2015-05-25 18:18:56 +00:00
// Alter the go to top button
var gotop = document.getElementById('gotop');
gotop.setAttribute('href', 'javascript:void(0);');
gotop.setAttribute('onclick', 'scrollToTop();');
2015-04-20 19:39:49 +00:00
// Login form under header and ajax logout
initHeaderLoginForm();
2015-05-09 00:56:55 +00:00
{ % if user . checklogin % }
// Make notification requests (there's a seperate one to make it happen before the first 60 seconds)
notifyRequest(' { { php . sessionid } } ');
setInterval(function() { notifyRequest ( '{{ php.sessionid }}' ) ; } , 60000);
{ % endif % }
2015-06-20 16:06:07 +00:00
{ % if php . self = = '/profile.php' and user . checklogin and user . data . id ! = profile . user . id % }
initFriendToggle();
{ % endif % }
2015-04-24 19:31:09 +00:00
{ % if php . self = = '/authenticate.php' and not sakura . lockauth % }
2015-04-20 19:39:49 +00:00
// AJAX Form Submission
var forms = {
2015-04-21 14:23:28 +00:00
{ % if not auth . changingPass % }
2015-04-20 19:39:49 +00:00
"loginForm": 'Logging in...',
{ % if not sakura . disableregister % } "registerForm": 'Processing registration...', { % endif % }
{ % i f not sakura . requireactive % } "resendForm": 'Attempting to resend activation...', { % endif % }
"passwordForm": 'Sending password recovery mail...'
2015-04-21 14:23:28 +00:00
{ % else % }
"passwordForm": 'Changing password...'
{ % endif % }
2015-04-20 19:39:49 +00:00
};
for(var i in forms) {
var form = document.getElementById(i);
var submit = form.querySelector('[type="submit"]');
2015-04-27 15:13:52 +00:00
form.setAttribute('onkeydown', 'formEnterCatch(event, \''+ submit.id +'\');');
2015-04-20 19:39:49 +00:00
submit.setAttribute('href', 'javascript:void(0);');
2015-05-25 18:18:56 +00:00
submit.setAttribute('onclick', 'submitPost(\''+ i +'\', true, \''+ forms[i] +'\', '+ (i == 'registerForm' ? 'true' : 'false') +');');
2015-04-20 19:39:49 +00:00
submit.setAttribute('type', 'button');
var createInput = document.createElement('input');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
form.appendChild(createInput);
}
{ % endif % }
};
2015-04-06 21:23:54 +00:00
</script>
</head>
2015-05-04 20:08:53 +00:00
<body>
2015-04-06 21:23:54 +00:00
<div id="container">
<span id="top"></span>
<div class="header" id="header">
2015-05-06 13:42:02 +00:00
<a class="logo" href="// { { sakura . urls . main } } /"> { { sakura . sitename } } </a>
2015-04-06 21:23:54 +00:00
<div class="menu">
<div class="menu-nav" id="navMenuSite">
<!-- Navigation menu, displayed on left side of the bar. -->
2015-04-18 11:35:16 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /" title="Return to the front page of Flashii">Home</a>
<a class="menu-item" href="// { { sakura . urls . main } } /news" title="Here you can read updates on Flashii">News</a>
2015-04-18 18:26:52 +00:00
<a class="menu-item" href="// { { sakura . urls . chat } } /" title="Chat with other Flashii members">Chat</a>
2015-05-23 03:31:42 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /forum" title="Discuss things with other members but static">Forums</a>
2015-05-24 22:06:53 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /search" title="Search on Flashii">Search</a>
2015-04-18 18:26:52 +00:00
{ % if user . checklogin % }
2015-05-03 16:25:57 +00:00
<a class="menu-item menu-donate" href="// { { sakura . urls . main } } /support" title="Give us money to keep the site (and other services) up and running">Support us</a>
2015-04-18 18:26:52 +00:00
{ % endif % }
2015-04-06 21:23:54 +00:00
</div>
<div class="menu-ucp" id="navMenuUser">
<!-- User menu, displayed on right side of the bar. -->
2015-04-17 22:51:53 +00:00
{ % if user . checklogin % }
2015-04-25 20:08:44 +00:00
<a class="menu-item avatar" href="// { { sakura . urls . main } } /u/ { { user . data . id } } " title="View and edit your own profile" style="background-image: url('// { { sakura . urls . main } } /a/ { { user . data . id } } '); width: auto; color: { { user . colour } } ; font-weight: 700;"> { { user . data . username } } </a>
2015-05-24 22:06:53 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /members" title="View a list with all the activated user accounts">Members</a>
2015-05-05 06:24:19 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /messages" title="Read your private message">Messages</a>
2015-05-23 03:31:42 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /manage" title="Manage the site">Manage</a>
2015-04-18 11:35:16 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /settings" title="Change your settings">Settings</a>
2015-06-20 19:25:41 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /logout?mode=logout&time= { { php . time } } &session= { { php . sessionid } } &redirect= { { sakura . currentpage } } " title="End your login session" id="headerLogoutLink">Logout</a>
2015-04-17 22:51:53 +00:00
{ % else % }
2015-04-24 19:31:09 +00:00
{ % if sakura . lockauth % }
<div class="menu-item" style="padding-left: 10px; padding-right: 10px;">Authentication is locked</div>
{ % else % }
2015-06-19 16:12:44 +00:00
<a class="menu-item" href="// { { sakura . urls . main } } /authenticate" title="Login to Flashii">Login or Register</a>
2015-04-24 19:31:09 +00:00
{ % endif % }
2015-04-17 22:51:53 +00:00
{ % endif % }
2015-04-06 21:23:54 +00:00
</div>
<div class="menu-mob">
<a class="menu-item" id="mobileNavToggle" href="javascript:;" onclick="mobileMenu(true);">Open Menu</a>
</div>
<div class="clear"></div>
</div>
</div>
<div id="contentwrapper">
2015-05-09 00:56:55 +00:00
<div id="notifications"></div>
2015-06-19 16:12:44 +00:00
{ % if not user . checklogin and php . self ! = '/authenticate.php' % }
<form method="post" action="/authenticate" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');">
2015-04-20 19:39:49 +00:00
<input type="hidden" name="redirect" value=" { { sakura . currentpage } } " />
<input type="hidden" name="session" value=" { { php . sessionid } } " />
<input type="hidden" name="time" value=" { { php . time } } " />
<input type="hidden" name="mode" value="login" />
2015-04-24 17:48:56 +00:00
<div>
<label for="headerLoginUserName">Username:</label>
<input type="text" id="headerLoginUserName" name="username" class="inputStyling" placeholder="Username" />
</div>
<div>
<label for="headerLoginPassword">Password:</label>
<input type="password" id="headerLoginPassword" name="password" class="inputStyling" placeholder="Password" />
</div>
<div>
<input type="checkbox" name="remember" id="headerLoginRemember" />
<label for="headerLoginRemember">Remember me</label>
</div>
<div>
2015-06-19 16:12:44 +00:00
<input type="submit" id="headerLoginButton" name="submit" class="inputStyling small" value="Login" />
2015-04-24 17:48:56 +00:00
</div>
2015-04-20 19:39:49 +00:00
</form>
2015-04-06 21:23:54 +00:00
{ % endif % }
2015-04-25 20:08:44 +00:00
<noscript>
<div class="headerNotify">
<h1>You have JavaScript disabled!</h1>
<p>A lot of things on this site require JavaScript to be enabled (e.g. the chat), we try to keep both sides happy but it is highly recommended that you enable it (you'll also have to deal with this message being here if you don't enable it).</p>
</div>
</noscript>