hide-threads.js: fix working with ukko

This commit is contained in:
czaks 2013-07-22 23:29:24 -04:00
parent d111c6ab8c
commit 6bc309697e

View File

@ -12,11 +12,9 @@
*/ */
$(document).ready(function(){ $(document).ready(function(){
if($('div.banner').length != 0) if (active_page != "index" && active_page != "ukko")
return; // not index return; // not index
var board = $('form input[name="board"]').val().toString();
if (!localStorage.hiddenthreads) if (!localStorage.hiddenthreads)
localStorage.hiddenthreads = '{}'; localStorage.hiddenthreads = '{}';
@ -37,13 +35,15 @@ $(document).ready(function(){
} }
} }
$('div.post.op').each(function() {
var id = $(this).children('p.intro').children('a.post_no:eq(1)').text();
var thread_container = $(this).parent();
var board = thread_container.data("board");
if (!hidden_data[board]) { if (!hidden_data[board]) {
hidden_data[board] = {}; // id : timestamp hidden_data[board] = {}; // id : timestamp
} }
$('div.post.op').each(function() {
var id = $(this).children('p.intro').children('a.post_no:eq(1)').text();
var thread_container = $(this).parent();
$('<a class="hide-thread-link" style="float:left;margin-right:5px" href="javascript:void(0)">[]</a><span> </span>') $('<a class="hide-thread-link" style="float:left;margin-right:5px" href="javascript:void(0)">[]</a><span> </span>')
.insertBefore(thread_container.find('p.fileinfo:first')) .insertBefore(thread_container.find('p.fileinfo:first'))
.click(function() { .click(function() {