kot aufräumen

This commit is contained in:
sirx 2016-11-06 02:11:53 +01:00
parent b35a45f55b
commit 77450a379a
3 changed files with 34 additions and 52 deletions

View File

@ -12,25 +12,7 @@
{% endfor %} {% endfor %}
</ul> </ul>
<script src="./s/jquery-3.1.0.min.js"></script> <script src="./s/jquery-3.1.0.min.js"></script>
<script> <script src="./s/shit.js"></script>
var load = false; <script src="./s/theme.js"></script>
$(()=>{
$(window).scroll(()=>{
if($(window).scrollTop() + $(window).height() >= $(document).height() - 130 && !load) {
load = true;
$.getJSON('./api/p/'+$('#posts').data('last'), (msg) => {
var html = "";
for(var i = 0; i < msg.items.length; i++)
if(msg.items[i].id)
html += "<li class=\"post\"><a href=\"./"+msg.items[i].id+"\" title=\""+msg.items[i].mime+"\"><img class=\"thumb\" src=\"./t/"+msg.items[i].id+".png\" /></a></li>\n";
$('#posts').append(html);
$('#posts').data('last', msg.last);
load = false;
});
}
});
});
</script>
<script src="./s/theme.js"></script>
</body> </body>
</html> </html>

View File

@ -47,37 +47,7 @@
<span id="themes">theme: </span> <span id="themes">theme: </span>
</div> </div>
</div> </div>
<script> <script src="./s/shit.js"></script>
function arrowKeys(e) { <script src="./s/theme.js"></script>
switch(e.keyCode) {
case 39:
var prev = document.getElementById('prev');
if(prev) prev.click();
break;
case 37:
var next = document.getElementById('next');
if(next) next.click();
break;
}
}
if(document.readyState == 'complete' || document.readyState == 'loaded')
document.addEventListener('keydown', arrowKeys);
else {
if(/Chrome/i.test(navigator.userAgent))
window.addEventListener('load', function () {
document.addEventListener('keydown', arrowKeys);
});
else
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('keydown', arrowKeys);
});
}
var video = document.getElementById('player');
video.volume = 0.3;
var x = document.getElementById("player");
x.volume = 0.3;
</script>
<script src="./s/theme.js"></script>
</body> </body>
</html> </html>

30
s/shit.js Normal file
View File

@ -0,0 +1,30 @@
function arrowKeys(e) {
switch(e.keyCode) {
case 39:
var prev = document.getElementById('prev');
if(prev) prev.click();
break;
case 37:
var next = document.getElementById('next');
if(next) next.click();
break;
}
}
if(document.readyState == 'complete' || document.readyState ==
'loaded')
document.addEventListener('keydown', arrowKeys);
else {
if(/Chrome/i.test(navigator.userAgent))
window.addEventListener('load', function () {
document.addEventListener('keydown', arrowKeys);
});
else
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('keydown', arrowKeys);
});
}
var video = document.getElementById('player');
video.volume = 0.3;
var x = document.getElementById("player");
x.volume = 0.3;