From 5058e1f3fd21a68cfd185adb2168c4e926ca0c29 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 2 Mar 2020 17:12:43 +0000 Subject: [PATCH] standard jquery --- ext/bbcode/script.js | 2 +- ext/blotter/script.js | 2 +- ext/bulk_actions/script.js | 4 +--- ext/handle_pixel/script.js | 2 +- ext/index/script.js | 2 +- ext/notes/script.js | 2 +- ext/pools/script.js | 2 +- ext/resize/script.js | 2 +- ext/rule34/script.js | 2 +- ext/setup/main.php | 2 +- ext/static_files/script.js | 2 +- ext/update/script.js | 2 +- ext/view/script.js | 2 +- 13 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ext/bbcode/script.js b/ext/bbcode/script.js index ff7b3c35..96c6ea7d 100644 --- a/ext/bbcode/script.js +++ b/ext/bbcode/script.js @@ -1,4 +1,4 @@ -$(document).ready(function() { +document.addEventListener('DOMContentLoaded', () => { $(".shm-clink").each(function(idx, elm) { var target_id = $(elm).data("clink-sel"); if(target_id && $(target_id).length > 0) { diff --git a/ext/blotter/script.js b/ext/blotter/script.js index dfffcf35..2623f3e4 100644 --- a/ext/blotter/script.js +++ b/ext/blotter/script.js @@ -1,6 +1,6 @@ /*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */ -$(document).ready(function() { +document.addEventListener('DOMContentLoaded', () => { $(".shm-blotter2-toggle").click(function() { $(".shm-blotter2").slideToggle("slow", function() { if($(".shm-blotter2").is(":hidden")) { diff --git a/ext/bulk_actions/script.js b/ext/bulk_actions/script.js index 288449d9..5e0b9423 100644 --- a/ext/bulk_actions/script.js +++ b/ext/bulk_actions/script.js @@ -189,9 +189,7 @@ function add_selector_button($block) { $block.click(c); // sometimes the thumbs *is* the A } - - -$(function () { +document.addEventListener('DOMContentLoaded', () => { // Clear the selection, in case it was autocompleted by the browser. $('#bulk_selected_ids').val(""); }); diff --git a/ext/handle_pixel/script.js b/ext/handle_pixel/script.js index e127e42f..6cb05f2c 100644 --- a/ext/handle_pixel/script.js +++ b/ext/handle_pixel/script.js @@ -1,4 +1,4 @@ -$(function() { +document.addEventListener('DOMContentLoaded', () => { function zoom(zoom_type, save_cookie) { save_cookie = save_cookie === undefined ? true : save_cookie; diff --git a/ext/index/script.js b/ext/index/script.js index 02113695..f9b05b33 100644 --- a/ext/index/script.js +++ b/ext/index/script.js @@ -1,6 +1,6 @@ /*jshint bitwise:false, curly:true, eqeqeq:true, evil:true, forin:false, noarg:true, noempty:true, nonew:true, undef:false, strict:false, browser:true, jquery:true */ -$(function() { +document.addEventListener('DOMContentLoaded', () => { var blocked_tags = (Cookies.get("ui-blocked-tags") || "").split(" "); var needs_refresh = false; for(var i=0; i { if(window.notes) { $('#main_image').load(function(){ $('#main_image').imgNotes({notes: window.notes}); diff --git a/ext/pools/script.js b/ext/pools/script.js index 6b45792c..16119d32 100644 --- a/ext/pools/script.js +++ b/ext/pools/script.js @@ -1,6 +1,6 @@ /*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */ -$(function() { +document.addEventListener('DOMContentLoaded', () => { $('#order_pool').change(function(){ var val = $("#order_pool option:selected").val(); Cookies.set("shm_ui-order-pool", val, {path: '/', expires: 365}); //FIXME: This won't play nice if COOKIE_PREFIX is not "shm_". diff --git a/ext/resize/script.js b/ext/resize/script.js index 21edb03d..66da2b31 100644 --- a/ext/resize/script.js +++ b/ext/resize/script.js @@ -1,4 +1,4 @@ -$(function() { +document.addEventListener('DOMContentLoaded', () => { var original_width = $("#original_width").val(); var original_height = $("#original_height").val(); diff --git a/ext/rule34/script.js b/ext/rule34/script.js index fe45729f..d50ab1e3 100644 --- a/ext/rule34/script.js +++ b/ext/rule34/script.js @@ -1,4 +1,4 @@ -$(function() { +document.addEventListener('DOMContentLoaded', () => { if(Cookies.get("ui-tnc-agreed") !== "true") { $("BODY").addClass("censored"); $("BODY").append("
"); diff --git a/ext/setup/main.php b/ext/setup/main.php index 6bcaaf85..d2255ab5 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -348,7 +348,7 @@ class Setup extends Extension checkbox.disabled = true; out_span.innerHTML = '(testing...)'; - $(document).ready(function() { + document.addEventListener('DOMContentLoaded', () => { var http_request = getHTTPObject(); http_request.open('GET', '$test_url', false); http_request.send(null); diff --git a/ext/static_files/script.js b/ext/static_files/script.js index 1b2051cd..068212cd 100644 --- a/ext/static_files/script.js +++ b/ext/static_files/script.js @@ -1,6 +1,6 @@ /*jshint bitwise:false, curly:true, eqeqeq:true, evil:true, forin:false, noarg:true, noempty:true, nonew:true, undef:false, strict:false, browser:true */ -$(document).ready(function() { +document.addEventListener('DOMContentLoaded', () => { /** Load jQuery extensions **/ //Code via: http://stackoverflow.com/a/13106698 $.fn.highlight = function (fadeOut) { diff --git a/ext/update/script.js b/ext/update/script.js index c2719786..424702d2 100644 --- a/ext/update/script.js +++ b/ext/update/script.js @@ -1,6 +1,6 @@ /*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */ -$(function() { +document.addEventListener('DOMContentLoaded', () => { if($('#updatecheck').length !== 0){ $.getJSON('https://api.github.com/repos/shish/shimmie2/commits', function(data){ var c = data[0]; diff --git a/ext/view/script.js b/ext/view/script.js index 1ccc8d57..3c966a11 100644 --- a/ext/view/script.js +++ b/ext/view/script.js @@ -1,4 +1,4 @@ -$(document).ready(function() { +document.addEventListener('DOMContentLoaded', () => { if(document.location.hash.length > 3) { var query = document.location.hash.substring(1);