Hide stub link
This commit is contained in:
parent
cc239c5a44
commit
7ea2e633ff
@ -2968,7 +2968,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub, replies, thisPost;
|
var apply, div, hideStubLink, makeStub, replies, thisPost;
|
||||||
|
|
||||||
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3029,7 +3029,12 @@
|
|||||||
replies = $.el('label', {
|
replies = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox name=replies> Show replies"
|
innerHTML: "<input type=checkbox name=replies> Show replies"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', PostHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3061,6 +3066,26 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(post) {
|
||||||
|
var data;
|
||||||
|
|
||||||
|
if (!post.isReply || post.isClone || !post.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(data = PostHiding.db.get({
|
||||||
|
boardID: post.board.ID,
|
||||||
|
threadID: post.thread.ID,
|
||||||
|
postID: post.ID
|
||||||
|
}))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return PostHiding.menu.post = post;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, parent, post, replies, thisPost;
|
var makeStub, parent, post, replies, thisPost;
|
||||||
@ -3104,6 +3129,13 @@
|
|||||||
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
||||||
}
|
}
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var post;
|
||||||
|
|
||||||
|
post = PostHiding.menu.post;
|
||||||
|
post.nodes.root.hidden = true;
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(post, type) {
|
makeButton: function(post, type) {
|
||||||
@ -3360,7 +3392,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub;
|
var apply, div, hideStubLink, makeStub;
|
||||||
|
|
||||||
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3377,7 +3409,12 @@
|
|||||||
makeStub = $.el('label', {
|
makeStub = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3399,6 +3436,20 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(_arg) {
|
||||||
|
var isReply, thread;
|
||||||
|
|
||||||
|
thread = _arg.thread, isReply = _arg.isReply;
|
||||||
|
if (isReply || !thread.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ThreadHiding.menu.thread = thread;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, thread;
|
var makeStub, thread;
|
||||||
@ -3408,6 +3459,13 @@
|
|||||||
ThreadHiding.hide(thread, makeStub);
|
ThreadHiding.hide(thread, makeStub);
|
||||||
ThreadHiding.saveHiddenState(thread, makeStub);
|
ThreadHiding.saveHiddenState(thread, makeStub);
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var thread;
|
||||||
|
|
||||||
|
thread = ThreadHiding.menu.thread;
|
||||||
|
ThreadHiding.hide(thread, false);
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(thread, type) {
|
makeButton: function(thread, type) {
|
||||||
@ -3461,9 +3519,6 @@
|
|||||||
if (makeStub == null) {
|
if (makeStub == null) {
|
||||||
makeStub = Conf['Stubs'];
|
makeStub = Conf['Stubs'];
|
||||||
}
|
}
|
||||||
if (thread.isHidden) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OP = thread.OP;
|
OP = thread.OP;
|
||||||
threadRoot = OP.nodes.root.parentNode;
|
threadRoot = OP.nodes.root.parentNode;
|
||||||
thread.isHidden = true;
|
thread.isHidden = true;
|
||||||
@ -6605,7 +6660,7 @@
|
|||||||
return $.event('AddMenuEntry', {
|
return $.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: a,
|
el: a,
|
||||||
order: 70,
|
order: 100,
|
||||||
open: function(_arg) {
|
open: function(_arg) {
|
||||||
var file;
|
var file;
|
||||||
|
|
||||||
|
|||||||
@ -2964,7 +2964,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub, replies, thisPost;
|
var apply, div, hideStubLink, makeStub, replies, thisPost;
|
||||||
|
|
||||||
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3025,7 +3025,12 @@
|
|||||||
replies = $.el('label', {
|
replies = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox name=replies> Show replies"
|
innerHTML: "<input type=checkbox name=replies> Show replies"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', PostHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3057,6 +3062,26 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(post) {
|
||||||
|
var data;
|
||||||
|
|
||||||
|
if (!post.isReply || post.isClone || !post.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(data = PostHiding.db.get({
|
||||||
|
boardID: post.board.ID,
|
||||||
|
threadID: post.thread.ID,
|
||||||
|
postID: post.ID
|
||||||
|
}))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return PostHiding.menu.post = post;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, parent, post, replies, thisPost;
|
var makeStub, parent, post, replies, thisPost;
|
||||||
@ -3100,6 +3125,13 @@
|
|||||||
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
||||||
}
|
}
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var post;
|
||||||
|
|
||||||
|
post = PostHiding.menu.post;
|
||||||
|
post.nodes.root.hidden = true;
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(post, type) {
|
makeButton: function(post, type) {
|
||||||
@ -3356,7 +3388,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub;
|
var apply, div, hideStubLink, makeStub;
|
||||||
|
|
||||||
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3373,7 +3405,12 @@
|
|||||||
makeStub = $.el('label', {
|
makeStub = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3395,6 +3432,20 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(_arg) {
|
||||||
|
var isReply, thread;
|
||||||
|
|
||||||
|
thread = _arg.thread, isReply = _arg.isReply;
|
||||||
|
if (isReply || !thread.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ThreadHiding.menu.thread = thread;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, thread;
|
var makeStub, thread;
|
||||||
@ -3404,6 +3455,13 @@
|
|||||||
ThreadHiding.hide(thread, makeStub);
|
ThreadHiding.hide(thread, makeStub);
|
||||||
ThreadHiding.saveHiddenState(thread, makeStub);
|
ThreadHiding.saveHiddenState(thread, makeStub);
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var thread;
|
||||||
|
|
||||||
|
thread = ThreadHiding.menu.thread;
|
||||||
|
ThreadHiding.hide(thread, false);
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(thread, type) {
|
makeButton: function(thread, type) {
|
||||||
@ -3457,9 +3515,6 @@
|
|||||||
if (makeStub == null) {
|
if (makeStub == null) {
|
||||||
makeStub = Conf['Stubs'];
|
makeStub = Conf['Stubs'];
|
||||||
}
|
}
|
||||||
if (thread.isHidden) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OP = thread.OP;
|
OP = thread.OP;
|
||||||
threadRoot = OP.nodes.root.parentNode;
|
threadRoot = OP.nodes.root.parentNode;
|
||||||
thread.isHidden = true;
|
thread.isHidden = true;
|
||||||
@ -6626,7 +6681,7 @@
|
|||||||
return $.event('AddMenuEntry', {
|
return $.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: a,
|
el: a,
|
||||||
order: 70,
|
order: 100,
|
||||||
open: function(_arg) {
|
open: function(_arg) {
|
||||||
var file;
|
var file;
|
||||||
|
|
||||||
|
|||||||
@ -2967,7 +2967,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub, replies, thisPost;
|
var apply, div, hideStubLink, makeStub, replies, thisPost;
|
||||||
|
|
||||||
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3028,7 +3028,12 @@
|
|||||||
replies = $.el('label', {
|
replies = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox name=replies> Show replies"
|
innerHTML: "<input type=checkbox name=replies> Show replies"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', PostHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3060,6 +3065,26 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(post) {
|
||||||
|
var data;
|
||||||
|
|
||||||
|
if (!post.isReply || post.isClone || !post.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(data = PostHiding.db.get({
|
||||||
|
boardID: post.board.ID,
|
||||||
|
threadID: post.thread.ID,
|
||||||
|
postID: post.ID
|
||||||
|
}))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return PostHiding.menu.post = post;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, parent, post, replies, thisPost;
|
var makeStub, parent, post, replies, thisPost;
|
||||||
@ -3103,6 +3128,13 @@
|
|||||||
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);
|
||||||
}
|
}
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var post;
|
||||||
|
|
||||||
|
post = PostHiding.menu.post;
|
||||||
|
post.nodes.root.hidden = true;
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(post, type) {
|
makeButton: function(post, type) {
|
||||||
@ -3359,7 +3391,7 @@
|
|||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
init: function() {
|
init: function() {
|
||||||
var apply, div, makeStub;
|
var apply, div, hideStubLink, makeStub;
|
||||||
|
|
||||||
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) {
|
||||||
return;
|
return;
|
||||||
@ -3376,7 +3408,12 @@
|
|||||||
makeStub = $.el('label', {
|
makeStub = $.el('label', {
|
||||||
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
innerHTML: "<input type=checkbox checked=" + Conf['Stubs'] + "> Make stub"
|
||||||
});
|
});
|
||||||
return $.event('AddMenuEntry', {
|
hideStubLink = $.el('a', {
|
||||||
|
textContent: 'Hide stub',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
$.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
|
||||||
|
$.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: div,
|
el: div,
|
||||||
order: 20,
|
order: 20,
|
||||||
@ -3398,6 +3435,20 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return $.event('AddMenuEntry', {
|
||||||
|
type: 'post',
|
||||||
|
el: hideStubLink,
|
||||||
|
order: 15,
|
||||||
|
open: function(_arg) {
|
||||||
|
var isReply, thread;
|
||||||
|
|
||||||
|
thread = _arg.thread, isReply = _arg.isReply;
|
||||||
|
if (isReply || !thread.isHidden) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ThreadHiding.menu.thread = thread;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
var makeStub, thread;
|
var makeStub, thread;
|
||||||
@ -3407,6 +3458,13 @@
|
|||||||
ThreadHiding.hide(thread, makeStub);
|
ThreadHiding.hide(thread, makeStub);
|
||||||
ThreadHiding.saveHiddenState(thread, makeStub);
|
ThreadHiding.saveHiddenState(thread, makeStub);
|
||||||
return $.event('CloseMenu');
|
return $.event('CloseMenu');
|
||||||
|
},
|
||||||
|
hideStub: function() {
|
||||||
|
var thread;
|
||||||
|
|
||||||
|
thread = ThreadHiding.menu.thread;
|
||||||
|
ThreadHiding.hide(thread, false);
|
||||||
|
$.event('CloseMenu');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
makeButton: function(thread, type) {
|
makeButton: function(thread, type) {
|
||||||
@ -3460,9 +3518,6 @@
|
|||||||
if (makeStub == null) {
|
if (makeStub == null) {
|
||||||
makeStub = Conf['Stubs'];
|
makeStub = Conf['Stubs'];
|
||||||
}
|
}
|
||||||
if (thread.isHidden) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OP = thread.OP;
|
OP = thread.OP;
|
||||||
threadRoot = OP.nodes.root.parentNode;
|
threadRoot = OP.nodes.root.parentNode;
|
||||||
thread.isHidden = true;
|
thread.isHidden = true;
|
||||||
@ -6605,7 +6660,7 @@
|
|||||||
return $.event('AddMenuEntry', {
|
return $.event('AddMenuEntry', {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
el: a,
|
el: a,
|
||||||
order: 70,
|
order: 100,
|
||||||
open: function(_arg) {
|
open: function(_arg) {
|
||||||
var file;
|
var file;
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,10 @@ PostHiding =
|
|||||||
innerHTML: '<input type=checkbox name=thisPost> This post'
|
innerHTML: '<input type=checkbox name=thisPost> This post'
|
||||||
replies = $.el 'label',
|
replies = $.el 'label',
|
||||||
innerHTML: "<input type=checkbox name=replies> Show replies"
|
innerHTML: "<input type=checkbox name=replies> Show replies"
|
||||||
|
hideStubLink = $.el 'a',
|
||||||
|
textContent: 'Hide stub'
|
||||||
|
href: 'javascript:;'
|
||||||
|
$.on hideStubLink, 'click', PostHiding.menu.hideStub
|
||||||
|
|
||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
@ -79,6 +83,18 @@ PostHiding =
|
|||||||
replies.firstChild.checked = if data?.hideRecursively? then data.hideRecursively else Conf['Recursive Hiding']
|
replies.firstChild.checked = if data?.hideRecursively? then data.hideRecursively else Conf['Recursive Hiding']
|
||||||
true
|
true
|
||||||
subEntries: [{el: apply}, {el: thisPost}, {el: replies}]
|
subEntries: [{el: apply}, {el: thisPost}, {el: replies}]
|
||||||
|
|
||||||
|
$.event 'AddMenuEntry',
|
||||||
|
type: 'post'
|
||||||
|
el: hideStubLink
|
||||||
|
order: 15
|
||||||
|
open: (post) ->
|
||||||
|
if !post.isReply or post.isClone or !post.isHidden
|
||||||
|
return false
|
||||||
|
unless data = PostHiding.db.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}
|
||||||
|
return false
|
||||||
|
PostHiding.menu.post = post
|
||||||
|
|
||||||
hide: ->
|
hide: ->
|
||||||
parent = @parentNode
|
parent = @parentNode
|
||||||
thisPost = $('input[name=thisPost]', parent).checked
|
thisPost = $('input[name=thisPost]', parent).checked
|
||||||
@ -109,6 +125,11 @@ PostHiding =
|
|||||||
if data = PostHiding.db.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}
|
if data = PostHiding.db.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}
|
||||||
PostHiding.saveHiddenState post, !(thisPost and replies), !thisPost, data.makeStub, !replies
|
PostHiding.saveHiddenState post, !(thisPost and replies), !thisPost, data.makeStub, !replies
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
|
hideStub: ->
|
||||||
|
{post} = PostHiding.menu
|
||||||
|
post.nodes.root.hidden = true
|
||||||
|
$.event 'CloseMenu'
|
||||||
|
return
|
||||||
|
|
||||||
makeButton: (post, type) ->
|
makeButton: (post, type) ->
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
|
|||||||
@ -71,6 +71,11 @@ ThreadHiding =
|
|||||||
makeStub = $.el 'label',
|
makeStub = $.el 'label',
|
||||||
innerHTML: "<input type=checkbox checked=#{Conf['Stubs']}> Make stub"
|
innerHTML: "<input type=checkbox checked=#{Conf['Stubs']}> Make stub"
|
||||||
|
|
||||||
|
hideStubLink = $.el 'a',
|
||||||
|
textContent: 'Hide stub'
|
||||||
|
href: 'javascript:;'
|
||||||
|
$.on hideStubLink, 'click', ThreadHiding.menu.hideStub
|
||||||
|
|
||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
@ -81,12 +86,27 @@ ThreadHiding =
|
|||||||
ThreadHiding.menu.thread = thread
|
ThreadHiding.menu.thread = thread
|
||||||
true
|
true
|
||||||
subEntries: [el: apply; el: makeStub]
|
subEntries: [el: apply; el: makeStub]
|
||||||
|
|
||||||
|
$.event 'AddMenuEntry',
|
||||||
|
type: 'post'
|
||||||
|
el: hideStubLink
|
||||||
|
order: 15
|
||||||
|
open: ({thread, isReply}) ->
|
||||||
|
if isReply or !thread.isHidden
|
||||||
|
return false
|
||||||
|
ThreadHiding.menu.thread = thread
|
||||||
|
|
||||||
hide: ->
|
hide: ->
|
||||||
makeStub = $('input', @parentNode).checked
|
makeStub = $('input', @parentNode).checked
|
||||||
{thread} = ThreadHiding.menu
|
{thread} = ThreadHiding.menu
|
||||||
ThreadHiding.hide thread, makeStub
|
ThreadHiding.hide thread, makeStub
|
||||||
ThreadHiding.saveHiddenState thread, makeStub
|
ThreadHiding.saveHiddenState thread, makeStub
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
|
hideStub: ->
|
||||||
|
{thread} = ThreadHiding.menu
|
||||||
|
ThreadHiding.hide thread, false
|
||||||
|
$.event 'CloseMenu'
|
||||||
|
return
|
||||||
|
|
||||||
makeButton: (thread, type) ->
|
makeButton: (thread, type) ->
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
@ -122,7 +142,6 @@ ThreadHiding =
|
|||||||
ThreadHiding.saveHiddenState thread
|
ThreadHiding.saveHiddenState thread
|
||||||
|
|
||||||
hide: (thread, makeStub=Conf['Stubs']) ->
|
hide: (thread, makeStub=Conf['Stubs']) ->
|
||||||
return if thread.isHidden
|
|
||||||
{OP} = thread
|
{OP} = thread
|
||||||
threadRoot = OP.nodes.root.parentNode
|
threadRoot = OP.nodes.root.parentNode
|
||||||
thread.isHidden = true
|
thread.isHidden = true
|
||||||
|
|||||||
@ -8,7 +8,7 @@ DownloadLink =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: a
|
el: a
|
||||||
order: 70
|
order: 100
|
||||||
open: ({file}) ->
|
open: ({file}) ->
|
||||||
return false unless file
|
return false unless file
|
||||||
a.href = file.URL
|
a.href = file.URL
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user