Move IRC updating to the updater's settings. Scroll only on new posts.
This commit is contained in:
parent
bc9093584b
commit
5aa208c279
@ -89,7 +89,6 @@
|
|||||||
},
|
},
|
||||||
Monitoring: {
|
Monitoring: {
|
||||||
'Thread Updater': [true, 'Update threads'],
|
'Thread Updater': [true, 'Update threads'],
|
||||||
'IRC Updating': [false, 'Scroll updated posts into view'],
|
|
||||||
'Unread Count': [true, 'Show unread post count in tab title'],
|
'Unread Count': [true, 'Show unread post count in tab title'],
|
||||||
'Post in Title': [true, 'Show the op\'s post in the tab title'],
|
'Post in Title': [true, 'Show the op\'s post in the tab title'],
|
||||||
'Thread Stats': [true, 'Display reply and image count'],
|
'Thread Stats': [true, 'Display reply and image count'],
|
||||||
@ -139,6 +138,7 @@
|
|||||||
updater: {
|
updater: {
|
||||||
checkbox: {
|
checkbox: {
|
||||||
'Verbose': [true, 'Show countdown timer, new post count'],
|
'Verbose': [true, 'Show countdown timer, new post count'],
|
||||||
|
'IRC Updating': [false, 'Scroll updated posts into view'],
|
||||||
'Auto Update': [true, 'Automatically fetch new posts']
|
'Auto Update': [true, 'Automatically fetch new posts']
|
||||||
},
|
},
|
||||||
'Interval': 30
|
'Interval': 30
|
||||||
@ -1622,7 +1622,7 @@
|
|||||||
return updater.interval = this.value = this.value.match(/\d+/)[0];
|
return updater.interval = this.value = this.value.match(/\d+/)[0];
|
||||||
},
|
},
|
||||||
update: function() {
|
update: function() {
|
||||||
var arr, body, br, id, input, replies, reply, _i, _len, _ref, _ref2;
|
var arr, body, br, id, input, length, replies, reply, _i, _len, _ref, _ref2;
|
||||||
if (this.status === 404) {
|
if (this.status === 404) {
|
||||||
updater.timer.textContent = '';
|
updater.timer.textContent = '';
|
||||||
updater.count.textContent = 404;
|
updater.count.textContent = 404;
|
||||||
@ -1649,10 +1649,11 @@
|
|||||||
while ((reply = replies.pop()) && (reply.id > id)) {
|
while ((reply = replies.pop()) && (reply.id > id)) {
|
||||||
arr.push(reply.parentNode.parentNode.parentNode);
|
arr.push(reply.parentNode.parentNode.parentNode);
|
||||||
}
|
}
|
||||||
|
length = arr.length;
|
||||||
updater.timer.textContent = '-' + updater.interval;
|
updater.timer.textContent = '-' + updater.interval;
|
||||||
if (updater.verbose) {
|
if (updater.verbose) {
|
||||||
updater.count.textContent = '+' + arr.length;
|
updater.count.textContent = '+' + length;
|
||||||
if (arr.length === 0) {
|
if (length === 0) {
|
||||||
updater.count.className = '';
|
updater.count.className = '';
|
||||||
} else {
|
} else {
|
||||||
updater.count.className = 'new';
|
updater.count.className = 'new';
|
||||||
@ -1661,7 +1662,7 @@
|
|||||||
while (reply = arr.pop()) {
|
while (reply = arr.pop()) {
|
||||||
$.before(br, reply);
|
$.before(br, reply);
|
||||||
}
|
}
|
||||||
if (updater.ircUpd) {
|
if (updater.ircUpd && length) {
|
||||||
return scrollTo(0, d.body.scrollHeight);
|
return scrollTo(0, d.body.scrollHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,6 @@ config =
|
|||||||
'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail']
|
'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail']
|
||||||
Monitoring:
|
Monitoring:
|
||||||
'Thread Updater': [true, 'Update threads']
|
'Thread Updater': [true, 'Update threads']
|
||||||
'IRC Updating': [false, 'Scroll updated posts into view']
|
|
||||||
'Unread Count': [true, 'Show unread post count in tab title']
|
'Unread Count': [true, 'Show unread post count in tab title']
|
||||||
'Post in Title': [true, 'Show the op\'s post in the tab title']
|
'Post in Title': [true, 'Show the op\'s post in the tab title']
|
||||||
'Thread Stats': [true, 'Display reply and image count']
|
'Thread Stats': [true, 'Display reply and image count']
|
||||||
@ -73,8 +72,9 @@ config =
|
|||||||
update: 'u'
|
update: 'u'
|
||||||
updater:
|
updater:
|
||||||
checkbox:
|
checkbox:
|
||||||
'Verbose': [true, 'Show countdown timer, new post count']
|
'Verbose': [true, 'Show countdown timer, new post count']
|
||||||
'Auto Update': [true, 'Automatically fetch new posts']
|
'IRC Updating': [false, 'Scroll updated posts into view']
|
||||||
|
'Auto Update': [true, 'Automatically fetch new posts']
|
||||||
'Interval': 30
|
'Interval': 30
|
||||||
|
|
||||||
# flatten the config
|
# flatten the config
|
||||||
@ -1346,11 +1346,12 @@ updater =
|
|||||||
replies = $$ 'td[id]', body
|
replies = $$ 'td[id]', body
|
||||||
while (reply = replies.pop()) and (reply.id > id)
|
while (reply = replies.pop()) and (reply.id > id)
|
||||||
arr.push reply.parentNode.parentNode.parentNode #table
|
arr.push reply.parentNode.parentNode.parentNode #table
|
||||||
|
length = arr.length
|
||||||
|
|
||||||
updater.timer.textContent = '-' + updater.interval
|
updater.timer.textContent = '-' + updater.interval
|
||||||
if updater.verbose
|
if updater.verbose
|
||||||
updater.count.textContent = '+' + arr.length
|
updater.count.textContent = '+' + length
|
||||||
if arr.length is 0
|
if length is 0
|
||||||
updater.count.className = ''
|
updater.count.className = ''
|
||||||
else
|
else
|
||||||
updater.count.className = 'new'
|
updater.count.className = 'new'
|
||||||
@ -1358,7 +1359,7 @@ updater =
|
|||||||
#XXX add replies in correct order so backlinks resolve
|
#XXX add replies in correct order so backlinks resolve
|
||||||
while reply = arr.pop()
|
while reply = arr.pop()
|
||||||
$.before br, reply
|
$.before br, reply
|
||||||
if updater.ircUpd
|
if updater.ircUpd && length
|
||||||
scrollTo 0, d.body.scrollHeight
|
scrollTo 0, d.body.scrollHeight
|
||||||
|
|
||||||
timeout: ->
|
timeout: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user