Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -39,7 +39,7 @@ this.updateURL({sortby:cell.attr('data-key'),sortdirection:order});};this.startL
|
||||
return{by:sortBy.attr('data-key'),order:sortOrder};};this._getFilterValue=function(){var sortBar=this.scope.find('[data-role="tableSortBar"]');if(!sortBar.length){return'';}
|
||||
return sortBar.find('.ipsDataFilters__button--active').closest('[data-filter]').attr('data-filter');};this._getSearchValue=function(){if(ips.utils.url.getParam('quicksearch')){return ips.utils.url.getParam('quicksearch');}
|
||||
return this.scope.find('[data-role="tableSearch"]').val();};});}(jQuery,_));;
|
||||
ips.templates.set('core.appMenu.reorder'," <span data-role='reorder' style='display: none'><i class='fa-solid fa-bars'></i></span>");ips.templates.set('core.controlStrip.menu'," <ul class='ipsMenu ipsMenu_auto' role='menu' id='{{id}}_menu' style='display: none'> {{{content}}} </ul>");ips.templates.set('core.controlStrip.menuItem'," <li class='ipsMenu_item ipsControlStrip_menuItem' role='menuitem' id='{{id}}'> {{{item}}} </li>");ips.templates.set('core.controlStrip.dropdown'," <li class='ipsControlStrip_button ipsControlStrip_dropdown' data-dropdown id='{{id}}'> <a href='#'> <i class='ipsControlStrip_icon fa-solid fa-angle-down'></i> </a> </li>");ips.templates.set('core.trees.childWrapper'," {{{content}}}");ips.templates.set('core.trees.loadingRow'," <ol class='ipsTree'><li class='ipsTree_loadingRow ipsLoading ipsLoading--tiny'>{{#lang}}loading{{/lang}}</li></ol>");ips.templates.set('core.trees.loadingPane'," <div class='ipsLoading' style='height: 150px'> </div>");ips.templates.set('core.trees.noRows'," <div class='i-text-align_center i-padding_3 i-color_soft'>{{#lang}}no_results{{/lang}}</div>");ips.templates.set('core.livesearch.noResults'," <li class='i-text-align_center i-padding_3 i-color_soft' data-role='result'> <br><br> </li>");ips.templates.set('languages.translateString'," <div class='cTranslateTable_field'> <textarea class='ipsInput'>{{value}}</textarea> <a href='#' data-action='saveWords' tabindex='-1' class='ipsButton ipsButton--positive ipsButton--tiny ipsButton--icon'><i class='fa-solid fa-check'></i> {{#lang}}languageSave{{/lang}}</a> </div>");ips.templates.set('support.guideSearch'," <li> <a href=\"{{link}}\" target='_blank' rel='noopener'>{{title}}</a> </li>");ips.templates.set('support.guideSearch.noResults'," <li class='i-color_soft'> {{#lang}}no_results{{/lang}} </li>");ips.templates.set('support.ticket.supportSummary'," <div class='i-padding-top_3'> {{#lang}}health_ticket_beforeproceeding{{/lang}} </div>");;
|
||||
ips.templates.set('core.appMenu.reorder'," <span data-role='reorder' style='display: none'><i class='fa-solid fa-bars'></i></span>");ips.templates.set('core.controlStrip.menu'," <ul class='ipsMenu ipsMenu_auto' role='menu' id='{{id}}_menu' style='display: none'> {{{content}}} </ul>");ips.templates.set('core.controlStrip.menuItem'," <li class='ipsMenu_item ipsControlStrip_menuItem' role='menuitem' id='{{id}}'> {{{item}}} </li>");ips.templates.set('core.controlStrip.dropdown'," <li class='ipsControlStrip_button ipsControlStrip_dropdown' data-dropdown id='{{id}}'> <a href='#'> <i class='ipsControlStrip_icon fa-solid fa-angle-down'></i> </a> </li>");ips.templates.set('core.trees.childWrapper'," {{{content}}}");ips.templates.set('core.trees.loadingRow'," <ol class='ipsTree'><li class='ipsTree_loadingRow ipsLoading ipsLoading--tiny'>{{#lang}}loading{{/lang}}</li></ol>");ips.templates.set('core.trees.loadingPane'," <div class='ipsLoading' style='height: 150px'> </div>");ips.templates.set('core.trees.noRows'," <div class='i-text-align_center i-padding_3 i-color_soft'>{{#lang}}no_results{{/lang}}</div>");ips.templates.set('core.livesearch.noResults'," <li class='i-text-align_center i-padding_3 i-color_soft' data-role='result'> <br><br> </li>");ips.templates.set('languages.translateString'," <div class='cTranslateTable_field'> <textarea class='ipsInput'>{{value}}</textarea> <button type='button' href='#' data-action='saveWords' tabindex='-1' class='ipsButton ipsButton--positive ipsButton--tiny ipsButton--icon'><i class='fa-solid fa-check'></i> {{#lang}}languageSave{{/lang}}</button> </div>");ips.templates.set('support.guideSearch'," <li> <a href=\"{{link}}\" target='_blank' rel='noopener'>{{title}}</a> </li>");ips.templates.set('support.guideSearch.noResults'," <li class='i-color_soft'> {{#lang}}no_results{{/lang}} </li>");ips.templates.set('support.ticket.supportSummary'," <div class='i-padding-top_3'> {{#lang}}health_ticket_beforeproceeding{{/lang}} </div>");;
|
||||
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.app',{initialize:function(){this.on('click','[data-clickshow]',this.clickShow);this.on('click','[data-clickhide]',this.clickHide);this.on('click','[data-clickempty]',this.clickEmpty);this.on('click','[data-delete]',this.deleteSomething);this.on('click','a[data-confirm]',this.confirmSomething);this.on('click','[data-doajax]',this.doAjaxAction);this.on(document,'contentChange',this._checkAndClearAutosave);this.setup();},setup:function(){if(ips.utils.serviceWorker.supported){ips.utils.serviceWorker.registerServiceWorker('admin',false);}
|
||||
this._checkAndClearAutosave();if(!ips.getSetting('memberID')&&ips.utils.url.getParam('_fromLogout')){ips.utils.db.removeByType('editorSave');}},_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');}},doAjaxAction:function(e){e.preventDefault();ips.getAjax()($(e.currentTarget).attr('href'),{dataType:'json'}).done(function(response){ips.ui.flashMsg.show(response);}).fail(function(jqXHR){if(Debug.isEnabled()){Debug.error(jqXHR.responseText);}else{window.location=$(e.currentTarget).attr('href');}});},deleteSomething:function(e){e.preventDefault();var elem=$(e.currentTarget);var deleteTitle=elem.attr('data-delete-message');var extraWarning=elem.attr('data-delete-warning');ips.ui.alert.show({type:'confirm',icon:'warn',message:deleteTitle||ips.getString('delete_confirm'),subText:extraWarning||'',focus:'cancel',callbacks:{ok:function(){if(elem.attr('data-noajax')!==undefined){window.location=elem.attr('href')+'&csrfKey='+ips.getSetting('csrfKey')+'&wasConfirmed=1';return;}
|
||||
|
||||
+305
-379
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
;(function($,_,undefined){"use strict";ips.controller.mixin('contentListing','core.global.core.table',true,function(){this._rowSelector='li';this.after('initialize',function(){this.on('menuItemSelected','[data-role="sortButton"]',this.changeSorting);this.on('change','[data-role="moderation"]',this.selectRow);this.on('paginationClicked',this.frontPaginationClicked);this.on('markTableRead',this.markAllRead);$(document).on('markTableRowRead',_.bind(this.markRowRead,this));$(document).on('markAllRead',_.bind(this.markAllRead,this));$(document).on('updateTableURL',_.bind(this.updateTableURL,this));$(document).on('moderationSubmitted',_.bind(this.clearLocalStorage,this));});this.after('setup',function(){this._tableID=this.scope.attr('data-tableID');this._storeID='table-'+this._stateKey;if(this.scope.attr('data-dummyLoadingSelector')){this._rowSelector=this.scope.attr('data-dummyLoadingSelector');}
|
||||
this._findCheckedRows();this.on('pageActionReady',this._findCheckedRows);});this.before('_handleStateChanges',function(state){ips.utils.analytics.trackPageView(state.url);});this.before('_getResults',function(){this._setTableLoading(true);});this.after('_getResultsAlways',function(){this._setTableLoading(false);});this.after('_updateTable',function(){this.scope.find('[data-ipsPageAction]').trigger('refresh.pageAction');this.scope.find('[data-role="tableRows"]').css({opacity:"0.0001"}).animate({opacity:"1"});this._findCheckedRows();});this._findCheckedRows=function(){if(!this.scope.find('input[type="checkbox"]').length){return;}
|
||||
var dataStore=ips.utils.db.get('moderation',this._storeID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){var sizeOtherPage=0;_.each(dataStore,function(val,key){if(self.scope.find('[data-rowid="'+key+'"]').length){self.scope.find('[data-rowid="'+key+'"]').addClass('ipsData__item--selected').find('input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{sizeOtherPage++;pageAction.trigger('addManualItem.pageAction',{id:'moderate['+key+']',actions:val});}});if(this.scope.find('[data-ipsAutoCheck]')){this.scope.find('[data-ipsAutoCheck]').trigger('setInitialCount.autoCheck',{count:sizeOtherPage});}}};this.clearLocalStorage=function(){ips.utils.db.remove('moderation',this._storeID);};this._showLoading=function(){return _.isUndefined(this.scope.attr('data-dummyLoading'));};this.markAllRead=function(){this.scope.find('.ipsSubList__item--unread').removeClass('ipsSubList__item--unread').addClass('ipsSubList__item--read');this.scope.find('[data-ips-unread]').removeAttr('data-ips-unread').attr('data-ips-read','');this.elem.querySelectorAll('.ipsIndicator').forEach(unreadIcon=>unreadIcon.remove())};this.markRowRead=function(e,data){if(_.isUndefined(data.tableID)||data.tableID!=this._tableID){return;}
|
||||
var dataStore=ips.utils.db.get('moderation',this._storeID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){var sizeOtherPage=0;_.each(dataStore,function(val,key){if(self.scope.find('[data-rowid="'+key+'"]').length){self.scope.find('[data-rowid="'+key+'"]').addClass('ipsData__item--selected').find('input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{sizeOtherPage++;pageAction.trigger('addManualItem.pageAction',{id:'moderate['+key+']',actions:val});}});if(this.scope.find('[data-ipsAutoCheck]')){this.scope.find('[data-ipsAutoCheck]').trigger('setInitialCount.autoCheck',{count:sizeOtherPage});}}};this.clearLocalStorage=function(){ips.utils.db.remove('moderation',this._storeID);};this._showLoading=function(){return _.isUndefined(this.scope.attr('data-dummyLoading'));};this.markAllRead=function(){this.scope.find('.ipsSubList__item--unread').removeClass('ipsSubList__item--unread').addClass('ipsSubList__item--read');this.scope.find('[data-ips-unread]').removeAttr('data-ips-unread').attr('data-ips-read','');this.scope.find('[data-ips-badge-new]').remove();this.elem.querySelectorAll('.ipsIndicator').forEach(unreadIcon=>unreadIcon.remove())};this.markRowRead=function(e,data){if(_.isUndefined(data.tableID)||data.tableID!=this._tableID){return;}
|
||||
this.scope.find('[data-rowID="'+data.rowID+'"]').removeAttr('data-ips-unread').attr('data-ips-read','');};this.updateTableURL=function(e,data){this.updateURL(data);};this.frontPaginationClicked=function(){var wrappingDialog=this.scope.closest('.ipsDialog');var elemPosition=ips.utils.position.getElemPosition(wrappingDialog.length?wrappingDialog:this.scope);$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'});};this.selectRow=function(e){var row=$(e.currentTarget).closest('.ipsData__item');var rowID=row.attr('data-rowID');var dataStore=ips.utils.db.get('moderation',this._storeID)||{};var rowActions=row.find('[data-role="moderation"]').attr('data-actions');row.toggleClass('ipsData__item--selected',$(e.currentTarget).is(':checked'));if(rowID){if($(e.currentTarget).is(':checked')){if(_.isUndefined(dataStore[rowID])){dataStore[rowID]=rowActions;}}else{delete dataStore[rowID];}
|
||||
if(_.size(dataStore)){ips.utils.db.set('moderation',this._storeID,dataStore,undefined,Date.now()/1000+86400);}else{ips.utils.db.remove('moderation',this._storeID);}}};this._setTableLoading=function(loading){var rowElem=this.scope.find('[data-role="tableRows"]');var rows=rowElem.find('> '+this._rowSelector);if(_.isUndefined(this.scope.attr('data-dummyLoading'))){this._basicLoading(loading);return;}
|
||||
if(!loading||!rowElem.length||!rows.length){return;}
|
||||
@@ -15,19 +15,22 @@ this.updateURL({sortby:sortBy,sortdirection:sortDirection,page:1});};this._getSo
|
||||
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);}
|
||||
if($('#elInlineMessage').length){var dialogRef=ips.ui.dialog.create({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';}}});},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'});}
|
||||
;(function($,_,undefined){"use strict";const PREINITIALIZED_DIMS_FLAG=Symbol('PREINITIALIZED_DIMS_FLAG');if(ips?.utils?.db?.get instanceof Function){document.querySelectorAll('iframe[data-controller*="core.front.core.autosizeiframe"][src]').forEach(embed=>{if(!embed.src||embed.src===window.location.href){return;}
|
||||
const currentDims=ips.utils.db.get("embedDimsCache",embed.src);if(typeof currentDims?.height==='number'&¤tDims.height>0){Debug.log(`(EMBED) - Filling in width and height before registering controller for embed ${embed.src}`);embed[PREINITIALIZED_DIMS_FLAG]={width:typeof currentDims.width==='number'?currentDims.width:0,height:typeof currentDims.height==='number'?currentDims.height:0};if(typeof currentDims.width==='number'&¤tDims.width>0){requestAnimationFrame(()=>{embed.style.height=currentDims.height+"px";embed.style.width=currentDims.style.width+"px";})}else{requestAnimationFrame(()=>{embed.style.height=currentDims.height+"px";});}}})}
|
||||
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();},getEmbedSrc(){return this.elem.src;},setup(){this._lastDims={height:0,width:0};let cachedDims;if(PREINITIALIZED_DIMS_FLAG in this.elem){Object.assign(this._lastDims,this.elem[PREINITIALIZED_DIMS_FLAG]);}else if(this.getEmbedSrc()&&(cachedDims=ips.utils.db.get('embedDimsCache',this.getEmbedSrc()))&&cachedDims){if(typeof cachedDims?.height==='number'&&cachedDims.height>0){Debug.log(`(EMBED) - Using cached height and width while the embed initializes`);if(typeof cachedDims?.width==='number'&&cachedDims.width>0){this.dims(cachedDims);}else{this.height({height:cachedDims.height});}}}
|
||||
var iframe=this.scope.get(0);iframe.style.overflow='hidden';this._getBorderAdjustment();if(this.scope.height()>800){this.scope.css({height:'800px'});}
|
||||
this._iframe=iframe.contentWindow;this._embedId='embed'+parseInt(Math.random()*(10000000000-1)+1);this.scope.attr('data-embedId',this._embedId);if(!window.postMessage||!window.JSON.parse){this.scope.css({height:'400px'});Debug.error("Can't resize embed: "+this._embedId);return;}
|
||||
this._startReadyTimeout();},_startReadyTimeout(){this._readyTimeout=setInterval(_.bind(function(){this._postMessage('ready');},this),100);setTimeout(_.bind(function(){this._stopReadyTimeout();},this),10000);},_stopReadyTimeout(){if(this._readyTimeout!==null){Debug.log("Stopped posting to embed "+this._embedId);clearInterval(this._readyTimeout);this._readyTimeout=null;}},destruct(){Debug.log('Destruct autoSizeIframe '+this._embedId);this._stopReadyTimeout();this._postMessage('stop');},receiveMessage(e){if(e.originalEvent.origin!==this._origin){return;}
|
||||
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,_));;
|
||||
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._lastDims.height=data.height;if(this.getEmbedSrc()){ips.utils.db.set('embedDimsCache',this.getEmbedSrc(),this._lastDims);}}},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;if(this.getEmbedSrc()){ips.utils.db.set('embedDimsCache',this.getEmbedSrc(),this._lastDims);}}},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}}));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','deleteComment','approveComment']){this.on(document,'click',`${menuSelector} [data-action="${action}"]`,this[action]);}}
|
||||
for(const action of['quoteComment','multiQuoteComment','rateReview','cancelEditComment']){this.on('click',`[data-action="${action}"]`,this[action]);}
|
||||
@@ -35,7 +38,7 @@ this.on('submit','form',this.submitEdit);this.on('change','input[type="checkbox"
|
||||
this.on('click','[data-action="quoteSelection"]',this.quoteSelection);this.on('submitDialog','[data-action="recommendComment"]',this.recommendComment);this.on('click','[data-action="unrecommendComment"]',this.unrecommendComment);this.on('tabChanged',this.tabChanged);this.on('setMultiQuoteEnabled.comment setMultiQuoteDisabled.comment',this.setMultiQuote);this.on('disableQuoting.comment',this.disableQuoting);this.on(document,'getEditFormLoading.comment saveEditCommentLoading.comment '+
|
||||
'deleteCommentLoading.comment',this.commentLoading);this.on(document,'getEditFormDone.comment saveEditCommentDone.comment '+
|
||||
'deleteCommentDone.comment',this.commentDone);this.on(document,'getEditFormDone.comment',this.getEditFormDone);this.on(document,'getEditFormError.comment',this.getEditFormError);this.on(document,'saveEditCommentDone.comment',this.saveEditCommentDone);this.on(document,'saveEditCommentError.comment',this.saveEditCommentError);this.on(document,'deleteCommentDone.comment',this.deleteCommentDone);this.on(document,'deleteCommentError.comment',this.deleteCommentError);this.on(document,'unrecommendCommentDone.comment',this.unrecommendCommentDone);this.on(document,'unrecommendCommentError.comment',this.unrecommendCommentError);this.on(document,'approveCommentLoading.comment',this.approveCommentLoading);this.on(document,'approveCommentDone.comment',this.approveCommentDone);this.on(document,'approveCommentError.comment',this.approveCommentError);this.setup();},setup:function(){this._commentID=this.scope.attr('data-commentID');this._clickHandler=_.bind(this._hideQuoteTooltip,this);this._setupIntersectionObserver();this._setupShareCommentDialog();const fragment=window.location.hash;const match=fragment.match(/#find(Review|Comment)-(\d+)/);if(match){const type=match[1]
|
||||
const commentId=match[2];const elementId=`find${type}-${commentId}`;const element=document.getElementById(elementId);if(!element){var currentUrl=new URL(window.location.href);currentUrl.searchParams.set('do',`find${type}`);currentUrl.searchParams.set(type.toLowerCase(),commentId);window.location.href=currentUrl;}}},destroy:function(){},tabChanged:function(e,data){this._menu=undefined;this.getMenu();},inlineQuote:function(){var self=this;var quoteButton=this.scope.find('[data-action="quoteComment"]');if(this._isEditing||this._quotingDisabled||!quoteButton.length){return;}
|
||||
const commentId=match[2];const elementId=`find${type}-${commentId}`;const element=document.getElementById(elementId);if(!element){const currentUrl=new URL(window.location.href);currentUrl.updateSearchParams({params:{do:`find${type}`,[type.toLowerCase()]:commentId.toString()}});window.location.href=currentUrl;}}},destroy:function(){},tabChanged:function(e,data){this._menu=undefined;this.getMenu();},inlineQuote:function(){var self=this;var quoteButton=this.scope.find('[data-action="quoteComment"]');if(this._isEditing||this._quotingDisabled||!quoteButton.length){return;}
|
||||
clearInterval(this._quoteTimeout);this._quoteTimeout=setInterval(function(){self._checkQuoteStatus();},400);},recommendComment:function(e,data){var commentHtml=$('<div>'+data.response.comment+'</div>').find('[data-controller="core.front.core.comment"]').html();this.scope.html(commentHtml).closest('.ipsEntry').addClass('ipsEntry--popular');$(document).trigger('contentChange',[this.scope]);if(ips.utils.db.isEnabled()){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsHide');}
|
||||
this.trigger('refreshRecommendedComments',{scroll:true,recommended:data.response.recommended});},unrecommendComment:function(e,data){e.preventDefault();var url=$(e.currentTarget).attr('href');this.trigger('unrecommendComment.comment',{url:url,commentID:this._commentID});},unrecommendCommentDone:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
var commentHtml=$('<div>'+data.comment+'</div>').find('[data-controller="core.front.core.comment"]').html();console.log(commentHtml);this.scope.html(commentHtml).closest('.ipsEntry').removeClass('ipsEntry--popular').find('.ipsEntry__popularFlag').remove();ips.ui.flashMsg.show(ips.getString('commentUnrecommended'));this.trigger('removeRecommendation',{commentID:data.unrecommended});},unrecommendCommentError:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
@@ -49,7 +52,7 @@ var tooltipSize={width:tooltip.show().outerWidth(),height:tooltip.show().outerHe
|
||||
const feed=document.querySelector(`[data-feedid=${this.elem.dataset.feedid}][data-controller*="core.front.core.commentFeed"]`);if(feed){return $(feed);}
|
||||
Debug.warn(`The comment feed for a comment could not be identified. This can be prevented by ensuring the comment and its feed have macthing data-feedid attributes (comment's feedid: ${this.elem.dataset.feedid})`);}else{Debug.warn(`A comment is missing its data-feedid attribute, so its comment feed could not be identified. This can be prevented by ensuring the comment and its feed have macthing data-feedid attributes`);}
|
||||
Debug.warn(this.elem);return $(this.elem.closest(`[data-controller*="core.front.core.commentFeed"]`)||this.elem);},quoteSelection:function(e){e.preventDefault();this._getQuoteData();if(this._selectedText){this.feedJQ().trigger('quoteComment.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:this._selectedText,citeurl:$(this.elem).get(0).querySelector(".ipsEntry__date[href]")?.getAttribute('href')});}
|
||||
this._hideQuoteTooltip();},commentCheckbox:function(e){var checked=$(e.currentTarget).is(':checked');this.scope.closest('.js-ipsEntry').toggleClass('ipsEntry--selected',checked);this.scope.closest('.js-ipsEntry').find('label[for='+$(e.currentTarget).attr('id')+']').toggleClass('ipsInput--pseudoChecked',checked);this.feedJQ().trigger('checkedComment.comment',{commentID:this._commentID,actions:$(e.currentTarget).attr('data-actions'),checked:checked});},disableQuoting:function(){this._quotingDisabled=true;this.scope.find('[data-ipsQuote-editor]').remove();},rateReview:function(e){e.preventDefault();var self=this;ips.getAjax()($(e.currentTarget).attr('href')).done(function(response){var content=$("<div>"+response+"</div>");self.scope.html(content.find('[data-controller="core.front.core.comment"]').contents());$(document).trigger('contentChange',[self.scope]);}).fail(function(err){window.location=$(e.currentTarget).attr('href');});},_menu:undefined,getMenu(){if(!this._menu){let activeTabId=this.elem.closest(`[data-commentstype="reviews"]`)?'elReview':'elComment';Debug.log(activeTabId);let commentFeed=this.scope.get(0)?.closest('[data-controller]')
|
||||
this._hideQuoteTooltip();},commentCheckbox:function(e){var checked=$(e.currentTarget).is(':checked');this.scope.closest('.js-ipsEntry').toggleClass('ipsEntry--selected',checked);this.scope.closest('.js-ipsEntry').find('label[for='+$(e.currentTarget).attr('id')+']').toggleClass('ipsInput--pseudoChecked',checked);this.feedJQ().trigger('checkedComment.comment',{commentID:this._commentID,actions:$(e.currentTarget).attr('data-actions'),checked:checked});},disableQuoting:function(){this._quotingDisabled=true;this.scope.find('[data-ipsQuote-editor]').remove();},rateReview:function(e){e.preventDefault();var self=this;ips.getAjax()($(e.currentTarget).attr('href')).done(function(response){var content=$("<div>"+response+"</div>");self.scope.html(content.find('[data-controller="core.front.core.comment"]').contents());$(document).trigger('contentChange',[self.scope]);}).fail(function(err){window.location=$(e.currentTarget).attr('href');});},_menu:undefined,getMenu(){if(!this._menu){let activeTabId=this.elem.closest(`[data-commentstype="reviews"]`)?'elReview':'elComment';let commentFeed=this.scope.get(0)?.closest('[data-controller]')
|
||||
while(commentFeed&&!commentFeed.dataset.controller?.includes('core.front.core.commentFeed')){commentFeed=commentFeed.parentElement?.closest('[data-controller]')}
|
||||
const menuLink=(commentFeed||document).querySelector('#'+activeTabId+`_${this.scope.get(0)?.dataset['commentid']} [href][data-ipsmenu]`);this._menu=menuLink?document.querySelector(menuLink.getAttribute('href')):null;}
|
||||
return this._menu;},_setupShareCommentDialog(){const shareButton=this.getMenu()?.querySelector('[data-role="shareComment"], [data-role="shareReview"]');const shareMenu=shareButton?.dataset.ipsdialogContent?document.querySelector(shareButton.dataset.ipsdialogContent):null;const copyToClipboard=shareMenu?.querySelector('[data-role="shareButton"]');let shared=false;if(window.isSecureContext&©ToClipboard){copyToClipboard.onclick=e=>e.preventDefault()
|
||||
@@ -70,8 +73,7 @@ ips.ui.flashMsg.show(ilang`copied`)
|
||||
if(!shared&&ips.utils.contentViews.enabled()&&this.scope.get(0).dataset.commentapp==='forums'){shared=true;ips.getAjax()(`${location.protocol}${ips.getSetting("baseURL")}/?app=core&module=system&controller=ajax&do=trackPostShareIntent&commentId=${this.scope.get(0).dataset.commentid}`).done(()=>{Debug.log("Sent post share intent");})}}
|
||||
copyToClipboard.addEventListener('pointerup',cb)
|
||||
copyToClipboard.addEventListener('pointercancel',()=>copyToClipboard.removeEventListener('pointerup',cb))
|
||||
copyToClipboard.addEventListener('pointerleave',()=>copyToClipboard.removeEventListener('pointerup',cb))})}else if(copyToClipboard){Debug.log(`Converting share copy to clipboard links to contenteditable links`)
|
||||
copyToClipboard.setAttribute('hidden','')
|
||||
copyToClipboard.addEventListener('pointerleave',()=>copyToClipboard.removeEventListener('pointerup',cb))})}else if(copyToClipboard){copyToClipboard.setAttribute('hidden','')
|
||||
const shareArea=document.createElement('span')
|
||||
const wrap=document.createElement('span')
|
||||
if(copyToClipboard.querySelector(':scope > i')){const icon=copyToClipboard.querySelector(':scope > i')
|
||||
@@ -91,10 +93,10 @@ document.getSelection().addRange(range)
|
||||
try{if(document.execCommand instanceof Function){document.execCommand?.('copy')
|
||||
ips.ui.flashMsg.show(ips.getString('copied'))}}catch(e){}}}},setMultiQuote:function(e,data){var selector='[data-commentApp="'+data.contentapp+'"]';selector+='[data-commentType="'+data.contenttype+'"]';selector+='[data-commentID="'+data.contentcommentid+'"]';if(this.scope.is(selector)){if(!_.isNull(e)&&e.type=='setMultiQuoteEnabled'){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsButton--simple').addClass('ipsButton--secondary').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}else if(_.isNull(e)||e.type=='setMultiQuoteDisabled'){this.scope.find('[data-action="multiQuoteComment"]').addClass('ipsButton--simple').removeClass('ipsButton--secondary').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}}},quoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;}
|
||||
var html=this._prepareQuote($('<div/>').html(this.scope.find('[data-role="commentContent"]').html()));this.feedJQ().trigger('quoteComment.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html(),citeurl:$(this.elem).get(0).querySelector(".ipsEntry__date[href]")?.getAttribute('href')});},multiQuoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;}
|
||||
var button=$(e.currentTarget);var mqActive=button.attr('data-mqActive');var html=this._prepareQuote($('<div/>').html(this.scope.find('[data-role="commentContent"]').html()));this.feedJQ().trigger((mqActive)?'removeMultiQuote.comment':'addMultiQuote.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html(),button:button.attr('data-mqId'),citeurl:$(this.elem).get(0).querySelector(".ipsEntry__date[href]")?.getAttribute('href')});if(mqActive){button.removeClass('ipsButton--secondary').addClass('ipsButton--simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}else{button.removeClass('ipsButton--simple').addClass('ipsButton--secondary').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}},editComment:function(e){e.preventDefault();this._commentContents=this.scope.find('[data-role="commentContent"]').html();var url=$(e.currentTarget).attr('href');this.scope.find('[data-role="commentContent"]').removeClass('ipsRichText');this.trigger('getEditForm.comment',{url:url,commentID:this._commentID});},cancelEditComment:function(e){e.preventDefault();var self=this;ips.ui.alert.show({type:'verify',icon:'warn',message:ips.getString('cancel_edit_confirm'),subText:'',buttons:{yes:ips.getString('yes'),no:ips.getString('no')},callbacks:{yes:function(){ips.ui.editorv5.destruct(self.scope.find('[data-ipseditorv5]'));self.scope.find('[data-role="commentContent"]').html(self._commentContents);self.scope.find('[data-role="commentControls"], [data-action="expandTruncate"]').show();self.scope.find('[data-action="editComment"]').parent('li').show();self.scope.find('[data-role="commentContent"]').addClass('ipsRichText');$(document).trigger('contentChange',[self.scope]);}}});},submitEdit:function(e){e.preventDefault();e.stopPropagation();var form=this.scope.find('form');var url=form.attr('action');var data=form.serialize();form.find('[data-action="cancelEditComment"]').remove();form.find('[type="submit"]').prop('disabled',true).text(ips.getString('saving'));this.trigger('saveEditComment.comment',{form:data,url:url,commentID:this._commentID});},commentLoading:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
var button=$(e.currentTarget);var mqActive=button.attr('data-mqActive');var html=this._prepareQuote($('<div/>').html(this.scope.find('[data-role="commentContent"]').html()));this.feedJQ().trigger((mqActive)?'removeMultiQuote.comment':'addMultiQuote.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html(),button:button.attr('data-mqId'),citeurl:$(this.elem).get(0).querySelector(".ipsEntry__date[href]")?.getAttribute('href')});if(mqActive){button.removeClass('ipsButton--secondary').addClass('ipsButton--simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}else{button.removeClass('ipsButton--simple').addClass('ipsButton--secondary').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}},editComment:function(e){e.preventDefault();this._commentContents=this.scope.find('[data-role="commentContent"]').html();var url=$(e.currentTarget).attr('href');this.trigger('getEditForm.comment',{url:url,commentID:this._commentID});},cancelEditComment:function(e){e.preventDefault();var self=this;ips.ui.alert.show({type:'verify',icon:'warn',message:ips.getString('cancel_edit_confirm'),subText:'',buttons:{yes:ips.getString('yes'),no:ips.getString('no')},callbacks:{yes:function(){ips.ui.editorv5.destruct(self.scope.find('[data-ipseditorv5]'));self.scope.find('[data-role="commentContent"]').html(self._commentContents);self.scope.find('[data-role="commentControls"], [data-action="expandTruncate"]').show();self.scope.find('[data-action="editComment"]').parent('li').show();self.scope.find('[data-role="commentContent"]').addClass('ipsRichText');$(document).trigger('contentChange',[self.scope]);}}});},submitEdit:function(e){e.preventDefault();e.stopPropagation();var form=this.scope.find('form');var url=form.attr('action');var data=form.serialize();form.find('[data-action="cancelEditComment"]').remove();form.find('[type="submit"]').prop('disabled',true).text(ips.getString('saving'));this.trigger('saveEditComment.comment',{form:data,url:url,commentID:this._commentID});},commentLoading:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
var commentLoading=this.scope.find('[data-role="commentLoading"]');commentLoading.removeClass('ipsHide');},commentDone:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
this.scope.find('[data-role="commentLoading"]').addClass('ipsHide');},getEditFormDone:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
var self=this;var showForm=_.once(function(){self._isEditing=true;self.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').hide();self.scope.find('[data-action="editComment"]').parent('li').hide();self.scope.find('[data-role="commentContent"]').html(data.response);$(document).trigger('contentChange',[self.scope.find('[data-role="commentContent"]')]);});var elemPosition=ips.utils.position.getElemPosition(this.scope);var windowScroll=$(window).scrollTop();var viewHeight=$(window).height();if(elemPosition.absPos.top<windowScroll||elemPosition.absPos.top>(windowScroll+viewHeight)){$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'},function(){showForm();});}else{showForm();}},getEditFormError:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
const showForm=_.once(()=>{this._isEditing=true;this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').hide();this.scope.find('[data-action="editComment"]').parent('li').hide();this.scope.find('[data-role="commentContent"]').html(data.response);this.scope.find('[data-role="commentContent"]').removeClass('ipsRichText');$(document).trigger('contentChange',[this.scope.find('[data-role="commentContent"]')]);});var elemPosition=ips.utils.position.getElemPosition(this.scope);var windowScroll=$(window).scrollTop();var viewHeight=$(window).height();if(elemPosition.absPos.top<windowScroll||elemPosition.absPos.top>(windowScroll+viewHeight)){$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'},function(){showForm();});}else{showForm();}},getEditFormError:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
window.location=data.url;},saveEditCommentDone:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
ips.ui.editorv5.destruct(this.scope.find('[data-ipseditorv5]'));this._isEditing=false;this.scope.find('[data-role="commentContent"]').replaceWith($('<div>'+data.response+'</div>').find('[data-role="commentContent"]'));this.scope.trigger('refreshContent');this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').show();this.scope.find('[data-action="editComment"]').parent('li').show();$(document).trigger('contentChange',[this.scope]);},saveEditCommentError:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('editCommentError'),});},approveComment:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href');this.trigger('approveComment.comment',{url:url,commentID:this._commentID});},approveCommentLoading:function(e,data){if(data.commentID!=this._commentID){return;}
|
||||
@@ -127,9 +129,12 @@ if(replyForm.attr('data-noAjax')){this._pollingEnabled=false;}
|
||||
if(!('commentFeed'in ips.utils.history.getState())){this._updateState({})
|
||||
ips.utils.history.replaceState(this.historyState,'commentFeed',window.location.href)}
|
||||
if(!_.isUndefined(this.scope.attr('data-lastPage'))&&this._pollingEnabled){this._startPolling();}
|
||||
$(document).ready(()=>{this._setUpMultiQuote();this._findCheckedComments();});this.on('updateTimestamps',this._updateTimestamps);for(const ev of['ips:editorUpdated','ips:editorAfterInit']){this.elem.addEventListener(ev,e=>{const{elem}=e.detail;const submit=elem.closest(CSS.supports('selector(a:has(b))')?'form:has(input[type="submit"],button[type="submit"])':'form').querySelectorAll(':is(button, input)[type="submit"]');if(!submit.length){return;}
|
||||
const widget=ips.ui.editorv5.getObj(elem);if(!widget){return;}
|
||||
const empty=!widget.getInstanceHTML();submit.forEach(item=>{if(empty){item.setAttribute('disabled','');}else{item.removeAttribute('disabled');}})})}},clearLocalStorage:function(){ips.utils.db.remove('moderation',$(document).find("[data-feedID]").attr('data-feedID'));},destroy:function(){$(document).off('click','[data-role="multiQuote_'+this._containerID+'"]',this._boundMQ);$(document).off('click','[data-action="clearQuoted_'+this._containerID+'"]',this._boundCMQ);this._stopPolling();},_getUrlParams:function(){const sort=this._getSortValue();const obj={sortby:sort.by||'',sortdirection:sort.order||'',};obj[this._pageParam]=ips.utils.url.getPageNumber(this._pageParam)||1;return obj;},_getSortValue:function(){return{by:'',order:''};},stateChange(e){if(e.detail?.type==='replace'||!('commentFeed'in ips.utils.history.getState())){return;}
|
||||
$(document).ready(()=>{this._setUpMultiQuote();this._findCheckedComments();});this.on('updateTimestamps',this._updateTimestamps);for(const ev of['ips:editorUpdated','ips:editorAfterInit']){this.elem.addEventListener(ev,_.debounce(e=>{const{elem,instance}=e.detail;const submit=elem.closest(CSS.supports('selector(a:has(b))')?'form:has(input[type="submit"],button[type="submit"])':'form').querySelectorAll(':is(button, input)[type="submit"]');if(!submit.length){return;}
|
||||
function nodeHasContent(node){if(node.textContent?.trim()?.length){return true;}
|
||||
if(node.isAtom&&!node.isText){return true;}
|
||||
if(node.children&&Symbol.iterator in node.children){for(const child of node.children){if(nodeHasContent(child)){return true;}}}
|
||||
return false;}
|
||||
const empty=!nodeHasContent(instance.state.doc);submit.forEach(item=>{if(empty){item.setAttribute('disabled','');}else{item.removeAttribute('disabled');}})},100));}},clearLocalStorage:function(){ips.utils.db.remove('moderation',$(document).find("[data-feedID]").attr('data-feedID'));},destroy:function(){$(document).off('click','[data-role="multiQuote_'+this._containerID+'"]',this._boundMQ);$(document).off('click','[data-action="clearQuoted_'+this._containerID+'"]',this._boundCMQ);this._stopPolling();},_getUrlParams:function(){const sort=this._getSortValue();const obj={sortby:sort.by||'',sortdirection:sort.order||'',};obj[this._pageParam]=ips.utils.url.getPageNumber(this._pageParam)||1;return obj;},_getSortValue:function(){return{by:'',order:''};},stateChange(e){if(e.detail?.type==='replace'||!('commentFeed'in ips.utils.history.getState())){return;}
|
||||
const state={data:ips.utils.history.getState('commentFeed'),url:window.location.href}
|
||||
if(typeof state.data!=="object"){return;}
|
||||
const lastChange=e.detail.type==='pop'?'pop':ips.utils.history.getLastChangeType()
|
||||
@@ -146,7 +151,7 @@ this._setUpMultiQuote();$(document).trigger('contentChange',[this.scope]);this._
|
||||
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{}},_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._paginatedOnce=true;const urlObj=new URL(data.href,location.href);const queryKey=Object.fromEntries(urlObj.searchParams.entries());if(!(this._pageParam in queryKey)){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;}
|
||||
@@ -156,12 +161,13 @@ window.scrollBy({top:boundingBox.top-30,behavior:'smooth'})});}},_updateURL:func
|
||||
let newUrl=this._getURL();if(newUrl.slice(-1)==='?'){newUrl=newUrl.substring(0,newUrl.length-1);}
|
||||
if(this._seoPagination===true){newUrl=ips.utils.url.pageParamToPath(newUrl,this._pageParam,this.historyState[this._pageParam]);}
|
||||
ips.utils.history.pushState(this.historyState,'commentFeed',newUrl);this._updateDoneCallback=callback;},_updateState(newParams){Object.assign(this._urlParams,newParams);this.historyState={...this._urlParams}
|
||||
Object.assign(this.historyState,{controller:this.controllerID,feedID:this._commentFeedID})},_getURL:function(){const urlObj=new URL(this._baseURL);const skipParams=new Set(['controller','feedID','bypassState']);for(const param in this._urlParams){if(this._urlParams[param]&&!skipParams.has(param)&&!(param===this._pageParam&&Number(this._urlParams[this._pageParam])<=1)){urlObj.searchParams.set(param,this._urlParams[param])}}
|
||||
return urlObj.toString();},editorCompatibility:function(e,data){if(!data.compatible){this.triggerOn('core.front.core.comment','disableQuoting.comment');}},checkedComment:function(e,data){var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};if(data.checked){if(_.isUndefined(dataStore[data.commentID])){dataStore[data.commentID]=data.actions;}}else{delete dataStore[data.commentID];}
|
||||
Object.assign(this.historyState,{controller:this.controllerID,feedID:this._commentFeedID})},_getURL:function(){const urlObj=new URL(this._baseURL);const skipParams=new Set(['controller','feedID','bypassState']);const params={};for(const param in this._urlParams){if(this._urlParams[param]&&!skipParams.has(param)){params[param]=this._urlParams[param].toString();}}
|
||||
urlObj.updateSearchParams({params});return urlObj.toString();},editorCompatibility:function(e,data){if(!data.compatible){this.triggerOn('core.front.core.comment','disableQuoting.comment');}},checkedComment:function(e,data){var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};if(data.checked){if(_.isUndefined(dataStore[data.commentID])){dataStore[data.commentID]=data.actions;}}else{delete dataStore[data.commentID];}
|
||||
if(_.size(dataStore)){ips.utils.db.set('moderation',this._commentFeedID,dataStore,undefined,(Date.now()/1000)+86400);}else{ips.utils.db.remove('moderation',this._commentFeedID);}},_findCheckedComments:function(){if(!this.scope.find('input[type="checkbox"]').length){return;}
|
||||
var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){var sizeOtherPage=0;_.each(dataStore,function(val,key){if(self.scope.find('[data-commentID="'+key+'"]').length){self.scope.find('[data-commentID="'+key+'"] input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{sizeOtherPage++;pageAction.trigger('addManualItem.pageAction',{id:'multimod['+key+']',actions:val});}});if(this.scope.find('[data-ipsAutoCheck]')){this.scope.find('[data-ipsAutoCheck]').trigger('setInitialCount.autoCheck',{count:sizeOtherPage});}}},signatureOptions:function(e,data){data.originalEvent.preventDefault();if(data.selectedItemID=='oneSignature'){this._ignoreSingleSignature($(e.currentTarget).attr('data-memberID'));}else{this._ignoreAllSignatures();}},_ignoreAllSignatures:function(){var self=this;var url=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=settings&do=toggleSigs';var signatures=this.scope.find('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url).done(function(response){ips.ui.flashMsg.show(ips.getString('signatures_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('signatures_error'),callbacks:{}});});},_ignoreSingleSignature:function(memberID){var url=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=ignore&do=ignoreType&type=signatures';var signatures=this.scope.find('[data-role="memberSignature"]').find('[data-memberID="'+memberID+'"]').closest('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url,{data:{member_id:parseInt(memberID)}}).done(function(response){ips.ui.flashMsg.show(ips.getString('single_signature_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('single_signature_error'),callbacks:{}});});},filterClick:function(e){e.preventDefault();var urlObj=ips.utils.url.getURIObject($(e.target).attr('href'));var queryKey=urlObj.queryKey;this._updateURL(queryKey);},quoteComment:function(e,data){if(this.scope.find('[data-role="replyArea"] [data-ipsEditorv5]').length){ips.ui.editorv5.getObjWithInit(this.scope.find('[data-role="replyArea"] [data-ipsEditorv5]'),function(editor){editor.insertQuotes([data]);});}},windowBlur:function(e){if(this._pollingEnabled){Debug.log('Window blurred, pausing polling...');this._pollingPaused=true;}},windowFocus:function(e){if(this._pollingEnabled&&this._pollingPaused){Debug.log('Window focused...');this._pollingPaused=false;if(this._pollOnUnpaused){this._pollOnUnpaused=false;this.pollForNewReplies();}}},handleSocketCommentTrigger:function(){if(!_.isUndefined(this.scope.attr('data-lastPage'))&&this._pollingEnabled){this.pollForNewReplies();}},_startPolling:function(){this._pollingActive=true;Debug.log('Starting polling with interval '+(this._currentPoll/1000)+'s');this._pollingTimeout=setTimeout(()=>{this.pollForNewReplies();},this._currentPoll);},_stopPolling:function(){this._pollingActive=false;if(this._pollingTimeout){clearTimeout(this._pollingTimeout);}
|
||||
Debug.log("Stopped polling for new replies in comment feed.");},pollForNewReplies(){const replyForm=this.scope.find('[data-role="replyArea"] form');const commentsOnThisPage=this.scope.find('[data-commentid]');if(!commentsOnThisPage.length){return;}
|
||||
const lastSeenId=this._getLastSeenID(commentsOnThisPage);const type=$(commentsOnThisPage[commentsOnThisPage.length-1]).attr('data-commentType');if(type.match(/-review$/)){Debug.log("Polling disabled for reviews");this._stopPolling();return;}
|
||||
var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){var sizeOtherPage=0;_.each(dataStore,function(val,key){if(self.scope.find('[data-commentID="'+key+'"]').length){self.scope.find('[data-commentID="'+key+'"] input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{sizeOtherPage++;pageAction.trigger('addManualItem.pageAction',{id:'multimod['+key+']',actions:val});}});if(this.scope.find('[data-ipsAutoCheck]')){this.scope.find('[data-ipsAutoCheck]').trigger('setInitialCount.autoCheck',{count:sizeOtherPage});}}},signatureOptions:function(e,data){data.originalEvent.preventDefault();if(data.selectedItemID=='oneSignature'){this._ignoreSingleSignature($(e.currentTarget).attr('data-memberID'));}else{this._ignoreAllSignatures();}},_ignoreAllSignatures:function(){var self=this;var url=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=settings&do=toggleSigs';var signatures=this.scope.find('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url).done(function(response){ips.ui.flashMsg.show(ips.getString('signatures_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('signatures_error'),callbacks:{}});});},_ignoreSingleSignature:function(memberID){var url=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=ignore&do=ignoreType&type=signatures';var signatures=this.scope.find('[data-role="memberSignature"]').find('[data-memberID="'+memberID+'"]').closest('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url,{data:{member_id:parseInt(memberID)}}).done(function(response){ips.ui.flashMsg.show(ips.getString('single_signature_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('single_signature_error'),callbacks:{}});});},filterClick:function(e){e.preventDefault();var urlObj=ips.utils.url.getURIObject($(e.target).attr('href'));var queryKey=urlObj.queryKey;this._updateURL(queryKey);},quoteComment:function(e,data){if(this.scope.find('[data-role="replyArea"] [data-ipsEditorv5]').length){ips.ui.editorv5.getObjWithInit(this.scope.find('[data-role="replyArea"] [data-ipsEditorv5]'),function(editor){editor.insertQuotes([data]);});}},windowBlur:function(e){if(this._pollingEnabled){Debug.log('Window blurred, pausing polling...');this._pollingPaused=true;}},windowFocus:function(e){if(this._pollingEnabled&&this._pollingPaused){Debug.log('Window focused...');this._pollingPaused=false;if(this._pollOnUnpaused){this._pollOnUnpaused=false;this.pollForNewReplies();}}},handleSocketCommentTrigger:function(){if(!_.isUndefined(this.scope.attr('data-lastPage'))&&this._pollingEnabled){this.pollForNewReplies();}},_startPolling:function(){if(ips.utils.sockets.enabled()&&ips.utils.sockets.connected()){return;}
|
||||
this._pollingActive=true;Debug.log('Starting polling with interval '+(this._currentPoll/1000)+'s');this._pollingTimeout=setTimeout(()=>{this.pollForNewReplies();},this._currentPoll);},_stopPolling:function(){this._pollingActive=false;if(this._pollingTimeout){clearTimeout(this._pollingTimeout);}
|
||||
Debug.log("Stopped polling for new replies in comment feed.");},pollForNewReplies(){const replyForm=this.scope.find('[data-role="replyArea"] form');const commentsOnThisPage=document.querySelectorAll(`[data-feedid="${this.elem.dataset.feedid}"] [data-commentid]`);if(!commentsOnThisPage.length){return;}
|
||||
const lastSeenId=this._getLastSeenID($(commentsOnThisPage));const type=$(commentsOnThisPage[commentsOnThisPage.length-1]).attr('data-commentType');if(type.match(/-review$/)){Debug.log("Polling disabled for reviews");this._stopPolling();return;}
|
||||
if(this._pollingPaused){Debug.log('Window blurred, delaying poll until focused...');this._pollOnUnpaused=true;return;}
|
||||
if(this._pollAjax&&this._pollAjax.abort!==undefined){this._pollAjax.abort();}
|
||||
this._pollAjax=ips.getAjax();this._pollAjax(replyForm.attr('action'),{dataType:'json',data:'do=checkForNewReplies&type=count&lastSeenID='+lastSeenId+'&csrfKey='+ips.getSetting('csrfKey'),type:'post'}).done(response=>{if(response.error&&response.error==='auto_polling_disabled'){this._stopPolling();return;}
|
||||
@@ -184,15 +190,15 @@ form.find("[data-role='commentFormError']").each(function(){$(this).remove();});
|
||||
ips.ui.flashMsg.show(ips.getString('mergedConncurrentPosts'));$(document).trigger('contentChange',[self.scope]);}else{if(response.postedByLoggedInMember){self.trigger('ipsDataLayer',{_key:'content_comment',_properties:response.dataLayer});}
|
||||
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')});}}
|
||||
form.find("[data-role='commentFormError']").each(function(){$(this).remove();});if(autoFollow.length){self.trigger('followingItem',{feedID:self.scope.attr('data-follow-area-id')||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(){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"]`)
|
||||
const content=$('<div/>').append(typeof data.content==='string'?data.content:'');const comment=content.find('.js-ipsEntry');if(comment.length){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=comment.get(0)
|
||||
const id=parseInt(actualContent?.querySelector(`[data-commentid]`)?.dataset.commentid);const existing=Number.isInteger(id)&&this.findCommentInFeed(id);if(existing&&existing.parentElement){existing.parentElement.replaceChild(existing,actualContent);}else{commentFeed.append(comment.css({opacity:"0.001"}));const newItemTop=comment.offset().top;const windowScroll=$(window).scrollTop();const viewHeight=$(window).height();function _showComment(){comment.css({opacity:"1"});ips.utils.anim.go('fadeInDown',comment.filter(':not(.ipsHide)'));}
|
||||
if(data.scrollToItem&&(newItemTop<windowScroll||newItemTop>(windowScroll+viewHeight))){$('html, body').animate({scrollTop:newItemTop+'px'},'fast',function(){setTimeout(_showComment,100);});}else{_showComment();}
|
||||
if(ips.utils.db.isEnabled()){const buttons=comment.find('[data-action="multiQuoteComment"]');buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);}}}else{Debug.log(`core.front.core.commentFeed:addToCommentFeed() - Invalid content provided to addToCommentFeed. The data.content property is supposed to contain HTML with an element that has the \`js-ipsEntry\` class. This may be expected, as in the case of posts held for approval.`);if(Debug.isEnabled()){console.log(data);}}
|
||||
if(!('resetEditor'in data)||data.resetEditor!==false){this.scope.find('[data-role="replyArea"] [data-ipsEditorv5]').data('_editor').reset();}
|
||||
if(ips.utils.db.isEnabled()){const buttons=comment.find('[data-action="multiQuoteComment"]');buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);}}
|
||||
this._updateCount(data.totalItems);this._updateTimestamps();$(document).trigger('contentChange',[this.scope]);},deletedComment:function(e,data){data=$.parseJSON(data.response);var self=this;if(data.type=='redirect'){window.location=data.url;}
|
||||
else{this._updateCount(data.total);}},_updateCount:function(newTotal){if(this.scope.find('[data-role="comment_count"]')){var langString='js_num_comments';if(this.scope.find('[data-role="comment_count"]').attr('data-commentCountString')){langString=this.scope.find('[data-role="comment_count"]').attr('data-commentCountString');}
|
||||
this.scope.find('[data-role="comment_count"]').text(ips.pluralize(ips.getString(langString),newTotal));}},doMultiQuote:function(e){var mqData=this._getMultiQuoteData();var replyArea=this.scope.find('[data-role="replyArea"]');var output=[];var self=this;if(!_.size(mqData)||!replyArea.is(':visible')){return;}
|
||||
@@ -218,12 +224,13 @@ for(const[timeEl,timeStamp]of timestampMap.entries()){const key="time_"+timeStam
|
||||
this._updateCount($(e.target).closest('[data-commentsType]').attr('data-commentsType'),newTotal);},_updateCount:function(type,number){var langString='js_num_'+type;var elem=$('#'+$(this.scope).attr('data-tabsId')+'_tab_'+type);elem.text(ips.pluralize(ips.getString(langString),number));}});}(jQuery,_));;
|
||||
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.ignoredComments',{initialize:function(){this.on('menuItemSelected','[data-action="ignoreOptions"]',this.commentIgnore);},commentIgnore:function(e,data){switch(data.selectedItemID){case'showPost':data.originalEvent.preventDefault();this._showHiddenPost(e,data);break;case'stopIgnoring':data.originalEvent.preventDefault();this._stopIgnoringFromComment(e,data);break;}},_showHiddenPost:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsEntry--ignored');var commentID=ignoreRow.attr('data-ignoreCommentID');var comment=this.scope.find('#'+commentID);ignoreRow.remove();comment.removeClass('ipsHide');},_stopIgnoringFromComment:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsEntry--ignored');var userID=ignoreRow.attr('data-ignoreUserID');var self=this;var posts=this.scope.find('[data-ignoreUserID="'+userID+'"]');posts.each(function(){self.scope.find('#'+$(this).attr('data-ignoreCommentID')).removeClass('ipsHide');$(this).remove();});var url=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=ignore&do=ignoreType&type=topics&off=1';ips.getAjax()(url,{data:{member_id:parseInt(userID)}}).done(function(){ips.ui.flashMsg.show(ips.getString('ignore_prefs_updated'));}).fail(function(){window.location=ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=ignore&do=ignoreType&off=1type=topics&member_id='+userID;});}});}(jQuery,_));;
|
||||
;(function($,_){"use strict";ips.controller.register('core.front.core.instantNotifications',{_pollTimeout:60,_windowInactivePoll:0,_pollMultiplier:1,_messagesEnabled:null,_ajaxObj:null,_debugPolling:true,_browserNotifications:{},_paused:false,_interval:null,_usingRealtime:false,initialize(){this.on(document,ips.utils.events.getVisibilityEvent(),this.windowVisibilityChange);this.on(window,'storage',this.storageChange);this.setup();},setup(){if(!ips.utils.db.isEnabled()||!(window.JSON?.parse instanceof Function)){Debug.warn("Sorry, your browser doesn't support localStorage or JSON so we can't load instant notifications for you.");return;}
|
||||
if(ips.utils.sockets.enabled()){if(ips.utils.sockets.connected){this._useRealtime();}else{this.on(document,'socket.connected',this._useRealtime)}}
|
||||
if(ips.utils.sockets.enabled()){if(ips.utils.sockets.connected()){this._useRealtime();}else{this.on(document,'socket.connected',this._useRealtime)}}
|
||||
this.on(document,`socket.notifications_available`,()=>{Debug.log('Notifications: fetching the latest notification counts');this._useRealtime();this._doAjaxRequest(this._getCurrentCounts());})
|
||||
this._messagesEnabled=this.scope.find('[data-notificationType="inbox"]').length;this._setInterval(this._pollTimeout);this._doInitialCheck();},_useRealtime(){if(!this._usingRealtime){this._stopPolling();this._usingRealtime=true;}},storageChange(e){var event=e.originalEvent;if(event.key!=='notifications.'+ips.getSetting('baseURL')){return;}
|
||||
if(this._debugPolling){Debug.log('Notifications: updating instantly from storage event');}
|
||||
try{var data=JSON.parse(event.newValue);var counts=this._getCurrentCounts();this._updateIcons({messages:parseInt(data.messages),notifications:parseInt(data.notifications)},counts);}catch(err){}},windowVisibilityChange(){var hiddenProp=ips.utils.events.getVisibilityProp();if(!_.isUndefined(hiddenProp)&&!document[hiddenProp]){this._updateBrowserTitle(0);if(!this._usingRealtime){this._pollMultiplier=1;this._windowInactivePoll=0;if(this._paused){this._checkNotifications();this._setInterval(this._pollTimeout);}
|
||||
if(this._debugPolling){Debug.log("Notifications: Resetting inactive poll.");}}}},_setInterval(timeoutInSecs){clearInterval(this._interval);this._interval=setInterval(_.bind(this._checkNotifications,this),timeoutInSecs*1000);},_doInitialCheck(){const storage=ips.utils.db.get('notifications',ips.getSetting('baseURL'));const counts=this._getCurrentCounts();if(!storage||typeof storage!=="object"){return;}
|
||||
if(this._debugPolling){Debug.log("Notifications: Resetting inactive poll.");}}}},_setInterval(timeoutInSecs){clearInterval(this._interval);if(this._usingRealtime){return;}
|
||||
this._interval=setInterval(_.bind(this._checkNotifications,this),timeoutInSecs*1000);},_doInitialCheck(){const storage=ips.utils.db.get('notifications',ips.getSetting('baseURL'));const counts=this._getCurrentCounts();if(!storage||typeof storage!=="object"){return;}
|
||||
if((this._messagesEnabled&&counts.messages>storage.messages)||counts.notifications>storage.notifications){if(this._debugPolling){Debug.log("Notifications: bubbles reporting higher counts for notifications or messages.");}
|
||||
const dataToSend={notifications:storage.notifications};if(this._messagesEnabled)dataToSend.messages=storage.message
|
||||
this._doAjaxRequest(dataToSend);}},_checkNotifications(){const storage=ips.utils.db.get('notifications',ips.getSetting('baseURL'));const timestamp=ips.utils.time.timestamp();const counts=this._getCurrentCounts();const currentTimeout=this._pollTimeout*this._pollMultiplier;if(document[ips.utils.events.getVisibilityProp()]){if(this._windowInactivePoll>=3&&this._pollMultiplier===1){if(this._debugPolling){Debug.log("Notifications: Polled over 3 minutes, increasing multiplier to 2");}
|
||||
@@ -284,8 +291,7 @@ if(!data.content?.content_id||parseInt(data.content.content_id)!==this._getItemI
|
||||
if((data?.content?.comment_id||null)!==this._getCommentId()){return;}
|
||||
if('count'in data&&'score'in data){if(typeof data.blurb!=="string"||this.scope.get(0).querySelector(`[data-action='reactLaunch'].ipsReact_reacted`)){data.blurb=await this._fetchBlurb();}
|
||||
if(typeof data.blurb!=="string"){return;}
|
||||
this._updateReaction(data);}},async _fetchBlurb(){try{const reactionUrl=this.scope.get(0).querySelector(`[data-role='reaction'][href]`)?.getAttribute('href');if(!reactionUrl)return null;let url=new URL(reactionUrl);url.searchParams.delete('csrfKey');url.searchParams.delete('reaction');url.searchParams.delete('do');url.searchParams.set('do',`reactionBlurb${this._getCommentId() ? 'Comment' : ''}`)
|
||||
const response=await ips.fetch(url.toString())
|
||||
this._updateReaction(data);}},async _fetchBlurb(){try{const reactionUrl=this.scope.get(0).querySelector(`[data-role='reaction'][href]`)?.getAttribute('href');if(!reactionUrl)return null;let url=new URL(reactionUrl);url.updateSearchParams({params:{csrfKey:null,reaction:null,do:`reactionBlurb${this._getCommentId() ? "Comment" : ""}`,}});const response=await ips.fetch(url.toString())
|
||||
if(typeof response?.blurb==='string'){return response.blurb;}}catch(e){}
|
||||
return null;},_getCommentId(){if($(this.scope).get(0)?.closest(`[data-commentid]`)){return parseInt($(this.scope).get(0)?.closest(`[data-commentid]`).dataset.commentid)||null}
|
||||
return null;},_getItemId(){return parseInt($(this.scope).get(0)?.closest('[data-feedid]')?.dataset.feedid.match(/(\d+)$/)?.[1])||parseInt(document.body.dataset?.pageid)||null},clickLaunchReaction(){if(!ips.utils.events.isTouchDevice()||this._singleReaction){return;}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|conLine truncated
|
||||
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-mLine truncated
|
||||
!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e}function o(t,e,r){return this instanceof o?("string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=n(t),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new o(t,e,r)}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var h=t.jQuery,a=t.console;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&d[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var d={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var i=new s(t,e);this.images.push(i)},o.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},o.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("loaLine truncated
|
||||
(function(e,t,n,r,i){function T(t){t=t.split(")");var n=e.trim,i=-1,s=t.length-1,o,u,a,f=h?new Float32Array(6):[],l=h?new Float32Array(6):[],c=h?new Float32Array(6):[1,0,0,1,0,0];f[0]=f[3]=c[0]=c[3]=1;f[1]=f[2]=f[4]=f[5]=0;while(++i<s){o=t[i].split("(");u=n(o[0]);a=o[1];l[0]=l[3]=1;l[1]=l[2]=l[4]=l[5]=0;switch(u){case b+"X":l[4]=parseInt(a,10);break;case b+"Y":l[5]=parseInt(a,10);break;case b:a=a.split(",");l[4]=parseInt(a[0],10);l[5]=parseInt(a[1]||0,10);break;case w:a=M(a);l[0]=r.cos(a);l[1]=r.sin(a);l[2]=-r.sin(a);l[3]=r.cos(a);break;case E+"X":l[0]=+a;break;case E+"Y":l[3]=a;break;case E:a=a.split(",");l[0]=a[0];l[3]=a.length>1?a[1]:a[0];break;case S+"X":l[2]=r.tan(M(a));break;case S+"Y":l[1]=r.tan(M(a));break;case x:a=a.split(",");l[0]=a[0];l[1]=a[1];l[2]=a[2];l[3]=a[3];l[4]=parseInt(a[4],10);l[5]=parseInt(a[5],10);break}c[0]=f[0]*l[0]+f[2]*l[1];c[1]=f[1]*l[0]+f[3]*l[1];c[2]=f[0]*l[2]+f[2]*l[3];c[3]=f[1]*l[2]+f[3]*l[3];c[4]=f[0]*l[4]+f[2]*l[5]+f[4];c[5]=f[1]*l[4]+f[3]*l[5]+f[5];f=[c[0],c[1],c[2],c[3],c[4],c[5]]}return c}function N(e){var t,n,i,s=e[0],o=e[1],u=e[2],a=e[3];if(s*a-o*u){t=r.sqrt(s*s+o*o);s/=t;o/=t;i=s*u+o*a;u-=s*i;a-=o*i;n=r.sqrt(u*u+a*a);u/=n;a/=n;i/=n;if(s*a<o*u){s=-s;o=-o;i=-i;t=-t}}else{t=n=i=0}return[[b,[+e[4],+e[5]]],[w,r.atan2(o,s)],[S+"X",r.atan(i)],[E,[t,n]]]}function C(t,n){var r={start:[],end:[]},i=-1,s,o,u,a;(t=="none"||L(t))&&(t="");(n=="none"||L(n))&&(n="");if(t&&n&&!n.indexOf("matrix")&&_(t).join()==_(n.split(")")[0]).join()){r.origin=t;t="";n=n.slice(n.indexOf(")")+1)}if(!t&&!n){return}if(!t||!n||A(t)==A(n)){t&&(t=t.split(")"))&&(s=t.length);n&&(n=n.split(")"))&&(s=n.length);while(++i<s-1){t[i]&&(o=t[i].split("("));n[i]&&(u=n[i].split("("));a=e.trim((o||u)[0]);O(r.start,k(a,o?o[1]:0));O(r.end,k(a,u?u[1]:0))}}else{r.start=N(T(t));r.end=N(T(n))}return r}function k(e,t){var n=+!e.indexOf(E),r,i=e.replace(/e[XY]/,"e");switch(e){case b+"Y":case E+"Y":t=[n,t?parseFloat(t):n];break;case b+"X":case b:case E+"X":r=1;case E:t=t?(t=t.split(","))&&[parseFloat(t[0]),parseFloat(t.length>1?t[1]:e==E?r||t[0]:n+"")]:[n,n];break;case S+"X":case S+"Y":case w:t=t?M(t):0;break;case x:return N(t?_(t):[1,0,0,1,0,0]);break}return[[i,t]]}function L(e){return m.test(e)}function A(e){return e.replace(/(?:\([^)]*\))|\s/g,"")}function O(e,t,n){while(n=t.shift()){e.push(n)}}function M(e){return~e.indexOf("deg")?parseInt(e,10)*(r.PI*2/360):~e.indexOf("grad")?parseInt(e,10)*(r.PI/200):parseFloat(e)}function _(e){e=/([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(e);return[e[1],e[2],e[3],e[4],e[5],e[6]]}var s=n.createElement("div"),o=s.style,u="Transform",a=["O"+u,"ms"+u,"Webkit"+u,"Moz"+u],f=a.length,l,c,h="Float32Array"in t,p,d,v=/Matrix([^)]*)/,m=/^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/,g="transform",y="transformOrigin",b="translate",w="rotate",E="scale",S="skew",x="matrix";while(f--){if(a[f]in o){e.support[g]=l=a[f];e.support[y]=l+"Origin";continue}}if(!l){e.support.matrixFilter=c=o.filter===""}e.cssNumber[g]=e.cssNumber[y]=true;if(l&&l!=g){e.cssProps[g]=l;e.cssProps[y]=l+"Origin";if(l=="Moz"+u){p={get:function(t,n){return n?e.css(t,l).split("px").join(""):t.style[l]},set:function(e,t){e.style[l]=/matrix\([^)p]*\)/.test(t)?t.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/,x+"$1$2px,$3px"):t}}}else if(/^1\.[0-5](?:\.|$)/.test(e.fn.jquery)){p={get:function(t,n){return n?e.css(t,l.replace(/^ms/,"Ms")):t.style[l]}}}}else if(c){p={get:function(t,n,r){var s=n&&t.currentStyle?t.currentStyle:t.style,o,u;if(s&&v.test(s.filter)){o=RegExp.$1.split(",");o=[o[0].split("=")[1],o[2].split("=")[1],o[1].split("=")[1],o[3].split("=")[1]]}else{o=[1,0,0,1]}if(!e.cssHooks[y]){o[4]=s?parseInt(s.left,10)||0:0;o[5]=s?parseInt(s.top,10)||0:0}else{u=e._data(t,"transformTranslate",i);o[4]=u?u[0]:0;o[5]=u?u[1]:0}return r?o:x+"("+o+")"},set:function(t,n,r){var i=t.style,s,o,u,a;if(!r){i.zoom=1}n=T(n);o=["Matrix("+"M11="+n[0],"M12="+n[2],"M21="+n[1],"M22="+n[3],"SizingMethod='auto expand'"].join();u=(s=t.currentStyle)&&s.filter||i.filter||"";i.filter=v.test(u)?u.replace(v,o):u+" progid:DXImageTransform.Microsoft."+o+")";if(!e.cssHooks[y]){if(a=e.transform.centerOrigin){i[a=="margin"?"marginLeft":"left"]=-(t.offsetWidth/2)+t.clientWidth/2+"px";i[a=="margin"?"marginTop":"top"]=-(t.offsetHeight/2)+t.clientHeight/2+"px"}i.left=n[4]+"px";i.top=n[5]+"px"}else{e.cssHooks[y].set(t,n)}}}}if(p){e.cssHooks[g]=p}d=p&&p.get||e.css;e.fx.step.transform=function(t){var n=t.elem,i=t.start,s=t.end,o=t.pos,u="",a=1e5,f,h,v,m;if(!i||typeof i==="string"){if(!i){i=d(n,l)}if(c){n.style.zoom=1}s=s.split("+=").join(i);e.extend(t,C(i,s));i=t.start;s=t.end}f=i.length;while(f--){h=i[f];v=s[f];m=+false;switch(h[0]){case b:m="px";case E:m||(m="");u=h[0]+"("+r.round((h[1][0]+(v[1][0]-h[1][0])*o)*a)/a+m+","+r.round((h[1][1]+(v[1][1]-h[1][1])*o)*a)/a+m+")"+u;break;case S+"X":case S+"Y":case w:u=h[0]+"("+r.round((h[1]+(v[1]-h[1])*o)*a)/a+"rad)"+u;break}}t.origin&&(u=t.origin+u);p&&p.set?p.set(n,u,+true):n.styleLine truncated
|
||||
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=global||self,global.Mustache=factory())})(this,function(){"use strict";var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}function primitiveHasOwnProperty(primitive,propName){return primitive!=null&&typeof primitive!=="object"&&primitive.hasOwnProperty&&primitive.hasOwnProperty(propName)}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var lineHasNonSpace=false;var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;var indentation="";var tagIndex=0;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length);indentation+=chr}else{nonSpace=true;lineHasNonSpace=true;indentation+=" "}tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n"){stripSpace();indentation="";tagIndex=0;lineHasNonSpace=false}}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==="{"){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type="&"}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error("Unclosed tag at "+scanner.pos);if(type==">"){token=[type,value,start,scanner.pos,indentation,tagIndex,lineHasNonSpace]}else{token=[type,value,start,scanner.pos]}tagIndex++;tokens.push(token);if(type==="#"||type==="^"){sections.push(token)}else if(type==="/"){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==="name"||type==="{"||type==="&"){nonSpace=true}else if(type==="="){compileTags(value)}}stripSpace();openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==="text"&&lastToken&&lastToken[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case"#":case"^":collector.push(token);sections.push(token);collector=token[4]=[];break;case"/":section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};ScannerLine truncated
|
||||
var Debug=Debug||{};;(function($,_,undefined){"use strict";Debug=function(){var options={enabled:false,level:1,adapters:[]};var LEVEL={DEBUG:1,INFO:2,WARN:3,ERROR:4};var debug=function(msg){logMessage(LEVEL.DEBUG,msg);return Debug;},info=function(msg){logMessage(LEVEL.INFO,msg);return Debug;},warn=function(msg){logMessage(LEVEL.WARN,msg);return Debug;},error=function(msg){logMessage(LEVEL.ERROR,msg);return Debug;},logMessage=function(level,message){if(options.enabled&&level>=options.level&&options.adapters.length){for(let i=0;i<options.adapters.length;i++){options.adapters[i].write(level,message);}}
|
||||
return Debug;},setEnabled=function(enabled){options.enabled=(enabled===false)?false:true;return Debug;},isEnabled=function(){return options.enabled;},setLevel=function(level){if(LEVEL[level]){options.level=LEVEL[level];}
|
||||
@@ -11,7 +10,8 @@ return Debug;},clearAdapters=function(){options.adapters=[];return Debug;};retur
|
||||
break;case 2:console.info(msg);break;case 3:console.warn(msg);break;case 4:console.error(msg);break;}}};Debug.addAdapter(new Console);if(ipsDebug||(!_.isUndefined(window.localStorage)&&'localStorage'in window&&window['localStorage']!==null&&window.localStorage.getItem('DEBUG'))){Debug.setEnabled(true).setLevel('DEBUG').info("Enabled logging");}}(jQuery,_));;
|
||||
var ips=ips||{};jQuery.migrateMute=true;(function($,_,undefined){class CustomSubmitEvent extends Event{submitter=undefined;originalEvent=undefined;constructor(originalEvent){super('submit',{bubbles:true});this.submitter=originalEvent.submitter;this.originalEvent=originalEvent;}}
|
||||
"use strict";let logTimeIndent=0;ips=(function(){var _settings,_strings={},_graphData={},uid=1,urand=Math.ceil(Math.random()*10000),elemContainer,_location='front';var boot=function(config){_settings=config;_setAjaxConfig();_setAjaxEventListeners();document.addEventListener('submit',e=>{const form=e.target;if(e instanceof SubmitEvent&&form instanceof HTMLFormElement&&form.method.toUpperCase()==='POST'&&!getSetting('memberID')&&getCsrfKeyExpiry()<Date.now()/1000){Debug.log(`Intercepted form submission... fetching fresh CSRF key`);e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();getFreshCsrfKey().then(()=>{Debug.log(`Got a new CSRF key, resuming the form submission`);let submitButton=(e instanceof SubmitEvent||e.submitter instanceof Element)?e.submitter:form.querySelector('button[type="submit"], button:not([type]), input[type="submit"]');if(submitButton){submitButton.click();}else{const ev=new CustomSubmitEvent(e);form.dispatchEvent(ev);if(ev.defaultPrevented){return;}
|
||||
form.submit();}});}},{capture:true});$.fn.animationComplete=function(callback){return $(this).one('webkitAnimationEnd animationend',function(e){if(e.target==this){callback.apply(this);}});};$.fn.identify=function(){return this.each(function(){if(!this.id){this.id='ips_uid_'+urand+'_'+(++uid);}});};var oldProp=$.fn.prop;var newProp=function(){var retFunc=oldProp.apply(this,arguments);this.trigger('propChanged',this);return retFunc;};$.fn.prop=newProp;Function.prototype.method=function(name,func){this.prototype[name]=func;return this;};_.templateSettings={interpolate:/\{\{(.+?)\}\}/g
|
||||
form.submit();}});}},{capture:true});$.fn.animationComplete=function(callback){if('getAnimations'in Element.prototype){const elements=[...this];(new Promise(resolve=>setTimeout(resolve,0))).then(()=>Promise.allSettled((elements.map(el=>el.getAnimations()).flat()).map(anim=>anim.finished))).then(()=>callback.apply(this));return $(this);}
|
||||
return $(this).one('webkitAnimationEnd animationend',function(e){if(e.target==this){callback.apply(this);}});};$.fn.identify=function(){return this.each(function(){if(!this.id){this.id='ips_uid_'+urand+'_'+(++uid);}});};var oldProp=$.fn.prop;var newProp=function(){var retFunc=oldProp.apply(this,arguments);this.trigger('propChanged',this);return retFunc;};$.fn.prop=newProp;Function.prototype.method=function(name,func){this.prototype[name]=func;return this;};_.templateSettings={interpolate:/\{\{(.+?)\}\}/g
|
||||
};if(!Debug.isEnabled()&&window.console){window.console.log("%cThis is a browser feature intended for developers. Do not paste any code here given to you by someone else. It may compromise your account or have other negative side effects.","font-weight: bold; font-size: 14px;");}
|
||||
$(document).trigger('doneBooting').ready(function(){_location=$('body').attr('data-pageLocation')||'front';});},getAjax=function(){const wrap=method=>(...args)=>{let options={},url;if(typeof args[0]==='string'){url=args[0];options=args[1]||{};}else if(typeof args[0]==='object'&&args[0]){options=args[0];}
|
||||
if((options.method||options.type)?.toLowerCase()!=='post'||getSetting('memberID')||getCsrfKeyExpiry()>=Date.now()/1000){return method(...args);}
|
||||
@@ -51,7 +51,7 @@ delete options.traditional
|
||||
delete options.xhr
|
||||
delete options.xhrFields
|
||||
if(options.type&&!options.method){options.method=options.type;delete options.type;}
|
||||
getAjax()(options).done(resolve).fail(reject)})},getContainer=function(){var tryThis=$(getSetting('container'));return(tryThis.length)?tryThis:$('body');},_refreshCsrfKey=async function(){setSetting('csrfKeyExpiry',Math.floor(Date.now()/1000+20));try{const response=await window.fetch(getSetting('baseURL').toString().replace(/\/+$/,'')+'/?app=core&module=system&controller=ajax&do=getCsrfKey&path='+window.location.pathname);const data=await response.json();Debug.log(`Got new CSRF Key: ${data.key}`);setSetting('csrfKey',data.key);setSetting('csrfKeyExpiry',typeof data.expiry==="number"?data.expiry:Math.floor(Date.now()/1000+500));_setAjaxConfig();document.querySelectorAll(`form input[name="csrfKey"]`).forEach(input=>{input.value=data.key;});document.querySelectorAll(`form:is([action*="?csrfKey="],[action*="&csrfKey="])`).forEach(form=>{const url=new URL(form.action);if((url.toString().startsWith('https:'+ips.getSetting('baseURL'))||url.toString().startsWith('http:'+ips.getSetting('baseURL')))&&(url.searchParams.has('csrfKey')||form.method.toLowerCase()!=='get')){url.searchParams.set('csrfKey',data.key);form.action=url.toString();}});document.querySelectorAll(`[href*="?csrfKey="], [href*="&csrfKey="]`).forEach(linkLikeEl=>{const url=new URL(linkLikeEl.href||linkLikeEl.getAttribute('href'));if((url.toString().startsWith('https:'+ips.getSetting('baseURL'))||url.toString().startsWith('http:'+ips.getSetting('baseURL')))&&url.searchParams.has('csrfKey')){url.searchParams.set('csrfKey',data.key);linkLikeEl.setAttribute('href',url.toString());}});document.dispatchEvent(new CustomEvent('ips:csrfKeyUpdated'));}catch(e){Debug.warn(e);}},getCsrfKeyExpiry=function(){const setting=getSetting('csrfKeyExpiry');if(typeof setting==="number"&&!Number.isNaN(setting)&&getSetting('csrfKey')){return setting;}
|
||||
getAjax()(options).done(resolve).fail(reject)})},getContainer=function(){var tryThis=$(getSetting('container'));return(tryThis.length)?tryThis:$('body');},_refreshCsrfKey=async function(){setSetting('csrfKeyExpiry',Math.floor(Date.now()/1000+20));try{const response=await window.fetch(getSetting('baseURL').toString().replace(/\/+$/,'')+'/?app=core&module=system&controller=ajax&do=getCsrfKey&path='+window.location.pathname);const data=await response.json();Debug.log(`Got new CSRF Key: ${data.key}`);setSetting('csrfKey',data.key);setSetting('csrfKeyExpiry',typeof data.expiry==="number"?data.expiry:Math.floor(Date.now()/1000+500));_setAjaxConfig();document.querySelectorAll(`form input[name="csrfKey"]`).forEach(input=>{input.value=data.key;});document.querySelectorAll(`form:is([action*="?csrfKey="],[action*="&csrfKey="])`).forEach(form=>{const url=new URL(form.action);if((url.toString().startsWith('https:'+ips.getSetting('baseURL'))||url.toString().startsWith('http:'+ips.getSetting('baseURL')))&&(url.searchParams.has('csrfKey')||form.method.toLowerCase()!=='get')){url.updateSearchParams({param:'csrfKey',value:data.key});form.action=url.toString();}});document.querySelectorAll(`[href*="?csrfKey="], [href*="&csrfKey="]`).forEach(linkLikeEl=>{const url=new URL(linkLikeEl.href||linkLikeEl.getAttribute('href'));if((url.toString().startsWith('https:'+ips.getSetting('baseURL'))||url.toString().startsWith('http:'+ips.getSetting('baseURL')))&&url.searchParams.has('csrfKey')){url.updateSearchParams({param:'csrfKey',value:data.key});linkLikeEl.setAttribute('href',url.toString());}});document.dispatchEvent(new CustomEvent('ips:csrfKeyUpdated'));}catch(e){Debug.warn(e);}},getCsrfKeyExpiry=function(){const setting=getSetting('csrfKeyExpiry');if(typeof setting==="number"&&!Number.isNaN(setting)&&getSetting('csrfKey')){return setting;}
|
||||
return 0;},getFreshCsrfKey=async function(){if(getSetting('memberID')&&getSetting('csrfKey')){return getSetting('csrfKey');}
|
||||
if(Date.now()/1000>=getCsrfKeyExpiry()){await _refreshCsrfKey();}
|
||||
return getSetting('csrfKey');},_setAjaxConfig=function(){var data={csrfKey:getSetting('csrfKey')};$.ajaxSetup({data:data,cache:true});},_setAjaxEventListeners=function(){var count=0;$(document).ajaxSend(function(event,request,settings){if(!_.isUndefined(settings)&&settings.showLoading===true){if(!$('#elAjaxLoading').length){getContainer().append(templates.render('core.general.ajax'));}
|
||||
|
||||
Reference in new issue
Block a user