Beep on reply to you. #631
This commit is contained in:
parent
9ec7d6e1d4
commit
8faefb9ec5
@ -985,6 +985,10 @@ Config =
|
|||||||
false
|
false
|
||||||
'Beep on new post to completely read thread.'
|
'Beep on new post to completely read thread.'
|
||||||
]
|
]
|
||||||
|
'Beep Quoting You': [
|
||||||
|
false
|
||||||
|
'Beep on new post quoting you.'
|
||||||
|
]
|
||||||
'Auto Scroll': [
|
'Auto Scroll': [
|
||||||
false
|
false
|
||||||
'Scroll updated posts into view. Only enabled at bottom of page.'
|
'Scroll updated posts into view. Only enabled at bottom of page.'
|
||||||
|
|||||||
@ -90,6 +90,14 @@ ThreadUpdater =
|
|||||||
###
|
###
|
||||||
beep: 'data:audio/wav;base64,<%= grunt.file.read("src/Monitoring/beep.wav", {encoding: "base64"}) %>'
|
beep: 'data:audio/wav;base64,<%= grunt.file.read("src/Monitoring/beep.wav", {encoding: "base64"}) %>'
|
||||||
|
|
||||||
|
playBeep: ->
|
||||||
|
ThreadUpdater.audio or= $.el 'audio', src: ThreadUpdater.beep
|
||||||
|
{audio} = ThreadUpdater
|
||||||
|
if audio.paused
|
||||||
|
audio.play()
|
||||||
|
else
|
||||||
|
$.one audio, 'ended', ThreadUpdater.playBeep
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
checkpost: (e) ->
|
checkpost: (e) ->
|
||||||
return if e.detail.threadID isnt ThreadUpdater.thread.ID
|
return if e.detail.threadID isnt ThreadUpdater.thread.ID
|
||||||
@ -314,14 +322,14 @@ ThreadUpdater =
|
|||||||
ThreadUpdater.set 'status', "+#{posts.length}", 'new'
|
ThreadUpdater.set 'status', "+#{posts.length}", 'new'
|
||||||
ThreadUpdater.outdateCount = 0
|
ThreadUpdater.outdateCount = 0
|
||||||
|
|
||||||
unreadCount = Unread.posts?.size
|
unreadCount = Unread.posts?.size
|
||||||
|
unreadQYCount = Unread.postsQuotingYou?.size
|
||||||
|
|
||||||
Main.callbackNodes Post, posts
|
Main.callbackNodes Post, posts
|
||||||
|
|
||||||
if Conf['Beep'] and d.hidden and unreadCount is 0 and Unread.posts?.size
|
if d.hidden
|
||||||
unless ThreadUpdater.audio
|
ThreadUpdater.playBeep() if Conf['Beep'] and Unread.posts?.size > 0 and unreadCount is 0
|
||||||
ThreadUpdater.audio = $.el 'audio', src: ThreadUpdater.beep
|
ThreadUpdater.playBeep() if Conf['Beep Quoting You'] and Unread.postsQuotingYou?.size > unreadQYCount
|
||||||
ThreadUpdater.audio.play()
|
|
||||||
|
|
||||||
scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and
|
scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and
|
||||||
ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25
|
ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user