forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-12-01 14:25:00 +02:00
parent 9ca4efeec2
commit 37257b9618
21 changed files with 404 additions and 431 deletions

View File

@ -12,7 +12,7 @@
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var prevScrollpos = window.pageYOffset; var prevScrollpos = window.pageYOffset;
window.onscroll = function () { window.onscroll = function () {
var currentScrollPos = window.pageYOffset; var currentScrollPos = window.pageYOffset;
@ -32,8 +32,7 @@ window.onload = function() {
} }
prevScrollpos = currentScrollPos; prevScrollpos = currentScrollPos;
} }
});
};
</script> </script>
{% endblock %} {% endblock %}

View File

@ -40,7 +40,7 @@
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var prevScrollpos = window.pageYOffset; var prevScrollpos = window.pageYOffset;
window.onscroll = function () { window.onscroll = function () {
var currentScrollPos = window.pageYOffset; var currentScrollPos = window.pageYOffset;
@ -60,8 +60,7 @@ window.onload = function() {
} }
prevScrollpos = currentScrollPos; prevScrollpos = currentScrollPos;
} }
});
};
</script> </script>
{% endblock %} {% endblock %}

View File

@ -1,6 +1,6 @@
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
const banModal = function(link, id, name) { const banModal = function(link, id, name) {
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`; document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
document.getElementById("ban-modal-link").value = link; document.getElementById("ban-modal-link").value = link;
@ -24,7 +24,7 @@ window.onload = function() {
} }
}; };
}; });
</script> </script>
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true"> <div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">

View File

@ -28,19 +28,18 @@
{% if p and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %} {% if p and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
comments = JSON.parse(localStorage.getItem("comment-counts")) || {} comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
lastCount = comments['{{p.id}}'] lastCount = comments['{{p.id}}']
if (lastCount && {{c.created_utc*1000}} > lastCount.t) { if (lastCount && {{c.created_utc*1000}} > lastCount.t) {
document.getElementById("reddot-{{c.id}}").innerHTML = '<i style="color:red !important" class="text-admin fas fa-circle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Unread"></i>' document.getElementById("reddot-{{c.id}}").innerHTML = '<i style="color:red !important" class="text-admin fas fa-circle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Unread"></i>'
} }
});
}; </script>
</script>
{% endif %} {% endif %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
(() => { (() => {
const date = new Date({{c.created_utc*1000}}); const date = new Date({{c.created_utc*1000}});
document.getElementById('timestamp-{{c.id}}').title = date.toString(); document.getElementById('timestamp-{{c.id}}').title = date.toString();
@ -54,8 +53,7 @@ window.onload = function() {
{%endif%} {%endif%}
{%endif%} {%endif%}
})() })()
});
};
</script> </script>
<div style="display:none" id="popover-{{c.id}}"> <div style="display:none" id="popover-{{c.id}}">
@ -817,7 +815,7 @@ window.onload = function() {
{% include "expanded_image_modal.html" %} {% include "expanded_image_modal.html" %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
function poll_vote(cid, parentid) { function poll_vote(cid, parentid) {
{% if v %} {% if v %}
for(let el of document.getElementsByClassName('presult-'+parentid)) { for(let el of document.getElementsByClassName('presult-'+parentid)) {
@ -838,7 +836,7 @@ window.onload = function() {
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!"; document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
{% endif %} {% endif %}
} }
}; });
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')); const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
@ -852,6 +850,6 @@ window.onload = function() {
}) })
</script> </script>
<script defer src="/assets/js/popover.js?v=8"></script> <script defer src="/assets/js/popover.js?v=9"></script>
</body> </body>

View File

@ -292,7 +292,7 @@
{% if v and v.agendaposter %} {% if v and v.agendaposter %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var BugDispatch={options:{minDelay:500,maxDelay:1E4,minBugs:2,maxBugs:20,minSpeed:5,maxSpeed:10,maxLargeTurnDeg:150,maxSmallTurnDeg:10,maxWiggleDeg:5,imageSprite:"fly-sprite.webp",bugWidth:13,bugHeight:14,num_frames:5,zoom:10,canFly:!0,canDie:!0,numDeathTypes:3,monitorMouseMovement:!1,eventDistanceToBug:40,minTimeBetweenMultipy:1E3,mouseOver:"random"},initialize:function(a){this.options=mergeOptions(this.options,a);this.options.minBugs>this.options.maxBugs&&(this.options.minBugs=this.options.maxBugs); var BugDispatch={options:{minDelay:500,maxDelay:1E4,minBugs:2,maxBugs:20,minSpeed:5,maxSpeed:10,maxLargeTurnDeg:150,maxSmallTurnDeg:10,maxWiggleDeg:5,imageSprite:"fly-sprite.webp",bugWidth:13,bugHeight:14,num_frames:5,zoom:10,canFly:!0,canDie:!0,numDeathTypes:3,monitorMouseMovement:!1,eventDistanceToBug:40,minTimeBetweenMultipy:1E3,mouseOver:"random"},initialize:function(a){this.options=mergeOptions(this.options,a);this.options.minBugs>this.options.maxBugs&&(this.options.minBugs=this.options.maxBugs);
this.modes=["multiply","nothing"];this.options.canFly&&this.modes.push("fly","flyoff");this.options.canDie&&this.modes.push("die");-1==this.modes.indexOf(this.options.mouseOver)&&(this.options.mouseOver="random");this.transform=null;this.transforms={Moz:function(a){this.bug.style.MozTransform=a},webkit:function(a){this.bug.style.webkitTransform=a},O:function(a){this.bug.style.OTransform=a},ms:function(a){this.bug.style.msTransform=a},Khtml:function(a){this.bug.style.KhtmlTransform=a},w3c:function(a){this.bug.style.transform= this.modes=["multiply","nothing"];this.options.canFly&&this.modes.push("fly","flyoff");this.options.canDie&&this.modes.push("die");-1==this.modes.indexOf(this.options.mouseOver)&&(this.options.mouseOver="random");this.transform=null;this.transforms={Moz:function(a){this.bug.style.MozTransform=a},webkit:function(a){this.bug.style.webkitTransform=a},O:function(a){this.bug.style.OTransform=a},ms:function(a){this.bug.style.msTransform=a},Khtml:function(a){this.bug.style.KhtmlTransform=a},w3c:function(a){this.bug.style.transform=
a}};if("transform"in document.documentElement.style)this.transform=this.transforms.w3c;else{var b=["Moz","webkit","O","ms","Khtml"],c=0;for(c=0;c<b.length;c++)if(b[c]+"Transform"in document.documentElement.style){this.transform=this.transforms[b[c]];break}}if(this.transform){this.bugs=[];b="multiply"===this.options.mouseOver?this.options.minBugs:this.random(this.options.minBugs,this.options.maxBugs,!0);c=0;var d=this;for(c=0;c<b;c++){a=JSON.parse(JSON.stringify(this.options));var e=SpawnBug();a.wingsOpen= a}};if("transform"in document.documentElement.style)this.transform=this.transforms.w3c;else{var b=["Moz","webkit","O","ms","Khtml"],c=0;for(c=0;c<b.length;c++)if(b[c]+"Transform"in document.documentElement.style){this.transform=this.transforms[b[c]];break}}if(this.transform){this.bugs=[];b="multiply"===this.options.mouseOver?this.options.minBugs:this.random(this.options.minBugs,this.options.maxBugs,!0);c=0;var d=this;for(c=0;c<b;c++){a=JSON.parse(JSON.stringify(this.options));var e=SpawnBug();a.wingsOpen=
@ -340,8 +340,7 @@
maxBugs: 1, maxBugs: 1,
mouseOver: "fly" mouseOver: "fly"
}); });
});
};
</script> </script>
<noscript> <noscript>
<style> <style>

View File

@ -2,8 +2,7 @@
<script defer src="/assets/js/twitter.js" charset="utf-8"> <script defer src="/assets/js/twitter.js" charset="utf-8">
</script> </script>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
document.getElementById('twitter-widget-0').setAttribute('sandbox','') document.getElementById('twitter-widget-0').setAttribute('sandbox','')
};
};
</script> </script>

View File

@ -2,8 +2,7 @@
<script defer src="https://platform.twitter.com/widgets.js" charset="utf-8"> <script defer src="https://platform.twitter.com/widgets.js" charset="utf-8">
</script> </script>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
document.getElementById('twitter-widget-0').setAttribute('sandbox','') document.getElementById('twitter-widget-0').setAttribute('sandbox','')
});
};
</script> </script>

View File

@ -1,14 +1,13 @@
{% extends "default.html" %} {% extends "default.html" %}
{% block content %} {% block content %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
function removeFollower(event, username) { function removeFollower(event, username) {
post_toast('/remove_follow/' + username); post_toast('/remove_follow/' + username);
let table = document.getElementById("followers-table"); let table = document.getElementById("followers-table");
table.removeChild(event.target.parentElement.parentElement); table.removeChild(event.target.parentElement.parentElement);
} }
});
};
</script> </script>
<pre> <pre>

View File

@ -1,14 +1,13 @@
{% extends "default.html" %} {% extends "default.html" %}
{% block content %} {% block content %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
function removeFollower(event, username) { function removeFollower(event, username) {
post_toast('/unfollow/' + username); post_toast('/unfollow/' + username);
let table = document.getElementById("followers-table"); let table = document.getElementById("followers-table");
table.removeChild(event.target.parentElement.parentElement); table.removeChild(event.target.parentElement.parentElement);
} }
});
};
</script> </script>
<pre> <pre>

View File

@ -9,7 +9,7 @@
{% if not v.fp %} {% if not v.fp %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
function fp(fp) { function fp(fp) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("POST", '{{request.host_url}}fp/'+fp, true); xhr.open("POST", '{{request.host_url}}fp/'+fp, true);
@ -32,9 +32,8 @@
fpPromise fpPromise
.then(fp => fp.get()) .then(fp => fp.get())
.then(result => {if (result.visitorId != '{{v.fp}}') fp(result.visitorId);}) .then(result => {if (result.visitorId != '{{v.fp}}') fp(result.visitorId);})
});
}; </script>
</script>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -174,7 +173,7 @@
</div> </div>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
if (!("standalone" in window.navigator) && window.navigator.standalone) { if (!("standalone" in window.navigator) && window.navigator.standalone) {
if (window.innerWidth <= 737) { if (window.innerWidth <= 737) {
document.getElementById('mobile-prompt').show() document.getElementById('mobile-prompt').show()
@ -187,15 +186,14 @@
} }
} }
} }
});
}; </script>
</script>
{% endif %} {% endif %}
{% if v %} {% if v %}
<script defer src="https://js.pusher.com/beams/1.0/push-notifications-cdn.js"></script> <script defer src="https://js.pusher.com/beams/1.0/push-notifications-cdn.js"></script>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
const beamsClient = new PusherPushNotifications.Client({ const beamsClient = new PusherPushNotifications.Client({
instanceId: '02ddcc80-b8db-42be-9022-44c546b4dce6', instanceId: '02ddcc80-b8db-42be-9022-44c546b4dce6',
}); });
@ -204,9 +202,8 @@
.then(() => beamsClient.addDeviceInterest('{{v.strid}}')) .then(() => beamsClient.addDeviceInterest('{{v.strid}}'))
.then(() => beamsClient.getDeviceInterests()) .then(() => beamsClient.getDeviceInterests())
.catch(console.error); .catch(console.error);
});
}; </script>
</script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -68,7 +68,7 @@
</div> </div>
</div> </div>
<script defer src="/assets/js/mobile_navigation_bar.js?v=53"></script> <script defer src="/assets/js/mobile_navigation_bar.js?v=54"></script>
<style> <style>
.btn-dead:hover, .active.btn-dead:hover, .active.btn-dead { .btn-dead:hover, .active.btn-dead:hover, .active.btn-dead {

View File

@ -6,7 +6,7 @@
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
block_user=function() { block_user=function() {
var exileForm = document.getElementById("exile-form"); var exileForm = document.getElementById("exile-form");
@ -40,8 +40,7 @@ window.onload = function() {
xhr.send(f) xhr.send(f)
} }
} }
});
};
</script> </script>
<div class="row"> <div class="row">

View File

@ -38,7 +38,7 @@
</div> </div>
{% if v.agendaposter %} {% if v.agendaposter %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
const flip = (e) => { const flip = (e) => {
e.preventDefault(); e.preventDefault();
document.getElementsByTagName("body")[0].setAttribute("style", "-moz-transform: scale(-1, -1);-o-transform: scale(-1, -1);-webkit-transform: scale(-1, -1);transform: scale(-1, -1);"); document.getElementsByTagName("body")[0].setAttribute("style", "-moz-transform: scale(-1, -1);-o-transform: scale(-1, -1);-webkit-transform: scale(-1, -1);transform: scale(-1, -1);");
@ -46,7 +46,7 @@ window.onload = function() {
document.getElementById("submit-btn").onclick = flip; document.getElementById("submit-btn").onclick = flip;
}; });
</script> </script>
{% endif %} {% endif %}
</div> </div>

View File

@ -685,7 +685,7 @@
<script defer src="/assets/js/settings_profile.js?v=58"></script> <script defer src="/assets/js/settings_profile.js?v=58"></script>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
document.onpaste = function(event) { document.onpaste = function(event) {
var focused = document.activeElement; var focused = document.activeElement;
if (focused.id == 'bio-text') { if (focused.id == 'bio-text') {
@ -699,8 +699,7 @@ window.onload = function() {
} }
} }
} }
});
};
</script> </script>
{% include "emoji_modal.html" %} {% include "emoji_modal.html" %}

View File

@ -5,16 +5,15 @@
{% block content %} {% block content %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
document.getElementById('new_email').addEventListener('input', function () { document.getElementById('new_email').addEventListener('input', function () {
document.getElementById("email-password").classList.remove("d-none"); document.getElementById("email-password").classList.remove("d-none");
document.getElementById("email-password-label").classList.remove("d-none"); document.getElementById("email-password-label").classList.remove("d-none");
document.getElementById("emailpasswordRequired").classList.remove("d-none"); document.getElementById("emailpasswordRequired").classList.remove("d-none");
}); });
}; });
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'))
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'))
</script> </script>
<div class="row"> <div class="row">

View File

@ -829,7 +829,7 @@
</div> </div>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
(() => { (() => {
const date = new Date({{p.created_utc*1000}}); const date = new Date({{p.created_utc*1000}});
document.getElementById('timestamp').title = date.toString(); document.getElementById('timestamp').title = date.toString();
@ -858,8 +858,7 @@ window.onload = function() {
{%endif%} {%endif%}
{%endif%} {%endif%}
})() })()
});
};
</script> </script>
{% if v and v.id==p.author_id %} {% if v and v.id==p.author_id %}
@ -876,7 +875,7 @@ window.onload = function() {
{% if not p.comment_count %} {% if not p.comment_count %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
function poll_vote(cid) { function poll_vote(cid) {
{% if v %} {% if v %}
for(let el of document.getElementsByClassName('presult')) { for(let el of document.getElementsByClassName('presult')) {
@ -894,9 +893,8 @@ window.onload = function() {
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!"; document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
{% endif %} {% endif %}
} }
});
}; </script>
</script>
{% if v %} {% if v %}
<script defer src="/assets/js/comments_v.js?v=73"></script> <script defer src="/assets/js/comments_v.js?v=73"></script>
@ -915,7 +913,7 @@ window.onload = function() {
{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %} {% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %}
{% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") < 3 else 40 %} {% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") < 3 else 40 %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
new BugController({ new BugController({
imageSprite: "/assets/images/fly-sprite.webp", imageSprite: "/assets/images/fly-sprite.webp",
canDie: false, canDie: false,
@ -923,8 +921,7 @@ window.onload = function() {
maxBugs: {{maxbugs}}, maxBugs: {{maxbugs}},
mouseOver: "multiply" mouseOver: "multiply"
}); });
});
};
</script> </script>
{% endif %} {% endif %}
@ -934,7 +931,7 @@ window.onload = function() {
{% set minbugs = 10*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 20 %} {% set minbugs = 10*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 20 %}
{% set maxbugs = 20*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 40 %} {% set maxbugs = 20*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 40 %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
new BugController({ new BugController({
imageSprite: "/assets/images/fireflies.webp", imageSprite: "/assets/images/fireflies.webp",
canDie: false, canDie: false,
@ -942,8 +939,7 @@ window.onload = function() {
maxBugs: {{maxbugs}}, maxBugs: {{maxbugs}},
mouseOver: "multiply" mouseOver: "multiply"
}); });
});
};
</script> </script>
{% endif %} {% endif %}

View File

@ -54,7 +54,7 @@
</div> </div>
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
(() => { (() => {
const date = new Date({{p.created_utc*1000}}); const date = new Date({{p.created_utc*1000}});
document.getElementById('timestamp-{{p.id}}').title = date.toString(); document.getElementById('timestamp-{{p.id}}').title = date.toString();
@ -76,8 +76,7 @@ window.onload = function() {
{%endif%} {%endif%}
{%endif%} {%endif%}
})() })()
});
};
</script> </script>
{% set ups=p.upvotes %} {% set ups=p.upvotes %}
@ -688,4 +687,4 @@ window.onload = function() {
{% include "award_modal.html" %} {% include "award_modal.html" %}
{% endif %} {% endif %}
<script defer src="/assets/js/popover.js?v=8"></script> <script defer src="/assets/js/popover.js?v=9"></script>

View File

@ -71,7 +71,7 @@
{% if u.song %} {% if u.song %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var audio = new Audio('/songs/{{u.id}}'); var audio = new Audio('/songs/{{u.id}}');
audio.loop=true; audio.loop=true;
@ -93,16 +93,12 @@ window.onload = function() {
} }
{% endif %} {% endif %}
window.addEventListener( 'load', function() {
audio.play(); audio.play();
document.getElementById('userpage').addEventListener('click', () => { document.getElementById('userpage').addEventListener('click', () => {
if (audio.paused) audio.play(); if (audio.paused) audio.play();
}, {once : true}); }, {once : true});
};
}); </script>
};
</script>
{% endif %} {% endif %}
<div class="row d-none d-md-block"> <div class="row d-none d-md-block">

View File

@ -4,7 +4,7 @@
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var prevScrollpos = window.pageYOffset; var prevScrollpos = window.pageYOffset;
window.onscroll = function () { window.onscroll = function () {
var currentScrollPos = window.pageYOffset; var currentScrollPos = window.pageYOffset;
@ -24,8 +24,7 @@ window.onload = function() {
} }
prevScrollpos = currentScrollPos; prevScrollpos = currentScrollPos;
} }
});
};
</script> </script>
{% endblock %} {% endblock %}

View File

@ -4,7 +4,7 @@
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var prevScrollpos = window.pageYOffset; var prevScrollpos = window.pageYOffset;
window.onscroll = function () { window.onscroll = function () {
var currentScrollPos = window.pageYOffset; var currentScrollPos = window.pageYOffset;
@ -24,8 +24,7 @@ window.onload = function() {
} }
prevScrollpos = currentScrollPos; prevScrollpos = currentScrollPos;
} }
});
};
</script> </script>
{% endblock %} {% endblock %}

View File

@ -4,7 +4,7 @@
{% block fixedMobileBarJS %} {% block fixedMobileBarJS %}
<script> <script>
window.onload = function() { window.addEventListener("load",function(event) {
var prevScrollpos = window.pageYOffset; var prevScrollpos = window.pageYOffset;
window.onscroll = function () { window.onscroll = function () {
var currentScrollPos = window.pageYOffset; var currentScrollPos = window.pageYOffset;
@ -24,8 +24,7 @@ window.onload = function() {
} }
prevScrollpos = currentScrollPos; prevScrollpos = currentScrollPos;
} }
});
};
</script> </script>
{% endblock %} {% endblock %}