add thread watcher refresh button
This commit is contained in:
parent
77a3d59ddf
commit
a24f62923b
@ -557,10 +557,16 @@ span.hide-announcement {
|
||||
padding-left: 3px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
min-width: 136px;
|
||||
min-width: 146px;
|
||||
max-height: 92%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
#thread-watcher .refresh {
|
||||
padding: 0px 3px;
|
||||
}
|
||||
#watcher-check-threads {
|
||||
display: none;
|
||||
}
|
||||
#thread-watcher .menu-button {
|
||||
bottom: 1px;
|
||||
}
|
||||
@ -598,7 +604,7 @@ span.hide-announcement {
|
||||
#thread-watcher a {
|
||||
text-decoration: none;
|
||||
}
|
||||
#thread-watcher .move>.close {
|
||||
#thread-watcher .move > .close {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
|
||||
@ -1,2 +1,7 @@
|
||||
<div class="move">Thread Watcher <span id="watcher-status"></span><a class="menu-button" href="javascript:;"><i class="fa fa-angle-down"></i></a><a class=close href=javascript:;>×</a></span></div>
|
||||
<div class="move">
|
||||
Thread Watcher <a class="refresh fa fa-refresh" title="Check threads" href="javascript:;"></a>
|
||||
<span id="watcher-status"></span>
|
||||
<a class="menu-button" href="javascript:;"><i class="fa fa-angle-down"></i></a>
|
||||
<a class="close" href="javascript:;">×</a>
|
||||
</div>
|
||||
<div id="watched-threads"></div>
|
||||
|
||||
@ -18,7 +18,8 @@ ThreadWatcher =
|
||||
|
||||
$.on d, 'QRPostSuccessful', @cb.post
|
||||
$.on sc, 'click', @toggleWatcher
|
||||
$.on $('.move>.close', ThreadWatcher.dialog), 'click', @toggleWatcher
|
||||
$.on $('.move > .refresh', ThreadWatcher.dialog), 'click', @fetchAllStatus
|
||||
$.on $('.move > .close', ThreadWatcher.dialog), 'click', @toggleWatcher
|
||||
|
||||
$.on d, '4chanXInitFinished', @ready
|
||||
switch g.VIEW
|
||||
@ -117,13 +118,13 @@ ThreadWatcher =
|
||||
fetching: 0
|
||||
fetchAllStatus: ->
|
||||
return unless (threads = ThreadWatcher.getAll()).length
|
||||
ThreadWatcher.status.textContent = '...'
|
||||
for thread in threads
|
||||
ThreadWatcher.fetchStatus thread
|
||||
return
|
||||
fetchStatus: ({boardID, threadID, data}) ->
|
||||
return if data.isDead
|
||||
{fetchCount} = ThreadWatcher
|
||||
ThreadWatcher.status.textContent = '...' if fetchCount.fetching is 0
|
||||
fetchCount.fetching++
|
||||
$.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",
|
||||
onloadend: ->
|
||||
@ -298,6 +299,7 @@ ThreadWatcher =
|
||||
cb: ThreadWatcher.cb.checkThreads
|
||||
entry:
|
||||
el: $.el 'a',
|
||||
id: 'watcher-check-threads'
|
||||
textContent: 'Check threads'
|
||||
refresh: -> (if $('div:not(.dead-thread)', ThreadWatcher.list) then $.rmClass else $.addClass) @el, 'disabled'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user