Slightly better consistency between "reload"/"refresh"/"update" usage.

This commit is contained in:
Mayhem 2013-10-31 05:21:31 +01:00
parent 22c561b796
commit 0038f1f011
4 changed files with 8 additions and 9 deletions

View File

@ -13,5 +13,5 @@
</label>
</div>
<div>
<input value="Update" type="button" name="Update">
<input value="Refresh thread" type="button" name="Update">
</div>

View File

@ -142,7 +142,7 @@ Settings =
return
div = $.el 'div',
innerHTML: "<button></button><span class=description>: Clear manually-hidden threads and posts on all boards. Refresh the page to apply."
innerHTML: "<button></button><span class=description>: Clear manually-hidden threads and posts on all boards. Reload the page to apply."
button = $ 'button', div
hiddenNum = 0
$.get 'hiddenThreads', boards: {}, (item) ->
@ -205,7 +205,7 @@ Settings =
try
data = JSON.parse e.target.result
Settings.loadSettings data
if confirm 'Import successful. Refresh now?'
if confirm 'Import successful. Reload now?'
window.location.reload()
catch err
output.textContent = 'Import failed due to an error.'

View File

@ -13,10 +13,9 @@ ThreadWatcher =
$.on d, '4chanXInitFinished', @ready
switch g.VIEW
when 'index'
$.on d, 'IndexRefresh', @cb.indexUpdate
$.on d, 'IndexRefresh', @refresh
$.on d, 'IndexRefresh', @cb.onIndexRefresh
when 'thread'
$.on d, 'ThreadUpdate', @cb.threadUpdate
$.on d, 'ThreadUpdate', @cb.onThreadRefresh
now = Date.now()
if (@db.data.lastChecked or 0) < now - 2 * $.HOUR
@ -74,7 +73,7 @@ ThreadWatcher =
$.set 'AutoWatch', threadID
else if Conf['Auto Watch Reply']
ThreadWatcher.add board.threads[threadID]
indexUpdate: ->
onIndexRefresh: ->
{db} = ThreadWatcher
for threadID, data of db.data.boards[g.BOARD.ID] when threadID not in g.BOARD.threads
if Conf['Auto Prune']
@ -84,7 +83,7 @@ ThreadWatcher =
db.data.lastChecked = Date.now()
db.save()
ThreadWatcher.refresh()
threadUpdate: (e) ->
onThreadRefresh: (e) ->
{thread} = e.detail
return unless e.detail[404] and ThreadWatcher.db.get {boardID: thread.board.ID, threadID: thread.ID}
# Update 404 status.

View File

@ -701,7 +701,7 @@ QR =
imgContainer = $.el 'div',
className: 'captcha-img'
title: 'Reload'
title: 'Reload reCAPTCHA'
innerHTML: '<img>'
input = $.el 'input',
className: 'captcha-input field'