temporary fix optional chaining before =
This commit is contained in:
parent
60ae31ead0
commit
8b0f4b5b7f
@ -588,7 +588,8 @@ Index =
|
||||
# Optional notification for manual refreshes
|
||||
Index.notice or= new Notice 'info', 'Refreshing index...'
|
||||
Index.nTimeout or= setTimeout ->
|
||||
Index.notice?.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)'
|
||||
# TODO check if notice exists
|
||||
Index.notice.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)'
|
||||
, 3 * $.SECOND
|
||||
else
|
||||
# Also display notice if Index Refresh is taking too long
|
||||
|
||||
@ -5,11 +5,13 @@ Volume =
|
||||
|
||||
$.sync 'Allow Sound', (x) ->
|
||||
Conf['Allow Sound'] = x
|
||||
Volume.inputs?.unmute.checked = x
|
||||
# TODO check if inputs exits
|
||||
Volume.inputs.unmute.checked = x
|
||||
|
||||
$.sync 'Default Volume', (x) ->
|
||||
Conf['Default Volume'] = x
|
||||
Volume.inputs?.volume.value = x
|
||||
# TODO check if inputs exits
|
||||
Volume.inputs.volume.value = x
|
||||
|
||||
if Conf['Mouse Wheel Volume']
|
||||
Callbacks.Post.push
|
||||
|
||||
@ -59,4 +59,5 @@ PSAHiding =
|
||||
$.add content, [psa.childNodes...]
|
||||
else
|
||||
$.add psa, [content.childNodes...]
|
||||
PSAHiding.hr?.hidden = psa.hidden
|
||||
# TODO check if hr exists
|
||||
PSAHiding.hr.hidden = psa.hidden
|
||||
|
||||
@ -77,7 +77,8 @@ ThreadStats =
|
||||
{thread, postCountEl, fileCountEl, ipCountEl} = ThreadStats
|
||||
postCountEl.textContent = ThreadStats.postCount
|
||||
fileCountEl.textContent = ThreadStats.fileCount
|
||||
ipCountEl?.textContent = thread.ipCount ? '?'
|
||||
# TOTO check if ipCountEl exists
|
||||
ipCountEl.textContent = thread.ipCount ? '?'
|
||||
postCountEl.classList.toggle 'warning', (thread.postLimit and !thread.isSticky)
|
||||
fileCountEl.classList.toggle 'warning', (thread.fileLimit and !thread.isSticky)
|
||||
|
||||
|
||||
@ -786,7 +786,8 @@ QR =
|
||||
post.unlock()
|
||||
|
||||
if (err = @response?.getElementById 'errmsg') # error!
|
||||
$('a', err)?.target = '_blank' # duplicate image link
|
||||
# TODO: check if exists
|
||||
$('a', err).target = '_blank' # duplicate image link
|
||||
else if (connErr = (!@response or @response.title isnt 'Post successful!'))
|
||||
err = QR.connectionError()
|
||||
Captcha.cache.save QR.currentCaptcha if QR.captcha is Captcha.v2 and QR.currentCaptcha
|
||||
|
||||
@ -223,7 +223,8 @@ Main =
|
||||
return if !Main.isThisPageLegit()
|
||||
|
||||
# disable the mobile layout
|
||||
$('link[href*=mobile]', d.head)?.disabled = true
|
||||
# TODO check if exists
|
||||
$('link[href*=mobile]', d.head).disabled = true
|
||||
doc.dataset.host = location.host
|
||||
$.addClass doc, "sw-#{g.SITE.software}"
|
||||
$.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user