@ -14,6 +14,8 @@ define('forum/topic/posts', [
] , function ( pagination , infinitescroll , postTools , images , navigator , components , translator , hooks , helpers ) {
] , function ( pagination , infinitescroll , postTools , images , navigator , components , translator , hooks , helpers ) {
const Posts = { } ;
const Posts = { } ;
Posts . signaturesShown = { } ;
Posts . onNewPost = function ( data ) {
Posts . onNewPost = function ( data ) {
if (
if (
! data ||
! data ||
@ -282,6 +284,7 @@ define('forum/topic/posts', [
Posts . onTopicPageLoad = function ( posts ) {
Posts . onTopicPageLoad = function ( posts ) {
handlePrivateUploads ( posts ) ;
handlePrivateUploads ( posts ) ;
images . wrapImagesInLinks ( posts ) ;
images . wrapImagesInLinks ( posts ) ;
hideDuplicateSignatures ( posts ) ;
Posts . showBottomPostBar ( ) ;
Posts . showBottomPostBar ( ) ;
posts . find ( '[component="post/content"] img:not(.not-responsive)' ) . addClass ( 'img-responsive' ) ;
posts . find ( '[component="post/content"] img:not(.not-responsive)' ) . addClass ( 'img-responsive' ) ;
Posts . addBlockquoteEllipses ( posts ) ;
Posts . addBlockquoteEllipses ( posts ) ;
@ -353,6 +356,20 @@ define('forum/topic/posts', [
} ) ;
} ) ;
}
}
function hideDuplicateSignatures ( posts ) {
if ( ajaxify . data [ 'signatures:hideDuplicates' ] ) {
posts . each ( ( index , el ) => {
const signatureEl = $ ( el ) . find ( '[component="post/signature"]' ) ;
const uid = signatureEl . attr ( 'data-uid' ) ;
if ( Posts . signaturesShown [ uid ] ) {
signatureEl . addClass ( 'hidden' ) ;
} else {
Posts . signaturesShown [ uid ] = true ;
}
} ) ;
}
}
function removeNecroPostMessages ( removedPostEls ) {
function removeNecroPostMessages ( removedPostEls ) {
removedPostEls . each ( ( index , el ) => {
removedPostEls . each ( ( index , el ) => {
$ ( ` [data-necro-post-index=" ${ $ ( el ) . attr ( 'data-index' ) } "] ` ) . remove ( ) ;
$ ( ` [data-necro-post-index=" ${ $ ( el ) . attr ( 'data-index' ) } "] ` ) . remove ( ) ;