ukko: bugfixes
This commit is contained in:
parent
73b5cf5a08
commit
3922677968
@ -35,12 +35,12 @@ $(document).ready(function() {
|
|||||||
ukkohide.click(function() {
|
ukkohide.click(function() {
|
||||||
hiddenboards[board] = (hiddenboards[board] !== true);
|
hiddenboards[board] = (hiddenboards[board] !== true);
|
||||||
if (hiddenboards[board] !== true) {
|
if (hiddenboards[board] !== true) {
|
||||||
$('[data-board="'+board+'"][data-cached!="yes"]').show().prev().
|
$('[data-board="'+board+'"]:not([data-cached="yes"])').show().prev().
|
||||||
find('.ukkohide').html(_("(hide threads from this board)")).
|
find('.ukkohide').html(_("(hide threads from this board)")).
|
||||||
parent().find('hr').hide();
|
parent().find('hr').hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('[data-board="'+board+'"][data-cached!="yes"]').hide().prev().
|
$('[data-board="'+board+'"]:not([data-cached="yes"])').hide().prev().
|
||||||
find('.ukkohide').html(_("(show threads from this board)"))
|
find('.ukkohide').html(_("(show threads from this board)"))
|
||||||
.parent().find('hr').show();
|
.parent().find('hr').show();
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ $(document).ready(function() {
|
|||||||
while($(window).scrollTop() + $(window).height() + 500 > $(document).height() && !loading && overflow.length > 0) {
|
while($(window).scrollTop() + $(window).height() + 500 > $(document).height() && !loading && overflow.length > 0) {
|
||||||
var page = '../' + overflow[0].board + '/' + overflow[0].page;
|
var page = '../' + overflow[0].board + '/' + overflow[0].page;
|
||||||
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
|
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
|
||||||
if (thread.length > 0 && thread.data("cached") !== 'yes') { // already present
|
if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present
|
||||||
overflow.shift();
|
overflow.shift();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ $(document).ready(function() {
|
|||||||
var boardheader = $('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a> </h2>');
|
var boardheader = $('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a> </h2>');
|
||||||
|
|
||||||
if($.inArray(page, cache) != -1 && thread.length > 0) {
|
if($.inArray(page, cache) != -1 && thread.length > 0) {
|
||||||
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).data("cached", "no").css('display', 'block'));
|
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block'));
|
||||||
boardheader.insertBefore(thread);
|
boardheader.insertBefore(thread);
|
||||||
addukkohide.call(boardheader);
|
addukkohide.call(boardheader);
|
||||||
$(document).trigger('new_post', thread);
|
$(document).trigger('new_post', thread);
|
||||||
@ -79,12 +79,12 @@ $(document).ready(function() {
|
|||||||
cache.push(page);
|
cache.push(page);
|
||||||
|
|
||||||
$(data).find('div[id*="thread_"]').each(function() {
|
$(data).find('div[id*="thread_"]').each(function() {
|
||||||
$('form[name="postcontrols"]').prepend($(this).css('display', 'none').data("cached", "yes").attr('data-board', overflow[0].board));
|
$('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board));
|
||||||
});
|
});
|
||||||
|
|
||||||
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
|
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
|
||||||
if(thread.length > 0 && thread.data('cached') !== 'no') {
|
if(thread.length > 0 && thread.attr('data-cached') !== 'no') {
|
||||||
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).data("cached", "no").css('display', 'block'));
|
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block'));
|
||||||
boardheader.insertBefore(thread);
|
boardheader.insertBefore(thread);
|
||||||
addukkohide.call(boardheader);
|
addukkohide.call(boardheader);
|
||||||
$(document).trigger('new_post', thread);
|
$(document).trigger('new_post', thread);
|
||||||
|
Loading…
Reference in New Issue
Block a user