<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="icon" href="../../favicon.ico" type="image/png">
<title>Video List</title>
<meta name="description" content="Wrapper: Offline's Video List">
<link rel="stylesheet" type="text/css" href="../css/oldglobal.css">
</head>
<body>
<header>
<div>
<h1 style="margin:0"><img id="logo" src="../img/list_logo.png" alt="Wrapper: Offline"/></h1>
<div id="headbuttons">
<a class="button_small" onclick="document.getElementById('file').click()">UPLOAD A MOVIE</a>
<div id="char_dropdown" class="button_small">
<div>CREATE A CHARACTER</div>
<menu>
<h2>Comedy World</h2>
<a href="/cc?themeId=family&bs=adam">Guy (Adam)</a>
<a href="/cc?themeId=family&bs=eve">Girl (Eve)</a>
<a href="/cc?themeId=family&bs=bob">Fat (Bob)</a>
<a href="/cc?themeId=family&bs=rocky">Buff (Rocky)</a>
<hr>
<h2>Anime</h2>
<a href="/cc?themeId=anime&bs=guy">Guy</a>
<a href="/cc?themeId=anime&bs=girl">Girl</a>
<a href="/cc?themeId=ninjaanime&bs=guy">Guy (Ninja)</a>
<a href="/cc?themeId=ninjaanime&bs=girl">Girl (Ninja)</a>
<hr>
<h2>Peepz</h2>
<a href="/cc?themeId=cc2&bs=default">Lil Peepz</a>
<a href="/cc?themeId=chibi&bs=default">Chibi Peepz</a>
<a href="/cc?themeId=ninja&bs=default">Chibi Ninjas</a>
</menu>
</div>
<a href="/go_full" class="button_big">MAKE A VIDEO</a>
</div>
</div>
</header>
<table>
<thead>
<tr>
<td></td>
<td>Video Title</td>
<td>Last Modified</td>
<td></td>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<td colspan="127"><a id="load_more" href="javascript:;">LOAD MORE...</a></td>
</tr>
</tfoot>
</table>
<footer>
<a id="discordlink" href="https://discord.gg/yhGAetN">Discord Server</a>
</footer>
<form enctype='multipart/form-data' action='/upload_movie' method='post'>
<input id='file' type="file" onchange="this.form.submit()" name='import' />
</form>
</body>
<script>
const closeReq = new XMLHttpRequest();
closeReq.open('GET', '/events/close');
closeReq.send();
var json;
var tbody = document.getElementsByTagName('tbody')[0];
var loadMore = document.getElementById('load_more');
const listReq = new XMLHttpRequest();
listReq.open('GET', '/movieList');
listReq.send();
var C = 0;
function loadRows() {
let c = C; C += 69;
for (; c < C; c++) {
if (c > json.length - 1) {
loadMore.remove();
break;
}
const tbl = json[c];
const date = tbl.date.substr(0, 10) + ' ' + tbl.date.substr(11);
tbody.insertAdjacentHTML('beforeend',
'<tr><td><img src="/movie_thumbs/' + tbl.id + '"></td><td><div>' + tbl.title + '</div><div>' + tbl.durationString + '</div></div></td><td><span>' + date.match(/./g).join('</span><span>') + '</span></td><td><a href="javascript:;" onclick="popup(\'' + tbl.id + '\')"></a><a href="/go_full?movieId=' + tbl.id + '"></a><a href="/movies/' + tbl.id + '.xml" download="' + tbl.title + '"></a></td></tr>');
}
}
loadMore.onclick = loadRows;
listReq.onreadystatechange = function (e) {
if (listReq.readyState != 4) return;
json = JSON.parse(listReq.responseText);
loadRows();
}
function popup(id) {
window.open('/player?movieId=' + id, 'MsgWindow', 'width=1280,height=720,left=' + (screen.width / 2 - 640) + ',top=' + (screen.height / 2 - 360));
}
</script>
</html>