Move post info into o.info.
This commit is contained in:
parent
72f048377b
commit
192f985f55
@ -32,25 +32,25 @@ Build =
|
|||||||
postID: data.no
|
postID: data.no
|
||||||
threadID: data.resto or data.no
|
threadID: data.resto or data.no
|
||||||
boardID: boardID
|
boardID: boardID
|
||||||
# info
|
|
||||||
name: Build.unescape(data.name) or ''
|
|
||||||
tripcode: data.trip
|
|
||||||
uniqueID: data.id
|
|
||||||
email: Build.unescape data.email
|
|
||||||
subject: Build.unescape data.sub
|
|
||||||
flagCode: data.country
|
|
||||||
flag: Build.unescape data.country_name
|
|
||||||
dateText: data.now
|
|
||||||
dateUTC: data.time
|
|
||||||
commentHTML: {innerHTML: data.com or ''}
|
|
||||||
# thread status
|
# thread status
|
||||||
isSticky: !!data.sticky
|
isSticky: !!data.sticky
|
||||||
isClosed: !!data.closed
|
isClosed: !!data.closed
|
||||||
isArchived: !!data.archived
|
isArchived: !!data.archived
|
||||||
# file status
|
# file status
|
||||||
fileDeleted: !!data.filedeleted
|
fileDeleted: !!data.filedeleted
|
||||||
|
o.info =
|
||||||
|
subject: Build.unescape data.sub
|
||||||
|
email: Build.unescape data.email
|
||||||
|
name: Build.unescape(data.name) or ''
|
||||||
|
tripcode: data.trip
|
||||||
|
uniqueID: data.id
|
||||||
|
flagCode: data.country
|
||||||
|
flag: Build.unescape data.country_name
|
||||||
|
dateUTC: data.time
|
||||||
|
dateText: data.now
|
||||||
|
commentHTML: {innerHTML: data.com or ''}
|
||||||
if data.capcode
|
if data.capcode
|
||||||
o.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, (c) -> c.toUpperCase())
|
o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, (c) -> c.toUpperCase())
|
||||||
o.capcodeHighlight = /_highlight$/.test data.capcode
|
o.capcodeHighlight = /_highlight$/.test data.capcode
|
||||||
if data.ext
|
if data.ext
|
||||||
o.file =
|
o.file =
|
||||||
@ -75,12 +75,8 @@ Build =
|
|||||||
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
|
This function contains code from 4chan-JS (https://github.com/4chan/4chan-JS).
|
||||||
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
|
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
|
||||||
###
|
###
|
||||||
{
|
{postID, threadID, boardID, file} = o
|
||||||
postID, threadID, boardID
|
{subject, email, name, tripcode, capcode, uniqueID, flagCode, flag, dateUTC, dateText, commentHTML} = o.info
|
||||||
name, capcode, capcodeHighlight, tripcode, uniqueID, email, subject, flagCode, flag, dateText, dateUTC
|
|
||||||
commentHTML
|
|
||||||
file, fileDeleted
|
|
||||||
} = o
|
|
||||||
isOP = postID is threadID
|
isOP = postID is threadID
|
||||||
{staticPath, gifIcon} = Build
|
{staticPath, gifIcon} = Build
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}{
|
}{
|
||||||
?{fileDeleted}{
|
?{o.fileDeleted}{
|
||||||
<div class="file" id="f${postID}">
|
<div class="file" id="f${postID}">
|
||||||
<span class="fileThumb">
|
<span class="fileThumb">
|
||||||
<img src="${staticPath}filedeleted-res${gifIcon}" alt="File deleted." class="fileDeletedRes retina">
|
<img src="${staticPath}filedeleted-res${gifIcon}" alt="File deleted." class="fileDeletedRes retina">
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
?{!isOP}{<div class="sideArrows" id="sa${postID}">>></div>}
|
?{!isOP}{<div class="sideArrows" id="sa${postID}">>></div>}
|
||||||
<div id="p${postID}" class="post ${postClass}?{capcodeHighlight}{ highlightPost}">
|
<div id="p${postID}" class="post ${postClass}?{o.capcodeHighlight}{ highlightPost}">
|
||||||
?{isOP}{&{fileBlock}&{postInfo}}{&{postInfo}&{fileBlock}}
|
?{isOP}{&{fileBlock}&{postInfo}}{&{postInfo}&{fileBlock}}
|
||||||
<blockquote class="postMessage" id="m${postID}">&{commentHTML}</blockquote>
|
<blockquote class="postMessage" id="m${postID}">&{commentHTML}</blockquote>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -126,26 +126,24 @@ class Fetcher
|
|||||||
|
|
||||||
@threadID = +data.thread_num
|
@threadID = +data.thread_num
|
||||||
o =
|
o =
|
||||||
# id
|
|
||||||
postID: @postID
|
postID: @postID
|
||||||
threadID: @threadID
|
threadID: @threadID
|
||||||
boardID: @boardID
|
boardID: @boardID
|
||||||
# info
|
o.info =
|
||||||
|
subject: data.title
|
||||||
|
email: data.email
|
||||||
name: data.name or ''
|
name: data.name or ''
|
||||||
|
tripcode: data.trip
|
||||||
capcode: switch data.capcode
|
capcode: switch data.capcode
|
||||||
when 'M' then 'Mod'
|
when 'M' then 'Mod'
|
||||||
when 'A' then 'Admin'
|
when 'A' then 'Admin'
|
||||||
when 'D' then 'Developer'
|
when 'D' then 'Developer'
|
||||||
tripcode: data.trip
|
|
||||||
uniqueID: data.poster_hash
|
uniqueID: data.poster_hash
|
||||||
email: data.email
|
|
||||||
subject: data.title
|
|
||||||
flagCode: data.poster_country
|
flagCode: data.poster_country
|
||||||
flag: data.poster_country_name
|
flag: data.poster_country_name
|
||||||
dateText: data.fourchan_date
|
|
||||||
dateUTC: data.timestamp
|
dateUTC: data.timestamp
|
||||||
|
dateText: data.fourchan_date
|
||||||
commentHTML: comment
|
commentHTML: comment
|
||||||
# file
|
|
||||||
if data.media?.media_filename
|
if data.media?.media_filename
|
||||||
o.file =
|
o.file =
|
||||||
name: data.media.media_filename
|
name: data.media.media_filename
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user