Fix #513 and other stub issues.
This commit is contained in:
parent
d2b28ea42f
commit
6fe9d5536f
@ -512,7 +512,7 @@
|
|||||||
Filter = {
|
Filter = {
|
||||||
filters: {},
|
filters: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
var boards, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
var boards, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4;
|
||||||
for (key in Config.filter) {
|
for (key in Config.filter) {
|
||||||
this.filters[key] = [];
|
this.filters[key] = [];
|
||||||
_ref = Conf[key].split('\n');
|
_ref = Conf[key].split('\n');
|
||||||
@ -540,11 +540,20 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no';
|
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no';
|
||||||
stub = (_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0;
|
stub = (function() {
|
||||||
stub = stub === 'yes' && !Conf['Show Stubs'] || stub === 'no' && Conf['Show Stubs'];
|
var _ref3;
|
||||||
|
switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) {
|
||||||
|
case 'yes':
|
||||||
|
return true;
|
||||||
|
case 'no':
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return Conf['Show Stubs'];
|
||||||
|
}
|
||||||
|
})();
|
||||||
if (hl = /highlight/.test(filter)) {
|
if (hl = /highlight/.test(filter)) {
|
||||||
hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1] : void 0) || 'filter_highlight';
|
hl = ((_ref3 = filter.match(/highlight:(\w+)/)) != null ? _ref3[1] : void 0) || 'filter_highlight';
|
||||||
top = ((_ref5 = filter.match(/top:(yes|no)/)) != null ? _ref5[1] : void 0) || 'yes';
|
top = ((_ref4 = filter.match(/top:(yes|no)/)) != null ? _ref4[1] : void 0) || 'yes';
|
||||||
top = top === 'yes';
|
top = top === 'yes';
|
||||||
}
|
}
|
||||||
this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
|
this.filters[key].push(this.createFilter(regexp, op, stub, hl, top));
|
||||||
@ -926,9 +935,12 @@
|
|||||||
}
|
}
|
||||||
return $.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
|
return $.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
|
||||||
},
|
},
|
||||||
hide: function(thread, invert_stub_conf) {
|
hide: function(thread, show_stub) {
|
||||||
var a, num, opInfo, span, text;
|
var a, num, opInfo, span, text;
|
||||||
if (Conf['Show Stubs'] === invert_stub_conf) {
|
if (show_stub == null) {
|
||||||
|
show_stub = Conf['Show Stubs'];
|
||||||
|
}
|
||||||
|
if (!show_stub) {
|
||||||
thread.hidden = true;
|
thread.hidden = true;
|
||||||
thread.nextElementSibling.hidden = true;
|
thread.nextElementSibling.hidden = true;
|
||||||
return;
|
return;
|
||||||
@ -1002,8 +1014,11 @@
|
|||||||
}
|
}
|
||||||
return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
|
return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
|
||||||
},
|
},
|
||||||
hide: function(root, invert_stub_conf) {
|
hide: function(root, show_stub) {
|
||||||
var a, el, side, stub;
|
var a, el, side, stub;
|
||||||
|
if (show_stub == null) {
|
||||||
|
show_stub = Conf['Show Stubs'];
|
||||||
|
}
|
||||||
side = $('.sideArrows', root);
|
side = $('.sideArrows', root);
|
||||||
if (side.hidden) {
|
if (side.hidden) {
|
||||||
return;
|
return;
|
||||||
@ -1011,7 +1026,7 @@
|
|||||||
side.hidden = true;
|
side.hidden = true;
|
||||||
el = side.nextElementSibling;
|
el = side.nextElementSibling;
|
||||||
el.hidden = true;
|
el.hidden = true;
|
||||||
if (Conf['Show Stubs'] === invert_stub_conf) {
|
if (!show_stub) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stub = $.el('div', {
|
stub = $.el('div', {
|
||||||
@ -4243,8 +4258,7 @@ a[href="javascript:;"] {\
|
|||||||
float: left;\
|
float: left;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
.hidden_thread ~ *,\
|
.thread > .hidden_thread ~ *,\
|
||||||
.hidden_thread + div.opContainer,\
|
|
||||||
[hidden],\
|
[hidden],\
|
||||||
#content > [name=tab]:not(:checked) + div,\
|
#content > [name=tab]:not(:checked) + div,\
|
||||||
#updater:not(:hover) > :not(.move),\
|
#updater:not(:hover) > :not(.move),\
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
master
|
master
|
||||||
|
- Mayhem
|
||||||
|
Fix some stub issues.
|
||||||
|
|
||||||
2.31.0
|
2.31.0
|
||||||
- Mayhem
|
- Mayhem
|
||||||
|
|||||||
@ -424,8 +424,13 @@ Filter =
|
|||||||
|
|
||||||
# Overrule the `Show Stubs` setting.
|
# Overrule the `Show Stubs` setting.
|
||||||
# Defaults to stub showing.
|
# Defaults to stub showing.
|
||||||
stub = filter.match(/stub:(yes|no)/)?[1]
|
stub = switch filter.match(/stub:(yes|no)/)?[1]
|
||||||
stub = stub is 'yes' and !Conf['Show Stubs'] or stub is 'no' and Conf['Show Stubs']
|
when 'yes'
|
||||||
|
true
|
||||||
|
when 'no'
|
||||||
|
false
|
||||||
|
else
|
||||||
|
Conf['Show Stubs']
|
||||||
|
|
||||||
# Highlight the post, or hide it.
|
# Highlight the post, or hide it.
|
||||||
# If not specified, the highlight class will be filter_highlight.
|
# If not specified, the highlight class will be filter_highlight.
|
||||||
@ -704,8 +709,8 @@ ThreadHiding =
|
|||||||
hiddenThreads[id] = Date.now()
|
hiddenThreads[id] = Date.now()
|
||||||
$.set "hiddenThreads/#{g.BOARD}/", hiddenThreads
|
$.set "hiddenThreads/#{g.BOARD}/", hiddenThreads
|
||||||
|
|
||||||
hide: (thread, invert_stub_conf) ->
|
hide: (thread, show_stub=Conf['Show Stubs']) ->
|
||||||
unless Conf['Show Stubs'] isnt invert_stub_conf
|
unless show_stub
|
||||||
thread.hidden = true
|
thread.hidden = true
|
||||||
thread.nextElementSibling.hidden = true
|
thread.nextElementSibling.hidden = true
|
||||||
return
|
return
|
||||||
@ -764,14 +769,14 @@ ReplyHiding =
|
|||||||
g.hiddenReplies[id] = Date.now()
|
g.hiddenReplies[id] = Date.now()
|
||||||
$.set "hiddenReplies/#{g.BOARD}/", g.hiddenReplies
|
$.set "hiddenReplies/#{g.BOARD}/", g.hiddenReplies
|
||||||
|
|
||||||
hide: (root, invert_stub_conf) ->
|
hide: (root, show_stub=Conf['Show Stubs']) ->
|
||||||
side = $ '.sideArrows', root
|
side = $ '.sideArrows', root
|
||||||
return if side.hidden # already hidden once by the filter
|
return if side.hidden # already hidden once by the filter
|
||||||
side.hidden = true
|
side.hidden = true
|
||||||
el = side.nextElementSibling
|
el = side.nextElementSibling
|
||||||
el.hidden = true
|
el.hidden = true
|
||||||
|
|
||||||
return unless Conf['Show Stubs'] isnt invert_stub_conf
|
return unless show_stub
|
||||||
|
|
||||||
stub = $.el 'div',
|
stub = $.el 'div',
|
||||||
className: 'hide_reply_button stub'
|
className: 'hide_reply_button stub'
|
||||||
@ -3228,8 +3233,7 @@ a[href="javascript:;"] {
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden_thread ~ *,
|
.thread > .hidden_thread ~ *,
|
||||||
.hidden_thread + div.opContainer,
|
|
||||||
[hidden],
|
[hidden],
|
||||||
#content > [name=tab]:not(:checked) + div,
|
#content > [name=tab]:not(:checked) + div,
|
||||||
#updater:not(:hover) > :not(.move),
|
#updater:not(:hover) > :not(.move),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user