From 85b129d06b5971d4822d17e8cbb7aa1ebd367269 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 Jun 2014 01:09:20 -0700 Subject: [PATCH] more HTML fixes --- src/General/Build.coffee | 27 ++++++++++++++++----------- src/General/html/Build/post.html | 4 ++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 319aeef70..7445eea0d 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -11,9 +11,8 @@ Build = {'&': '&', ''': "'", '"': '"', '<': '<', '>': '>'}[c] shortFilename: (filename, isReply) -> # FILENAME SHORTENING SCIENCE: - # OPs have a +10 characters threshold. # The file extension is not taken into account. - threshold = if isReply then 30 else 40 + threshold = 30 ext = filename.match(/\.?[^\.]*$/)[0] if filename.length - ext.length > threshold "#{filename[...threshold - 5]}(...)#{ext}" @@ -100,7 +99,8 @@ Build = h_tripcode = '' if email - h_emailStart = "" + emailProcessed = encodeURIComponent(email).replace(/%40/g, '@') + h_emailStart = "" h_emailEnd = '' else h_emailStart = '' @@ -110,20 +110,25 @@ Build = when 'admin', 'admin_highlight' h_capcodeClass = ' capcodeAdmin' h_capcodeStart = ' ## Admin' - h_capcodeIcon = " " + h_capcodeIcon = "Admin Icon" when 'mod' h_capcodeClass = ' capcodeMod' h_capcodeStart = ' ## Mod' - h_capcodeIcon = " " + h_capcodeIcon = "Mod Icon" when 'developer' h_capcodeClass = ' capcodeDeveloper' h_capcodeStart = ' ## Developer' - h_capcodeIcon = " " + h_capcodeIcon = "Developer Icon" else h_capcodeClass = '' h_capcodeStart = '' h_capcodeIcon = '' + if capcode + h_nameClass = ' capcode' + else + h_nameClass = '' + if !capcode and uniqueID h_userID = " (ID: #{E uniqueID}) " else @@ -132,9 +137,9 @@ Build = unless flagCode h_flag = '' else if boardID is 'pol' - h_flag = " #{E flagCode}" + h_flag = "#{E flagCode}" else - h_flag = " " + h_flag = "" if file?.isDeleted if isOP @@ -158,7 +163,7 @@ Build = file.twidth = file.theight = 100 shortFilename = 'Spoiler Image' else - shortFilename = Build.shortFilename file.name + shortFilename = Build.shortFilename file.name, !isOP if boardID is 'f' h_imgSrc = '' @@ -195,12 +200,12 @@ Build = quoteLink = "/#{boardID}/thread/#{threadID}\#q#{postID}" if isSticky - h_sticky = " Sticky" + h_sticky = " Sticky" else h_sticky = '' if isClosed - h_closed = " Closed" + h_closed = " Closed" else h_closed = '' diff --git a/src/General/html/Build/post.html b/src/General/html/Build/post.html index 851e483e8..8d8ac2e9d 100755 --- a/src/General/html/Build/post.html +++ b/src/General/html/Build/post.html @@ -8,8 +8,8 @@ #{h_subject} #{h_emailStart} - #{E name}#{' '} - #{h_tripcode}#{h_capcodeStart}#{h_emailEnd}#{h_capcodeIcon}#{h_userID}#{h_flag} + #{E name} + #{h_tripcode}#{h_capcodeStart}#{h_emailEnd} #{h_capcodeIcon}#{h_userID}#{h_flag} #{' '} #{E date}#{' '}