From d61ebffdc76a14cb478eb84845ac151e42e4eade Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 24 Apr 2015 19:38:11 -0700 Subject: [PATCH] Whitespace. --- src/General/Build.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index ec38cc312..45612d081 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -2,10 +2,12 @@ Build = staticPath: '//s.4cdn.org/image/' gifIcon: if window.devicePixelRatio >= 2 then '@2x.gif' else '.gif' spoilerRange: {} + unescape: (text) -> return text unless text? text.replace(/<[^>]*>/g, '').replace /&(amp|#039|quot|lt|gt);/g, (c) -> {'&': '&', ''': "'", '"': '"', '<': '<', '>': '>'}[c] + shortFilename: (filename) -> threshold = 30 ext = filename.match(/\.?[^\.]*$/)[0] @@ -13,19 +15,23 @@ Build = "#{filename[...threshold - 5]}(...)#{ext}" else filename + spoilerThumb: (boardID) -> if spoilerRange = Build.spoilerRange[boardID] # Randomize the spoiler image. "#{Build.staticPath}spoiler-#{boardID}#{Math.floor 1 + spoilerRange * Math.random()}.png" else "#{Build.staticPath}spoiler.png" + sameThread: (boardID, threadID) -> g.VIEW is 'thread' and g.BOARD.ID is boardID and g.THREADID is +threadID + postURL: (boardID, threadID, postID) -> if Build.sameThread boardID, threadID "#p#{postID}" else "/#{boardID}/thread/#{threadID}#p#{postID}" + postFromObject: (data, boardID, suppressThumb) -> o = # id @@ -70,6 +76,7 @@ Build = tag: data.tag o.file.dimensions = "#{o.file.width}x#{o.file.height}" unless /\.pdf$/.test o.file.url Build.post o, suppressThumb + post: (o, suppressThumb) -> ### This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).