Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

+11 -7
View File
@@ -11,13 +11,15 @@ if(!this._tableOverlay){this._tableOverlay=$('<div/>').addClass('ipsLoading').hi
if(loading){var dims=ips.utils.position.getElemDims(rowElem);var position=ips.utils.position.getElemPosition(rowElem);this._tableOverlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+$(document).scrollTop()+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});rowElem.css({opacity:"0.5"});}else{rowElem.animate({opacity:"1"});this._tableOverlay.hide();}};this.changeSorting=function(e,data){data.originalEvent.preventDefault();if(_.isUndefined(data.selectedItemID)){return;}
var current=this._getSortValue();var menuItem=data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"]');var sortBy=data.selectedItemID;var sortDirection=current.order;if(menuItem.attr('data-sortDirection')){sortDirection=menuItem.attr('data-sortDirection');}
this.updateURL({sortby:sortBy,sortdirection:sortDirection,page:1});};this._getSortValue=function(){var by=ips.utils.url.getParam('sortby');var order=ips.utils.url.getParam('sortdirection');return{by:by||'',order:order||''};};this._getFilterValue=function(){var filter=ips.utils.url.getParam('filter');return filter||'';};});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.app',{initialize:function(){this.on('click','a[data-confirm],button[data-confirm]',this.confirmSomething);this.on(document,'contentChange',this._checkAndClearAutosave);this.on(document,'contentChange',this.checkOldEmbeds);this.on(document,'contentChange',this.updateExternalLinks);document.addEventListener("ips:colorScheme",this.colorScheme);window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change',this.updatePrefersColorScheme);this.setup();},setup:function(){if(ips.utils.serviceWorker.supported){ips.utils.serviceWorker.registerServiceWorker('front',!_.isUndefined(ips.utils.cookie.get('loggedIn')));}
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.app',{initialize:function(){this.on('click','a[data-confirm],button[data-confirm]',this.confirmSomething);this.on(document,'contentChange',this._checkAndClearAutosave);this.on(document,'contentChange',this.checkOldEmbeds);this.on(document,'contentChange',this.updateExternalLinks);document.addEventListener("ips:colorScheme",this.colorScheme);window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change',this.updatePrefersColorScheme);if(ips.utils.broadcastChannel.enabled){ips.utils.broadcastChannel.channel.addEventListener("message",this.broadcastChannelEvent);}
this.setup();},setup:function(){if(ips.utils.serviceWorker.supported){ips.utils.serviceWorker.registerServiceWorker('front',!_.isUndefined(ips.utils.cookie.get('loggedIn')));}
if(!ips.utils.events.isTouchDevice()){this.scope.addClass('ipsApp_noTouch');}
ips.utils.cookie.set('ipsTimezone',new Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC");this._checkAndClearAutosave();if(!ips.getSetting('memberID')&&ips.utils.url.getParam('_fromLogout')){ips.utils.db.removeByType('editorSave');}
if($('#elInlineMessage').length){var dialogRef=ips.ui.dialog.create({showFrom:'#inbox',content:'#elInlineMessage',title:$('#elInlineMessage').attr('title')});setTimeout(function(){dialogRef.show();},800);}
ips.utils.links.updateExternalLinks(this.scope);this._upgradeOldEmbeds(this.scope);if(!ips.getSetting('viewProfiles')){this._removeProfileLinks();}},updateExternalLinks:function(e,data){ips.utils.links.updateExternalLinks(data);},checkOldEmbeds:function(e,data){this._upgradeOldEmbeds(data);},_removeProfileLinks:function(){this.scope.find('a[data-mentionid],a[href*="controller=profile"]').replaceWith(function(){return $(this).contents();});},_upgradeOldEmbeds:function(element){if(_.isUndefined(element)){return;}
var oldEmbeds=element.find('[data-embedcontent]:not([data-controller], [data-embed-src])');var toRefresh=[];if(oldEmbeds.length){oldEmbeds.each(function(){$(this).attr('data-controller','core.front.core.autoSizeIframe');toRefresh.push(this);Debug.log("Upgraded old embed");});$(document).trigger('contentChange',[jQuery([]).pushStack(toRefresh)]);}},_checkAndClearAutosave:function(){if(ips.utils.cookie.get('clearAutosave')){var autoSaveKeysToClear=ips.utils.cookie.get('clearAutosave').split(',');for(var i=0;i<autoSaveKeysToClear.length;i++){ips.utils.db.remove('editorSave',autoSaveKeysToClear[i]);}
ips.utils.cookie.unset('clearAutosave');}},confirmSomething:function(e){e.preventDefault();var elem=$(e.currentTarget);var customMessage=$(e.currentTarget).attr('data-confirmMessage');var subMessage=$(e.currentTarget).attr('data-confirmSubMessage');var icon=$(e.currentTarget).attr('data-confirmIcon');ips.ui.alert.show({type:'confirm',icon:(icon)?icon:'warn',message:(customMessage)?customMessage:ips.getString('generic_confirm'),subText:(subMessage)?subMessage:'',callbacks:{ok:function(){window.location=elem.attr('href')+'&wasConfirmed=1';}}});},colorScheme(ev){let value=ev.detail.scheme;document.querySelectorAll('[data-ips-prefers-color-scheme]').forEach(el=>{el.removeAttribute('aria-current');if(el.matches('[data-ips-prefers-color-scheme='+value+']')){el.setAttribute('aria-current','true');}});document.documentElement.dataset.ipsSchemeActive=value;if(value==='system'){document.documentElement.dataset.ipsScheme=(window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}else{document.documentElement.dataset.ipsScheme=value;}
ips.utils.cookie.unset('clearAutosave');}},confirmSomething:function(e){e.preventDefault();var elem=$(e.currentTarget);var customMessage=$(e.currentTarget).attr('data-confirmMessage');var subMessage=$(e.currentTarget).attr('data-confirmSubMessage');var icon=$(e.currentTarget).attr('data-confirmIcon');ips.ui.alert.show({type:'confirm',icon:(icon)?icon:'warn',message:(customMessage)?customMessage:ips.getString('generic_confirm'),subText:(subMessage)?subMessage:'',callbacks:{ok:function(){window.location=elem.attr('href')+'&wasConfirmed=1';}}});},broadcastChannelEvent(ev){if(ev.data.command==="colorScheme"){document.dispatchEvent(new CustomEvent("ips:colorScheme",{bubbles:true,detail:{scheme:ev.data.value}}));}},colorScheme(ev){if(document.documentElement.matches('[data-ips-scheme-toggle="false"]')){return;}
let value=ev.detail.scheme;document.querySelectorAll('[data-ips-prefers-color-scheme]').forEach(el=>{if(el.matches('[data-ips-prefers-color-scheme='+value+']')){el.setAttribute('aria-current','true');}else{el.removeAttribute('aria-current');}});document.documentElement.dataset.ipsSchemeActive=value;if(value==='system'){document.documentElement.dataset.ipsScheme=(window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}else{document.documentElement.dataset.ipsScheme=value;}
ips.utils.cookie.set('scheme_preference',value,true);},updatePrefersColorScheme:function(){if(document.documentElement.getAttribute('data-ips-scheme-active')==='system'){document.documentElement.setAttribute('data-ips-scheme',(window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light');}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.autoSizeIframe',{_origin:ips.utils.url.getOrigin(),_embedId:'',_iframe:null,_border:{vertical:0,horizontal:0},initialize(){if(!this.scope.is('iframe')){return;}
this.on(window,'message',this.receiveMessage);this.on(document,'breakpointChange',this.breakpointChange);this.setup();},setup(){this._lastDims={height:0,width:0};var iframe=this.scope.get(0);iframe.style.overflow='hidden';this._getBorderAdjustment();if(this.scope.height()>800){this.scope.css({height:'800px'});}
@@ -26,7 +28,7 @@ this._startReadyTimeout();},_startReadyTimeout(){this._readyTimeout=setInterval(
try{const pmData=typeof e.originalEvent.data==='string'?JSON.parse(e.originalEvent.data):e.originalEvent.data;const method=pmData.method;if(pmData.embedId===undefined||pmData.embedId!==this._embedId){return;}
this._stopReadyTimeout();this[method]?.call(this,pmData);}catch(err){Debug.error(err.message);}},_postMessage(method,obj){Debug.log("Posting to iframe "+this._embedId);this._iframe.postMessage(JSON.stringify(_.extend(obj||{},{method:method,embedId:this._embedId})),this._origin);},_getBorderAdjustment(){this._border.vertical=parseInt(this.scope.css('border-top-width'))+parseInt(this.scope.css('border-bottom-width'));this._border.horizontal=parseInt(this.scope.css('border-left-width'))+parseInt(this.scope.css('border-right-width'));},breakpointChange(e,data){this._postMessage('responsiveState',{currentIs:data.curBreakName});},dialog(data){var options=ips.ui.getAcceptedOptions('dialog');var dialogOptions={};_.each(options,function(opt){if(!_.isUndefined(data.options['data-ipsdialog-'+opt.toLowerCase()])){dialogOptions[opt]=data.options['data-ipsdialog-'+opt.toLowerCase()];}});if(_.isUndefined(dialogOptions['url'])){dialogOptions['url']=data.url;}
var dialogRef=ips.ui.dialog.create(dialogOptions);dialogRef.show();},height(data){if(this._lastDims.height!==data.height){this.scope.css({height:parseInt(data.height)+this._border.vertical+'px'});this._postMessage('setDimensions',{height:parseInt(data.height)});this._lastDims.height=data.height;}},dims(data){if(parseInt(this._lastDims.height)!==parseInt(data.height)||this._lastDims.width!==data.width){this.scope.css({height:parseInt(data.height)+this._border.vertical+'px',maxWidth:(data.width.toString().indexOf('%')==-1)?parseInt(data.width)+this._border.horizontal+'px':'100%'});this._lastDims.height=data.height;this._lastDims.width=data.width;}},ok(){this._stopReadyTimeout();this.scope.addClass('ipsEmbed_finishedLoading');this._postMessage('responsiveState',{currentIs:ips.utils.responsive.getCurrentKey()});}});}(jQuery,_));;
;(function(){"use strict";ips.controller.register('core.front.core.colorScheme',{initialize(){this.menu=this.scope[0];this.on(this.menu,'click',this.changeColorScheme);if(!this.menu.querySelector("[aria-current")){this.schemePref=ips.utils.cookie.get('scheme_preference')||document.documentElement.dataset.ipsSchemeDefault;document.querySelectorAll('[data-ips-prefers-color-scheme='+this.schemePref+']').forEach(el=>el.setAttribute('aria-current','true'));}},changeColorScheme(ev){let el=ev.target.closest('[data-controller="core.front.core.colorScheme"] [data-ips-prefers-color-scheme]');if(!el)return;document.dispatchEvent(new CustomEvent("ips:colorScheme",{bubbles:true,detail:{scheme:el.dataset.ipsPrefersColorScheme}}));}});}());;
;(function(){"use strict";ips.controller.register('core.front.core.colorScheme',{initialize(){this.menu=this.scope[0];this.on(this.menu,'click',this.changeColorScheme);if(!this.menu.querySelector("[aria-current")){this.schemePref=ips.utils.cookie.get('scheme_preference')||document.documentElement.dataset.ipsSchemeDefault;document.querySelectorAll('[data-ips-prefers-color-scheme='+this.schemePref+']').forEach(el=>el.setAttribute('aria-current','true'));}},changeColorScheme(ev){let el=ev.target.closest('[data-controller="core.front.core.colorScheme"] [data-ips-prefers-color-scheme]');if(!el)return;document.dispatchEvent(new CustomEvent("ips:colorScheme",{bubbles:true,detail:{scheme:el.dataset.ipsPrefersColorScheme}}));if(ips.utils.broadcastChannel.enabled){ips.utils.broadcastChannel.channel.postMessage({command:'colorScheme',value:el.dataset.ipsPrefersColorScheme});}}});}());;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.comment',{_quoteData:null,_commentContents:'',_quotingDisabled:false,_quoteTimeout:null,_isEditing:false,_clickHandler:null,_observer:null,initialize:function(){for(const link of this.scope.find('[data-ipsMenu]')){const menuSelector=$(link).attr('href');for(const action of['editComment','cancelEditComment','deleteComment','approveComment']){this.on(document,'click',`${menuSelector} [data-action="${action}"]`,this[action]);}}
for(const action of['quoteComment','multiQuoteComment','rateReview']){this.on('click',`[data-action="${action}"]`,this[action]);}
this.on('submit','form',this.submitEdit);this.on('change','input[type="checkbox"][data-role="moderation"]',this.commentCheckbox);this.elem.addEventListener('ipsCalcQuote',()=>this.inlineQuote())
@@ -143,7 +145,8 @@ this._updateDoneCallback=null});this._overlay.hide();const currentPageNo=ips.uti
this._setUpMultiQuote();$(document).trigger('contentChange',[this.scope]);this._findCheckedComments();ips.ui.tableOfContents.refreshElems();},_getResultsFail:function(jqXHR,textStatus,errorThrown){if(Debug.isEnabled()){if(jqXHR instanceof RangeError){Debug.error(jqXHR)
return;}
Debug.error("Ajax request failed ("+textStatus+"): "+errorThrown);Debug.error(jqXHR.responseText);}else{window.location=this._getURL();}},_getResultsAlways:function(){},_setLoading:function(status){var commentFeed=this.scope.find('[data-role="commentFeed"]');if(status){if(!this._overlay){this._overlay=$('<div/>').addClass('ipsLoading').hide();ips.getContainer().append(this._overlay);}
var dims=ips.utils.position.getElemDims(commentFeed);var position=ips.utils.position.getElemPosition(commentFeed);this._overlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+$(document).scrollTop()+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});commentFeed.animate({opacity:"0.5"});}else{}},paginationClick:function(e,data){data.originalEvent.preventDefault();if(data.pageNo!==this._urlParams[this._pageParam]){var urlObj=ips.utils.url.getURIObject(data.href);var queryKey=urlObj.queryKey;if(_.isUndefined(queryKey[this._pageParam])){queryKey[this._pageParam]=data.pageNo;}
var dims=ips.utils.position.getElemDims(commentFeed);var position=ips.utils.position.getElemPosition(commentFeed);this._overlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+$(document).scrollTop()+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});commentFeed.animate({opacity:"0.5"});}else{}},_paginatedOnce:false,paginationClick:function(e,data){data.originalEvent.preventDefault();if(data.pageNo!==this._urlParams[this._pageParam]){Debug.log("Possibly collapsing elements as the user navigated away from the first page");if(parseInt(`${this._urlParams[this._pageParam]}`)===1&&!this._paginatedOnce){document.querySelectorAll(`[data-feedid="${this._commentFeedID}"] [data-collapse-off-first-page]`).forEach(toCollapse=>{toCollapse.dispatchEvent(new CustomEvent("ips:truncateCollapse",{bubbles:true}));})}
this._paginatedOnce=true;var urlObj=ips.utils.url.getURIObject(data.href);var queryKey=urlObj.queryKey;if(_.isUndefined(queryKey[this._pageParam])){queryKey[this._pageParam]=data.pageNo;}
this._seoPagination=data.seoPagination;this._updateURL(queryKey,()=>{const elem=this.elem.querySelector(`.ipsButtonBar--top`)
if(!(elem instanceof HTMLElement)){Debug.warn("Couldn't find the .ipsButtonBar--top or .ipsButtonBar--bottom pagination container inside the comment feed controller. This is likely a theme error that needs to be addressed so that the content feed can be scrolled to the top or bottom after pagination")
return;}
@@ -170,8 +173,9 @@ this.loadNewPosts(e);}};if(this._notification){this._notification.hide();}
if(parseInt(response.count)===1&&'photo'in response&&'name'in response){Object.apply(notifyData,{title:ips.getString('notificationNewPostSingleTitle',response),body:ips.getString('notificationNewPostSingleBody',response),icon:response.photo});}else{Object.apply(notifyData,{title:ips.pluralize(ips.getString('notificationNewPostMultipleTitle'),[response.count]),body:ips.pluralize(ips.getString('notificationNewPostMultipleBody',response),[response.count])});}
this._notification=ips.utils.notification.create(notifyData);this._notification.show();},async _importNewReplies(loadNewPage=true){const form=this.scope.find('[data-role="replyArea"] form');const commentsOnThisPage=this.scope.find('[data-commentid]');const _lastSeenID=this._getLastSeenID(commentsOnThisPage);try{const response=await ips.fetch(form.attr('action'),{data:{do:'checkForNewReplies',type:'fetch',lastSeenID:_lastSeenID,showing:this.getCurrentCommentPageCount()},type:'post'});if(loadNewPage&&commentsOnThisPage.length+parseInt(response.totalNewCount)>response.perPage){if(response.spillOverUrl){window.location=response.spillOverUrl;}else{window.location.reload();}}else{for(const item of[response.content].flat()){this.trigger('addToCommentFeed',{content:item,feedID:this._commentFeedID,resetEditor:false,totalItems:response.totalCount});}}
this._clearNotifications();}catch(e){Debug.warn(`Could not import new replies for the comment feed!`);Debug.error(e);}},_clearNotifications:function(){if(this._notification&&_.isFunction(this._notification.hide())){this._notification.hide();}
if($('#elFlashMessage').find('[data-role="newPostNotification"]').length){$('#elFlashMessage').find('[data-role="newPostNotification"]').trigger('closeFlashMsg.flashMsg');}},quickReply:function(e){var form=this.scope.find('[data-role="replyArea"] form');if(form.attr('data-noAjax')){return;}
e.preventDefault();e.stopPropagation();var self=this;var replyArea=this.scope.find('[data-role="replyArea"]');var submit=form.find('[type="submit"]');var autoFollow=this.scope.find('input[name$="auto_follow_checkbox"]');var commentsOnThisPage=this.scope.find('[data-commentid]');var _lastSeenID=this._getLastSeenID(commentsOnThisPage);var initialText=submit.text();submit.prop('disabled',true).text(ips.getString('saving'));var page=ips.utils.url.getPageNumber(this._pageParam);if(!page){page=1;}
if($('#elFlashMessage').find('[data-role="newPostNotification"]').length){$('#elFlashMessage').find('[data-role="newPostNotification"]').trigger('closeFlashMsg.flashMsg');}},quickReply:function(e){const form=this.scope.find('[data-role="replyArea"] form');if(form.attr('data-noAjax')){return;}
e.preventDefault();e.stopPropagation();const self=this;const replyArea=this.scope.find('[data-role="replyArea"]');const submit=form.find('[type="submit"]');const autoFollow=this.scope.find('input[name$="auto_follow_checkbox"]');const commentsOnThisPage=this.scope.find('[data-commentid]');const _lastSeenID=this._getLastSeenID(commentsOnThisPage);const submitButtons=[...submit];const submitRestorations=[];submitButtons.forEach(button=>{if(button.closest('.ipsIconPicker')){return;}
const initialText=button.innerText;button.setAttribute('disabled','');button.innerText=ips.getString('saving');submitRestorations.push(()=>{button.removeAttribute('disabled');button.innerText=initialText;});});let page=ips.utils.url.getPageNumber(this._pageParam);if(!page){page=1;}
this._clearNotifications();ips.getAjax()(form.attr('action'),{data:form.serialize()+'&currentPage='+page+'&_lastSeenID='+_lastSeenID,type:'post'}).done(function(response){if(response.type=='error'){if(response.form){if(replyArea.find('[data-ipseditorv5]')){ips.ui.editorv5.getObj(replyArea.find('[data-ipseditorv5]')).destruct();}
form.replaceWith($(response.form));$(document).trigger('contentChange',[self.scope]);}else{ips.ui.alert.show({type:'alert',icon:'warn',message:response.message,callbacks:{}});}}
else if(response.type=='redirect'){self.paginationClick(e,{href:response.url,originalEvent:e});}else if(response.type=='merge'){var comment=$(self.findCommentInFeed(response.id));comment.find('[data-role="commentContent"]').html(response.content);if(comment.find('pre.prettyprint').length){comment.find('pre.prettyprint').each(function(){$(this).html(window.PR.prettyPrintOne(_.escape($(this).text())));});}
@@ -181,7 +185,7 @@ ips.ui.flashMsg.show(ips.getString('mergedConncurrentPosts'));$(document).trigge
self.trigger('addToCommentFeed',{content:response.content,totalItems:response.total,feedID:self._commentFeedID,scrollToItem:true});if(response.message){ips.ui.flashMsg.show(response.message);}
if(self.scope.find('[data-role="replyArea"] input[name="guest_name"]').length){self.scope.find('[data-role="replyArea"] input[name="guest_name"]').val('');self.scope.find('[data-role="replyArea"] [data-ipsEditorv5]').find('.ipsComposeArea_dummy').hide().end().find('[data-role="mainEditorArea"]').show().end().closest('.ipsComposeArea').removeClass('ipsComposeArea_minimized').find('[data-ipsEditor-toolList]').show();}
form.find("[data-role='commentFormError']").each(function(){$(this).remove();});if(autoFollow.length){self.trigger('followingItem',{feedID:self.scope.attr('data-feedID'),following:autoFollow.is(':checked')});}}
self._clearNotifications();}).fail(function(jqXHR,textStatus,errorThrown){if(Debug.isEnabled()){Debug.error("Posting new reply failed: "+textStatus);Debug.log(jqXHR);Debug.log(errorThrown);}else{form.attr('data-noAjax','true');form.attr('action',form.attr('action')+((!form.attr('action').match(/\?/))?'?failedReply=1':'&failedReply=1'));form.submit();}}).always(function(){submit.prop('disabled',false).text(initialText?initialText:ips.getString('submit_reply'));});},loadNewPosts:function(e){e?.preventDefault?.();this._importNewReplies();},findCommentInFeed(commentId){const commentSelector=`[data-commentid="${commentId}"]`;const comment=this.elem.querySelector(`[data-role="commentFeed"] ${commentSelector}`);if(comment){return comment;}else if(this.elem.dataset.feedid){const feedSelector=`[data-feedid="${this.elem.dataset.feedid}"]`;return document.querySelector(`${feedSelector}${commentSelector}, ${feedSelector} ${commentSelector}`)||null;}
self._clearNotifications();}).fail(function(jqXHR,textStatus,errorThrown){if(Debug.isEnabled()){Debug.error("Posting new reply failed: "+textStatus);Debug.log(jqXHR);Debug.log(errorThrown);}else{form.attr('data-noAjax','true');form.attr('action',form.attr('action')+((!form.attr('action').match(/\?/))?'?failedReply=1':'&failedReply=1'));form.submit();}}).always(function(){submitRestorations.forEach(cb=>cb());});},loadNewPosts:function(e){e?.preventDefault?.();this._importNewReplies();},findCommentInFeed(commentId){const commentSelector=`[data-commentid="${commentId}"]`;const comment=this.elem.querySelector(`[data-role="commentFeed"] ${commentSelector}`);if(comment){return comment;}else if(this.elem.dataset.feedid){const feedSelector=`[data-feedid="${this.elem.dataset.feedid}"]`;return document.querySelector(`${feedSelector}${commentSelector}, ${feedSelector} ${commentSelector}`)||null;}
return null;},addToCommentFeed(e,data){if(typeof data?.content!=="string"||data.feedID!==this._commentFeedID){return;}
const content=$('<div/>').append(data.content);const div=content.get(0);const comment=content.find('.js-ipsEntry');let commentFeed=this.scope.find('[data-role="commentFeed"]');if(commentFeed.find('[data-role="moderationTools"]').length){commentFeed=commentFeed.find('[data-role="moderationTools"]');}
this.scope.find('[data-role="noComments"]').remove();const actualContent=div.querySelector(`[data-ips-hook="postWrapper"]`)