diff --git a/src/General/Build.coffee b/src/General/Build.coffee
index 7be733988..a0605a48f 100755
--- a/src/General/Build.coffee
+++ b/src/General/Build.coffee
@@ -13,6 +13,12 @@ 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) ->
@@ -81,70 +87,19 @@ Build =
isOP = postID is threadID
{staticPath, gifIcon} = Build
- ### Name Block ###
-
- switch capcode
- when 'admin', 'admin_highlight'
- capcodeClass = ' capcodeAdmin'
- capcodeStart = <%= html(' ## Admin') %>
- capcodeIcon = <%= html(' ') %>
- when 'mod'
- capcodeClass = ' capcodeMod'
- capcodeStart = <%= html(' ## Mod') %>
- capcodeIcon = <%= html('
') %>
- when 'developer'
- capcodeClass = ' capcodeDeveloper'
- capcodeStart = <%= html(' ## Developer') %>
- capcodeIcon = <%= html('
') %>
- when 'manager'
- capcodeClass = ' capcodeManager'
- capcodeStart = <%= html(' ## Manager') %>
- capcodeIcon = <%= html('
') %>
- when 'admin_emeritus'
- capcodeClass = ' capcodeAdmin'
- capcodeStart = <%= html(' ## Admin Emeritus') %>
- capcodeIcon = <%= html('
') %>
- else
- capcodeClass = ''
- capcodeStart = <%= html('') %>
- capcodeIcon = if isOP and boardID is 'f' then <%= html('') %> else <%= html(' ') %>
-
- nameClass = if capcode then ' capcode' else ''
-
- tripcodeField = if tripcode
- <%= html(' ${tripcode}') %>
- else
- <%= html('') %>
-
- emailField = <%= html('${name}&{tripcodeField}&{capcodeStart}') %>
- if email
- emailProcessed = encodeURIComponent(email).replace /%40/g, '@'
- emailField = <%= html('&{emailField}') %>
-
- userID = if !capcode and uniqueID
- <%= html(' (ID: ${uniqueID})') %>
- else
- <%= html('') %>
-
- flag = unless flagCode
- <%= html('') %>
- else
- <%= html(' ') %>
-
- nameBlock = <%= html(
- '' +
- '&{emailField}&{capcodeIcon}&{userID}&{flag}' +
- ' '
- ) %>
-
### Post Info ###
- subjectField = if isOP or boardID is 'f'
- <%= html('${subject} ') %>
- else
- <%= html('') %>
-
- desktop2 = if isOP and boardID is 'f' then '' else ' desktop'
+ if capcode
+ capcodeLC = capcode.split('_')[0]
+ capcodeUC = capcodeLC[0].toUpperCase() + capcodeLC[1..]
+ capcodeText = capcodeUC
+ capcodeLong = {'Admin': 'Administrator', 'Mod': 'Moderator'}[capcodeUC] or capcodeUC
+ capcodePlural = "#{capcodeLong}s"
+ capcodeDescription = "a 4chan #{capcodeLong}"
+ if capcode is 'admin_emeritus'
+ capcodeText = 'Admin Emeritus'
+ capcodePlural = 'the Administrator Emeritus'
+ capcodeDescription = "4chan's founding Administrator"
postLink = Build.postURL boardID, threadID, postID
quoteLink = if Build.sameThread boardID, threadID
@@ -152,104 +107,86 @@ Build =
else
"/#{boardID}/thread/#{threadID}#q#{postID}"
- icons = for type in ['Sticky', 'Closed', 'Archived'] when o["is#{type}"] and !(type is 'Closed' and o.isArchived)
- typeLC = type.toLowerCase()
- <%= html('
') %>
-
- replyLink = if isOP and g.VIEW is 'index'
- <%= html(' [Reply]') %>
- else
- <%= html('') %>
-
postInfo = <%= html(
'
&{comment}') %> - - wholePost = if isOP - <%= html( - '
&{comment}' + + '