Force stub menu to work

This commit is contained in:
Zixaphir 2013-08-09 19:21:26 -07:00
parent 97f7cca2b1
commit ee291bad0c
7 changed files with 244 additions and 173 deletions

View File

@ -1996,7 +1996,7 @@
} }
}, },
postFromNode: function(root) { postFromNode: function(root) {
return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', root)); return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")]|following::div[contains(@class,"postContainer")])', root));
}, },
contextFromNode: function(quotelink) { contextFromNode: function(quotelink) {
return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', quotelink)); return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', quotelink));
@ -3225,15 +3225,11 @@
var post; var post;
post = Get.postFromNode(this); post = Get.postFromNode(this);
if (post.isHidden) { PostHiding[(post.isHidden ? 'show' : 'hide')](post);
PostHiding.show(post);
} else {
PostHiding.hide(post);
}
return PostHiding.saveHiddenState(post, post.isHidden); return PostHiding.saveHiddenState(post, post.isHidden);
}, },
hide: function(post, makeStub, hideRecursively) { hide: function(post, makeStub, hideRecursively) {
var a, postInfo, quotelink, _i, _len, _ref; var a, button, postInfo, quotelink, _i, _len, _ref;
if (makeStub == null) { if (makeStub == null) {
makeStub = Conf['Stubs']; makeStub = Conf['Stubs'];
@ -3259,15 +3255,12 @@
return; return;
} }
a = PostHiding.makeButton(post, 'show'); a = PostHiding.makeButton(post, 'show');
postInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', post.nodes.info).textContent; postInfo = Conf['Anonymize'] ? 'Anonymous' : post.info.name;
$.add(a, $.tn(" " + postInfo)); $.add(a, $.tn(" " + postInfo));
post.nodes.stub = $.el('div', { post.nodes.stub = $.el('div', {
className: 'stub' className: 'stub'
}); });
$.add(post.nodes.stub, a); $.add(post.nodes.stub, !Conf['Menu'] ? a : [a, $.tn(' '), button = Menu.makeButton(post)]);
if (Conf['Menu']) {
$.add(post.nodes.stub, [$.tn(' '), Menu.makeButton(post)]);
}
return $.prepend(post.nodes.root, post.nodes.stub); return $.prepend(post.nodes.root, post.nodes.stub);
}, },
show: function(post, showRecursively) { show: function(post, showRecursively) {
@ -3462,11 +3455,6 @@
makeStub = $.el('label', { makeStub = $.el('label', {
innerHTML: "<input type=checkbox " + (Conf['Stubs'] ? 'checked' : '') + "> Make stub" innerHTML: "<input type=checkbox " + (Conf['Stubs'] ? 'checked' : '') + "> 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,
@ -3489,6 +3477,34 @@
} }
] ]
}); });
div = $.el('a', {
className: 'show-thread-link',
textContent: 'Show thread',
href: 'javascript:;'
});
$.on(show, 'click', ThreadHiding.menu.show);
$.event('AddMenuEntry', {
type: 'post'
});
({
el: div,
order: 20,
open: function(_arg) {
var isReply, thread;
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
}
ThreadHiding.menu.thread = thread;
return true;
}
});
hideStubLink = $.el('a', {
textContent: 'Hide stub',
href: 'javascript:;'
});
$.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
return $.event('AddMenuEntry', { return $.event('AddMenuEntry', {
type: 'post', type: 'post',
el: hideStubLink, el: hideStubLink,
@ -3513,6 +3529,14 @@
ThreadHiding.saveHiddenState(thread, makeStub); ThreadHiding.saveHiddenState(thread, makeStub);
return $.event('CloseMenu'); return $.event('CloseMenu');
}, },
show: function() {
var thread;
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
return $.event('CloseMenu');
},
hideStub: function() { hideStub: function() {
var thread; var thread;
@ -3567,7 +3591,7 @@
return ThreadHiding.saveHiddenState(thread); return ThreadHiding.saveHiddenState(thread);
}, },
hide: function(thread, makeStub) { hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot; var OP, a, button, numReplies, opInfo, span, threadRoot;
if (makeStub == null) { if (makeStub == null) {
makeStub = Conf['Stubs']; makeStub = Conf['Stubs'];
@ -3579,22 +3603,15 @@
threadRoot.hidden = threadRoot.nextElementSibling.hidden = true; threadRoot.hidden = threadRoot.nextElementSibling.hidden = true;
return; return;
} }
numReplies = 0; numReplies = ((span = $('.summary', threadRoot)) ? +span.textContent.match(/\d+/) : 0) + $$('.opContainer ~ .replyContainer', threadRoot).length;
if (span = $('.summary', threadRoot)) { numReplies = numReplies === 1 ? '1 reply' : "" + (numReplies || 'No') + " replies";
numReplies = +span.textContent.match(/\d+/); opInfo = Conf['Anonymize'] ? 'Anonymous' : OP.info.name;
}
numReplies += $$('.opContainer ~ .replyContainer', threadRoot).length;
numReplies = numReplies === 1 ? '1 reply' : "" + numReplies + " replies";
opInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', OP.nodes.info).textContent;
a = ThreadHiding.makeButton(thread, 'show'); a = ThreadHiding.makeButton(thread, 'show');
$.add(a, $.tn(" " + opInfo + " (" + numReplies + ")")); $.add(a, $.tn(" " + opInfo + " (" + numReplies + ")"));
thread.stub = $.el('div', { thread.stub = $.el('div', {
className: 'stub' className: 'stub'
}); });
$.add(thread.stub, a); $.add(thread.stub, !Conf['Menu'] ? a : [a, $.tn(' '), button = Menu.makeButton(OP)]);
if (Conf['Menu']) {
$.add(thread.stub, [$.tn(' '), Menu.makeButton(OP)]);
}
return $.prepend(threadRoot, thread.stub); return $.prepend(threadRoot, thread.stub);
}, },
show: function(thread) { show: function(thread) {
@ -4203,7 +4220,9 @@
seek: function(type) { seek: function(type) {
var post, posts, result, str; var post, posts, result, str;
return unlses(Conf['Mark Quotes of You'] && Conf['Quick Reply']); if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
$.rmClass($('.highlight'), 'highlight'); $.rmClass($('.highlight'), 'highlight');
if (!QuoteYou.lastRead) { if (!QuoteYou.lastRead) {
if (!(post = QuoteYou.lastRead = $('.quotesYou'))) { if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
@ -6993,7 +7012,15 @@
} }
}; };
Menu = { Menu = (function() {
var a;
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '<span class=drop-marker></span>',
href: 'javascript:;'
});
return {
init: function() { init: function() {
if (g.VIEW === 'catalog' || !Conf['Menu']) { if (g.VIEW === 'catalog' || !Conf['Menu']) {
return; return;
@ -7010,28 +7037,23 @@
if (this.isClone) { if (this.isClone) {
button = $('.menu-button', this.nodes.info); button = $('.menu-button', this.nodes.info);
} else { } else {
button = Menu.makeButton(this); button = a.cloneNode(true);
$.add(this.nodes.info, [$.tn('\u00A0'), button]); $.add(this.nodes.info, [$.tn('\u00A0'), button]);
} }
return $.on(button, 'click', Menu.toggle); return $.on(button, 'click', Menu.toggle);
}, },
makeButton: (function() { makeButton: function() {
var a; var el;
a = null; el = a.cloneNode(true);
return function() { $.on(el, 'click', Menu.toggle);
a || (a = $.el('a', { return el;
className: 'menu-button fourchanx-link', },
innerHTML: '<i></i>',
href: 'javascript:;'
}));
return a.cloneNode(true);
};
})(),
toggle: function(e) { toggle: function(e) {
return Menu.menu.toggle(e, this, Get.postFromNode(this)); return Menu.menu.toggle(e, this, Get.postFromNode(this));
} }
}; };
})();
ReportLink = { ReportLink = {
init: function() { init: function() {

View File

@ -2008,7 +2008,7 @@
} }
}, },
postFromNode: function(root) { postFromNode: function(root) {
return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', root)); return Get.postFromRoot($.x('(ancestor::div[contains(@class,"postContainer")]|following::div[contains(@class,"postContainer")])', root));
}, },
contextFromNode: function(quotelink) { contextFromNode: function(quotelink) {
return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', quotelink)); return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', quotelink));
@ -3230,15 +3230,11 @@
var post; var post;
post = Get.postFromNode(this); post = Get.postFromNode(this);
if (post.isHidden) { PostHiding[(post.isHidden ? 'show' : 'hide')](post);
PostHiding.show(post);
} else {
PostHiding.hide(post);
}
return PostHiding.saveHiddenState(post, post.isHidden); return PostHiding.saveHiddenState(post, post.isHidden);
}, },
hide: function(post, makeStub, hideRecursively) { hide: function(post, makeStub, hideRecursively) {
var a, postInfo, quotelink, _i, _len, _ref; var a, button, postInfo, quotelink, _i, _len, _ref;
if (makeStub == null) { if (makeStub == null) {
makeStub = Conf['Stubs']; makeStub = Conf['Stubs'];
@ -3264,15 +3260,12 @@
return; return;
} }
a = PostHiding.makeButton(post, 'show'); a = PostHiding.makeButton(post, 'show');
postInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', post.nodes.info).textContent; postInfo = Conf['Anonymize'] ? 'Anonymous' : post.info.name;
$.add(a, $.tn(" " + postInfo)); $.add(a, $.tn(" " + postInfo));
post.nodes.stub = $.el('div', { post.nodes.stub = $.el('div', {
className: 'stub' className: 'stub'
}); });
$.add(post.nodes.stub, a); $.add(post.nodes.stub, !Conf['Menu'] ? a : [a, $.tn(' '), button = Menu.makeButton(post)]);
if (Conf['Menu']) {
$.add(post.nodes.stub, [$.tn(' '), Menu.makeButton(post)]);
}
return $.prepend(post.nodes.root, post.nodes.stub); return $.prepend(post.nodes.root, post.nodes.stub);
}, },
show: function(post, showRecursively) { show: function(post, showRecursively) {
@ -3467,11 +3460,6 @@
makeStub = $.el('label', { makeStub = $.el('label', {
innerHTML: "<input type=checkbox " + (Conf['Stubs'] ? 'checked' : '') + "> Make stub" innerHTML: "<input type=checkbox " + (Conf['Stubs'] ? 'checked' : '') + "> 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,
@ -3494,6 +3482,34 @@
} }
] ]
}); });
div = $.el('a', {
className: 'show-thread-link',
textContent: 'Show thread',
href: 'javascript:;'
});
$.on(show, 'click', ThreadHiding.menu.show);
$.event('AddMenuEntry', {
type: 'post'
});
({
el: div,
order: 20,
open: function(_arg) {
var isReply, thread;
thread = _arg.thread, isReply = _arg.isReply;
if (isReply || !thread.isHidden) {
return false;
}
ThreadHiding.menu.thread = thread;
return true;
}
});
hideStubLink = $.el('a', {
textContent: 'Hide stub',
href: 'javascript:;'
});
$.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);
return $.event('AddMenuEntry', { return $.event('AddMenuEntry', {
type: 'post', type: 'post',
el: hideStubLink, el: hideStubLink,
@ -3518,6 +3534,14 @@
ThreadHiding.saveHiddenState(thread, makeStub); ThreadHiding.saveHiddenState(thread, makeStub);
return $.event('CloseMenu'); return $.event('CloseMenu');
}, },
show: function() {
var thread;
thread = ThreadHiding.menu.thread;
ThreadHiding.show(thread);
ThreadHiding.saveHiddenState(thread);
return $.event('CloseMenu');
},
hideStub: function() { hideStub: function() {
var thread; var thread;
@ -3572,7 +3596,7 @@
return ThreadHiding.saveHiddenState(thread); return ThreadHiding.saveHiddenState(thread);
}, },
hide: function(thread, makeStub) { hide: function(thread, makeStub) {
var OP, a, numReplies, opInfo, span, threadRoot; var OP, a, button, numReplies, opInfo, span, threadRoot;
if (makeStub == null) { if (makeStub == null) {
makeStub = Conf['Stubs']; makeStub = Conf['Stubs'];
@ -3584,22 +3608,15 @@
threadRoot.hidden = threadRoot.nextElementSibling.hidden = true; threadRoot.hidden = threadRoot.nextElementSibling.hidden = true;
return; return;
} }
numReplies = 0; numReplies = ((span = $('.summary', threadRoot)) ? +span.textContent.match(/\d+/) : 0) + $$('.opContainer ~ .replyContainer', threadRoot).length;
if (span = $('.summary', threadRoot)) { numReplies = numReplies === 1 ? '1 reply' : "" + (numReplies || 'No') + " replies";
numReplies = +span.textContent.match(/\d+/); opInfo = Conf['Anonymize'] ? 'Anonymous' : OP.info.name;
}
numReplies += $$('.opContainer ~ .replyContainer', threadRoot).length;
numReplies = numReplies === 1 ? '1 reply' : "" + numReplies + " replies";
opInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', OP.nodes.info).textContent;
a = ThreadHiding.makeButton(thread, 'show'); a = ThreadHiding.makeButton(thread, 'show');
$.add(a, $.tn(" " + opInfo + " (" + numReplies + ")")); $.add(a, $.tn(" " + opInfo + " (" + numReplies + ")"));
thread.stub = $.el('div', { thread.stub = $.el('div', {
className: 'stub' className: 'stub'
}); });
$.add(thread.stub, a); $.add(thread.stub, !Conf['Menu'] ? a : [a, $.tn(' '), button = Menu.makeButton(OP)]);
if (Conf['Menu']) {
$.add(thread.stub, [$.tn(' '), Menu.makeButton(OP)]);
}
return $.prepend(threadRoot, thread.stub); return $.prepend(threadRoot, thread.stub);
}, },
show: function(thread) { show: function(thread) {
@ -4208,7 +4225,9 @@
seek: function(type) { seek: function(type) {
var post, posts, result, str; var post, posts, result, str;
return unlses(Conf['Mark Quotes of You'] && Conf['Quick Reply']); if (!(Conf['Mark Quotes of You'] && Conf['Quick Reply'])) {
return;
}
$.rmClass($('.highlight'), 'highlight'); $.rmClass($('.highlight'), 'highlight');
if (!QuoteYou.lastRead) { if (!QuoteYou.lastRead) {
if (!(post = QuoteYou.lastRead = $('.quotesYou'))) { if (!(post = QuoteYou.lastRead = $('.quotesYou'))) {
@ -6974,7 +6993,15 @@
} }
}; };
Menu = { Menu = (function() {
var a;
a = $.el('a', {
className: 'menu-button brackets-wrap',
innerHTML: '<span class=drop-marker></span>',
href: 'javascript:;'
});
return {
init: function() { init: function() {
if (g.VIEW === 'catalog' || !Conf['Menu']) { if (g.VIEW === 'catalog' || !Conf['Menu']) {
return; return;
@ -6991,28 +7018,23 @@
if (this.isClone) { if (this.isClone) {
button = $('.menu-button', this.nodes.info); button = $('.menu-button', this.nodes.info);
} else { } else {
button = Menu.makeButton(this); button = a.cloneNode(true);
$.add(this.nodes.info, [$.tn('\u00A0'), button]); $.add(this.nodes.info, [$.tn('\u00A0'), button]);
} }
return $.on(button, 'click', Menu.toggle); return $.on(button, 'click', Menu.toggle);
}, },
makeButton: (function() { makeButton: function() {
var a; var el;
a = null; el = a.cloneNode(true);
return function() { $.on(el, 'click', Menu.toggle);
a || (a = $.el('a', { return el;
className: 'menu-button fourchanx-link', },
innerHTML: '<i></i>',
href: 'javascript:;'
}));
return a.cloneNode(true);
};
})(),
toggle: function(e) { toggle: function(e) {
return Menu.menu.toggle(e, this, Get.postFromNode(this)); return Menu.menu.toggle(e, this, Get.postFromNode(this));
} }
}; };
})();
ReportLink = { ReportLink = {
init: function() { init: function() {

View File

@ -113,6 +113,7 @@ PostHiding =
return return
PostHiding.saveHiddenState post, true, thisPost, makeStub, replies PostHiding.saveHiddenState post, true, thisPost, makeStub, replies
$.event 'CloseMenu' $.event 'CloseMenu'
show: -> show: ->
parent = @parentNode parent = @parentNode
thisPost = $('input[name=thisPost]', parent).checked thisPost = $('input[name=thisPost]', parent).checked
@ -158,10 +159,7 @@ PostHiding =
toggle: -> toggle: ->
post = Get.postFromNode @ post = Get.postFromNode @
if post.isHidden PostHiding[(if post.isHidden then 'show' else 'hide')] post
PostHiding.show post
else
PostHiding.hide post
PostHiding.saveHiddenState post, post.isHidden PostHiding.saveHiddenState post, post.isHidden
hide: (post, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) -> hide: (post, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) ->
@ -184,13 +182,14 @@ PostHiding =
if Conf['Anonymize'] if Conf['Anonymize']
'Anonymous' 'Anonymous'
else else
$('.nameBlock', post.nodes.info).textContent post.info.name
$.add a, $.tn " #{postInfo}" $.add a, $.tn " #{postInfo}"
post.nodes.stub = $.el 'div', post.nodes.stub = $.el 'div',
className: 'stub' className: 'stub'
$.add post.nodes.stub, a $.add post.nodes.stub, unless Conf['Menu']
if Conf['Menu'] a
$.add post.nodes.stub, [$.tn(' '), Menu.makeButton post] else
[a, $.tn(' '), button = Menu.makeButton post]
$.prepend post.nodes.root, post.nodes.stub $.prepend post.nodes.root, post.nodes.stub
show: (post, showRecursively=Conf['Recursive Hiding']) -> show: (post, showRecursively=Conf['Recursive Hiding']) ->

View File

@ -71,11 +71,6 @@ ThreadHiding =
makeStub = $.el 'label', makeStub = $.el 'label',
innerHTML: "<input type=checkbox #{if Conf['Stubs'] then 'checked' else ''}> Make stub" innerHTML: "<input type=checkbox #{if Conf['Stubs'] then 'checked' else ''}> 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
@ -87,6 +82,27 @@ ThreadHiding =
true true
subEntries: [el: apply; el: makeStub] subEntries: [el: apply; el: makeStub]
div = $.el 'a',
className: 'show-thread-link'
textContent: 'Show thread'
href: 'javascript:;'
$.on show, 'click', ThreadHiding.menu.show
$.event 'AddMenuEntry',
type: 'post'
el: div
order: 20
open: ({thread, isReply}) ->
if isReply or !thread.isHidden
return false
ThreadHiding.menu.thread = thread
true
hideStubLink = $.el 'a',
textContent: 'Hide stub'
href: 'javascript:;'
$.on hideStubLink, 'click', ThreadHiding.menu.hideStub
$.event 'AddMenuEntry', $.event 'AddMenuEntry',
type: 'post' type: 'post'
el: hideStubLink el: hideStubLink
@ -102,6 +118,13 @@ ThreadHiding =
ThreadHiding.hide thread, makeStub ThreadHiding.hide thread, makeStub
ThreadHiding.saveHiddenState thread, makeStub ThreadHiding.saveHiddenState thread, makeStub
$.event 'CloseMenu' $.event 'CloseMenu'
show: ->
{thread} = ThreadHiding.menu
ThreadHiding.show thread
ThreadHiding.saveHiddenState thread
$.event 'CloseMenu'
hideStub: -> hideStub: ->
{thread} = ThreadHiding.menu {thread} = ThreadHiding.menu
ThreadHiding.hide thread, false ThreadHiding.hide thread, false
@ -150,24 +173,28 @@ ThreadHiding =
threadRoot.hidden = threadRoot.nextElementSibling.hidden = true # <hr> threadRoot.hidden = threadRoot.nextElementSibling.hidden = true # <hr>
return return
numReplies = 0 numReplies = (
if span = $ '.summary', threadRoot if span = $ '.summary', threadRoot
numReplies = +span.textContent.match /\d+/ +span.textContent.match /\d+/
numReplies += $$('.opContainer ~ .replyContainer', threadRoot).length else
numReplies = if numReplies is 1 then '1 reply' else "#{numReplies} replies" 0
) +
$$('.opContainer ~ .replyContainer', threadRoot).length
numReplies = if numReplies is 1 then '1 reply' else "#{numReplies or 'No'} replies"
opInfo = opInfo =
if Conf['Anonymize'] if Conf['Anonymize']
'Anonymous' 'Anonymous'
else else
$('.nameBlock', OP.nodes.info).textContent OP.info.name
a = ThreadHiding.makeButton thread, 'show' a = ThreadHiding.makeButton thread, 'show'
$.add a, $.tn " #{opInfo} (#{numReplies})" $.add a, $.tn " #{opInfo} (#{numReplies})"
thread.stub = $.el 'div', thread.stub = $.el 'div',
className: 'stub' className: 'stub'
$.add thread.stub, a $.add thread.stub, unless Conf['Menu']
if Conf['Menu'] a
$.add thread.stub, [$.tn(' '), Menu.makeButton OP] else
[a, $.tn(' '), button = Menu.makeButton OP]
$.prepend threadRoot, thread.stub $.prepend threadRoot, thread.stub
show: (thread) -> show: (thread) ->

View File

@ -18,7 +18,7 @@ Get =
post = g.posts["#{boardID}.#{postID}"] post = g.posts["#{boardID}.#{postID}"]
if index then post.clones[index] else post if index then post.clones[index] else post
postFromNode: (root) -> postFromNode: (root) ->
Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', root Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")]|following::div[contains(@class,"postContainer")])', root
contextFromNode: (quotelink) -> contextFromNode: (quotelink) ->
Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', quotelink Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', quotelink
postDataFromLink: (link) -> postDataFromLink: (link) ->

View File

@ -1,4 +1,9 @@
Menu = Menu = do ->
a = $.el 'a',
className: 'menu-button brackets-wrap'
innerHTML: '<span class=drop-marker></span>'
href: 'javascript:;'
init: -> init: ->
return if g.VIEW is 'catalog' or !Conf['Menu'] return if g.VIEW is 'catalog' or !Conf['Menu']
@ -11,18 +16,14 @@ Menu =
if @isClone if @isClone
button = $ '.menu-button', @nodes.info button = $ '.menu-button', @nodes.info
else else
button = Menu.makeButton @ button = a.cloneNode true
$.add @nodes.info, [$.tn('\u00A0'), button] $.add @nodes.info, [$.tn('\u00A0'), button]
$.on button, 'click', Menu.toggle $.on button, 'click', Menu.toggle
makeButton: do -> makeButton: ->
a = null el = a.cloneNode true
-> $.on el, 'click', Menu.toggle
a or= $.el 'a', el
className: 'menu-button fourchanx-link'
innerHTML: '<i></i>'
href: 'javascript:;'
a.cloneNode true
toggle: (e) -> toggle: (e) ->
Menu.menu.toggle e, @, Get.postFromNode @ Menu.menu.toggle e, @, Get.postFromNode @

View File

@ -33,7 +33,7 @@ QuoteYou =
cb: cb:
seek: (type) -> seek: (type) ->
return unlses Conf['Mark Quotes of You'] and Conf['Quick Reply'] return unless Conf['Mark Quotes of You'] and Conf['Quick Reply']
$.rmClass $('.highlight'), 'highlight' $.rmClass $('.highlight'), 'highlight'
unless QuoteYou.lastRead unless QuoteYou.lastRead