From 0d0b2fcd7e807f50b621c17e153194cf99edef5b Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 10 Apr 2015 23:11:59 +0200 Subject: [PATCH] thread-stats.js: vichan fixes --- js/thread-stats.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/thread-stats.js b/js/thread-stats.js index fb520c71..f3b2d375 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -12,9 +12,9 @@ $(document).ready(function(){ //check if page uses unique ID var IDsupport = ($('.poster_id').length > 0); var thread_id = (document.location.pathname + document.location.search).split('/'); - thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0]; + thread_id = thread_id[thread_id.length -1].split(/+-/)[0].split('.')[0]; - $('form[name="postcontrols"] > .delete') + $('.boardlist.bottom, footer') .first() .before('
'); var el = $('#thread_stats'); @@ -67,6 +67,7 @@ $(document).ready(function(){ }; $('#thread_stats_uids').text(size(ids)); } + var board_name = $('input[name="board"]').val(); $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json').success(function(data){ var found, page = '???'; for (var i=0;data[i];i++){ @@ -88,6 +89,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(){ + var board_name = $('input[name="board"]').val(); $.getJSON('//'+ document.location.host +'/'+ board_name +'/threads.json').success(function(data){ var found, page = '???'; for (var i=0;data[i];i++){