Decrease the unread count when inlining unread posts. Close #57

This commit is contained in:
Nicolas Stepien 2011-12-27 23:22:59 +01:00
parent f221b09f63
commit ccc6e009de
3 changed files with 11 additions and 1 deletions

View File

@ -2469,10 +2469,15 @@
return this.classList.toggle('inlined'); return this.classList.toggle('inlined');
}, },
add: function(q, id) { add: function(q, id) {
var el, inline, pathname, root, threadID; var el, i, inline, pathname, root, threadID;
root = q.parentNode.nodeName === 'FONT' ? q.parentNode : q.nextSibling ? q.nextSibling : q; root = q.parentNode.nodeName === 'FONT' ? q.parentNode : q.nextSibling ? q.nextSibling : q;
if (el = $.id(id)) { if (el = $.id(id)) {
inline = quoteInline.table(id, el.innerHTML); inline = quoteInline.table(id, el.innerHTML);
if (g.REPLY && conf['Unread Count'] && (i = unread.replies.indexOf(el.parentNode.parentNode.parentNode)) !== -1) {
unread.replies.splice(i, 1);
unread.updateTitle();
Favicon.update();
}
if (/\bbacklink\b/.test(q.className)) { if (/\bbacklink\b/.test(q.className)) {
$.after(q.parentNode, inline); $.after(q.parentNode, inline);
if (conf['Forward Hiding']) { if (conf['Forward Hiding']) {

View File

@ -1,6 +1,7 @@
master master
- mayhem - mayhem
redirect 404'd pictures to archives when possible redirect 404'd pictures to archives when possible
the unread count will decrease when inlining quotes of unread posts
the report button can open multiple popups again the report button can open multiple popups again
add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) add omploader to the list of optional flavors (http://ompldr.org/upload?url1=)
update archive redirections update archive redirections

View File

@ -1959,6 +1959,10 @@ quoteInline =
root = if q.parentNode.nodeName is 'FONT' then q.parentNode else if q.nextSibling then q.nextSibling else q root = if q.parentNode.nodeName is 'FONT' then q.parentNode else if q.nextSibling then q.nextSibling else q
if el = $.id id if el = $.id id
inline = quoteInline.table id, el.innerHTML inline = quoteInline.table id, el.innerHTML
if g.REPLY and conf['Unread Count'] and (i = unread.replies.indexOf el.parentNode.parentNode.parentNode) isnt -1
unread.replies.splice i, 1
unread.updateTitle()
Favicon.update()
if /\bbacklink\b/.test q.className if /\bbacklink\b/.test q.className
$.after q.parentNode, inline $.after q.parentNode, inline
$.addClass $.x('ancestor::table', el), 'forwarded' if conf['Forward Hiding'] $.addClass $.x('ancestor::table', el), 'forwarded' if conf['Forward Hiding']