Skip to content

Commit

Permalink
Code cleanup in preparation for conversion. #829
Browse files Browse the repository at this point in the history
  • Loading branch information
ccd0 committed Jul 28, 2019
1 parent c8f7dea commit e47359a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Filtering/Filter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Filter =

node: ->
return if @isClone
{hide, stub, hl, top, noti} = Filter.test @, (!@isFetchedQuote and (@isReply or g.VIEW is 'index'))
{hide, stub, hl, noti} = Filter.test @, (!@isFetchedQuote and (@isReply or g.VIEW is 'index'))
if hide
if @isReply
PostHiding.hide @, stub
Expand Down
2 changes: 1 addition & 1 deletion src/General/Settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Settings =
'%board'
else
c
for key, val of Config.hotkeys when key of data.Conf
for key of Config.hotkeys when key of data.Conf
data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, (s) -> "#{s[0].toUpperCase()}#{s[1..]}").replace /(^|.+\+)[A-Z]$/g, (s) ->
"Shift+#{s[0...-1]}#{s[-1..].toLowerCase()}"
if data.WatchedThreads
Expand Down
2 changes: 0 additions & 2 deletions src/General/UI.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ class Menu
setPosition: =>
mRect = @menu.getBoundingClientRect()
bRect = lastToggledButton.getBoundingClientRect()
bTop = window.scrollY + bRect.top
bLeft = window.scrollX + bRect.left
cHeight = doc.clientHeight
cWidth = doc.clientWidth
[top, bottom] = if bRect.top + bRect.height + mRect.height < cHeight
Expand Down
4 changes: 2 additions & 2 deletions src/Linkification/Embedding.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Embedding =
style.pointerEvents = 'none'

title: (data) ->
{key, uid, options, link, post} = data
{key, uid, link} = data
return if not (service = Embedding.types[key].title)
$.addClass link, key.toLowerCase()
if service.batchSize
Expand Down Expand Up @@ -179,7 +179,7 @@ Embedding =
title: (req, data) ->
return unless req.status

{key, uid, options, link, post} = data
{key, uid, link, post} = data
{status} = req
service = Embedding.types[key].title

Expand Down
1 change: 1 addition & 0 deletions src/Monitoring/ThreadUpdater.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ ThreadUpdater =
ThreadUpdater.error @
else
ThreadUpdater.error @
return

kill: ->
ThreadUpdater.thread.kill()
Expand Down
1 change: 0 additions & 1 deletion src/Posting/Captcha.fixes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Captcha.fixes =
@addTooltips16 @images

addLabels: ->
imageSelect = $ '.fbc-payload-imageselect'
labels = for checkbox, i in @images
checkbox.id = "checkbox-#{i}"
label = $.el 'label',
Expand Down
2 changes: 1 addition & 1 deletion src/classes/DataBoard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class DataBoard

clean: ->
siteID = g.SITE.ID
for boardID, val of @data[siteID].boards
for boardID of @data[siteID].boards
@deleteIfEmpty {siteID, boardID}
now = Date.now()
unless now - 2 * $.HOUR < (@data[siteID].lastChecked or 0) <= now
Expand Down
6 changes: 3 additions & 3 deletions src/platform/CrossOrigin.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ CrossOrigin.ajax = (url, options={}) ->
timeout
onload: (xhr) ->
try
response = switch responseType
switch responseType
when 'json'
if xhr.responseText then JSON.parse(xhr.responseText) else null
response = if xhr.responseText then JSON.parse(xhr.responseText) else null
else
xhr.responseText
response = xhr.responseText
$.extend req, {
response
status: xhr.status
Expand Down

0 comments on commit e47359a

Please sign in to comment.