make thread hiding work again
This commit is contained in:
parent
f78585381e
commit
96daa0aa3a
21
4chan_x.js
21
4chan_x.js
@ -1432,13 +1432,13 @@
|
||||
cb: {
|
||||
hide: function(e) {
|
||||
var thread;
|
||||
thread = e.target.parentNode;
|
||||
thread = e.target.parentNode.parentNode;
|
||||
return threadHiding.hide(thread);
|
||||
},
|
||||
show: function(e) {
|
||||
var div, thread;
|
||||
div = e.target.parentNode;
|
||||
thread = div.nextSibling;
|
||||
thread = div.parentNode;
|
||||
threadHiding.show(thread);
|
||||
return $.remove(div);
|
||||
}
|
||||
@ -1446,14 +1446,13 @@
|
||||
hide: function(thread) {
|
||||
var hiddenThreads, id;
|
||||
threadHiding.hideHide(thread);
|
||||
id = $('input[value=delete]', thread).name;
|
||||
id = thread.firstChild.id;
|
||||
hiddenThreads = $.getValue("hiddenThread/" + g.BOARD + "/", {});
|
||||
hiddenThreads[id] = Date.now();
|
||||
return $.setValue("hiddenThread/" + g.BOARD + "/", hiddenThreads);
|
||||
},
|
||||
hideHide: function(thread) {
|
||||
var a, div, name, num, span, text, trip, _ref;
|
||||
$.hide(thread);
|
||||
if ($.config('Show Stubs')) {
|
||||
if (span = $('.omittedposts', thread)) {
|
||||
num = Number(span.textContent.match(/\d+/)[0]);
|
||||
@ -1468,18 +1467,23 @@
|
||||
textContent: "[ + ] " + name + trip + " (" + text + ")"
|
||||
});
|
||||
$.bind(a, 'click', threadHiding.cb.show);
|
||||
div = $.el('div');
|
||||
div = $.el('div', {
|
||||
className: 'block'
|
||||
});
|
||||
$.append(div, a);
|
||||
return $.before(thread, div);
|
||||
$.append(thread, div);
|
||||
return $.addClass(thread, 'stub');
|
||||
} else {
|
||||
$.hide(thread);
|
||||
return $.hide(thread.nextSibling);
|
||||
}
|
||||
},
|
||||
show: function(thread) {
|
||||
var hiddenThreads, id;
|
||||
$.removeClass(thread, 'stub');
|
||||
$.show(thread);
|
||||
$.show(thread.nextSibling);
|
||||
id = $('input[value=delete]', thread).name;
|
||||
id = thread.firstChild.id;
|
||||
hiddenThreads = $.getValue("hiddenThread/" + g.BOARD + "/", {});
|
||||
delete hiddenThreads[id];
|
||||
return $.setValue("hiddenThread/" + g.BOARD + "/", hiddenThreads);
|
||||
@ -1972,6 +1976,9 @@
|
||||
#navlinks > a {\
|
||||
font-size: 16px;\
|
||||
}\
|
||||
div.thread.stub > *:not(.block) {\
|
||||
display: none;\
|
||||
}\
|
||||
.hide {\
|
||||
display: none;\
|
||||
}\
|
||||
|
||||
@ -1094,11 +1094,11 @@ threadHiding =
|
||||
|
||||
cb:
|
||||
hide: (e) ->
|
||||
thread = e.target.parentNode
|
||||
thread = e.target.parentNode.parentNode
|
||||
threadHiding.hide thread
|
||||
show: (e) ->
|
||||
div = e.target.parentNode
|
||||
thread = div.nextSibling
|
||||
thread = div.parentNode
|
||||
threadHiding.show thread
|
||||
|
||||
$.remove div
|
||||
@ -1106,15 +1106,13 @@ threadHiding =
|
||||
hide: (thread) ->
|
||||
threadHiding.hideHide thread
|
||||
|
||||
id = $('input[value=delete]', thread).name
|
||||
id = thread.firstChild.id
|
||||
|
||||
hiddenThreads = $.getValue "hiddenThread/#{g.BOARD}/", {}
|
||||
hiddenThreads[id] = Date.now()
|
||||
$.setValue "hiddenThread/#{g.BOARD}/", hiddenThreads
|
||||
|
||||
hideHide: (thread) ->
|
||||
$.hide thread
|
||||
|
||||
if $.config 'Show Stubs'
|
||||
if span = $ '.omittedposts', thread
|
||||
num = Number span.textContent.match(/\d+/)[0]
|
||||
@ -1129,18 +1127,22 @@ threadHiding =
|
||||
textContent: "[ + ] #{name}#{trip} (#{text})"
|
||||
$.bind a, 'click', threadHiding.cb.show
|
||||
|
||||
div = $.el 'div'
|
||||
div = $.el 'div',
|
||||
className: 'block'
|
||||
|
||||
$.append div, a
|
||||
$.before thread, div
|
||||
$.append thread, div
|
||||
$.addClass thread, 'stub'
|
||||
else
|
||||
$.hide thread
|
||||
$.hide thread.nextSibling
|
||||
|
||||
show: (thread) ->
|
||||
$.removeClass thread, 'stub'
|
||||
$.show thread
|
||||
$.show thread.nextSibling
|
||||
|
||||
id = $('input[value=delete]', thread).name
|
||||
id = thread.firstChild.id
|
||||
|
||||
hiddenThreads = $.getValue "hiddenThread/#{g.BOARD}/", {}
|
||||
delete hiddenThreads[id]
|
||||
@ -1587,6 +1589,9 @@ $.addStyle '
|
||||
#navlinks > a {
|
||||
font-size: 16px;
|
||||
}
|
||||
div.thread.stub > *:not(.block) {
|
||||
display: none;
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user