diff --git a/src/site/SW.yotsuba.Build/CatalogThreadHtml.tsx b/src/site/SW.yotsuba.Build/CatalogThreadHtml.tsx index 43f5be7..cd59623 100644 --- a/src/site/SW.yotsuba.Build/CatalogThreadHtml.tsx +++ b/src/site/SW.yotsuba.Build/CatalogThreadHtml.tsx @@ -1,25 +1,63 @@ -import h, { hFragment, EscapedHtml } from "../../globals/jsx"; +import h, { hFragment, EscapedHtml } from '../../globals/jsx' export default function generateCatalogThreadHtml( - thread, src, imgClass, data, postCount, fileCount, pageCount, staticPath, gifIcon, + thread, + src, + imgClass, + data, + postCount, + fileCount, + pageCount, + staticPath, + gifIcon, ): EscapedHtml { - return <> - - {imgClass ? - : - - } - -
- - {postCount}{' / '} - {fileCount}{' / '} - {pageCount} - - - {thread.isSticky ? : ''} - {thread.isClosed ? : ''} - -
- ; + return ( + <> + + {imgClass ? ( + + ) : ( + + )} + +
+ + + {postCount} + + {' / '} + + {fileCount} + + {' / '} + {pageCount} + + + {thread.isSticky ? ( + + ) : ( + '' + )} + {thread.isClosed ? ( + + ) : ( + '' + )} + +
+ + ) } diff --git a/src/site/SW.yotsuba.Build/FileHtml.tsx b/src/site/SW.yotsuba.Build/FileHtml.tsx index ce08287..c0d1497 100644 --- a/src/site/SW.yotsuba.Build/FileHtml.tsx +++ b/src/site/SW.yotsuba.Build/FileHtml.tsx @@ -1,49 +1,90 @@ -import h, { EscapedHtml, isEscaped } from "../../globals/jsx"; +import h, { EscapedHtml, isEscaped } from '../../globals/jsx' export default function generateFileHtml( - file, ID, boardID, fileURL, shortFilename, fileThumb, o, staticPath, gifIcon + file, + ID, + boardID, + fileURL, + shortFilename, + fileThumb, + o, + staticPath, + gifIcon, ): EscapedHtml { if (file) { - const fileContent: (EscapedHtml | string)[] = []; - if (boardID === "f") { + const fileContent: (EscapedHtml | string)[] = [] + if (boardID === 'f') { fileContent.push( -
- {'File: '} - {file.name} - -({file.size}, {file.dimensions}{file.tag ? ', ' + file.tag : ''}) -
- ); +
+ + {'File: '} + + {file.name} + + -({file.size}, {file.dimensions} + {file.tag ? ', ' + file.tag : ''}) + +
, + ) } else { fileContent.push( -
+
{'File: '} - + {file.isSpoiler ? 'Spoiler Image' : shortFilename} - {` (${file.size}, ${file.dimensions || "PDF"})`} + {` (${file.size}, ${file.dimensions || 'PDF'})`}
, {file.size} - - ); + , + ) } - return
{...fileContent}
; + return ( +
+ {...fileContent} +
+ ) } else if (o.fileDeleted) { - return
- - File deleted. - -
; + return ( +
+ + File deleted. + +
+ ) } - return { innerHTML: '', [isEscaped]: true }; + return { innerHTML: '', [isEscaped]: true } } diff --git a/src/site/SW.yotsuba.Build/PostInfoHtml.tsx b/src/site/SW.yotsuba.Build/PostInfoHtml.tsx index e226fb2..7eaf061 100644 --- a/src/site/SW.yotsuba.Build/PostInfoHtml.tsx +++ b/src/site/SW.yotsuba.Build/PostInfoHtml.tsx @@ -1,24 +1,62 @@ -import { g } from "../../globals/globals"; -import h, { EscapedHtml } from "../../globals/jsx"; +import { g } from '../../globals/globals' +import h, { EscapedHtml } from '../../globals/jsx' export default function generatePostInfoHtml( - ID, o, subject, capcode, email, name, tripcode, pass, capcodeLC, capcodePlural, staticPath, gifIcon, - capcodeDescription, uniqueID, flag, flagCode, flagCodeTroll, dateUTC, dateText, postLink, quoteLink, boardID, + ID, + o, + subject, + capcode, + email, + name, + tripcode, + pass, + capcodeLC, + capcodePlural, + staticPath, + gifIcon, + capcodeDescription, + uniqueID, + flag, + flagCode, + flagCodeTroll, + dateUTC, + dateText, + postLink, + quoteLink, + boardID, threadID, ): EscapedHtml { - const nameHtml: (EscapedHtml | string)[] = [{name}]; - if (tripcode) nameHtml.push(' ', {tripcode}); - if (pass) nameHtml.push(' ', ) + const nameHtml: (EscapedHtml | string)[] = [ + {name}, + ] + if (tripcode) nameHtml.push(' ', {tripcode}) + if (pass) + nameHtml.push( + ' ', + , + ) if (capcode) { nameHtml.push( ' ', - ## {capcode} + + ## {capcode} + , ) } - const nameBlockContent: (EscapedHtml | string)[] = - email ? [' ', {...nameHtml}] : nameHtml; - if (!(boardID === "f" && !o.isReply || capcodeDescription)) nameBlockContent.push(' '); + const nameBlockContent: (EscapedHtml | string)[] = email + ? [ + ' ', + + {...nameHtml} + , + ] + : nameHtml + if (!((boardID === 'f' && !o.isReply) || capcodeDescription)) + nameBlockContent.push(' ') if (capcodeDescription) { nameBlockContent.push( {`${capcode} - ); + />, + ) if (uniqueID && !capcode) { nameBlockContent.push( - (ID: ${uniqueID}) - + (ID:{' '} + + ${uniqueID} + + ) + , ) } } - if (flagCode) nameBlockContent.push(' ', ); - if (flagCodeTroll) nameBlockContent.push(' ', ); + if (flagCode) + nameBlockContent.push( + ' ', + , + ) + if (flagCodeTroll) + nameBlockContent.push( + ' ', + , + ) const postNumContent: (EscapedHtml | string)[] = [ - No., - {ID}, - ]; + + No. + , + + {ID} + , + ] if (o.isSticky) { - const src = `${staticPath}sticky${gifIcon}`; - postNumContent.push(' '); - if (boardID === "f") { - postNumContent.push(Sticky); + const src = `${staticPath}sticky${gifIcon}` + postNumContent.push(' ') + if (boardID === 'f') { + postNumContent.push( + Sticky, + ) } else { - postNumContent.push(Sticky) + postNumContent.push( + Sticky, + ) } } if (o.isClosed && !o.isArchived) { - postNumContent.push(' '); + postNumContent.push(' ') const src = `${staticPath}closed${gifIcon}` - if (boardID === "f") { - postNumContent.push(Closed) + if (boardID === 'f') { + postNumContent.push( + Closed, + ) } else { - postNumContent.push(Closed) + postNumContent.push( + Closed, + ) } } if (o.isArchived) { postNumContent.push( ' ', - Archived + Archived, ) } - if (!o.isReply && g.VIEW === "index") { + if (!o.isReply && g.VIEW === 'index') { // \u00A0 is nbsp postNumContent.push(' \u00A0 ') - postNumContent.push([Reply]) + postNumContent.push( + + [ + + Reply + + ] + , + ) } - return ; + return ( + + ) }