diff --git a/js/expand.js b/js/expand.js index a737ee7f..06151627 100644 --- a/js/expand.js +++ b/js/expand.js @@ -15,7 +15,7 @@ $(document).ready(function(){ if($('div.banner').length != 0) return; // not index - $('div.post.op span.omitted').each(function() { + var do_expand = function() { $(this) .html($(this).text().replace(_("Click reply to view."), ''+_("Click to expand")+'.')) .find('a').click(function() { @@ -52,5 +52,13 @@ $(document).ready(function(){ } }); }); + } + + $('div.post.op span.omitted').each(do_expand); + + $(document).bind("new_post", function(e, post) { + if (!$(post).hasClass("reply")) { + $(post).find('div.post.op span.omitted').each(do_expand); + } }); }); diff --git a/js/hide-threads.js b/js/hide-threads.js index abaa700f..44bd829b 100644 --- a/js/hide-threads.js +++ b/js/hide-threads.js @@ -35,7 +35,7 @@ $(document).ready(function(){ } } - $('div.post.op').each(function() { + var do_hide_threads = function() { var id = $(this).children('p.intro').children('a.post_no:eq(1)').text(); var thread_container = $(this).parent(); @@ -46,7 +46,7 @@ $(document).ready(function(){ } $('[–] ') - .insertBefore(thread_container.find(':first')) + .insertBefore(thread_container.find(':not(h2,h2 *):first')) .click(function() { hidden_data[board][id] = Math.round(Date.now() / 1000); store_data(); @@ -69,9 +69,15 @@ $(document).ready(function(){ hidden_div.remove(); }); - hidden_div.insertAfter(thread_container.find(':first')); + hidden_div.insertAfter(thread_container.find(':not(h2,h2 *):first')); }); if (hidden_data[board][id]) thread_container.find('.hide-thread-link').click(); + } + + $('div.post.op').each(do_hide_threads); + + $(document).bind('new_post', function(e, post) { + do_hide_threads.call($(post).find('div.post.op')[0]); }); }); diff --git a/js/show-backlinks.js b/js/show-backlinks.js index 4ead494b..f23cfc38 100644 --- a/js/show-backlinks.js +++ b/js/show-backlinks.js @@ -48,7 +48,12 @@ onready(function(){ $('div.post.reply').each(showBackLinks); $(document).bind('new_post', function(e, post) { - showBackLinks.call(post); + if ($(post).hasClass("reply")) { + showBackLinks.call(post); + } + else { + $(post).find('div.post.reply').each(showBackLinks); + } }); }); diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index dc8ed382..6566335e 100644 --- a/templates/themes/ukko/ukko.js +++ b/templates/themes/ukko/ukko.js @@ -10,6 +10,7 @@ $(document).ready(function() { if(thread.length > 0) { thread.prepend('

/' + overflow[0].board + '/

'); $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); + $(document).trigger('new_post', thread); overflow.shift(); } } else { @@ -25,6 +26,7 @@ $(document).ready(function() { if(thread.length > 0) { thread.prepend('

/' + overflow[0].board + '/

'); $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); + $(document).trigger('new_post', thread); overflow.shift(); } @@ -33,5 +35,4 @@ $(document).ready(function() { } } }); - });