replace "DOMContentLoaded" with "load"
parent
8bb55236e3
commit
264ed60cc4
|
@ -281,7 +281,7 @@ if (document.readyState === "complete" ||
|
|||
(document.readyState !== "loading" && !document.documentElement.doScroll)) {
|
||||
bsTriggerOnReady();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", bsTriggerOnReady);
|
||||
document.addEventListener("load", bsTriggerOnReady);
|
||||
}
|
||||
|
||||
function escapeHTML(unsafe) {
|
||||
|
|
|
@ -41,7 +41,7 @@ if (
|
|||
) {
|
||||
lotteryOnReady();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", lotteryOnReady);
|
||||
document.addEventListener("load", lotteryOnReady);
|
||||
}
|
||||
|
||||
function purchaseLotteryTicket() {
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
) {
|
||||
initializeBlackjack();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", initializeBlackjack);
|
||||
document.addEventListener("load", initializeBlackjack);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
) {
|
||||
initializeGame();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", initializeGame);
|
||||
document.addEventListener("load", initializeGame);
|
||||
}
|
||||
|
||||
function initializeGame() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
) {
|
||||
initializeGame();
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", initializeGame);
|
||||
document.addEventListener("load", initializeGame);
|
||||
}
|
||||
|
||||
// Kiss my ass if you're judgin'
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
{% if g.browser == 'apple' %}
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
const videos = document.querySelectorAll('video')
|
||||
|
||||
for (const video of videos) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{% if p.award_count("snow", v) %}
|
||||
<script defer src="{{'event/js/snow.js'|asset}}"></script>
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
document.addEventListener("load", () => {
|
||||
snow(80)
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% if request.path == '/' %}
|
||||
<script defer src="{{'event/js/snow.js'|asset}}"></script>
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
document.addEventListener("load", () => {
|
||||
snow(80)
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -170,7 +170,7 @@
|
|||
{% if request.path == '/' and v %}
|
||||
<script defer src="/assets/js/register_service_worker.js"></script>
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.addEventListener('load', function () {
|
||||
registerServiceWorker(
|
||||
"/assets/js/service_worker.js",
|
||||
"{{VAPID_PUBLIC_KEY}}",
|
||||
|
@ -196,7 +196,7 @@
|
|||
<script nonce="{{g.nonce}}">
|
||||
if (!window.matchMedia('(display-mode: minimal-ui)')['matches']) {
|
||||
if (window.innerWidth <= 737) {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt'))
|
||||
tt.show()
|
||||
document.getElementsByClassName('tooltip')[0].onclick = function(e) {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</div>
|
||||
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
for (const x of ['css','profilecss']) {
|
||||
const ta = document.getElementById(`${x}-textarea`);
|
||||
autoExpand(ta);
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
|
||||
{% if v.flairchanged %}
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
const date = formatDate(new Date({{v.flairchanged}}*1000));
|
||||
const text = ` - Your flair has been locked until ${date}`;
|
||||
document.getElementById('flair-body').value += text;
|
||||
|
@ -327,7 +327,7 @@
|
|||
{%- endif %}
|
||||
{% if FEATURES['USERS_PERMANENT_WORD_FILTERS'] -%}
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener("DOMContentLoaded", function (event) {
|
||||
document.addEventListener("load", function (event) {
|
||||
const sr_toggle = document.getElementById("slurreplacer");
|
||||
const sr_link = document.getElementById('slurreplacer-perma-link');
|
||||
const pr_toggle = document.getElementById("profanityreplacer");
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
|
||||
{% if not v or v.highlightcomments %}
|
||||
<script nonce="{{g.nonce}}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
|
||||
{% if "?context" not in request.full_path %}
|
||||
localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts"))
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
|
||||
<script nonce="{{g.nonce}}">
|
||||
{% if not v or v.highlightcomments %}
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('load', function() {
|
||||
showNewCommentCounts({{p.id}}, {{p.comment_count}})
|
||||
})
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue