From fd45298070dfaeea0c0556931eea92a37c1262b6 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Thu, 31 Dec 2020 01:04:11 -0600 Subject: [PATCH] Fixes jquery API breaking changes in auto-reload and thread-stats --- inc/instance-config.php | 1 + js/auto-reload.js | 2 +- js/thread-stats.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index 4489862c..2b5365d1 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -267,6 +267,7 @@ $config['stylesheets']['Tsuki'] = 'tsuki.css'; $config['additional_javascript'][] = 'js/local-time.js'; $config['additional_javascript'][] = 'js/auto-reload.js'; +$config['additional_javascript'][] = 'js/thread-stats.js'; $config['additional_javascript'][] = 'js/post-hover.js'; $config['additional_javascript'][] = 'js/style-select.js'; diff --git a/js/auto-reload.js b/js/auto-reload.js index b517feb0..44ec58da 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -47,7 +47,7 @@ $(document).ready(function(){ { return; // not index } - if($(".post.op").size() != 1) + if($(".post.op").length != 1) { return; //not thread page } diff --git a/js/thread-stats.js b/js/thread-stats.js index f9db6852..955a80d2 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -66,7 +66,7 @@ $(document).ready(function(){ }; $('#thread_stats_uids').text(size(ids)); } - $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json').success(function(data){ + $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json', function(data){ var found, page = '???'; for (var i=0;data[i];i++){ var threads = data[i].threads; @@ -87,7 +87,7 @@ $(document).ready(function(){ // load the current page the thread is on. // uses ajax call so it gets loaded on a delay (depending on network resources available) var thread_stats_page_timer = setInterval(function(){ - $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json').success(function(data){ + $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json', function(data){ var found, page = '???'; for (var i=0;data[i];i++){ var threads = data[i].threads;