From 421031650855af2c2c2c4cdb6cbb4f03910b9c9d Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Sat, 9 Jan 2016 01:32:22 +0000 Subject: [PATCH] Fix thread information widget --- js/thread-stats.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/js/thread-stats.js b/js/thread-stats.js index 8873dbdb..5785c9f3 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -12,18 +12,17 @@ $(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].split('.')[0]; + thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0]; - $('.boardlist.bottom, footer') - .first() - .before('
'); + $('#thread-links') + .after('
'); var el = $('#thread_stats'); - el.prepend(_('Page')+' ?'); + el.prepend('Page ?'); if (IDsupport){ el.prepend('0 UIDs | '); } - el.prepend('0 '+_('images')+' | '); - el.prepend('0 '+_('replies')+' | '); + el.prepend('0 images | '); + el.prepend('0 replies | '); delete el; function update_thread_stats(){ var op = $('#thread_'+ thread_id +' > div.post.op:not(.post-hover):not(.inline)').first(); @@ -67,7 +66,6 @@ $(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++){ @@ -89,7 +87,6 @@ $(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++){ @@ -113,4 +110,4 @@ $(document).ready(function(){ $('#update_thread').click(update_thread_stats); $(document).on('new_post',update_thread_stats); }); -} +} \ No newline at end of file