update HTML
This commit is contained in:
parent
65048751ad
commit
31ab0d8707
@ -22,6 +22,8 @@ Build =
|
|||||||
thumbRotate: do ->
|
thumbRotate: do ->
|
||||||
n = 0
|
n = 0
|
||||||
-> n = (n + 1) % 3
|
-> n = (n + 1) % 3
|
||||||
|
sameThread: (boardID, threadID) ->
|
||||||
|
g.VIEW is 'thread' and g.BOARD.ID is boardID and g.THREADID is +threadID
|
||||||
postFromObject: (data, boardID) ->
|
postFromObject: (data, boardID) ->
|
||||||
o =
|
o =
|
||||||
# id
|
# id
|
||||||
@ -85,8 +87,10 @@ Build =
|
|||||||
|
|
||||||
if isOP
|
if isOP
|
||||||
h_sideArrows = ''
|
h_sideArrows = ''
|
||||||
|
h_subject = "<span class='subject'>#{E subject}</span> "
|
||||||
else
|
else
|
||||||
h_sideArrows = "<div class='sideArrows' id='sa#{+postID}'>>></div>"
|
h_sideArrows = "<div class='sideArrows' id='sa#{+postID}'>>></div>"
|
||||||
|
h_subject = ''
|
||||||
|
|
||||||
h_postClass = "post #{if isOP then 'op' else 'reply'}#{if capcode is 'admin_highlight' then ' highlightPost' else ''}"
|
h_postClass = "post #{if isOP then 'op' else 'reply'}#{if capcode is 'admin_highlight' then ' highlightPost' else ''}"
|
||||||
|
|
||||||
@ -183,15 +187,18 @@ Build =
|
|||||||
else
|
else
|
||||||
h_file = ''
|
h_file = ''
|
||||||
|
|
||||||
if g.VIEW is 'thread' and g.THREADID is +threadID
|
if Build.sameThread boardID, threadID
|
||||||
h_quoteLink = "javascript:quote(#{+postID})"
|
postLink = "\#p#{postID}"
|
||||||
|
quoteLink = "javascript:quote('#{postID}');"
|
||||||
else
|
else
|
||||||
h_quoteLink = "/#{E boardID}/thread/#{+threadID}\#q#{+postID}"
|
postLink = "/#{boardID}/thread/#{threadID}\#p#{postID}"
|
||||||
|
quoteLink = "/#{boardID}/thread/#{threadID}\#q#{postID}"
|
||||||
|
|
||||||
if isSticky
|
if isSticky
|
||||||
h_sticky = " <img src='#{h_staticPath}sticky#{h_gifIcon}' alt='Sticky' title='Sticky' class='stickyIcon'>"
|
h_sticky = " <img src='#{h_staticPath}sticky#{h_gifIcon}' alt='Sticky' title='Sticky' class='stickyIcon'>"
|
||||||
else
|
else
|
||||||
h_sticky = ''
|
h_sticky = ''
|
||||||
|
|
||||||
if isClosed
|
if isClosed
|
||||||
h_closed = " <img src='#{h_staticPath}closed#{h_gifIcon}' alt='Closed' title='Closed' class='closedIcon'>"
|
h_closed = " <img src='#{h_staticPath}closed#{h_gifIcon}' alt='Closed' title='Closed' class='closedIcon'>"
|
||||||
else
|
else
|
||||||
@ -209,18 +216,17 @@ Build =
|
|||||||
h_replyLink = ''
|
h_replyLink = ''
|
||||||
|
|
||||||
container = $.el 'div',
|
container = $.el 'div',
|
||||||
id: "pc#{postID}"
|
|
||||||
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
|
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
|
||||||
innerHTML: <%= grunt.file.read('src/General/html/Build/post.html').replace(/>\s+/g, '>').replace(/\s+</g, '<').replace(/\s+/g, ' ').trim() %>
|
id: "pc#{postID}"
|
||||||
|
innerHTML: <%= grunt.file.read('src/General/html/Build/post.html').replace(/\r?\n\s*/g, '') %>
|
||||||
|
|
||||||
# Fix pathnames
|
# Fix pathnames
|
||||||
for quote in $$ '.quotelink', container
|
for quote in $$ '.quotelink', container
|
||||||
href = quote.getAttribute 'href'
|
href = quote.getAttribute 'href'
|
||||||
continue if href[0] is '/' # Cross-board quote, or board link
|
if (href[0] is '#') and !(Build.sameThread boardID, threadID)
|
||||||
if href[0] is '#'
|
quote.href = "/#{boardID}/thread/#{threadID}" + href
|
||||||
quote.href = "/#{boardID}/thread/#{threadID}#{href}"
|
else if (match = href.match /^\/([^\/]+)\/thread\/(\d+)/) and (Build.sameThread match[1], match[2])
|
||||||
else
|
quote.href = href.match(/(#[^#]*)?$/)[0] or '#'
|
||||||
quote.href = "/#{boardID}/thread/#{href}"
|
|
||||||
|
|
||||||
container
|
container
|
||||||
|
|
||||||
|
|||||||
@ -3,24 +3,24 @@
|
|||||||
|
|
||||||
#{if isOP then h_file else ''}
|
#{if isOP then h_file else ''}
|
||||||
|
|
||||||
<div class='postInfo' id='pi#{+postID}'>
|
<div class='postInfo desktop' id='pi#{+postID}'>
|
||||||
<input type='checkbox' name='#{+postID}' value='delete'>
|
<input type='checkbox' name='#{+postID}' value='delete'>#{' '}
|
||||||
#{' '}<span class='subject'>#{E subject}</span>#{' '}
|
#{h_subject}
|
||||||
<span class='nameBlock#{h_capcodeClass}'>
|
<span class='nameBlock#{h_capcodeClass}'>
|
||||||
#{h_emailStart}
|
#{h_emailStart}
|
||||||
<span class='name'>#{E name}</span>
|
<span class='name'>#{E name}</span>#{' '}
|
||||||
#{h_tripcode}#{h_capcodeStart}#{h_emailEnd}#{h_capcodeIcon}#{h_userID}#{h_flag}
|
#{h_tripcode}#{h_capcodeStart}#{h_emailEnd}#{h_capcodeIcon}#{h_userID}#{h_flag}
|
||||||
</span>#{' '}
|
</span>#{' '}
|
||||||
<span class='dateTime' data-utc='#{+dateUTC}'>#{E date}</span>#{' '}
|
<span class='dateTime' data-utc='#{+dateUTC}'>#{E date}</span>#{' '}
|
||||||
<span class='postNum'>
|
<span class='postNum desktop'>
|
||||||
<a href='/#{E boardID}/thread/#{+threadID}\#p#{+postID}' title='Link to this post'>No.</a>
|
<a href='#{E postLink}' title='Link to this post'>No.</a>
|
||||||
<a href='#{h_quoteLink}' title='Reply to this post'>#{+postID}</a>
|
<a href='#{E quoteLink}' title='Reply to this post'>#{+postID}</a>
|
||||||
#{h_pageIcon}#{h_sticky}#{h_closed}#{h_replyLink}
|
#{h_pageIcon}#{h_sticky}#{h_closed}#{h_replyLink}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#{if isOP then '' else h_file}
|
#{if isOP then '' else h_file}
|
||||||
|
|
||||||
<blockquote class='postMessage' id='m#{+postID}'>#{h_comment}</blockquote>#{' '}
|
<blockquote class='postMessage' id='m#{+postID}'>#{h_comment}</blockquote>
|
||||||
|
|
||||||
</div>"""
|
</div>"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user