Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -63,7 +63,7 @@ else if(this.storedValues.dates.start){this.scope.find('[data-role="dateSummary"
|
||||
else if(this.storedValues.dates.end){this.scope.find('[data-role="dateSummary"]').text('('+ips.getString('beforeX',{end:ips.utils.time.localeDateString(ips.utils.time.removeTimezone(new Date(this.storedValues.dates.end)))})+')');}
|
||||
else
|
||||
{this.scope.find('[data-role="dateSummary"]').text('');}
|
||||
this._updateURL();},_toggleButtonRow:function(e,type){e.preventDefault();var val=$(e.currentTarget).attr('data-'+type);this.scope.find('[data-'+type+']').removeClass('ipsButtonGroup__button--active').removeAttr('data-selected').filter('[data-'+type+'="'+val+'"]').addClass('ipsButtonGroup__button--active').attr('data-selected',true);this.storedValues[type]=val;this._resetFilters();this._updateURL();},_resetFilters:function(){var self=this;this.storedValues.filters=[];$('#el'+this.identifier+'Filter_menu').find('.ipsMenu_itemChecked').each(function(){self.storedValues.filters.push($(this).attr('data-ipsMenuValue'));});},_skipUpdate:false,_updateURL:function(){if(this._skipUpdate===true){this._skipUpdate=false;return;}
|
||||
this._updateURL();},_toggleButtonRow:function(e,type){e.preventDefault();var val=$(e.currentTarget).attr('data-'+type);this.scope.find('[data-'+type+']').removeClass('ipsButton--active').removeAttr('data-selected').filter('[data-'+type+'="'+val+'"]').addClass('ipsButton--active').attr('data-selected',true);this.storedValues[type]=val;this._resetFilters();this._updateURL();},_resetFilters:function(){var self=this;this.storedValues.filters=[];$('#el'+this.identifier+'Filter_menu').find('.ipsMenu_itemChecked').each(function(){self.storedValues.filters.push($(this).attr('data-ipsMenuValue'));});},_skipUpdate:false,_updateURL:function(){if(this._skipUpdate===true){this._skipUpdate=false;return;}
|
||||
var url=this._buildURL();var chartArea=this.scope.find('[data-role="chart"]');chartArea.css('height',chartArea.height()).html('').addClass('ipsLoading');ips.getAjax()(this.scope.attr('data-chart-url'),{data:url,type:'post'}).done(function(response){chartArea.css('height','auto').html(response);$(document).trigger('contentChange',[chartArea]);}).always(function(){chartArea.removeClass('ipsLoading');});$('button[data-role="applyFilters"]').prop('disabled',true);this.scope.find('[data-role="downloadChart"]').attr('href',this.scope.attr('data-chart-url')+'&'+url+'&download=1');},_buildURL:function(){var pieces=[];var self=this;pieces.push("noheader=1");pieces.push("timescale["+this.identifier+"]="+this.storedValues.timescale);if(!_.isUndefined(this.storedValues.type)){pieces.push("type["+this.identifier+"]="+this.storedValues.type);}
|
||||
if(!_.isUndefined(this.storedValues.term)&&!_.isNull(this.storedValues.term)){pieces.push("search["+this.identifier+"]="+this.storedValues.term);}
|
||||
_.each(this.storedValues.filters,function(value,idx){pieces.push("filters["+self.identifier+"]["+idx+"]="+value);});if(this.storedValues.dates.start||this.storedValues.dates.end){pieces.push("start["+this.identifier+"]="+this.storedValues.dates.start);pieces.push("end["+this.identifier+"]="+this.storedValues.dates.end);}
|
||||
|
||||
@@ -3,7 +3,7 @@ ips.templates.set('core.tooltip'," <div id='{{id}}' class='ipsTooltip' role='to
|
||||
<div class='ipsPixabayThumb' {{#width}}{{#height}}style="--i-ratio: {{width}} / {{height}}"{{/height}}{{/width}}>
|
||||
<img loading="lazy" {{#width}}width='{{width}}'{{/width}} {{#height}}height='{{height}}'{{/height}} src="{{thumb}}" class="ipsPixabayImage" data-url="{{url}}" data-id="{{imgid}}" alt="">
|
||||
</div>
|
||||
`);ips.templates.set('core.editor.emoticons'," <div class='ipsMenu ipsMenu_wide' id='{{id}}_menu' style='display: none' data-editorID='{{editor}}' data-controller='core.global.editor.emoticons'> <div class='ipsMenu_headerBar'> <h4 class='ipsTitle ipsTitle--h4'>{{#lang}}emoji{{/lang}}</h4> <div class='i-flex i-gap_2'> <a href='#' class='i-color_inherit ipsHide' data-role='skinToneMenu' data-ipsMenu data-ipsMenu-appendTo='#{{id}}_menu' id='{{id}}_tones'>{{#lang}}emoji_skin_tone{{/lang}} <i class='fa-solid fa-caret-down'></i></a> <a href='#' class='i-color_inherit ipsHide' data-role='categoryTrigger' data-ipsMenu data-ipsMenu-appendTo='#{{id}}_menu' id='{{id}}_more'>{{#lang}}emoticonCategories{{/lang}} <i class='fa-solid fa-caret-down'></i></a> </div> <ul class='ipsMenu ipsMenu_veryNarrow i-cursor_pointer' id='{{id}}_tones_menu' role='menu' style='display: none'> <li class='ipsMenu_title'>{{#lang}}emoji_skin_tone{{/lang}}</li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='none'><a>{{#lang}}emoji_skin_tone_default{{/lang}}</a></li> <li class='ipsMenu_sep'><hr></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='light'><a>\uD83C\uDFFB {{#lang}}emoji_skin_tone_light{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium-light'><a>\uD83C\uDFFC {{#lang}}emoji_skin_tone_medium_light{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium'><a>\uD83C\uDFFD {{#lang}}emoji_skin_tone_medium{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium-dark'><a>\uD83C\uDFFE {{#lang}}emoji_skin_tone_medium_dark{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='dark'><a>\uD83C\uDFFF {{#lang}}emoji_skin_tone_dark{{/lang}}</a></li> </ul> <ul data-role='categoryMenu' class='ipsMenu ipsMenu_auto i-cursor_pointer' id='{{id}}_more_menu' role='menu' style='display: none'> </ul> </div> <div class='ipsMenu_innerContent'> <div class='ipsEmoticons_content'> <div class='ipsEmpty ipsEmoticons_contentLoading' data-role='emojiLoading'> {{#lang}}loading{{/lang}}... </div> </div> </div> <div class='ipsMenu_footerBar'> <input type='text' data-role='emoticonSearch' class='ipsInput ipsInput--wide' placeholder='{{#lang}}emoticonFind{{/lang}}'> </div></div>");ips.templates.set('core.editor.emoticonSection'," <div data-panel='{{id}}'>{{{content}}}</div>");ips.templates.set('core.editor.emoticonMenu'," <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='{{categoryID}}'><a><span class='ipsMenu_itemCount'>{{count}}</span>{{title}}</a></li>");ips.templates.set('core.editor.emoticonCategory'," <div class='i-background_2 i-padding_2'><strong>{{title}}</strong></div> <div class='ipsEmoticons_category' data-categoryid='{{categoryID}}'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonSearch'," <div class='ipsEmoticons_category'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonRow'," <div class='ipsEmoticons_row ipsEmoji'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonItem'," <div class='ipsEmoticons_item' data-emoticon='{{tag}}' src='{{src}}' data-height='{{height}}' data-width='{{width}}' title='{{tag}}' loading='lazy'>{{{img}}}</div>");ips.templates.set('core.editor.emoji'," <div class='ipsEmoticons_item' title='{{name}}' data-emoji='{{code}}'>{{{display}}}</div>");ips.templates.set('core.editor.emojiNotNative'," <div class='ipsEmoticons_item' title='{{name}}' data-emoji='{{code}}'>{{{img}}}</div>");ips.templates.set('core.editor.emoticonBlank'," <div class='ipsEmoticons_item'> </div>");ips.templates.set('core.editor.emoticonNoResults'," <div class='i-padding_3 i-text-align_center i-color_soft'>{{#lang}}no_results{{/lang}}</div>");ips.templates.set('core.editor.emojiResult'," <li class='ipsMenu_item i-cursor_pointer' title='{{name}}' data-emoji='{{code}}'> <a><span class='ipsEmoji_result'>{{{emoji}}}</span> <span data-role='shortCode'>{{short_code}}</span></a> </li>");ips.templates.set('core.editor.quote',"<blockquote class='ipsQuote' data-ipsQuote data-gramm='false' cite='{{citeurl}}'><div class='ipsQuote_citation'>{{citation}}</div><div class='ipsQuote_contents ipsClearfix' data-gramm='false'>{{{contents}}}</div></blockquote>");ips.templates.set('core.editor.legacyQuoteUpcast',"<div class='ipsQuote_citation'>{{citation}}</div><div class='ipsQuote_contents ipsClearfix' data-gramm='false'>{{{contents}}}</div>");ips.templates.set('core.editor.citation'," <div class='ipsQuote_citation ipsQuote_open'> <a href='#' data-action='toggleQuote' aria-label='{{#lang}}toggle_quote{{/lang}}'> </a> {{#contenturl}} <a href='{{contenturl}}' class='ipsQuote_citation-origin'><i class='fa-solid fa-share'></i></a> {{/contenturl}} {{{citation}}} </div>");ips.templates.set('core.editor.citationLink'," <a href='{{baseURL}}?app=core&module=members&controller=profile&id={{userid}}' data-ipsHover data-ipshover-target='{{baseUR
Line truncated
|
||||
`);ips.templates.set('core.editor.emoticons'," <div class='ipsMenu ipsMenu_wide' id='{{id}}_menu' style='display: none' data-editorID='{{editor}}' data-controller='core.global.editor.emoticons'> <div class='ipsMenu_headerBar'> <h4 class='ipsTitle ipsTitle--h4'>{{#lang}}emoji{{/lang}}</h4> <div class='i-flex i-gap_2'> <a href='#' class='i-color_inherit ipsHide' data-role='skinToneMenu' data-ipsMenu data-ipsMenu-appendTo='#{{id}}_menu' id='{{id}}_tones'>{{#lang}}emoji_skin_tone{{/lang}} <i class='fa-solid fa-caret-down'></i></a> <a href='#' class='i-color_inherit ipsHide' data-role='categoryTrigger' data-ipsMenu data-ipsMenu-appendTo='#{{id}}_menu' id='{{id}}_more'>{{#lang}}emoticonCategories{{/lang}} <i class='fa-solid fa-caret-down'></i></a> </div> <ul class='ipsMenu ipsMenu_veryNarrow i-cursor_pointer' id='{{id}}_tones_menu' role='menu' style='display: none'> <li class='ipsMenu_title'>{{#lang}}emoji_skin_tone{{/lang}}</li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='none'><a>{{#lang}}emoji_skin_tone_default{{/lang}}</a></li> <li class='ipsMenu_sep'><hr></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='light'><a>\uD83C\uDFFB {{#lang}}emoji_skin_tone_light{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium-light'><a>\uD83C\uDFFC {{#lang}}emoji_skin_tone_medium_light{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium'><a>\uD83C\uDFFD {{#lang}}emoji_skin_tone_medium{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='medium-dark'><a>\uD83C\uDFFE {{#lang}}emoji_skin_tone_medium_dark{{/lang}}</a></li> <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='dark'><a>\uD83C\uDFFF {{#lang}}emoji_skin_tone_dark{{/lang}}</a></li> </ul> <ul data-role='categoryMenu' class='ipsMenu ipsMenu_auto i-cursor_pointer' id='{{id}}_more_menu' role='menu' style='display: none'> </ul> </div> <div class='ipsMenu_innerContent'> <div class='ipsEmoticons_content'> <div class='ipsEmpty ipsEmoticons_contentLoading' data-role='emojiLoading'> {{#lang}}loading{{/lang}}... </div> </div> </div> <div class='ipsMenu_footerBar'> <input type='text' data-role='emoticonSearch' class='ipsInput ipsInput--wide' placeholder='{{#lang}}emoticonFind{{/lang}}'> </div></div>");ips.templates.set('core.editor.emoticonSection'," <div data-panel='{{id}}'>{{{content}}}</div>");ips.templates.set('core.editor.emoticonMenu'," <li class='ipsMenu_item' role='menuitem' data-ipsMenuValue='{{categoryID}}'><a><span class='ipsMenu_itemCount'>{{count}}</span>{{title}}</a></li>");ips.templates.set('core.editor.emoticonCategory'," <div class='i-background_2 i-padding_2'><strong>{{title}}</strong></div> <div class='ipsEmoticons_category' data-categoryid='{{categoryID}}'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonSearch'," <div class='ipsEmoticons_category'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonRow'," <div class='ipsEmoticons_row ipsEmoji'>{{{emoticons}}}</div>");ips.templates.set('core.editor.emoticonItem'," <div class='ipsEmoticons_item' data-emoticon='{{tag}}' src='{{src}}' data-height='{{height}}' data-width='{{width}}' title='{{tag}}' loading='lazy'>{{{img}}}</div>");ips.templates.set('core.editor.emoji'," <div class='ipsEmoticons_item' title='{{name}}' data-emoji='{{code}}'>{{{display}}}</div>");ips.templates.set('core.editor.emojiNotNative'," <div class='ipsEmoticons_item' title='{{name}}' data-emoji='{{code}}'>{{{img}}}</div>");ips.templates.set('core.editor.emoticonBlank'," <div class='ipsEmoticons_item'> </div>");ips.templates.set('core.editor.emoticonNoResults'," <div class='i-padding_3 i-text-align_center i-color_soft'>{{#lang}}no_results{{/lang}}</div>");ips.templates.set('core.editor.emojiResult'," <li class='ipsMenu_item i-cursor_pointer' title='{{name}}' data-emoji='{{code}}'> <a><span class='ipsEmoji_result'>{{{emoji}}}</span> <span data-role='shortCode'>{{short_code}}</span></a> </li>");ips.templates.set('core.editor.quote',"<blockquote class='ipsQuote' data-ipsQuote data-gramm='false' cite='{{citeurl}}'><div class='ipsQuote_citation'>{{{citation}}}</div><div class='ipsQuote_contents ipsClearfix' data-gramm='false'>{{{contents}}}</div></blockquote>");ips.templates.set('core.editor.legacyQuoteUpcast',"<div class='ipsQuote_citation'>{{citation}}</div><div class='ipsQuote_contents ipsClearfix' data-gramm='false'>{{{contents}}}</div>");ips.templates.set('core.editor.citation'," <div class='ipsQuote_citation ipsQuote_open'> <a href='#' data-action='toggleQuote' aria-label='{{#lang}}toggle_quote{{/lang}}'> </a> {{#contenturl}} <a href='{{contenturl}}' class='ipsQuote_citation-origin'><i class='fa-solid fa-share'></i></a> {{/contenturl}} {{{citation}}} </div>");ips.templates.set('core.editor.citationLink'," <a href='{{baseURL}}?app=core&module=members&controller=profile&id={{userid}}' data-ipsHover data-ipshover-target='{{base
Line truncated
|
||||
ips.templates.set('core.rating.star'," <li class='{{className}}' data-ratingValue='{{value}}'><a href='#'><i class='fa-solid fa-star'></i></a></li>");ips.templates.set('core.rating.halfStar'," <li class='ipsRating_half' data-ratingValue='{{value}}'><i class='fa-solid fa-star-half'></i><i class='fa-solid fa-star-half fa-flip-horizontal'></i></li>");ips.templates.set('core.rating.loading'," <i class='ipsLoadingIcon'></span>");ips.templates.set('core.sidebar.managerWrapper',`\
|
||||
<div id='elSidebarManager' data-role='manager' class='ipsToolbox' hidden>
|
||||
<div class='ipsToolbox__tools'>
|
||||
@@ -50,7 +50,7 @@ ips.templates.set('core.rating.star'," <li class='{{className}}' data-ratingValu
|
||||
<button class="ipsIconPicker__close" data-role="close" aria-label="close" title="{{#lang}}close{{/lang}}" type="button"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
<div class="ipsIconPicker__search">
|
||||
<input type="text" name="icon_picker_search_box" data-role="search" placeholder="Search for an icon" class='ipsInput'>
|
||||
<input type="text" name="icon_picker_search_box" data-role="search" placeholder="{{#lang}}iconpicker_prompt{{/lang}}" class='ipsInput'>
|
||||
{{#allowedTypes}}
|
||||
<div data-role="type_selectors">
|
||||
{{#typeOptions}}
|
||||
@@ -1889,6 +1889,17 @@ elem.data('animQueue').push({animName:animName,run:toRun,args:args,deferred:defe
|
||||
var item=queue.shift();if(item.run=='anim'){elem.animationComplete(function(){elem.attr('animating',false);item.deferred.resolve();_checkQueue(elem);});elem.attr('animating',true);_transitions[item.animName][item.run].apply(this,item.args);}else{item.deferred.resolve();_transitions[item.animName][item.run].apply(this,item.args);_checkQueue(elem);}
|
||||
item.deferred.resolve();},cleanClasses=function(elem){$(elem).removeClass('ipsAnim').removeClass(function(index,css){return(css.match(/ipsAnim[0-9a-z_\-]+/gi)||[]).join(' ');});return elem;},isTransition=function(name){return!_.isUndefined(_transitions[name]);},addTransition=function(name,cssAnimation,fallbackAnimation){if(_transitions[name]){Debug.warn("A transition with the name '"+name+"' already exists");return;}
|
||||
_transitions[name]={anim:cssAnimation,fallback:fallbackAnimation};},scrollTo=function(elem,options){};return{init:init,cleanClasses:cleanClasses,animationSupport:animationSupport,isTransition:isTransition,addTransition:addTransition,go:go,cancel:cleanClasses};});}(jQuery,_));;
|
||||
;(function($,_){"use strict";ips.createModule("ips.utils.lazyload",function(){const fixedElements=new WeakSet();const imgDimsCache={_cache:new Map(),get(key){let value;if(!this._cache.has(key)){try{value=ips.utils.db.get('ips.utils.lazyloadImgDims',key);}catch(e){}}else{value=this._cache.get(key);}
|
||||
return value;},set(key,value){ips.utils.db.set('ips.utils.lazyloadImgDims',key,value,false,Math.round(Date.now()/1000)+86400);return this._cache.set(key,value);},has(key){return this._cache.has(key);},delete(key){ips.utils.db.remove('ips.utils.lazyloadImgDims',key);return this._cache.delete(key);}};return{init(){this.parseLazyLoadElements();$(document).on('contentChange',function(changedElement){try{$(changedElement).each(function(){ips.utils.lazyload.parseLazyLoadElements(this);});}catch(e){Debug.warn(`Something went wrong when processing lazy load images`);Debug.warn(e);}})},parseLazyLoadElements(root){root=root instanceof Element?root:document.body;root.querySelectorAll("[data-src]:is(img, audio, video, iframe, object, embed)").forEach(element=>{if(fixedElements.has(element)){return;}
|
||||
element.dataset.ipsLazyloadProcessed='1'
|
||||
fixedElements.add(element);if(element.getAttribute('src')===element.dataset.src){delete element.dataset.src
|
||||
return;}
|
||||
element.setAttribute('loading','lazy');element.setAttribute('src',element.dataset.src);delete element.dataset.src;if(element.matches('img')){let width=parseFloat(element.getAttribute('width')||'');let height=parseFloat(element.getAttribute('height')||'');if(width&&height&&!Number.isNaN(width)&&!Number.isNaN(height)){return;}else if(element.style.height||element.style.width){return;}else if(parseFloat(width?.toString()||element.dataset.width||'')&&parseFloat(height?.toString()||element.dataset.height||'')){width=Math.round(parseFloat(width?.toString()||element.dataset.width)*100)/100;height=Math.round(parseFloat(height?.toString()||element.dataset.height)*100)/100;}else if(parseFloat(width?.toString()||element.dataset.width||'')&&parseFloat(element.dataset.ratio||'')){width=Math.round(parseFloat(width?.toString()||element.dataset.width)*100)/100;height=Math.round((width/parseFloat(element.dataset.ratio))*100)/100;}else if(parseFloat(height?.toString()||element.dataset.height||'')&&parseFloat(element.dataset.ratio||'')){height=Math.round(parseFloat(height?.toString()||element.dataset.height)*100)/100;width=Math.round(height*parseFloat(element.dataset.ratio)*100)/100;}
|
||||
if(typeof height==="number"&&typeof width==="number"&&height>0&&width>0){Debug.log(`Determined the width and height from data- attributes`);element.setAttribute('width',width.toString());element.setAttribute('height',height.toString());}else{this.getNativeImgDims(element.getAttribute('src')).then(dims=>{if(dims){Debug.log(`Determined the width and height from the URL`);element.setAttribute('width',dims.width.toString());element.setAttribute('height',dims.height.toString());}}).catch(err=>{Debug.warn(`Failed to determine the native dims of the image at the URL ${element.getAttribute('url')}`);Debug.warn(err);})}}});},getNativeImgDims(url){return new Promise(_resolve=>{let done=false;let timeout;const resolve=val=>{if(timeout!==undefined){clearTimeout(timeout);}
|
||||
if(done){return;}
|
||||
done=true;_resolve(val);};try{let output={width:0,height:0};url=new URL(url);if(imgDimsCache.has(url.toString())){resolve(imgDimsCache.get(url.toString()));return;}
|
||||
const img=new Image();timeout=setTimeout(()=>{imgDimsCache.set(url.toString(),undefined);resolve(undefined);},3000);img.addEventListener('load',()=>{output.width=img.naturalWidth;output.height=img.naturalHeight;if(Number.isNaN(output.width)||Number.isNaN(output.height)||output.width<=0||output.height<=0){imgDimsCache.set(url.toString(),undefined);resolve(undefined);return;}
|
||||
output.height=Math.max(1,Math.round(output.height*100)/100);output.width=Math.max(1,Math.round(output.width*100)/100);imgDimsCache.set(url.toString(),output);resolve(output);});img.addEventListener('error',()=>{imgDimsCache.set(url.toString(),undefined);resolve(undefined);});img.src=url.toString();}catch(e){resolve(undefined);}});}}});})(jQuery,_);;
|
||||
;(function($,_,undefined){"use strict";ips.createModule('ips.utils.links',function(){var updateExternalLinks=function(element){if(ips.getSetting('links_external')){if(_.isUndefined(element)){return;}
|
||||
element.find('a[rel*="external"]').each(function(index,elem){elem.target="_blank";elem.rel=elem.rel.replace(" noopener","")+" noopener";});}};return{updateExternalLinks:updateExternalLinks};});}(jQuery,_));;
|
||||
;(function($,_){"use strict";ips.createModule('ips.utils.notification',function(){const supported=!!(window.Notification?.requestPermission instanceof Function&&ips.getSetting('pushPublicKey')!==null&&((parseFloat(navigator.userAgent.match(/version\/([\d\.]+).*safari/i)?.[1])||16.5)>=16.4));async function requestPermission(){if(supported)
|
||||
|
||||
@@ -32,7 +32,8 @@ for(const action of['quoteComment','multiQuoteComment','rateReview']){this.on('c
|
||||
this.on('submit','form',this.submitEdit);this.on('change','input[type="checkbox"][data-role="moderation"]',this.commentCheckbox);this.elem.addEventListener('ipsCalcQuote',()=>this.inlineQuote())
|
||||
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();},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;}
|
||||
'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;}
|
||||
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;}
|
||||
@@ -238,7 +239,7 @@ return notifyData;},_showNotification(notifyData,type){if(!document[ips.utils.ev
|
||||
if($('#elFlashMessage').is(':visible')&&$('#elFlashMessage').find('[data-role="newNotification"]').length){$('#elFlashMessage').find('[data-role="newNotification"]').replaceWith(html);}else{ips.ui.flashMsg.show(html,{timeout:8,position:'bottom',extraClasses:'cNotificationFlash',dismissable:function(){self._stopPolling();},escape:false});}},_updateTimestamp(){let storage=ips.utils.db.get('notifications',ips.getSetting('baseURL'));storage=_.extend(storage,{timestamp:ips.utils.time.timestamp()});ips.utils.db.set('notifications',ips.getSetting('baseURL'),storage);},_updateIcons(newData,oldData){const reportBadge=this.scope.find('[data-notificationType="reports"]');const reportCount=reportBadge.length?parseInt(reportBadge.text()):0;const notifyData={notifications:parseInt(newData.notifications),reports:reportCount};if(parseInt(newData.notifications)!==oldData.notifications){this._updateIcon('notify',newData.notifications);this.scope.trigger('clearUserbarCache',{type:'notify'});}
|
||||
if(this._messagesEnabled){if(parseInt(newData.messages)!==oldData.messages){this._updateIcon('inbox',newData.messages);this.scope.trigger('clearUserbarCache',{type:'inbox'});}
|
||||
notifyData.messages=parseInt(newData.messages);}},_updateIcon(type,count){const icon=this._getIcon(type);icon.attr('data-currentCount',count).text(count);if(parseInt(count)){ips.utils.anim.go((!icon.is(':visible'))?'zoomIn':'pulseOnce',icon.removeClass('ipsHide'));}else{icon.fadeOut();}},_getIcon(type){return $('body').find('[data-notificationType="'+type+'"]');},_getCurrentCounts(){const messages=this.scope.find('[data-notificationType="inbox"]');const notifications=this.scope.find('[data-notificationType="notify"]');return{notifications:parseInt(notifications.attr('data-currentCount')),messages:(messages.length)?parseInt(messages.attr('data-currentCount')):null};},_stopPolling(){Debug.info("Stopping instant notification polling");clearInterval(this._interval);this._paused=true;}});}(jQuery,_));;
|
||||
;(function($,_,undefined){"use strict";const IMAGE_EXTENSIONS=new Set(['gif','jpeg','jpe','jpg','png','svg','webp'])
|
||||
;(function($,_,undefined){"use strict";const IMAGE_EXTENSIONS=new Set(['gif','jpeg','jpe','jpg','png','svg','webp','avif'])
|
||||
ips.controller.register('core.front.core.lightboxedImages',{_random:null,initialize:function(){var self=this;this.on('initializeImages',this.refreshContent);this.on('refreshContent',this.refreshContent);this.on(document,'imageRotated',function(e,data){var attachment=$(self.scope).find('.ipsAttachLink_image img[data-fileId='+data.fileId+']');self._updateAttachmentImage(attachment,data);});this.setup();},setup:function(){this._random='g'+(Math.round(Math.random()*100000));this._initializeAttachments();this._initializeImages();},refreshContent:function(e){Debug.log("Refreshing content in lightboxedImages");this.scope.removeAttr('data-loaded');this._initializeAttachments();this._initializeImages();e.stopPropagation();},_initializeAttachments:function(){var fileIDsToFetch={};var self=this;var attachments=this.scope.find('[data-fileid]').not(function(idx,elem){var elem=$(elem);return elem.is('source, video')||elem.find('source, video').length;});if(!attachments.length){return;}
|
||||
attachments.each(function(){var attachment=$(this);if(!_.isUndefined(attachment.attr('data-loaded'))){return;}
|
||||
if(!(attachment.is('img, .ipsAttachLink_image'))){var parent=attachment.parent();var clone=parent.clone();clone.children().remove();clone.text(clone.text().replace(/\s/g,''));if(!clone.text().length&&attachment.parentsUntil(this.scope,'li').length===0){attachment.addClass('ipsAttachLink_block');if(attachment.children().length){return;}
|
||||
|
||||
Reference in new issue
Block a user