Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+5 -5
View File
@@ -1,14 +1,14 @@
;(function($,_){"use strict";ips.controller.register('ips.core.badgepreview',{preview:undefined,badgetype:'badge',initialize(){this.preview=this.elem.querySelector('[data-role="preview"]')
;(function($,_){"use strict";ips.controller.register('ips.core.badgepreview',{preview:undefined,badgetype:'custombadge',initialize(){this.preview=this.elem.querySelector('[data-role="preview"]')
if('badgetype'in this.elem.dataset){this.badgetype=this.elem.dataset.badgetype;}
const _debounced=_.throttle(async()=>{await this.updateImage();},200,{trailing:true});for(const id of['icon','shape','foreground','background','border','sides','rotation','number_overlay'].map(i=>`${this.badgetype}_${i}`)){const config={attributes:true,childList:false,subtree:false}
const _debounced=_.throttle(async()=>{await this.updateImage();},200,{trailing:true});for(const id of['icon','shape','foreground','background','border','sides','rotation','number_overlay','icon_size'].map(i=>`${this.badgetype}_${i}`)){const config={attributes:true,childList:false,subtree:false}
this.getForm().querySelectorAll(`#${id} input`).forEach(element=>{if(id.endsWith('rotation')){element.oninput=()=>this.updateRotation();}else if(id.match(/_number_overlay$/)){element.oninput=()=>this.updateNumberOverlay();}else if(!id.match(/_(foreground|border|background)$/)){element.oninput=_debounced;}
const observer=new MutationObserver(mutationList=>{for(const mutationRecord of mutationList){if(mutationRecord.type==='attributes'&&['value','style'].includes(mutationRecord.attributeName)){if(id.endsWith('rotation')){this.updateRotation();}else if(id.match(/_(foreground|background|border)$/)){this.updateColor();}else if(id.match(/_number_overlay$/)){this.updateNumberOverlay();}else{_debounced();}
break}}})
observer.observe(element,config)})}},async updateImage(){let url=ipsSettings.baseURL+`/admin/?app=core&module=achievements&controller=badges&do=badgePreview`;const contents=await ips.fetch(url,{method:"POST",data:{shape:this.getShape(),icon:JSON.stringify(this.getIcon()),foreground:this.getForeground(),background:this.getBackground(),border:this.getBorder(),rotation:this.getRotation(),sides:this.getSides(),numberoverlay:this.getNumberOverlay()}});if(contents.querySelector('svg')){this.preview.innerHTML='';this.preview.appendChild(contents.querySelector('svg'));}},updateColor(){const foreground=this.getForeground();const background=this.getBackground();const border=this.getBorder();const svgElement=this.preview.querySelector('svg');const attrMap={foreground:['fgcolor',foreground],background:['bgcolor',background],border:['bordercolor',border]}
for(const colorField in attrMap){svgElement.querySelectorAll(`[data-${attrMap[colorField][0]}-placeholder]`).forEach(el=>{el.dataset[attrMap[colorField][0]+"Placeholder"].split(',').forEach(attr=>{el.setAttribute(attr,attrMap[colorField][1]);});})}
observer.observe(element,config)})}},async updateImage(){let url=ipsSettings.baseURL+`/admin/?app=core&module=achievements&controller=badges&do=badgePreview`;const contents=await ips.fetch(url,{method:"POST",data:{shape:this.getShape(),icon:JSON.stringify(this.getIcon()),foreground:this.getForeground(),background:this.getBackground(),border:this.getBorder(),rotation:this.getRotation(),sides:this.getSides(),numberoverlay:this.getNumberOverlay(),iconsize:this.getIconSize()}});if(contents.querySelector('svg')){this.preview.innerHTML='';this.preview.appendChild(contents.querySelector('svg'));this.updateNumberOverlay();}},updateColor(){const foreground=this.getForeground();const background=this.getBackground();const border=this.getBorder();const svgElement=this.preview.querySelector('svg');const attrMap={foreground:['fgcolor',foreground],background:['bgcolor',background],border:['bordercolor',border]}
for(const colorField in attrMap){svgElement?.querySelectorAll(`[data-${attrMap[colorField][0]}-placeholder]`).forEach(el=>{el.dataset[attrMap[colorField][0]+"Placeholder"].split(',').forEach(attr=>{el.setAttribute(attr,attrMap[colorField][1]);});})}
svgElement?.querySelectorAll('[data-embedded-fg-color][href]').forEach(img=>{const href=img.getAttribute('href');const url=new URL(href);if(url.protocol.toLowerCase()==='data:'&&url.pathname.startsWith('image/svg+xml,')){const data=decodeURIComponent(url.pathname.split(',',2)[1]);const embeddedXML=(new DOMParser()).parseFromString(data,'text/xml');let changed=false;for(const colorField in attrMap){embeddedXML.querySelectorAll(`[data-${attrMap[colorField][0]}-placeholder]`).forEach(el=>{el.getAttribute(`data-${attrMap[colorField][0]}-placeholder`).split(",").forEach(attr=>{changed=true;el.setAttribute(attr,attrMap[colorField][1]);})});}
if(changed){const encoded=`data:image/svg+xml,${encodeURIComponent(embeddedXML.documentElement.outerHTML)}`
img.setAttribute('href',encoded);}}})},updateNumberOverlay(){const svgElement=this.preview.querySelector('svg');const numberInput=this.getNumberOverlay();if(svgElement){if(numberInput){svgElement.querySelectorAll('.svg__text_overlay').forEach(overlay=>{overlay.innerHTML=`${numberInput}`});svgElement.querySelectorAll('[data-number-overlay]').forEach(overlay=>{overlay.style.display=''})}else{svgElement.querySelectorAll('[data-number-overlay]').forEach(overlay=>{overlay.style.display='none'})}}},isSquare:false,updateRotation(){const rotation=this.getRotation();const shape=this.getShape();if(shape==='ngon'&&rotation===45&&this.getSides()===4){this.updateImage();this.isSquare=true;}else if(this.isSquare){this.updateImage();this.isSquare=false;}else{if(['ngon','star','flower'].includes(shape)){this.preview.querySelectorAll('[transform]').forEach(node=>{if(node.getAttribute('transform').includes('rotate')){node.setAttribute('transform',`rotate(${rotation})`)}})}}},getForm(){return this.elem.closest('form')},getShape(){for(const input of this.getForm().querySelectorAll(`#${this.badgetype}_shape input[type="radio"][name="${this.badgetype}_shape"]`)){if(input.checked){return input.value}}
return'circle'},getIcon(){const value=JSON.parse(this.getForm().querySelector(`input[name="${this.badgetype}_icon"]`)?.value||'null')||null;if(Array.isArray(value)&&value.length){return value[0]}
return null},getForeground(){return this.getForm().querySelector(`input[name="${this.badgetype}_foreground"]`)?.value||"#ffffff";},getBackground(){return this.getForm().querySelector(`input[name="${this.badgetype}_background"]`)?.value||"#eeb95f";},getBorder(){return this.getForm().querySelector(`input[name="${this.badgetype}_border"]`)?.value||"#f7d36f";},getSides(){return parseInt(this.getForm().querySelector(`input[name="${this.badgetype}_sides"]`)?.value||"5");},getRotation(){return parseInt(this.getForm().querySelector(`input[name="${this.badgetype}_rotation"]`)?.value||"0");},getNumberOverlay(){if(this.getForm().querySelector(`input[type="checkbox"][name="${this.badgetype}_number_overlay"][data-control="unlimited"]`)?.checked){return 0;}
const value=parseInt(this.getForm().querySelector(`input[type="number"][name="${this.badgetype}_number_overlay"]`)?.value||this.getForm().querySelector(`input[type="number"][name="${this.badgetype}_number_overlay"]`)?.dataset.previousvalue||"0");return Math.min(Math.max(0,value),999)}})}(jQuery,_));
const value=parseInt(this.getForm().querySelector(`input[type="number"][name="${this.badgetype}_number_overlay"]`)?.value||this.getForm().querySelector(`input[type="number"][name="${this.badgetype}_number_overlay"]`)?.dataset.previousvalue||"0");return Math.min(Math.max(0,value),999)},getIconSize(){return Math.min(5,Math.max(1,parseInt(this.getForm().querySelector(`input[name="${this.badgetype}_icon_size"][type="range"]`)?.value)||3));}})}(jQuery,_));
+7 -4
View File
@@ -1,5 +1,5 @@
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.editable',{_editTimeout:null,_editing:false,initialize:function(){this.on('mousedown',this.editMousedown);this.on('mouseup mouseleave',this.editMouseup);this.on('click',this.editMouseclick);this.on('click','[data-role="edit"]',this.clickEdit);this.setup();},setup:function(){var defaultFill=this.scope.attr('data-default');if(ips.utils.events.isTouchDevice()||(!_.isUndefined(defaultFill)&&defaultFill=='empty')){this.scope.removeClass('ipsType_editable').find('[data-role="edit"]').show();}},clickEdit:function(e){e.preventDefault();this._triggerEdit();},editMousedown:function(e){var self=this;if(e.which!==1){return;}
this._editTimeout=setTimeout(_.bind(this._triggerEdit,this),1000);},editMouseup:function(e){clearTimeout(this._editTimeout);},editMouseclick:function(e){if(this._editing){e.preventDefault();}},_triggerEdit:function(){var self=this;this._editing=true;clearTimeout(this._editTimeout);var span=this.scope;var url=span.attr('data-url');var textField=span.find('[data-role="text"]');var fieldName=span.find('[data-name]').attr('data-name');var defaultFill=span.attr('data-default');span.hide();var defaultText=(_.isUndefined(defaultFill)||defaultFill!='empty')?textField.text().trim():'';var inputNode=$('<input/>').attr({type:'text'}).attr('data-role','editField').val(defaultText);span.after(inputNode);inputNode.focus();inputNode.on('blur',function(){inputNode.addClass('ipsField_loading');if(inputNode.val()==''){inputNode.remove();span.show();self._editing=false;}else{var dataToSend={};dataToSend[fieldName]=inputNode.val();ips.getAjax()(url,{method:'post',data:dataToSend}).done(function(response){textField.text(inputNode.val());}).fail(function(response){ips.ui.alert.show({type:'alert',icon:'warn',message:response.responseJSON,});}).always(function(){inputNode.remove();span.show();self._editing=false;});}});inputNode.on('keypress',function(e){if(e.keyCode==ips.ui.key.ENTER){e.stopPropagation();e.preventDefault();inputNode.blur();return false;}});inputNode.on('keydown',function(e){if(e.keyCode==ips.ui.key.ESCAPE){inputNode.remove();span.show();self._editing=false;return false;}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.tags',{initialize:function(){this.on('submit',this.submitForm);},submitForm:function(e){if($(e.currentTarget).attr('data-bypassValidation')){return true;}
e.preventDefault();e.stopPropagation();ips.ui.alert.show({type:'confirm',subText:ips.getString('tag_delete_confirm_detail'),icon:'fa-solid fa-triangle-exclamation',callbacks:{ok:function(){$(e.currentTarget).attr('data-bypassValidation',true);$(e.currentTarget).submit();},cancel:function(){return false;}}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.notificationMenu',{initialize:function(){this.on(document,'menuOpened',this.menuOpened);$('body').on('updateNotificationCount',this.updateNotificationCount);this.setup();},setup:function(){var notificationCount=parseInt(this.scope.find('[data-role="notificationCount"]').text());if(isNaN(notificationCount)){notificationCount=0;}
var storedNotificationCount=parseInt(ips.utils.cookie.get('acpNotificationCount'));if(isNaN(storedNotificationCount)){storedNotificationCount=0;}
if(notificationCount>storedNotificationCount){setTimeout(function(){$(this.scope).find('[data-role="notificationIcon"]').addClass('cAcpNotifications_animate');}.bind(this),800);}
@@ -14,9 +14,12 @@ e.preventDefault();if(data.selectedItemID=='os'){ips.utils.cookie.unset('acpthem
else
{var expires=new Date();expires.setFullYear(expires.getFullYear()+1);ips.utils.cookie.set('acptheme',data.selectedItemID,expires.toUTCString());}
$('#elThemeMenu_menu, #elNavThemeMob_menu').find('.ipsMenu_itemChecked').removeClass('ipsMenu_itemChecked');$('#elThemeMenu_menu, #elNavThemeMob_menu').find('[data-ipsMenuValue="'+data.selectedItemID+'"]').addClass('ipsMenu_itemChecked');this.setTheme();}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.langString',{_url:null,_hideTimeout:null,_currentValue:'',initialize:function(){this.on('change','textarea',this.changeTextarea);this.on('focus','textarea',this.focusTextarea);this.on('blur','textarea',this.blurTextarea);this.on('click','[data-action="saveWords"]',this.saveWords);this.on('click','[data-action="revertWords"]',this.revertWords);this.setup();},setup:function(){this._url=this.scope.attr('data-saveURL');var contents=this.scope.find('a').html();var html=ips.templates.render('languages.translateString',{value:_.unescape(contents)});this._currentValue=_.unescape(contents);this.scope.html(html);},changeTextarea:function(){},focusTextarea:function(){this.scope.addClass('cTranslateTable_field_focus').find('textarea').removeClass('ipsField_success').end().find('[data-action]').show();},blurTextarea:function(){this._saveWords(true);},_hideButtons:function(e){this.scope.removeClass('cTranslateTable_field_focus');},saveWords:function(e){e.preventDefault();this._saveWords(false);},_saveWords:function(hideButtonsImmediately){var self=this;var url=this._url+'&form_submitted=1&csrfKey='+ips.getSetting('csrfKey');var textarea=this.scope.find('textarea');var value=textarea.val();if(this._currentValue==value){this._hideButtons();return;}
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.editable',{_editTimeout:null,_editing:false,initialize:function(){this.on('mousedown',this.editMousedown);this.on('mouseup mouseleave',this.editMouseup);this.on('click',this.editMouseclick);this.on('click','[data-role="edit"]',this.clickEdit);this.setup();},setup:function(){var defaultFill=this.scope.attr('data-default');if(ips.utils.events.isTouchDevice()||(!_.isUndefined(defaultFill)&&defaultFill=='empty')){this.scope.removeClass('ipsType_editable').find('[data-role="edit"]').show();}},clickEdit:function(e){e.preventDefault();this._triggerEdit();},editMousedown:function(e){var self=this;if(e.which!==1){return;}
this._editTimeout=setTimeout(_.bind(this._triggerEdit,this),1000);},editMouseup:function(e){clearTimeout(this._editTimeout);},editMouseclick:function(e){if(this._editing){e.preventDefault();}},_triggerEdit:function(){var self=this;this._editing=true;clearTimeout(this._editTimeout);var span=this.scope;var url=span.attr('data-url');var textField=span.find('[data-role="text"]');var fieldName=span.find('[data-name]').attr('data-name');var defaultFill=span.attr('data-default');span.hide();var defaultText=(_.isUndefined(defaultFill)||defaultFill!='empty')?textField.text().trim():'';var inputNode=$('<input/>').attr({type:'text'}).attr('data-role','editField').val(defaultText);span.after(inputNode);inputNode.focus();inputNode.on('blur',function(){inputNode.addClass('ipsField_loading');if(inputNode.val()==''){inputNode.remove();span.show();self._editing=false;}else{var dataToSend={};dataToSend[fieldName]=inputNode.val();ips.getAjax()(url,{method:'post',data:dataToSend}).done(function(response){textField.text(inputNode.val());}).fail(function(response){ips.ui.alert.show({type:'alert',icon:'warn',message:response.responseJSON,});}).always(function(){inputNode.remove();span.show();self._editing=false;});}});inputNode.on('keypress',function(e){if(e.keyCode==ips.ui.key.ENTER){e.stopPropagation();e.preventDefault();inputNode.blur();return false;}});inputNode.on('keydown',function(e){if(e.keyCode==ips.ui.key.ESCAPE){inputNode.remove();span.show();self._editing=false;return false;}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.langString',{_url:null,_hideTimeout:null,_currentValue:'',initialize:function(){this.on('input','textarea',this.changeTextarea);this.on('focus','textarea',this.focusTextarea);this.on('blur','textarea',this.blurTextarea);this.on('click','[data-action="saveWords"]',this.saveWords);this.on('click','[data-action="revertWords"]',this.revertWords);this.setup();},setup:function(){this._url=this.scope.attr('data-saveURL');const contentRoot=this.elem.querySelector('[data-langcontent]');let contents;if(contentRoot){const getText=node=>(node instanceof Text?[node.wholeText]:(node.childNodes?.length?[...node.childNodes].map(getText):[])).flat();contents=getText(contentRoot).join('');}else{contents=this.elem.innerText;}
var html=ips.templates.render('languages.translateString',{value:contents});this._currentValue=contents;this.scope.html(html);this.changeTextarea();},changeTextarea:function(){this.elem.querySelector('[data-action="saveWords"]').disabled=this._currentValue===this.elem.querySelector('textarea').value},focusTextarea:function(){this.scope.addClass('cTranslateTable_field_focus').find('textarea').removeClass('ipsField_success').end().find('[data-action]').show();},blurTextarea:function(){this._saveWords(true);},_hideButtons:function(e){this.scope.removeClass('cTranslateTable_field_focus');},saveWords:function(e){e.preventDefault();this._saveWords(false);},_saveWords:function(hideButtonsImmediately){var self=this;var url=this._url+'&form_submitted=1&csrfKey='+ips.getSetting('csrfKey');var textarea=this.scope.find('textarea');var value=textarea.val();if(this._currentValue==value){this._hideButtons();return;}
if(this._hideTimeout){clearTimeout(this._hideTimeout);}
this.scope.find('[data-action]').addClass('ipsButton--disabled');ips.getAjax()(url,{type:'post',data:{lang_word_custom:encodeURIComponent(value)}}).done(function(){textarea.removeClass('ipsField_loading').addClass('ipsField_success');ips.ui.flashMsg.show(ips.getString('saved'));if(!hideButtonsImmediately){self._hideTimeout=setTimeout(_.bind(self._hideButtons,self),300);}else{self._hideButtons();}
this.elem.querySelector('[data-action="saveWords"]').disabled=true;ips.getAjax()(url,{type:'post',data:{lang_word_custom:encodeURIComponent(value)}}).done(function(){textarea.removeClass('ipsField_loading').addClass('ipsField_success');ips.ui.flashMsg.show(ips.getString('saved'));if(!hideButtonsImmediately){self._hideTimeout=setTimeout(_.bind(self._hideButtons,self),300);}else{self._hideButtons();}
self._currentValue=value;}).fail(function(){window.location=url;});},revertWords:function(e){}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.core.mobileNav',{initialize:function(){this.on('click','[data-action="mobileSearch"]',this.mobileSearch);this.on(document,'click','[data-role="clearCaches"]',this.clearCaches);},mobileSearch:function(e){e.preventDefault();if($('body').hasClass('acpSearchOpen')){$('body').find('.ipsModal').trigger('click');}
$('body').toggleClass('acpSearchOpen');},clearCaches:function(e){e.preventDefault();var button=this.scope.find('[data-role="clearCaches"]');if(button.hasClass('ipsButton--disabled')){return;}
+3 -3
View File
@@ -1,7 +1,8 @@
ips.templates.set('templates.customizationMedia.grid'," <ul class='cMedia_manager__items'> {{{contents}}} </ul>");ips.templates.set('templates.customizationMedia.noItems'," <div class='i-text-align_center i-font-size_2 i-color_soft i-padding_4'> {{#lang}}mediaEmptyFolder{{/lang}} </div>");ips.templates.set('templates.customizationMedia.noSearchResults'," <div class='i-text-align_center i-font-size_2 i-color_soft i-padding_4'> {{#lang}}mediaNoResults{{/lang}} </div>");;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.customization.customTemplatesForm',{currentHookPoint:null,initialize:function(){this.on('change','input[name=template_type]',this.typeChanged);this.on('change','select[name=template_hookapp]',this.hookAppChanged);this.on('change','select[name^=template_path_]',this.hookPathChanged);this.on('change','select[name^=template_hookpoint_]',this.hookPointChanged);this.on('click','[data-role=viewTemplate]',this.viewTemplate);this.setup();},setup:function(){$('li[id^=template_path_]').hide();$('#template_hookapp').hide();$('li[id^=template_hookpoint_]').hide();$('#template_hookpoint_type').hide();$('#template_key').hide();this.typeChanged();},viewTemplate:function(e){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();let dialogRef=ips.ui.dialog.create({title:ips.getString('custom_theme_template_title'),url:'?app=core&module=customization&controller=customtemplates&do=ajaxGetTemplate&hookpoint='+currentApp+'/'+currentPath.replace(/_/g,'/',)+':'+this.currentHookPoint,forceReload:true,remoteSubmit:true});dialogRef.show();},typeChanged:function(e,data){if($('input[name="template_type"]:checked').val()==='hook'){$('#template_key').hide();$('#template_hookapp').show();this.hookAppChanged(e,data);}else{$('#template_hookapp').hide();$('li[id^=template_path_]').hide();$('li[id^=template_hookpoint_]').hide();$('#template_key').show();}},hookAppChanged:function(e,data){$('li[id^=template_path_]').hide();$('li[id^=template_hookpoint_]').hide();$('#template_path_'+$('select[name=template_hookapp]').val()).show();this.hookPathChanged(e,data);},hookPathChanged:function(e,data){let currentApp=$('select[name=template_hookapp]').val();$('li[id^=template_hookpoint_'+currentApp+'_]').hide();$('#template_hookpoint_'+currentApp+'_'+$('select[name=template_path_'+currentApp+']').val()).show();this.hookPointChanged(e,data);},hookPointChanged:function(e,data){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();this.currentHookPoint=$('select[name=template_hookpoint_'+currentApp+'_'+currentPath+']').val();$('#template_hookpoint_type').show();this.getTemplateParams(e,data);},getTemplateParams:function(e,data){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();ips.getAjax()('?app=core&module=customization&controller=customtemplates&do=ajaxGetAvailableParams',{data:{hookpoint:currentApp+'/'+currentPath.replace(/_/g,'/',)+':'+this.currentHookPoint,hookpoint_type:$('#template_hookpoint_type').val(),}}).done(function(response){$('span[data-template-params]').html(response);});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.customization.designerCore',{_cmInstances:{},isSaving:false,initialize:function(){this.on('click','button[type="submit"]',this.save);this.on('tabChanged',this.changedTab);const debounce=_.debounce(_.bind(this._recalculatePanelWrapper,this),100);this.on(window,'resize',debounce);const disableSubmit=()=>{this.isSaving=true}
const debouncedEnableSubmit=_.debounce(()=>{this.isSaving=false},500)
this.elem.addEventListener('ips:codeboxAfterInit',e=>{if(e.detail?.instance){e.detail.instance.on('transaction',()=>{disableSubmit();debouncedEnableSubmit();});}})},changedTab:function(e,data){this._recalculatePanelWrapper();},async save(e){e.preventDefault();const form=this.scope.find('form[data-formid="form"]');if(this.isSaving){await new Promise(resolve=>setTimeout(resolve,500));}
this.elem.addEventListener('ips:codebox#update',()=>{disableSubmit();debouncedEnableSubmit();})},changedTab:function(e,data){this._recalculatePanelWrapper();},async save(e){e.preventDefault();const form=this.scope.find('form[data-formid="form"]');if(this.isSaving){await new Promise(resolve=>setTimeout(resolve,500));}
const save=Object.fromEntries(new FormData(form.get(0)).entries());Debug.log(save);this.scope.find('button[type="submit"]').addClass('ipsButton_disabled').removeClass('ipsButton_primary');try{await ips.fetch(form.attr('action'),{dataType:'json',data:save,type:'post'});ips.ui.flashMsg.show(ips.getString('saved'));}catch(jqXHR){let message=ips.getString('saveThemeError');try{message=JSON.parse(jqXHR.responseText);}
catch(e){}
ips.ui.alert.show({type:'alert',icon:'warn',message});}
@@ -16,5 +17,4 @@ console.log(output);this._fileListing.html(output);$(document).trigger('contentC
_.each(info,function(value,key){var elem=self._sidebar.find('[data-role="'+key+'"]');if(elem.is('input')){elem.val(value);}else if(key=='itemPreview'){elem.html(value);}else if(key=='itemUrl'){elem.html($('<a/>').attr('href',value).text(value).attr('target','_blank'));}
else if(value===null){elem.html($('<span/>').addClass('i-color_soft').text('Loading...'));}else{elem.text(value);}});this._sidebar.find('[data-role="itemDimensionsRow"]').toggle(info.itemShowDimensions);this._sidebar.find('[data-role="itemTag"]').get(0).select();this._sidebar.find('[data-role="itemInformation"]').show().end().find('[data-role="multipleItems"]').hide();this._sidebar.find('[data-role="replaceFile"]').show();$(document).trigger('contentChange',[this._sidebar]);}},doSearch:function(){var value=this.scope.find('[data-role="mediaSearch"]').val();if(!_.isEmpty(value)){this._searchStyleTag.html('[data-role="mediaItem"]:not([data-filename*="'+value.replace(/['"]+/g,'')+'" i]){ display: none; }');this._unselectAll();}else{this._searchStyleTag.html('');}
this._updatePreview();this._checkDeleteButton();},_getSelected:function(){if(this._fileListing.is(':visible')){return this._fileListing.find('.cMedia_itemSelected');}else{return this._searchResults.find('.cMedia_itemSelected');}},_resetSearch:function(){this.scope.find('[data-role="mediaSearch"]').val('');this._searchResults.hide();this._fileListing.show();this._unselectAll();this._updatePreview();this._checkDeleteButton();},_unselectAll:function(){this._fileListing.find('.cMedia_item').removeClass('cMedia_itemSelected');this._searchResults.find('.cMedia_item').removeClass('cMedia_itemSelected');}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.customization.themeForm',{initialize:function(){this.headerFooterCssFieldSetUp();},headerFooterCssFieldSetUp:function(){$('#theme_header').addClass('ipsFieldRow--fullWidth');$('#theme_footer').addClass('ipsFieldRow--fullWidth');$('#theme_css').addClass('ipsFieldRow--fullWidth');}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.customization.customTemplatesForm',{currentHookPoint:null,initialize:function(){this.on('change','input[name=template_type]',this.typeChanged);this.on('change','select[name=template_hookapp]',this.hookAppChanged);this.on('change','select[name^=template_path_]',this.hookPathChanged);this.on('change','select[name^=template_hookpoint_]',this.hookPointChanged);this.on('click','[data-role=viewTemplate]',this.viewTemplate);this.setup();},setup:function(){$('li[id^=template_path_]').hide();$('#template_hookapp').hide();$('li[id^=template_hookpoint_]').hide();$('#template_hookpoint_type').hide();$('#template_key').hide();this.typeChanged();},viewTemplate:function(e){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();let dialogRef=ips.ui.dialog.create({title:ips.getString('custom_theme_template_title'),url:'?app=core&module=customization&controller=customtemplates&do=ajaxGetTemplate&hookpoint='+currentApp+'/'+currentPath.replace(/_/g,'/',)+':'+this.currentHookPoint,forceReload:true,remoteSubmit:true});dialogRef.show();},typeChanged:function(e,data){if($('input[name="template_type"]:checked').val()==='hook'){$('#template_key').hide();$('#template_hookapp').show();this.hookAppChanged(e,data);}else{$('#template_hookapp').hide();$('li[id^=template_path_]').hide();$('li[id^=template_hookpoint_]').hide();$('#template_key').show();}},hookAppChanged:function(e,data){$('li[id^=template_path_]').hide();$('li[id^=template_hookpoint_]').hide();$('#template_path_'+$('select[name=template_hookapp]').val()).show();this.hookPathChanged(e,data);},hookPathChanged:function(e,data){let currentApp=$('select[name=template_hookapp]').val();$('li[id^=template_hookpoint_'+currentApp+'_]').hide();$('#template_hookpoint_'+currentApp+'_'+$('select[name=template_path_'+currentApp+']').val()).show();this.hookPointChanged(e,data);},hookPointChanged:function(e,data){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();this.currentHookPoint=$('select[name=template_hookpoint_'+currentApp+'_'+currentPath+']').val();$('#template_hookpoint_type').show();this.getTemplateParams(e,data);},getTemplateParams:function(e,data){let currentApp=$('select[name=template_hookapp]').val();let currentPath=$('select[name=template_path_'+currentApp+']').val();ips.getAjax()('?app=core&module=customization&controller=customtemplates&do=ajaxGetAvailableParams',{data:{hookpoint:currentApp+'/'+currentPath.replace(/_/g,'/',)+':'+this.currentHookPoint,hookpoint_type:$('#template_hookpoint_type').val(),}}).done(function(response){$('span[data-template-params]').html(response);});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.customization.themeForm',{initialize:function(){this.headerFooterCssFieldSetUp();},headerFooterCssFieldSetUp:function(){$('#theme_header').addClass('ipsFieldRow--fullWidth');$('#theme_footer').addClass('ipsFieldRow--fullWidth');$('#theme_css').addClass('ipsFieldRow--fullWidth');}});}(jQuery,_));;
+3 -3
View File
@@ -1,12 +1,11 @@
ips.templates.set('moderatorPermissions.checkUncheckAll'," <li class='ipsFieldRow'> <div class='ipsFieldRow__label'> </div> <div class='ipsFieldRow__content'> <ul class='ipsList ipsList--inline i-font-weight_500'> <li><button type='button' data-role='checkAll'>{{#lang}}check_all{{/lang}}</button></li> <li><button type='button' data-role='uncheckAll'>{{#lang}}uncheck_all{{/lang}}</button></li> </ul> </div> </li>");;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.listFlagSpammer',{initialize:function(){this.on('click',this.toggleFlagSpammer);},toggleFlagSpammer:function(e){e.preventDefault();var elem=$(e.currentTarget);var icon=elem.find('.fa-flag');ips.ui.alert.show({'type':'confirm','icon':'warn','message':icon.hasClass('ipsType_spammer')?ips.getString('confirmUnFlagAsSpammer'):ips.getString('confirmFlagAsSpammer'),'subText':icon.hasClass('ipsType_spammer')?ips.getString('confirmUnFlagAsSpammerDesc'):'',callbacks:{ok:function(){ips.getAjax()(elem.attr('href'),{dataType:'json'}).done(function(response){ips.ui.flashMsg.show(response);icon.toggleClass('ipsType_spammer');var newStatus=ips.utils.url.getParam('status',elem.attr('href'))==1?0:1;var newUrl=ips.utils.url.removeParam('status',elem.attr('href'));elem.attr('href',newUrl+'&status='+newStatus);elem.attr('_title',newStatus?ips.getString('flagAsSpammer'):ips.getString('unflagAsSpammer'));elem.attr('aria-label',newStatus?ips.getString('flagAsSpammer'):ips.getString('unflagAsSpammer'));}).fail(function(jqXHR){if(Debug.isEnabled()){Debug.error(jqXHR.responseText);}else{window.location=elem.attr('href');}});}}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.restrictions',{initialize:function(){this.on('click','.acpRestrictions_subHeader h3',this.toggleSubHeader);this.on('change','.acpRestrictions_header input[type="checkbox"]',this.toggleHeader);this.on('change','.acpAppRestrictions_header input[type="checkbox"]',this.toggleAppHeader);this.on('click','[data-action="checkAll"]',this.checkAll);this.on('click','[data-action="checkNone"]',this.checkNone);this.on('click','[data-action="expandAll"], [data-action="collapseAll"]',this.toggleDisplay);this.setup();},toggleDisplay:function(e){e.preventDefault();var row=$(e.currentTarget).closest('.acpRestrictions_header');var subHeaders=row.next().find('.acpRestrictions_subHeader');var self=this;var action=($(e.currentTarget).attr('data-action')=='expandAll')?'expand':'collapse';subHeaders.each(function(){if(action=='expand'){self._expandSection($(this));}else{self._collapseSection($(this));}});},toggleAppHeader:function(e){var check=$(e.currentTarget);var row=check.closest('.acpAppRestrictions_header');if(!check.is(':checked')){row.siblings('.acpAppRestrictions_panel').find('.acpRestrictions_header input[type="checkbox"]').each(function(){$(this).prop('disabled',true).attr('data-originalState',$(this).is(':checked')).attr('checked',false).trigger('change');});}else{row.siblings('.acpAppRestrictions_panel').find('input[type="checkbox"]').each(function(){var thisCheck=$(this);thisCheck.prop('disabled',false);if(thisCheck.attr('data-originalState')=='true'){thisCheck.prop('checked',true).trigger('change');}});row.siblings('.acpAppRestrictions_panel').find('.acpRestrictions_panel input[type="checkbox"]').each(function(){var thisCheck=$(this);var checked=thisCheck.closest('.acpRestrictions_panel').siblings('.acpRestrictions_header').find('input[type="checkbox"]').is(':checked');if(!checked){thisCheck.prop('disabled',true);}else{thisCheck.prop('disabled',false);}
if(thisCheck.attr('data-originalState')=='true'){thisCheck.prop('checked',true).trigger('change');}});}},toggleHeader:function(e){var check=$(e.currentTarget);var row=check.closest('.acpRestrictions_header');var unChecked=!check.is(':checked');row.next().find('input[type="checkbox"]').each(function(){var thisCheck=$(this);if(unChecked){thisCheck.attr('data-originalState',thisCheck.is(':checked')).prop('checked',false);}else if((thisCheck.attr('data-originalState')=='true')){thisCheck.prop('checked',true);}
thisCheck.prop('disabled',unChecked).trigger('change');});},toggleSubHeader:function(e){var header=$(e.currentTarget).parent();if(header.hasClass('acpRestrictions_open')){this._collapseSection(header);}else{this._expandSection(header);}},_expandSection:function(section){var next=section.next('ul');section.addClass('acpRestrictions_open').removeClass('acpRestrictions_closed');ips.utils.anim.go('fadeInDown fast',next);},_collapseSection:function(section){section.removeClass('acpRestrictions_open').addClass('acpRestrictions_closed');},checkAll:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).parents('.acpRestrictions_subHeader');var next=header.next('ul');if(!next.is(':visible')){next.animationComplete(function(){self._togglePermissions(true,next);});this._expandSection(header);}else{this._togglePermissions(true,next);}},checkNone:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).parents('.acpRestrictions_subHeader');var next=header.next('ul');if(!next.is(':visible')){next.animationComplete(function(){self._togglePermissions(false,next);});this._expandSection(header);}else{this._togglePermissions(false,next);}},_togglePermissions:function(state,container){container.find('input[type="checkbox"]:not( [disabled] )').prop('checked',state).change();},setup:function(){this.scope.find('.acpRestrictions_open').removeClass('acpRestrictions_open').addClass('acpRestrictions_closed');}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.moderatorPermissions',{initialize:function(){this.on('change','#ipsTabs_form_modperms__core_Content_panel input[type="checkbox"]',this.toggle);this.on('click','[data-role="checkAll"]',this.checkAll);this.on('click','[data-role="uncheckAll"]',this.checkAll);this.setup();},setup:function(){var mainPanel=this.scope.find('#ipsTabs_form_modperms__core_Content_panel');var self=this;mainPanel.find('input[type="checkbox"]').each(function(){self._toggleChanged($(this));});$(this.scope).find('.ipsTabs__panel').each(function(){var controls=$(ips.templates.render('moderatorPermissions.checkUncheckAll'));controls.find('button').attr('data-scope',$(this).attr('id'));$(this).children('ul').prepend(controls);});this._checkEachTab();},checkAll:function(e){e.preventDefault();var check=$(e.currentTarget).attr('data-role')=='checkAll';if($(e.currentTarget).attr('data-scope')){var scope=$('#'+$(e.currentTarget).attr('data-scope'));}else{var scope=$(this.scope);}
if(check&&!$(e.currentTarget).attr('data-scope')){$('input[name="mod_use_restrictions"][value="no"]').prop('checked',true).change();}
var self=this;scope.find('input[type="checkbox"]').each(function(){if(check&&!$(this).is(':checked')){$(this).prop('checked',true).change();}else if(!check&&$(this).is(':checked')){$(this).prop('checked',false).change();}});},toggle:function(e){this._toggleChanged($(e.currentTarget));this._checkEachTab();},_toggleChanged:function(thisToggle){var id=thisToggle.closest('.ipsFieldRow').attr('id').replace('_content','');var panels=this.scope.find('.ipsTabs__panel:not( #ipsTabs_form_modperms__core_Content_panel )');var otherToggles=panels.find('.ipsFieldRow[id^="'+id+'"]').not(thisToggle.closest('.ipsFieldRow'));if(thisToggle.is(':checked')){otherToggles.hide();otherToggles.find('input[type="checkbox"]').prop('disabled',true);}else{otherToggles.show();otherToggles.find('input[type="checkbox"]').prop('disabled',false);}},_checkEachTab:function(){var self=this;var panels=this.scope.find('.ipsTabs__panel:not( #ipsTabs_form_modperms__core_Content_panel )');panels.each(function(){var count=$(this).find('input[type="checkbox"]:enabled:not( [data-role="zeroVal"] )').length;var id=$(this).attr('id').replace('ipsTabs_tabs_form_','').replace('_panel','');if(!count){self.scope.find('#'+id).closest('li').hide();}else{self.scope.find('#'+id).closest('li').show();}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.lazyLoadingProfileBlock',{initialize:function(){var scope=$(this.scope);ips.getAjax()(scope.attr('data-url')).done(function(response){scope.html(response);$(document).trigger('contentChange',[scope]);});},});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.listFlagSpammer',{initialize:function(){this.on('click',this.toggleFlagSpammer);},toggleFlagSpammer:function(e){e.preventDefault();var elem=$(e.currentTarget);var icon=elem.find('.fa-flag');ips.ui.alert.show({'type':'confirm','icon':'warn','message':icon.hasClass('ipsType_spammer')?ips.getString('confirmUnFlagAsSpammer'):ips.getString('confirmFlagAsSpammer'),'subText':icon.hasClass('ipsType_spammer')?ips.getString('confirmUnFlagAsSpammerDesc'):'',callbacks:{ok:function(){ips.getAjax()(elem.attr('href'),{dataType:'json'}).done(function(response){ips.ui.flashMsg.show(response);icon.toggleClass('ipsType_spammer');var newStatus=ips.utils.url.getParam('status',elem.attr('href'))==1?0:1;var newUrl=ips.utils.url.removeParam('status',elem.attr('href'));elem.attr('href',newUrl+'&status='+newStatus);elem.attr('_title',newStatus?ips.getString('flagAsSpammer'):ips.getString('unflagAsSpammer'));elem.attr('aria-label',newStatus?ips.getString('flagAsSpammer'):ips.getString('unflagAsSpammer'));}).fail(function(jqXHR){if(Debug.isEnabled()){Debug.error(jqXHR.responseText);}else{window.location=elem.attr('href');}});}}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.history',{initialize:function(){this.on('menuItemSelected',this.filterSelected);},filterSelected:function(e,data){if(data.originalEvent){data.originalEvent.preventDefault();}
if(data.triggerID=='memberHistoryFilters'){$(this.scope).find('[data-role="historyTitle"]').text(data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"]').text());$(this.scope).find('[data-role="historyDisplay"]').addClass('ipsLoading').html('');ips.getAjax()(data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"] a').attr('href')).done(function(response){$(this.scope).find('[data-role="historyDisplay"]').html(response).removeClass('ipsLoading');$(document).trigger('contentChange',[this.scope]);}.bind(this));}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.form',{initialize:function(){this.on('submit',this.submitForm);},submitForm:function(e){var self=this;if($(e.currentTarget).attr('data-bypassValidation')){return true;}
@@ -20,4 +19,5 @@ this.scope.find('[data-role="regex"]').show();this.scope.find('[data-role="easy"
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.achievementRuleForm',{initialize(){this.on('click','[data-action="filterReveal"]',this.showFilter);this.on('click','[data-action="filterCollapse"]',this.hideFilter);this.on('change keyup','input[type="number"]',this.changeNumber);},showFilter(e){const ruleWrap=e.currentTarget.closest('[data-role="ruleWrap"]');const toggleWrap=e.currentTarget.closest('[data-role="toggleFilter"]');const check=toggleWrap.querySelector('input[type="checkbox"]');const conditionButtons=toggleWrap.closest('[data-role="conditionButtons"]');check.checked=true;check.dispatchEvent(new Event('change',{bubbles:true}));toggleWrap.ipsHide();if(conditionButtons?.querySelector('[data-role="toggleFilter"] input[data-filter]:not(:checked)')){conditionButtons?.ipsShow();}else{conditionButtons?.ipsHide();}
const filterName=check.dataset.filter;if(filterName){ruleWrap.querySelectorAll(`#${filterName}`).ipsShow();}
ruleWrap.querySelectorAll('input[type="number"]').forEach(el=>this._pluralizeNumber(el));},hideFilter(e){e.preventDefault();const filter=e.currentTarget.closest('[data-role="filterField"]');const filterName=filter.id;const check=filter.closest('[data-role="ruleWrap"]').querySelector(`#${filterName}Checkbox`);const toggleWrap=check.closest('[data-role="toggleFilter"]');check.checked=false;check.dispatchEvent(new Event('change',{bubbles:true}));toggleWrap.ipsShow()
toggleWrap.closest('[data-role="conditionButtons"]')?.ipsShow();filter.ipsHide();},changeNumber(e){this._pluralizeNumber(e.currentTarget);},_pluralizeNumber(input){const span=input.nextElementSibling;if(span?.matches('[data-role="th"]')){span.innerText=ips.pluralize(ips.getString('numberSuffix'),input.value);}}});}(jQuery,_));;
toggleWrap.closest('[data-role="conditionButtons"]')?.ipsShow();filter.ipsHide();},changeNumber(e){this._pluralizeNumber(e.currentTarget);},_pluralizeNumber(input){const span=input.nextElementSibling;if(span?.matches('[data-role="th"]')){span.innerText=ips.pluralize(ips.getString('numberSuffix'),input.value);}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.members.lazyLoadingProfileBlock',{initialize:function(){var scope=$(this.scope);ips.getAjax()(scope.attr('data-url')).done(function(response){scope.html(response);$(document).trigger('contentChange',[scope]);});},});}(jQuery,_));;
+4 -4
View File
@@ -1,6 +1,9 @@
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.stats.overview',{dateFilters:{'start':null,'end':null,'range':null},initialize:function(){this.on('submit','[data-role="dateFilter"]',this.updateDateFilter);this.on('change','[data-action="toggleApp"]',this.toggleApp);this.on('change','[name="predate"]',this.submitForm);this.on('click','[data-action="cancelDateRange"]',this.cancelDateRange);this.on('stats.ready',this.blockReady);$(document).on('reloadStatsDateFilters',_.bind(this.resendDateFilters,this));this.setup();},setup:function(){this.url=this.scope.attr('data-url');this.dateFilters.range=this.scope.find('[data-role="dateFilter"]').attr('data-defaultRange');},resendDateFilters:function(e){this.trigger('stats.setDateFilters',{dateFilters:this.dateFilters,url:this.url});},cancelDateRange:function(e){e.preventDefault();this.scope.find('select[name="predate"]').val(this.scope.find('.cStatsFilters').attr('data-defaultRange')).change();},submitForm:function(e){var select=$(e.currentTarget);if(select.val()==='-1'){this.scope.find('.cStatsFilters [data-role="formTitle"], select[name="predate"]').hide();this.scope.find('.cStatsFilters button').show();}else{this.scope.find('.cStatsFilters [data-role="formTitle"], select[name="predate"]').show();this.scope.find('.cStatsFilters button').hide();select.closest('form').submit();}},blockReady:function(e,data){$(e.target).trigger('stats.loadBlock',{dateFilters:this.dateFilters,url:this.url});},toggleApp:function(){var enabledApps=_.map(this.scope.find('[data-action="toggleApp"]:checked'),function(app){return $(app).attr('data-toggledApp')});var disabledApps=_.map(this.scope.find('[data-action="toggleApp"]:not( :checked )'),function(app){return $(app).attr('data-toggledApp');});this.scope.find('.cStatTile[data-app]').each(function(){var tile=$(this);if(tile.hasClass('ipsHide')&&enabledApps.indexOf($(this).attr('data-app'))!==-1){tile.css({transform:'scale(0.7)',opacity:"0"}).removeClass('ipsHide').animate({transform:'scale(1)',opacity:"1"});}else if(enabledApps.indexOf($(this).attr('data-app'))===-1){tile.addClass('ipsHide');}});ips.utils.cookie.set('overviewExcludedApps',JSON.stringify(disabledApps),true);},updateDateFilter:function(e){e.preventDefault();e.stopPropagation();this.dateFilters={'start':null,'end':null,'range':this.scope.find('[name="predate"]').val()};if(this.dateFilters.range=='-1'){this.dateFilters.start=this.scope.find('[name="date[start]"]').val();this.dateFilters.end=this.scope.find('[name="date[end]"]').val();}
this.triggerOn('core.admin.stats.overviewBlock','stats.loadBlock',{dateFilters:this.dateFilters,url:this.url});this.triggerOn('core.admin.stats.nodeFilters','stats.setDateFilters',{dateFilters:this.dateFilters,url:this.url});},});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.stats.nodeFilters',{url:null,dateFilters:{'start':null,'end':null,'range':null},initialize:function(){this.on('submit',this.reloadBlock);$(document).on('stats.setDateFilters',_.bind(this.statsReady,this));$(document).on('click.hovercard',_.bind(function(){this.trigger('reloadStatsDateFilters');},this));this.trigger('reloadStatsDateFilters');},statsReady:function(e,data){this.url=data.url;this.dateFilters=data.dateFilters;},reloadBlock:function(e){var blockKey=$(e.currentTarget).attr('data-block');var subblock=$(e.currentTarget).attr('data-subblock');var blockElement=$('[data-role="statsBlock"][data-block="'+blockKey+'"][data-subblock="'+subblock.replace(/\\/g,'\\\\')+'"]');blockElement.attr('data-nodeFilter',$(e.currentTarget).find('[data-role="nodeValue"]').val());e.preventDefault();e.stopPropagation();this.trigger('stats.nodeFilters',{blockToRefresh:blockKey,subblockToRefresh:subblock,url:this.url,dateFilters:this.dateFilters});$(document).trigger('click');}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.stats.filtering',{initialize:function(){this.on('click','[data-role="toggleGroupFilter"]',this.toggleGroupFilter);if($('#elGroupFilter').attr('data-hasGroupFilters')=='true'){$('#elGroupFilter').show();}},toggleGroupFilter:function(e){e.preventDefault();if($('#elGroupFilter').is(':visible')){$('#elGroupFilter').find('input[type="checkbox"]').prop('checked',true);$('#elGroupFilter').slideUp();}
else
{$('#elGroupFilter').slideDown();}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.stats.overviewBlock',{initialize:function(){Debug.log('init bloc');this.on('stats.loadBlock',this.loadBlock);$(document).on('stats.nodeFilters',_.bind(this.loadBlock,this));this.setup();},setup:function(){this.refresh=null;this.loaded=false;this.currentCounts=[];this.url=null;this.block=this.scope.attr('data-block');this.subblock=this.scope.attr('data-subblock');this.refreshInterval=this.scope.attr('data-refresh')?parseInt(this.scope.attr('data-refresh')):false;this.trigger('stats.ready');},getCounts:function(elem){return _.map(elem.find('[data-number]'),function(thisElem){return parseInt($(thisElem).attr('data-number'))});},startInterval:function(){if(!this.refreshInterval||!this.url){return;}
clearInterval(this.refresh);this.refresh=setInterval(_.bind(this.fetchUpdate,this),this.refreshInterval*1000);},fetchUpdate:function(){var self=this;ips.getAjax()(this.url,{type:'get'}).done(function(response){var newContent=$("<div>"+response+"</div>");var counts=self.getCounts(newContent);var hasDifference=false;if(counts.length!==self.currentCounts.length){hasDifference=true;}else{for(var i=0;i<counts.length;i++){if(counts[i]!==self.currentCounts[i]){hasDifference=true;break;}}}
if(hasDifference){self.scope.addClass('cStatTile--updated').find('[data-role="statBlockContent"]').html(response);self.currentCounts=counts;setTimeout(function(){self.scope.removeClass('cStatTile--updated');},2200);$(document).trigger('contentChange',[self.scope]);}else{Debug.log("No change in values in "+self.block);}});},loadBlock:function(e,data){if(!_.isUndefined(data.blockToRefresh)&&(data.blockToRefresh!=this.block||data.subblockToRefresh!=this.subblock)){Debug.log("Skipping because "+data.blockToRefresh+" does not match "+this.block+" or "+data.subblockToRefresh+" does not match "+this.subblock);return;}
@@ -8,7 +11,4 @@ var self=this;this.url=data.url+'&blockKey='+this.block;clearInterval(this.refre
if(!_.isUndefined(this.subblock)){this.url=this.url+'&subblock='+this.subblock;}
if(data.dateFilters.range!='-1'&&data.dateFilters.range!='0'){this.url=this.url+'&range='+data.dateFilters.range;}else if(data.dateFilters.range=='-1'&&!_.isNull(data.dateFilters.start)){this.url=this.url+'&start='+data.dateFilters.start+'&end='+data.dateFilters.end;}
if(this.scope.attr('data-nodeFilter')){this.url=this.url+'&nodes='+this.scope.attr('data-nodeFilter');}
ips.getAjax()(this.url,{type:'get'}).done(function(response){self.scope.addClass('cStatTile--loaded').find('.cStatTile__body').removeClass('ipsLoading').end().find('[data-role="statBlockContent"]').hide().html(response);self.scope.find('[data-role="statBlockContent"]').fadeIn('fast');self.loaded=true;self.currentCounts=self.getCounts(self.scope);self.startInterval();$(document).trigger('contentChange',[self.scope]);});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.stats.filtering',{initialize:function(){this.on('click','[data-role="toggleGroupFilter"]',this.toggleGroupFilter);if($('#elGroupFilter').attr('data-hasGroupFilters')=='true'){$('#elGroupFilter').show();}},toggleGroupFilter:function(e){e.preventDefault();if($('#elGroupFilter').is(':visible')){$('#elGroupFilter').find('input[type="checkbox"]').prop('checked',true);$('#elGroupFilter').slideUp();}
else
{$('#elGroupFilter').slideDown();}}});}(jQuery,_));;
ips.getAjax()(this.url,{type:'get'}).done(function(response){self.scope.addClass('cStatTile--loaded').find('.cStatTile__body').removeClass('ipsLoading').end().find('[data-role="statBlockContent"]').hide().html(response);self.scope.find('[data-role="statBlockContent"]').fadeIn('fast');self.loaded=true;self.currentCounts=self.getCounts(self.scope);self.startInterval();$(document).trigger('contentChange',[self.scope]);});}});}(jQuery,_));;
+2 -4
View File
@@ -3,14 +3,12 @@ ips.templates.set('menuManager.temporaryDropdown'," <li class='ipsMenu_item {{#s
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.settings',{initialize:function(){this.on('change','input[name=datastore_method]',this.datastoreChanged);this.on('change','input[name=cache_method]',this.cacheChanged);this.setup();},setup:function(){if($('input[name=datastore_method]:checked').val()=='Redis'){$("input[name=cache_method][value=Redis]").prop("checked",true);$('#form_cache_method').slideUp();$('li[id^=redis]').slideDown();}},cacheChanged:function(e,data){var value=$(e.currentTarget).val();if(value=='Redis'){$("input[name=datastore_method][value=Redis]").prop("checked",true);$('#form_cache_method,#id_datastore_filesystem_path').slideUp();$('li[id^=redis]').slideDown();}else{$('#form_cache_method').slideDown();$('li[id^=redis]').slideUp();if($('input[name=datastore_method]:checked').val()=="Redis"){$("input[name=datastore_method][value=FileSystem]").prop("checked",true);}}},datastoreChanged:function(e,data){var value=$(e.currentTarget).val();if(value=='Redis'){$("input[name=cache_method][value=Redis]").prop("checked",true);$('#form_cache_method').slideUp();$('li[id^=redis]').slideDown();}else{$('#form_cache_method').slideDown();$('li[id^=redis]').slideUp();if($('input[name=cache_method]:checked').val()=="Redis"){$("input[name=cache_method][value=None]").prop("checked",true);}}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.menuManager',{_hasChanges:false,initialize:function(){this.on('sortstop','.ipsTree_rows > .ipsTree',this.afterSort);this._hasChanges=ips.getSetting('menuChanged');this.togglePublish();},afterSort:function(event,ui){this._hasChanges=true;this.togglePublish();},togglePublish:function(){if(this._hasChanges){$('#acpPageHeader > .ipsMessage').fadeIn();}else{$('#acpPageHeader > .ipsMessage').hide();}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.login',{initialize:function(){this.on('tabChanged',this.tabChanged);this.on('click','[data-action="upgradeWarningContinue"]',this.upgradeWarningContinue);this.setup();},setup:function(){this.scope.find("#elTabContent .ipsTabs__panel:visible").first().find('input[type="text"]').first().focus();},tabChanged:function(e,data){ips.utils.cookie.set('acpLoginMethod',data.tabID,1);},upgradeWarningContinue:function(e,data){e.preventDefault();$(this.scope).find('[data-role="upgradeWarning"]').hide();$(this.scope).find('[data-role="loginForms"]').removeClass('ipsHide').show();}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.langString',{initialize:function(){this.on('click','[data-action="saveWords"]',this.saveWords);this.on('click','[data-action="revertWords"]',this.revertWords);this.setup();},setup:function(){var self=this;var textArea=$('<textarea />');textArea.attr('data-url',this.scope.attr('href')).val(this.scope.html()).change(function(e){self._change(e);});},_change:function(e){var elem=$(e.target);elem.addClass('ipsField_loading');var url=elem.attr('data-url')+'&form_submitted=1&csrfKey='+ips.getSetting('csrfKey')+
'&lang_word_custom='+encodeURIComponent(elem.val());ips.getAjax()(url).done(function(){elem.removeClass('ipsField_loading');ips.ui.flashMsg.show(ips.getString('saved'));}).fail(function(){window.location=url;});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.codeHook',{codeMirror:null,initialize:function(){this.on('click','[data-codeToInject]',this._itemClick);},_itemClick:function(e){var codeMirror=$(this.scope).find('textarea').data('CodeMirrorInstance');var regex=new RegExp($.parseJSON($(e.currentTarget).attr('data-signature')));var found=false;var lastLine=codeMirror.doc.lineCount()-1;codeMirror.doc.eachLine(function(line){if(line.text.match(regex)){found=true;codeMirror.setSelection({line:codeMirror.doc.getLineNumber(line),ch:0},{line:codeMirror.doc.getLineNumber(line),ch:line.text.length});codeMirror.scrollIntoView({line:codeMirror.doc.getLineNumber(line),ch:0});}
if(line.text.match(/^\s*}\s*$/)){lastLine=codeMirror.doc.getLineNumber(line);}});if(!found){codeMirror.doc.replaceRange($.parseJSON($(e.currentTarget).attr('data-codeToInject')),{line:lastLine-1,chr:0},{line:lastLine-1,chr:0});codeMirror.scrollIntoView({line:codeMirror.doc.lineCount(),ch:0});}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.autoupgradetimer',{initialize:function(){var self=this;var secondsRemaining=60*5;if(ips.getSetting('cloud2')){secondsRemaining=15;}
var interval=setInterval(function(){secondsRemaining--;if(secondsRemaining<1){clearInterval(interval);self.scope.find('[data-role="counter-wrapper"]').hide();self.scope.find('[data-role="continue-button"]').show();}
else
{var minutes=Math.floor(secondsRemaining/60);var seconds=secondsRemaining%60;self.scope.find('[data-role="counter"]').html(minutes+':'+((seconds>=10)?seconds:'0'+seconds));}},1000);}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.api',{initialize:function(){this.on('click','[data-action="showEndpoint"]',this.showEndpoint);},showEndpoint:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');this.scope.find('.cApiTree_activeNode').removeClass('cApiTree_activeNode');$(e.currentTarget).parent('li').addClass('cApiTree_activeNode');this.scope.find('[data-role="referenceContainer"]').html($('<div/>').addClass('ipsLoading').css({height:'300px'}));ips.getAjax()(url).done(function(response){self.scope.find('[data-role="referenceContainer"]').html(response)}).fail(function(){window.location=url;});this.scope.find('[data-role="referenceContainer"]')[0].scrollIntoView({behavior:"smooth"});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.apiPermissions',{initialize:function(){this.on('click','[data-action="toggleSection"]',this.toggleSection);this.on('click','.cApiPermissions [data-action="checkAll"]',this.checkAll);this.on('click','.cApiPermissions [data-action="checkNone"]',this.checkNone);this.on('click','.cApiPermissions_header [data-action="checkAll"]',this.checkAllHeader);this.on('click','.cApiPermissions_header [data-action="checkNone"]',this.checkNoneHeader);this.setup();},setup:function(){var self=this;var sections=this.scope.find('.cApiPermissions > li');sections.each(function(){self._calculatedCheckedEndpoints($(this));});},toggleSection:function(e){var header=$(e.currentTarget).parent();if(header.hasClass('cApiPermissions_open')){this._collapseSection(header);}else{this._expandSection(header);}},checkAllHeader:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).closest('.cApiPermissions_header');var sections=header.next('.cApiPermissions').find('> li');sections.each(function(){var next=$(this).find('> ul');if(!next.is(':visible')){next.animationComplete(function(){setTimeout(function(){self._togglePermissions(true,next);},300);});self._expandSection($(this));}else{self._togglePermissions(true,next);}})},checkNoneHeader:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).closest('.cApiPermissions_header');var sections=header.next('.cApiPermissions').find('> li');sections.each(function(){var next=$(this).find('> ul');if(!next.is(':visible')){next.animationComplete(function(){setTimeout(function(){self._togglePermissions(false,next);},300);});self._expandSection($(this));}else{self._togglePermissions(false,next);}})},checkAll:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).parents('li').first();var next=header.find('> ul');if(!next.is(':visible')){next.animationComplete(function(){setTimeout(function(){self._togglePermissions(true,next);},300);});this._expandSection(header);}else{this._togglePermissions(true,next);}},checkNone:function(e){e.preventDefault();var self=this;var header=$(e.currentTarget).parents('li').first();var next=header.find('> ul');if(!next.is(':visible')){next.animationComplete(function(){setTimeout(function(){self._togglePermissions(false,next);},300);});this._expandSection(header);}else{this._togglePermissions(false,next);}},_calculatedCheckedEndpoints:function(section){var totalEndpoints=section.find('input[name*="access"]');var checkedEndpoints=totalEndpoints.filter(':checked');var endpointSpan=section.find('[data-role="endpointOverview"]');if(section.hasClass('cApiPermissions_open')){endpointSpan.hide();}else{var text=ips.getString('apiEndpoints_all');if(!checkedEndpoints.length){text=ips.getString('apiEndpoints_none');}else if(totalEndpoints.length!==checkedEndpoints.length){text=ips.pluralize(ips.getString('apiEndpoints_some',{checked:checkedEndpoints.length}),totalEndpoints.length);}
endpointSpan.text(text).show();}},_togglePermissions:function(state,container){container.find('input[type="checkbox"]:not( [disabled] )').prop('checked',state).change();},_expandSection:function(section){var next=section.find('> ul');section.addClass('cApiPermissions_open').removeClass('cApiPermissions_closed');ips.utils.anim.go('fadeInDown fast',next);this._calculatedCheckedEndpoints(section);},_collapseSection:function(section){section.removeClass('cApiPermissions_open').addClass('cApiPermissions_closed');this._calculatedCheckedEndpoints(section);},});}(jQuery,_));;
endpointSpan.text(text).show();}},_togglePermissions:function(state,container){container.find('input[type="checkbox"]:not( [disabled] )').prop('checked',state).change();},_expandSection:function(section){var next=section.find('> ul');section.addClass('cApiPermissions_open').removeClass('cApiPermissions_closed');ips.utils.anim.go('fadeInDown fast',next);this._calculatedCheckedEndpoints(section);},_collapseSection:function(section){section.removeClass('cApiPermissions_open').addClass('cApiPermissions_closed');this._calculatedCheckedEndpoints(section);},});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.admin.system.api',{initialize:function(){this.on('click','[data-action="showEndpoint"]',this.showEndpoint);},showEndpoint:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');this.scope.find('.cApiTree_activeNode').removeClass('cApiTree_activeNode');$(e.currentTarget).parent('li').addClass('cApiTree_activeNode');this.scope.find('[data-role="referenceContainer"]').html($('<div/>').addClass('ipsLoading').css({height:'300px'}));ips.getAjax()(url).done(function(response){self.scope.find('[data-role="referenceContainer"]').html(response)}).fail(function(){window.location=url;});this.scope.find('[data-role="referenceContainer"]')[0].scrollIntoView({behavior:"smooth"});}});}(jQuery,_));;
+8 -10
View File
@@ -1,9 +1,6 @@
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.notifications',{initialize:function(){this.on(document,'menuOpened',this.menuOpened);this.on(document,'permissionDenied.notifications',this.hideNotice);this.on(document,'subscribePending.notifications',this.subscribePending);this.on(document,'subscribeSuccess.notifications',this.subscribeSuccess);this.on(document,'subscribeFail.notifications',this.subscribeFail);this.on('click','[data-action=browserNotificationPrompt]',this.requestPermission);this.on('click','[data-role=dismissNotification]',this.dismissNotification);this.on('click','[data-action="rejectPush"]',this.rejectPush);if(ips.getSetting('memberID')&&ips.utils.notification.supported&&ips.utils.serviceWorker.supported){this.setup();}},setup:function(){this._timeout=null;this._buttonText='';this._missingSubscription=false;if(ips.utils.notification.needsPermission()&&_.isUndefined(ips.utils.cookie.get('browserNotificationDismiss'))){this.scope.html(ips.templates.render('core.browserNotification.prompt')).hide();}else if(ips.utils.notification.hasPermission()&&_.isUndefined(ips.utils.cookie.get('notificationPushRejected'))){ips.utils.notification.getSubscription().then(subscription=>{if(subscription){return;}
this._missingSubscription=true;this.scope.html(ips.templates.render('core.browserNotification.missingSubscription')).hide();}).catch(err=>{Debug.log("getSubscription failed - browser may not support pushManager");Debug.log(err);return;});}},destroy:function(){clearTimeout(this._timeout);},menuOpened:function(e,data){let date;const showPrompt=()=>{this._timeout=setTimeout(()=>{this.scope.slideDown('fast');ips.utils.cookie.unset('notificationMenuShown');},750);};if(data.elemID==='elFullNotifications'){if(this._missingSubscription){showPrompt();}else{if(ips.utils.cookie.get('notificationMenuShown')===undefined){date=parseInt(ips.utils.cookie.get('notificationMenuShown'));if(date&&Date.now()>=date){showPrompt();}}else{date=new Date();date.setDate(date.getDate()+2);ips.utils.cookie.set('notificationMenuShown',date.getTime(),true);}}}},subscribePending:function(e,data){const button=this.scope.find('[data-action="browserNotificationPrompt"]');this._buttonText=button.text();button.prop('disabled',true).text(ips.getString('notificationsEnabling'));},subscribeSuccess:function(e,data){const button=this.scope.find('[data-action="browserNotificationPrompt"]');button.prop('disabled',true).text(ips.getString('notificationsSubscribed'));},subscribeFail:function(e,data){this.scope.find('[data-action="browserNotificationPrompt"]').prop('disabled',false).text(this._buttonText);this.scope.find('[data-role="promptMessage"]').text(ips.getString('notificationsSubscribeFailed')).slideDown();},requestPermission:function(){this.scope.find('[data-role="promptMessage"]').text(ips.getString('notificationsAllowPrompt')).slideDown();$(document).trigger('requestPermission.notifications');},rejectPush:function(e){e.preventDefault();ips.utils.cookie.set('notificationPushRejected',true,true);this.hideNotice();},hideNotice:function(){this.scope.slideUp('fast');},dismissNotification:function(e){if(e){e.preventDefault();}
var date=new Date();date.setDate(date.getDate()+100);ips.utils.cookie.set('browserNotificationDismiss',true,date.toUTCString());this.scope.slideUp({duration:400,complete:function(){$(this).remove();}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.onlineUsersWidget',{initialize(){if(!ips.getSetting('member_url')||this.elem.querySelector(`[data-memberId="${ips.getSetting('memberID')}"]`)){return;}
const memberRowHtml=ips.templates.render('core.onlineUser.linked',{memberUrl:ips.getSetting('member_url'),memberHovercardUrl:ips.getSetting('member_hovercardUrl'),formattedName:ips.getSetting('member_formattedName'),memberId:ips.getSetting('memberID')});this.scope.find('ul').prepend(memberRowHtml);const numOnline=this.elem.querySelector('[data-memberCount]');if(numOnline){numOnline.innerText=ips.pluralize(ips.getString('widget_onlineusers_membercount'),parseInt(numOnline.dataset.membercount)+1);}
this.elem.querySelector('li[data-noneOnline]')?.remove();}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.poll',{initialize:function(){this.on('submit','form',this.submitPoll);this.on('click','[data-action="viewResults"]',this.viewResults);},viewResults:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href')+'&fetchPoll=1&viewResults=1';if($(e.currentTarget).attr('data-viewResults-confirm')){var self=this;ips.ui.alert.show({type:'confirm',icon:'warn',message:ips.getString('generic_confirm'),subText:ips.getString('warn_allow_result_view'),callbacks:{ok:function(){self._viewResults(url+'&nullVote=1');}}});}else{this._viewResults(url);}},_viewResults:function(url){var self=this;self._setContentsLoading();ips.getAjax()(url).done(function(response){self.cleanContents();self.scope.html(response);$(document).trigger('contentChange',[self.scope]);});},_setContentsLoading:function(){var container=this.scope.find('[data-role="pollContents"]');var height=container.outerHeight();container.css({height:height+'px'}).html('').addClass('ipsLoading');},submitPoll:function(e){var form=$(e.currentTarget);if(form.attr('data-bypassAjax')){return}
e.preventDefault();var url=form.attr('action');var self=this;this.scope.find('button[type="submit"]').prop('disabled',true).text(ips.getString('votingNow'));if(url.match(/\?/)){url+='&';}else{url+='?';}
ips.getAjax()(url+'fetchPoll=1',{data:form.serialize(),type:'POST'}).done(function(response){self.cleanContents();self.scope.html(response);$(document).trigger('contentChange',[self.scope]);ips.ui.flashMsg.show(ips.getString('thanksForVoting'));}).fail(function(){form.attr('data-bypassAjax',true).submit();});}});}(jQuery,_));;
@@ -20,11 +17,11 @@ this.scope.find('[data-role="pollContainer"]').append(ips.templates.render('core
this.scope.find('.ipsTags__item:not(.ipsTags__item--edit)').remove();this.scope.prepend(data.tags);var editablePrefix=$('body').find('[data-editablePrefix]');if(editablePrefix.length){if(data.prefix){editablePrefix.html(data.prefix).removeClass('ipsHide');}else{editablePrefix.html('').addClass('ipsHide');}}else if(data.prefix.length){this.scope.prepend(data.prefix);}
this._setCount();this._checkMinMax();if(data.tagsChanged==1){ips.ui.flashMsg.show(ips.getString('tagsUpdated'));}},removeTag:function(e){e.preventDefault();var self=this;var remove=$(e.currentTarget);var url=remove.attr('href');var tagContainer=remove.closest('.ipsTags__item');var tag=tagContainer.find('.ipsTags__tag');tagContainer.fadeOut('fast');this._count--;this._checkMinMax();ips.getAjax()(url,{bypassRedirect:true}).done(function(){ips.ui.flashMsg.show(ips.getString('tagRemoved'));setTimeout(function(){tagContainer.remove();},200);}).fail(function(jqXHR,textStatus,errorThrown){tagContainer.stop().show().css({opacity:"1"});self._count++;if(jqXHR.responseJSON){ips.ui.alert.show({type:'alert',icon:'warn',message:jqXHR.responseJSON,callbacks:{}});}});},_checkMinMax:function(){var allowRemove=!(this._minTags&&this._count<=this._minTags);this.scope.find('[data-action="removeTag"]').toggle(allowRemove).end().find('.ipsTags__item--deletable').toggleClass('ipsTags__item--deletable',allowRemove);this.scope.find('.ipsTags__item--edit').toggle(!(this._maxTags&&this._count>=this._maxTags));},_setCount:function(){var prefix=this._getPrefix();var count=this.scope.find('.ipsTags__item').length;if(prefix.length&&prefix.is(':visible')){count++;}
this._count=count;},_getPrefix:function(){return $('body').find('[data-editablePrefix]');}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.tagEditorForm',{_placeholder:null,_menuID:'',_tagEditID:'',initialize:function(){this.on(document,'menuOpened',this.menuOpened);this.on(document,'menuClosed',this.menuClosed);this.on('submit','form',this.submitForm);this.setup();},setup:function(){this._menuID=this.scope.closest('.ipsMenu').attr('id').replace('_menu','');this._tagEditID=this._menuID.replace('elTagEditor_','');},menuClosed:function(e,data){if(data.elemID!=this._menuID){return;}
this.scope.html(ips.templates.render('core.edittags.default'));},menuOpened:function(e,data){if(data.elemID!=this._menuID){return;}
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.tagEditorForm',{_placeholder:null,_menuID:'',_tagEditID:'',initialize:function(){this.on(document,'menuOpened',this.menuOpened);this.on(document,'menuClosed',this.menuClosed);this.on('submit','form',this.submitForm);this.setup();},setup:function(){this._menuID=this.scope.closest('.ipsMenu').attr('id').replace('_menu','');this._tagEditID=this._menuID.replace('elTagEditor_','');},menuClosed:function(e,data){if(data.elemID!==this._menuID){return;}
ips.cleanContentsOf(this.elem);this.scope.html(ips.templates.render('core.edittags.default'));this._buildPlaceholder();},menuOpened:function(e,data){if(data.elemID!=this._menuID){return;}
var self=this;var url=$(data.originalEvent.currentTarget).attr('href');ips.getAjax()(url).done(function(response){self._setLoading(false);self.scope.html(response);$(document).trigger('contentChange',[self.scope]);}).fail(function(){window.location=url;});},submitForm:function(e){e.preventDefault();var self=this;var form=$(e.currentTarget);var autoComplete=this.scope.find('[data-ipsAutocomplete]');autoComplete.trigger('blur');setTimeout(function(){if(ips.ui.autocomplete.getObj(autoComplete).hasErrors()){e.preventDefault();return;}
self._setLoading(true);ips.getAjax()(form.attr('action'),{type:'post',data:form.serialize(),dataType:'json'}).done(function(response){self.scope.trigger('tagsUpdated',{tagEditID:self._tagEditID,tags:response.tags,prefix:response.prefix,tagsChanged:response.tagsChanged});self.scope.trigger('closeMenu');setTimeout(function(){self._setLoading(false);},200);}).fail(function(jqXHR,textStatus,errorThrown){if(jqXHR.responseJSON){ips.ui.alert.show({type:'alert',icon:'warn',message:jqXHR.responseJSON,callbacks:{}});}});},500);},_setLoading:function(loading){if(loading){if(!this._placeholder){this._buildPlaceholder();}
var width=this.scope.outerWidth();var height=this.scope.outerHeight();this.scope.hide();this._placeholder.show().css({width:width+'px',height:height+'px'});}else{if(this._placeholder){this._placeholder.hide();this.scope.show();}}},_buildPlaceholder:function(){this._placeholder=$('<div/>').addClass('ipsLoading').hide();this.scope.after(this._placeholder);}});}(jQuery,_));;
self._setLoading(true);ips.getAjax()(form.attr('action'),{type:'post',data:form.serialize(),dataType:'json'}).done(function(response){self.scope.trigger('tagsUpdated',{tagEditID:self._tagEditID,tags:response.tags,prefix:response.prefix,tagsChanged:response.tagsChanged});self.scope.trigger('closeMenu');}).fail(function(jqXHR,textStatus,errorThrown){if(jqXHR.responseJSON){ips.ui.alert.show({type:'alert',icon:'warn',message:jqXHR.responseJSON,callbacks:{}});}});},500);},_setLoading:function(loading){if(loading){if(!this._placeholder){this._buildPlaceholder();}
var width=this.scope.outerWidth();var height=this.scope.outerHeight();this.scope.hide();this._placeholder.show().css({width:width+'px',height:height+'px'});}else{if(this._placeholder){this._placeholder.hide();this.scope.show();}}},_buildPlaceholder:function(){this._placeholder?.remove?.();this._placeholder=$('<div/>').addClass('ipsLoading').hide();this.scope.after(this._placeholder);}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.announcementBanner',{initialize:function(){this.setup();this.on('click','[data-role="dismissAnnouncement"]',this.dismissAnnouncement);},setup:function(){this.scope.find('[data-announcementId]').each(function(){var announcement=$(this);if(ips.utils.cookie.get('announcement_'+announcement.attr('data-announcementId'))){announcement.hide();}});},dismissAnnouncement:function(e){var element=$(e.target).closest('[data-announcementId]');var id=element.attr('data-announcementId');var date=new Date();date.setTime(date.getTime()+(7*86400000));ips.utils.cookie.set('announcement_'+id,true,date.toUTCString());element.slideUp({duration:400,complete:function(){$(this).remove();}});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.articlePages',{_currentPage:1,_pages:null,_articleID:'',initialize(){this.on('paginationClicked',this.paginationClicked);this.setup();},setup(){this._articleID=this._getArticleID();this.on(window,`historychange:article-${this._articleID}`,this.stateChange);this._setupPages();},stateChange(){if(!(('article-'+this._articleID)in ips.utils.history.getState())){return;}
const state=ips.utils.history.getState(`article-${this._articleID}`)
@@ -43,7 +40,7 @@ if(this.scope.attr('data-role')=='cookieConsentBar'&&!ips.utils.cookie.get('cook
this.scope.toggle(!hide);$('body').toggleClass('cWithGuestTerms',!hide);},dismissTerms:function(e){e.preventDefault();ips.utils.cookie.set('guestTermsDismissed',1);this.hideGuestBar();},hideGuestBar:function(){this.scope.toggle(false);$('body').toggleClass('cWithGuestTerms',false);}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.followForm',{initialize:function(){this.on('submit',this.submitForm);this.on('click','[data-action="unfollow"]',this.unfollow);this.setup();},setup:function(){this._app=this.scope.attr('data-followApp');this._area=this.scope.attr('data-followArea');this._id=this.scope.attr('data-followID');},unfollow:function(e){e.preventDefault();this._doFollowAction($(e.currentTarget).attr('href'),{},true);},submitForm:function(e){e.preventDefault();this._doFollowAction(this.scope.attr('action'),this.scope.serialize(),false);},_doFollowAction:function(url,data,unfollow){var self=this;var dims=ips.utils.position.getElemDims(this.scope.parent('div'));this.scope.hide().parent('div').css({width:dims.outerWidth+'px',height:dims.outerHeight+'px'}).addClass('ipsLoading');ips.getAjax()(url,{data:data,type:'post'}).done(function(response){if(unfollow){self.trigger('followingItem',{feedID:self._area+'-'+self._id,unfollow:true});}else{self.trigger('followingItem',{feedID:self._area+'-'+self._id,notificationType:self.scope.find('[name="follow_type"]:checked').val(),anonymous:!self.scope.find('[name="follow_public_checkbox"]').is(':checked')});}
ips.ui.flashMsg.show(ips.getString('followUpdated'));}).fail(function(jqXHR,textStatus,errorThrown){window.location=url;}).always(function(){self.scope.parents('.ipsHovercard').remove();});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.followButton',{initialize:function(){this.setup();this.on(document,'followingItem',this.followingItemChange);},setup:function(){this._app=this.scope.attr('data-followApp');this._area=this.scope.attr('data-followArea');this._id=this.scope.attr('data-followID');this._feedID=this._area+'-'+this._id;this._button=this.scope.find('[data-role="followButton"]');},followingItemChange:function(e,data){if(data.feedID==this._feedID){this._reloadButton();}},_reloadButton:function(){this._button.addClass('i-opacity_3');var self=this;var pos=ips.utils.position.getElemPosition(this._button);var dims=ips.utils.position.getElemDims(this._button);this.scope.append(ips.templates.render('core.follow.loading'));this.scope.find('.ipsLoading').css({width:dims.outerWidth+'px',height:dims.outerHeight+'px',top:"0",left:"0",position:'absolute',zIndex:ips.ui.zIndex()});ips.getAjax()(ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=notifications&do=button',{data:_.extend({follow_app:this._app,follow_area:this._area,follow_id:this._id,},(this.scope.attr('data-buttonType'))?{button_type:this.scope.attr('data-buttonType')}:{},(this.scope.attr('data-buttonSize'))?{button_size:this.scope.attr('data-buttonSize')}:{})}).done(function(response){self.scope.html(response);$(document).trigger('contentChange',[self.scope]);if($('input[data-toggle-id="auto_follow_toggle"]').length){var val=self.scope.find('[data-role="followButton"]').attr('data-following');if(val=='false'&&$('input[data-toggle-id="auto_follow_toggle"]').is(':checked')){$('input[data-toggle-id="auto_follow_toggle"]').prop('checked',false).change();}else if(val=='true'&&!$('input[data-toggle-id="auto_follow_toggle"]').is(':checked')){$('input[data-toggle-id="auto_follow_toggle"]').prop('checked',true).change();}}}).fail(function(){self._button.removeClass('i-opacity_3');}).always(function(){self.scope.find('.ipsLoading').remove();});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.followButton',{initialize:function(){this.setup();this.on(document,'followingItem',this.followingItemChange);},setup:function(){this._app=this.scope.attr('data-followApp');this._area=this.scope.attr('data-followArea');this._id=this.scope.attr('data-followID');this._feedID=this._area+'-'+this._id;this._button=this.scope.find('[data-role="followButton"]');},followingItemChange:function(e,data){if(data.feedID===this._feedID){this._reloadButton();}},_reloadButton:function(){this._button.addClass('i-opacity_3');var self=this;var pos=ips.utils.position.getElemPosition(this._button);var dims=ips.utils.position.getElemDims(this._button);this.scope.append(ips.templates.render('core.follow.loading'));this.scope.find('.ipsLoading').css({width:dims.outerWidth+'px',height:dims.outerHeight+'px',top:"0",left:"0",position:'absolute',zIndex:ips.ui.zIndex()});ips.getAjax()(ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=notifications&do=button',{data:_.extend({follow_app:this._app,follow_area:this._area,follow_id:this._id,},(this.scope.attr('data-buttonType'))?{button_type:this.scope.attr('data-buttonType')}:{},(this.scope.attr('data-buttonSize'))?{button_size:this.scope.attr('data-buttonSize')}:{})}).done(function(response){self.scope.html(response);$(document).trigger('contentChange',[self.scope]);if($('input[data-toggle-id="auto_follow_toggle"]').length){var val=self.scope.find('[data-role="followButton"]').attr('data-following');if(val=='false'&&$('input[data-toggle-id="auto_follow_toggle"]').is(':checked')){$('input[data-toggle-id="auto_follow_toggle"]').prop('checked',false).change();}else if(val=='true'&&!$('input[data-toggle-id="auto_follow_toggle"]').is(':checked')){$('input[data-toggle-id="auto_follow_toggle"]').prop('checked',true).change();}}}).fail(function(){self._button.removeClass('i-opacity_3');}).always(function(){self.scope.find('.ipsLoading').remove();});}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.dataLayer',{eventHandlers:[],propertiesHandlers:[],initialize:function(){if(this.verify()){this.on('ipsDataLayer',this.handleEvent);this.on('ipsDataLayerProperties',this.handleProperties);this.setup();Debug.log('Pushing events to the dataLayer');}},setup:function(){for(let i in IpsDataLayerEventHandlers){let handler=IpsDataLayerEventHandlers[i];if(handler instanceof Function){try{let callback=handler();if(callback instanceof Function){this.eventHandlers.push(callback);}else{Debug.error(`Invalid Handler Callback Found: Returned value of type '${typeof (callback || undefined)}', expected a callback Function!`);}}catch(e){Debug.error(e);}}}
for(let i in IpsDataLayerPropertiesHandlers){let handler=IpsDataLayerPropertiesHandlers[i];if(handler instanceof Function){try{let callback=handler();if(callback instanceof Function){this.propertiesHandlers.push(callback);}else{Debug.error(`Invalid Handler Callback Found: Returned value of type '${typeof (callback || undefined)}', expected a callback Function!`);}}catch(e){Debug.error(e);}}}
this.unsetOldUniqueKeys();setTimeout(_.bind(this.loginLogout,this),200);setTimeout(_.bind(this.handleInitialEvents,this),202);this.on('ipsDataLayerSync',this.remoteFetchEvents);this.scope.find('[data-datalayer-postfetch]').on('click',function(e){setTimeout(function(){$(e.currentTarget).trigger('ipsDataLayerSync');},1500);});},handleEvent:function(evt,event){let Events=IpsDataLayerConfig._events;let Properties=IpsDataLayerConfig._properties;let PII=IpsDataLayerConfig._pii;if(!Object.keys(Events).length||!this.eventHandlers.length){return;}
@@ -68,8 +65,9 @@ ips.utils.db.set('ipsDataLayer','login',{logged_in:1},false)}else{if(stored.logg
ips.utils.db.set('ipsDataLayer','login',{logged_in:0},false);}},uniqueId:function(){let s=i=>{return Math.floor((1+Math.random())*Math.pow(16,i)).toString(16).substring(1);};let time=Date.now();let sec=Math.floor(time/1000);let secString=sec.toString(16);secString=secString.substring(secString.length-8);let ms=(time-(sec*1000))*1000;let msString=(ms+0x100000).toString(16).substring(1);return secString+msString+s(1)+'.'+s(4)+s(4);},unsetOldUniqueKeys:function(){let Events=IpsDataLayerConfig._events;for(let eventKey in Events){let saved=ips.utils.db.get('ipsDataLayer',eventKey)||{};if(Object.keys(saved).length){Debug.log(`Found stored unique keys for the event '${eventKey}'`);Debug.log(saved);if(!saved.exp||saved.exp<=(Date.now()/1000)){Debug.log(`Removing expired stored unique keys for the event '${eventKey}'`);ips.utils.db.set('ipsDataLayer',eventKey,0,false);}}}},remoteFetchEvents:function(){let self=this;ips.getAjax()('?app=core&module=system&controller=ajax&do=getDataLayerEvents').done(function(response){for(let i in response){self.handleEvent({},response[i]);}});},});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.contentMessage',{initialize:function(){this.on('change','#check_message_is_public',this.updateEditorBorder);this.setup();},setup:function(){this.scope.find('.ipsComposeArea_editor').addClass('cContentMessageEditor');this.updateEditorBorder();},updateEditorBorder:function(){if($('#check_message_is_public').is(":checked")){this.scope.find('.ipsComposeArea_editor').removeClass('cContentMessageEditor--private').addClass('cContentMessageEditor--public');}else{this.scope.find('.ipsComposeArea_editor').removeClass('cContentMessageEditor--public').addClass('cContentMessageEditor--private');}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.moderation',{_editTimeout:0,_editingTitle:false,initialize:function(){this.on('submit','[data-role="moderationTools"]',this.moderationSubmit);this.on('mousedown','[data-role="editableTitle"]',this.editTitleMousedown);this.on('mouseup mouseleave','[data-role="editableTitle"]',this.editTitleMouseup);this.on('click','[data-role="editableTitle"]',this.editTitleMouseclick);},editTitleMousedown:function(e){var self=this;if(e.which!==1){return;}
this._editTimeout=setTimeout(function(){self._editingTitle=true;clearTimeout(this._editTimeout);var anchor=$(e.currentTarget);anchor.hide();var inputNode=$('<input/>').attr({type:'text'}).attr('data-role','editTitleField').val(anchor.text().trim());anchor.after(inputNode);inputNode.focus();inputNode.on('blur',function(){inputNode.addClass('ipsField_loading');const oldTitle=anchor.text().trim();const newTitle=inputNode.val().trim();if(newTitle===''||newTitle===oldTitle){inputNode.remove();anchor.show();self._editingTitle=false;}
this._editTimeout=setTimeout(function(){self._editingTitle=true;clearTimeout(this._editTimeout);var anchor=$(e.currentTarget);anchor.hide();var inputNode=$('<input/>').attr({type:'text'}).attr('data-role','editTitleField').val(anchor.text().trim());anchor.after(inputNode);inputNode.focus();let params={do:'ajaxEditTitle'};if(anchor.attr('data-params')!==undefined){params=Object.assign({},params,JSON.parse(anchor.attr('data-params')));}
inputNode.on('blur',function(){inputNode.addClass('ipsField_loading');const oldTitle=anchor.text().trim();const newTitle=inputNode.val().trim();if(newTitle===''||newTitle===oldTitle){inputNode.remove();anchor.show();self._editingTitle=false;}
else
{ips.getAjax()(anchor.attr('href'),{method:'post',data:{do:'ajaxEditTitle',newTitle}}).done(function(response){anchor.text(response);}).fail(function(response){ips.ui.alert.show({type:'alert',icon:'warn',message:response.responseJSON,});}).always(function(){inputNode.remove();anchor.show();self._editingTitle=false;});}});inputNode.on('keypress',function(e){if(e.keyCode==ips.ui.key.ENTER){e.stopPropagation();e.preventDefault();inputNode.blur();return false;}});inputNode.on('keydown',function(e){if(e.keyCode==ips.ui.key.ESCAPE){inputNode.remove();anchor.show();self._editingTitle=false;return false;}});},1000);},editTitleMouseup:function(e){clearTimeout(this._editTimeout);},editTitleMouseclick:function(e){if(this._editingTitle){e.preventDefault();}},moderationSubmit:function(e){if(this._editingTitle){e.preventDefault();}
{params={...params,...{"newTitle":newTitle}};ips.getAjax()(anchor.attr('href'),{method:'post',data:params}).done(function(response){anchor.text(response);}).fail(function(response){ips.ui.alert.show({type:'alert',icon:'warn',message:response.responseJSON,});}).always(function(){inputNode.remove();anchor.show();self._editingTitle=false;});}});inputNode.on('keypress',function(e){if(e.keyCode==ips.ui.key.ENTER){e.stopPropagation();e.preventDefault();inputNode.blur();return false;}});inputNode.on('keydown',function(e){if(e.keyCode==ips.ui.key.ESCAPE){inputNode.remove();anchor.show();self._editingTitle=false;return false;}});},1000);},editTitleMouseup:function(e){clearTimeout(this._editTimeout);},editTitleMouseclick:function(e){if(this._editingTitle){e.preventDefault();}},moderationSubmit:function(e){if(this._editingTitle){e.preventDefault();}
var action=this.scope.find('[data-role="moderationAction"]').val();switch(action){case'delete':this._modActionDelete(e);break;case'move':this._modActionDialog(e,'move','narrow');break;case'hide':this._modActionDialog(e,'hide','narrow');break;case'split':this._modActionDialog(e,'split','wide');break;case'merge':this._modActionDialog(e,'merge','medium');break;case'tag':this._modActionDialog(e,'tag','narrow');break;case'untag':this._modActionDialog(e,'untag','narrow');break;default:$(document).trigger('moderationSubmitted');break;}},_modActionDelete:function(e){var self=this;var form=this.scope.find('[data-role="moderationTools"]');if(self._bypassDeleteCheck){return;}
e.preventDefault();var count=parseInt(this.scope.find('[data-role="moderation"]:checked').length)+parseInt(this.scope.find('[data-role="moderation"]:hidden').length);ips.ui.alert.show({type:'confirm',icon:'warn',message:(count>1)?ips.pluralize(ips.getString('delete_confirm_many'),count):ips.getString('delete_confirm'),callbacks:{ok:function(){$(document).trigger('moderationSubmitted');self._bypassDeleteCheck=true;self.scope.find('[data-role="moderationTools"]').submit();}}});},_modActionDialog:function(e,title,size){e.preventDefault();var form=this.scope.find('[data-role="moderationTools"]');var moveDialog=ips.ui.dialog.create({url:form.attr('action')+'&'+form.serialize().replace(/%5B/g,'[').replace(/%5D/g,']'),modal:true,title:ips.getString(title),forceReload:true,size:size});moveDialog.show();$(document).trigger('moderationSubmitted');}});}(jQuery,_));;
+2 -2
View File
@@ -76,9 +76,9 @@ if(data['stream_classes_type']===0&&defaultValues['stream_classes_type']===1){re
var containers={};if(!_.isUndefined(data['stream_classes'])&&_.isObject(data['stream_classes'])){_.each(_.without(_.keys(data['stream_classes']),'__EMPTY'),function(val,key){var contentType=$('div[data-role="streamContainer"][data-className="'+val.replace(/\\/g,'\\\\')+'"]').attr('data-contentKey');if(!_.isUndefined(contentType)&&$('input[name="stream_containers_'+contentType+'"]').length){containers[val]=$('input[name="stream_containers_'+contentType+'"]').val();}});}
if(!_.isEmpty(containers)){if(!_.isUndefined(defaultValues['containers'])&&!_.isEqual(containers,defaultValues['containers'])){returnedValues['stream_containers']=containers;}}
return returnedValues;},_buildRequestURL(extraParams){var urlDiff=this._getUrlDiff(this._formData);var params=[];_.each(urlDiff,function(val,key){if(_.isObject(val)){if(!_.size(val)){params.push(key+'=');}else{var keys=_.keys(val);var values=_.values(val);for(var i=0;i<keys.length;i++){var paramValue=(!_.isUndefined(values[i])?values[i]:1);params.push(key+'['+encodeURIComponent(keys[i])+']='+paramValue);}}}else{params.push(key+'='+encodeURIComponent(val));}});if(_.isObject(extraParams)){_.each(extraParams,function(val,key){params.push(key+'='+encodeURIComponent(val));});}
return this._baseURL+'&'+params.join('&');},menuOpened(e,data){data.menu.find('input[type="text"]').focus().get(0).select();},removeStream(e){e.preventDefault();ips.ui.alert.show({type:'confirm',message:ips.getString('confirmRemoveStream'),callbacks:{ok(){window.location=$(e.currentTarget).attr('href')+'&wasConfirmed=1';},}});},toggleDefault(e){e.preventDefault();var self=this;var link=$(e.currentTarget);var value=link.attr('data-change');var url=link.attr('href');ips.getAjax()(url).done(function(response){if(value===1){self.scope.find('a[data-action="toggleStreamDefault"][data-change="0"]').removeClass('ipsHide');self.scope.find('a[data-action="toggleStreamDefault"][data-change="1"]').addClass('ipsHide');}else{self.scope.find('a[data-action="toggleStreamDefault"][data-change="0"]').addClass('ipsHide');self.scope.find('a[data-action="toggleStreamDefault"][data-change="1"]').removeClass('ipsHide');}
return this._baseURL+'&'+params.join('&');},menuOpened(e,data){data.menu.find('input[type="text"]').focus().get(0).select();},removeStream(e){e.preventDefault();ips.ui.alert.show({type:'confirm',message:ips.getString('confirmRemoveStream'),callbacks:{ok(){window.location=$(e.currentTarget).attr('href')+'&wasConfirmed=1';},}});},toggleDefault(e){e.preventDefault();var self=this;var link=$(e.currentTarget);var value=link.attr('data-change');var url=link.attr('href');ips.getAjax()(url).done(function(response){if(value==1){self.scope.find('[data-role="toggleDefaultTrue"]').attr('hidden','');self.scope.find('[data-role="toggleDefaultFalse"]').removeAttr('hidden');}else{self.scope.find('[data-role="toggleDefaultTrue"]').removeAttr('hidden');self.scope.find('[data-role="toggleDefaultFalse"]').attr('hidden','');}
if(!response.title){$('a[data-action="defaultStream"]').hide();}else{$('a[data-action="defaultStream"]').attr('href',response.url).attr('aria-label',response.title).show().find('[data-role="defaultStreamName"]').html(response.title);}
if(value===1){if(!ips.utils.responsive.enabled||!ips.utils.responsive.currentIs('phone')&&$('a[data-action="defaultStream"]').is(':visible')){self._showStreamTooltip(response.tooltip);}else{ips.utils.anim.go('pulseOnce',$('a[data-action="defaultStream"]'));}}});},_showStreamTooltip(title){if(!this._tooltip){var tooltipHTML=ips.templates.render('core.tooltip',{id:'elDefaultStreamTooltip_'+this.controllerID});ips.getContainer().append(tooltipHTML);this._tooltip=$('#elDefaultStreamTooltip_'+this.controllerID);}else{this._tooltip.hide();}
if(value==1){if(!ips.utils.responsive.enabled||!ips.utils.responsive.currentIs('phone')&&$('a[data-action="defaultStream"]').is(':visible')){self._showStreamTooltip(response.tooltip);}else{ips.utils.anim.go('pulseOnce',$('a[data-action="defaultStream"]'));}}});},_showStreamTooltip(title){if(!this._tooltip){var tooltipHTML=ips.templates.render('core.tooltip',{id:'elDefaultStreamTooltip_'+this.controllerID});ips.getContainer().append(tooltipHTML);this._tooltip=$('#elDefaultStreamTooltip_'+this.controllerID);}else{this._tooltip.hide();}
if(this._tooltipTimer){clearTimeout(this._tooltipTimer);}
this._tooltip.text(ips.getString('streamDefaultTooltip',{title:title}));var streamLink=$('a[data-action="defaultStream"]:visible');var self=this;var positionInfo={trigger:streamLink.first(),target:this._tooltip,center:true,above:true};var tooltipPosition=ips.utils.position.positionElem(positionInfo);$(this._tooltip).css({left:tooltipPosition.left+'px',top:tooltipPosition.top+'px',position:(tooltipPosition.fixed)?'fixed':'absolute',zIndex:ips.ui.zIndex()});if(tooltipPosition.location.vertical==='top'){this._tooltip.addClass('ipsTooltip_top');}else{this._tooltip.addClass('ipsTooltip_bottom');}
this._tooltip.show();setTimeout(function(){if(self._tooltip&&self._tooltip.is(':visible')){ips.utils.anim.go('fadeOut',self._tooltip);}},3000);},_setStreamLoading(loading){var stream=this.scope.find('[data-role="streamContent"]');if(!loading){this._streamLoadingOverlay.hide();stream.css({opacity:"1"});return;}else{if(!this._streamLoadingOverlay){this._streamLoadingOverlay=$('<div/>').addClass('ipsLoading');ips.getContainer().append(this._streamLoadingOverlay);}
+1 -1
View File
@@ -23,7 +23,7 @@ else
{$('#elMetaTagEditor_customTags').find('li[data-role="noCustomMetaTagsMessage"]').show();}},formSubmit:function(e){var form=$(e.currentTarget);if(form.attr('data-noAjax')){return;}
e.preventDefault();var self=this;form.find('.ipsButton').prop('disabled',true).addClass('ipsButton--disabled');ips.getAjax()(form.attr('action'),{data:form.serialize(),type:'post'}).done(function(){ips.ui.flashMsg.show(ips.getString('metaTagsSaved'));form.find('.ipsButton').prop('disabled',false).removeClass('ipsButton--disabled');self._changed=false;if(form.find('[name="meta_tag_title"]').val()){document.title=form.find('[name="meta_tag_title"]').val();}
else
{document.title=self.scope.attr('data-defaultPageTitle');}}).fail(function(){form.attr('data-noAjax','true');form.submit();});},beforeUnload:function(){if(this._changed){return ips.getString('metaTagsUnsaved');}},addMetaBlock:function(e){e.preventDefault();var copy=this.scope.find('[data-role="metaTemplate"]').clone().attr('data-role','metaTagRow').hide();$('#elMetaTagEditor_customTags').append(copy);ips.utils.anim.go('fadeIn',copy);$(document).trigger('contentChange',[copy]);this.changed();this._showHideNoTagsMessage();},changed:function(e){this._changed=true;}});}(jQuery,_));;
{document.title=self.scope.attr('data-defaultPageTitle');}}).fail(function(){form.attr('data-noAjax','true');form.submit();});},beforeUnload:function(){if(this._changed){return ips.getString('metaTagsUnsaved');}},addMetaBlock:function(e){var copy=this.scope.find('[data-role="metaTemplate"]').clone().attr('data-role','metaTagRow').hide();$('#elMetaTagEditor_customTags').append(copy);ips.utils.anim.go('fadeIn',copy);$(document).trigger('contentChange',[copy]);this.changed();this._showHideNoTagsMessage();},changed:function(e){this._changed=true;}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.system.notificationSettings',{initialize:function(){this.on('click','[data-action="enablePush"]',this.enablePush);this.on(document,'subscribePending.notifications',this.subscribePending);this.on(document,'subscribeSuccess.notifications',this.subscribeSuccess);this.on(document,'subscribeFail.notifications',this.subscribeFail);this.on(document,'permissionDenied.notifications',this.permissionDenied);this.on('click','[data-action="showNotificationSettings"]',this.showNotificationSettings);this.on('click','[data-action="closeNotificationSettings"]',this.closeNotificationSettings);this.on('change','[data-role="notificationSettingsWindow"]',this.saveNotificationSettings);this.on('change','#elBrowserNotifications',this.promptMe);this.setup();},setup:function(){this._showNotificationOptions();},_showNotificationOptions:function(){const pushElement=this.scope.find('[data-action="enablePush"]');if(ips.utils.notification.supported&&ips.utils.serviceWorker.supported){if(Notification.permission==='granted'){ips.utils.notification.getSubscription().then(subscription=>{if(!subscription){return;}
const enableLink=pushElement.contents();pushElement.html(ips.templates.render('core.notifications.checking'));const jsonSubscription=JSON.parse(JSON.stringify(subscription));const key=jsonSubscription.keys.p256dh;ips.getAjax()(ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=notifications&do=verifySubscription',{type:'post',data:{key}}).done((response,status,jqXHR)=>{if(jqXHR.status===200){pushElement.html(ips.templates.render('core.notifications.success'));return;}
pushElement.html(enableLink);}).fail(()=>{pushElement.html(enableLink);});}).catch(err=>{Debug.error(err);pushElement.html(ips.templates.render('core.notifications.notSupported'));});}else if(Notification.permission==='denied'){pushElement.html(ips.templates.render('core.notifications.fail'));}}else{Debug.log("Notifications not supported");pushElement.html(ips.templates.render('core.notifications.notSupported'));}
+13 -9
View File
@@ -28,20 +28,23 @@ const response=await ips.fetch(ips.getSetting('baseURL'),{method:'GET',data});th
ips.utils.anim.go('fadeIn',this.scope);this.trigger('loadedWidget.widgets',{blockID:this._blockID});}catch(e){this.scope.html('Error');}
this._setLoading(false);},resetResponsiveClasses(deviceList){this.scope.removeClass('ipsResponsive_hidePhone').removeClass('ipsResponsive_hideDesktop').removeClass('ipsResponsive_hideTablet');for(const value of["Phone","Tablet","Desktop"].filter(i=>!deviceList.includes(i))){this.scope.addClass('ipsResponsive_hide'+value);}},markAllRead(){this.scope.find('[data-ips-unread]').removeAttr('data-ips-unread');},_setLoading(status){if(status){this.scope.html('').addClass('ipsLoading cSidebarBlock_loading');}else{this.scope.removeClass('ipsLoading cSidebarBlock_loading');}}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.widgets.carouselControls',{initialize(){if(this.elem.closest('.pageBuilderRoot')||!this.getCarousel()){return;}
this._area=undefined;this.setupCarousel();},_area:undefined,getCarousel(){if(this._area===undefined){const container=this.elem.closest('.cWidgetContainer');if(!container?.classList.contains('cWidgetContainer--carousel')){this._area=null;}else{this._area=container;}}
return this._area;},_carouselIndicator:undefined,_isScrolling:false,_actualCarouselIndex:0,getCarouselOffset(){const children=this.getCarousel().querySelectorAll(':scope > .cWidgetContainer:not([hidden])');if(this._isScrolling){return[this._actualCarouselIndex,children.length,children];}
const box=this.getCarousel().getBoundingClientRect();let index;for(index=0;index<children.length;index++){if(children[index].getBoundingClientRect().left>=(box.left-10)){return[index,children.length,children];}}
return[children.length-1,children.length,children];},getCarouselIndicator(){if(this._carouselIndicator===undefined){this._carouselIndicator=this.elem.querySelector(`.cWidgetContainer__carousel-indicator`);}
this._area=undefined;this.setupCarousel();},_area:undefined,getCarousel(){if(this._area===undefined){const container=this.elem.closest('.cWidgetContainer');if(!container?.classList.contains('cWidgetContainer--carousel')){this._area=null;}else{this._area=container.querySelector(":scope > .cWidgetContainer__carousel-wrap")||container;}}
return this._area;},_carouselIndicator:undefined,_isScrolling:false,_actualCarouselIndex:0,getCarouselOffset(){let children=[...this.getCarousel().querySelectorAll(':scope > .cWidgetContainer:not([hidden])')];if(this._isScrolling){return[this._actualCarouselIndex,children.length,children];}
const box=this.getScrollerBox();let index;for(index=0;index<children.length-1;index++){if(!this.isRTL()&&Math.ceil(children[index].getBoundingClientRect().left)>=Math.floor(box.left)){return[index,children.length,children];}else if(this.isRTL()&&Math.floor(children[index].getBoundingClientRect().right)<=Math.ceil(box.right)){return[index,children.length,children];}}
return[children.length-1,children.length,children];},isRTL(){return ips.ui.carousel.isRTL(this.getCarousel());},getCarouselIndicator(){if(this._carouselIndicator===undefined){this._carouselIndicator=this.elem.querySelector(`.cWidgetContainer__carousel-indicator`);}
return this._carouselIndicator;},updateCarouselIndicator(){const indicator=this.getCarouselIndicator();if(!indicator){Debug.warn(`Couldn't find a carousel indicator for a carousel`);return;}
let[index,total]=this.getCarouselOffset();index=Math.min(index,this.getPageCount());total=Math.min(total,this.getPageCount());indicator.innerHTML=this.shouldUseCarouselLinks()?`<a href="#${this.getCarouselHref(index)}">${index + 1}/${total}</a>`:`${index + 1}/${total}`;this.elem.querySelectorAll('button').forEach(el=>total<=1?el.setAttribute('disabled',''):el.removeAttribute('disabled'));},carouselScroll(e){const button=e.target?.closest?.(`[data-carousel-arrow]`);if(!button){return;}
const[index,total,children]=this.getCarouselOffset();const dir=button.dataset.carouselArrow||'next';const box=this.getCarousel().getBoundingClientRect();const atEnd=dir!=='prev'&&((index===total-1)||(children[total-1].getBoundingClientRect().right<=box.right-5));const toIndex=((dir==='prev'&&index===0)?(total-1):(atEnd?0:index+(dir==='prev'?-1:1)))%total;const childBox=children[toIndex].getBoundingClientRect();const scrollAmount=(toIndex===total-1?childBox.right:childBox.left)-box.left;this._isScrolling=true;this._actualCarouselIndex=toIndex;children.forEach(child=>child.style.scrollSnapStop="normal")
this.getCarousel().scrollTo({left:this.getCarousel().scrollLeft+scrollAmount,behavior:"smooth"});this.updateCarouselIndicator();},carouselScrollEnd(){this._isScrolling=false;const children=this.getCarousel().querySelectorAll(":scope > .cWidgetContainer:not([hidden])");children.forEach(child=>child.style.scrollSnapStop="")
const[index,total,children]=this.getCarouselOffset();const dir=button.dataset.carouselArrow||'next';const box=this.getScrollerBox();let atEnd=false;if(dir==='next'){if(index===total-1){atEnd=true;}else if(!this.isRTL()){atEnd=Math.floor(children[total-1].getBoundingClientRect().right)<=Math.ceil(box.right);}else{atEnd=Math.ceil(children[total-1].getBoundingClientRect().left)>=Math.floor(box.left);}}else{if(index===0){atEnd=true;}else if(this.isRTL()){atEnd=Math.floor(children[0].getBoundingClientRect().right)<=Math.ceil(box.right);}else{atEnd=Math.ceil(children[0].getBoundingClientRect().left)>=Math.floor(box.left);}}
const toIndex=((dir==='prev'&&atEnd)?(total-1):(atEnd?0:index+(dir==='prev'?-1:1)))%total;const childBox=children[toIndex].getBoundingClientRect();const paddedBox=this.getPaddedScrollBox();let scrollAmount;if(this.isRTL()){scrollAmount=(toIndex===total-1?childBox.left:childBox.right)-paddedBox.right;}else{scrollAmount=(toIndex===total-1?childBox.right:childBox.left)-paddedBox.left;}
this._isScrolling=true;this._actualCarouselIndex=toIndex;children.forEach(child=>child.style.scrollSnapStop="normal")
this.getCarousel().scrollTo({left:this.getCarousel().scrollLeft+scrollAmount,behavior:"smooth"});this.updateCarouselIndicator();},getScrollerBox(){return this.getCarousel().getBoundingClientRect();},getPaddedScrollBox(){const box=this.getScrollerBox();const padding=this.getScrollPadding();return new DOMRect(box.x+padding.left,box.y,box.width-(padding.left+padding.right),box.height);},getScrollPadding(){return ips.ui.carousel.getScrollPadding(this.getCarousel());},carouselScrollEnd(){this._isScrolling=false;const children=this.getCarousel().querySelectorAll(":scope > .cWidgetContainer:not([hidden])");children.forEach(child=>child.style.scrollSnapStop="")
this.updateCarouselIndicator();},getCarouselHref(idx){if(this.shouldUseCarouselLinks()){return`carouselwidget_${this.getCarousel().dataset.widgetarea}_${this.getCarousel().dataset.widgetAreaId}_${idx + 1}`;}
return'';},shouldUseCarouselLinks(){return!!(this.getCarousel().dataset.widgetAreaId&&this.getCarousel().dataset.widgetarea);},setupCarousel(){if(!(this.getCarousel()instanceof Element)||this.getCarousel().closest('body')!==document.body||!this.getCarousel().classList.contains('cWidgetContainer--carousel')||!this.getCarousel().querySelector(`:scope > .cWidgetContainer`)||(this.getCarousel().querySelectorAll(`:scope > .cWidgetContainer`).length===1&&this.getCarousel().querySelector(`:scope > .cWidgetContainer`).getBoundingClientRect().width>=this.elem.getBoundingClientRect().width)){this.elem.ipsHide();return;}
return'';},shouldUseCarouselLinks(){return!!(this.getCarousel().dataset.widgetAreaId&&this.getCarousel().dataset.widgetarea);},setupCarousel(){if(!(this.getCarousel()instanceof Element)||this.getCarousel().closest('body')!==document.body||!this.getCarousel().querySelector(`:scope > .cWidgetContainer`)||(this.getCarousel().querySelectorAll(`:scope > .cWidgetContainer`).length===1&&this.getCarousel().querySelector(`:scope > .cWidgetContainer`).getBoundingClientRect().width>=this.elem.getBoundingClientRect().width)){this.elem.ipsHide();return;}
this.elem.ipsShow();const buttonContainer=this.elem;buttonContainer.querySelectorAll('[data-carousel-arrow]').forEach(button=>button.addEventListener('click',e=>this.carouselScroll(e)));if('onscrollend'in this.getCarousel()){this.getCarousel().addEventListener('scrollend',()=>this.carouselScrollEnd(),{capture:true});}else{this.getCarousel().addEventListener('scroll',_.debounce(()=>this.carouselScrollEnd(),200),{capture:true});}
this.updateCarouselIndicator();if(this.shouldUseCarouselLinks()&&window.location.hash){const[_,total,children]=this.getCarouselOffset();for(let i=0;i<total;i++){const hash=this.getCarouselHref(i);if(hash&&window.location.hash===`#${hash}`){this._actualCarouselIndex=i;this._isScrolling=true;children[i].scrollIntoView({behavior:"instant",block:"start",inline:"start"});break;}}}
this.setupObserver();},getPageCount(){const box=this.getCarousel()?.getBoundingClientRect();if(!box){return 1;}
const children=this.getCarousel().querySelectorAll(`:scope > .cWidgetContainer:not([hidden])`);if(children.length<2){return 1;}
let children=[...this.getCarousel().querySelectorAll(`:scope > .cWidgetContainer:not([hidden])`)];if(children.length<2){return 1;}
if(this.isRTL()){children=children.reverse();}
let basePages=Math.ceil(Math.abs(children[children.length-1].getBoundingClientRect().right-children[0].getBoundingClientRect().left)/box.width);if(children.length>2&&(children[children.length-1].getBoundingClientRect().right-children[children.length-2].getBoundingClientRect().left)>box.width){basePages++;}
return basePages;},setupObserver(){if(this._observer){this._observer.disconnect();}
if(this.getCarousel()instanceof HTMLElement){this._observer=new ResizeObserver(_.debounce(()=>this.updateCarouselIndicator()));this._observer.observe(this.getCarousel());}}});}(jQuery,_));;
@@ -69,7 +72,8 @@ let url=window.location.href.replaceAll(/#.*$|\b_blockManager=1?\b/g,'')
url+=url.includes('?')?'&_blockManager=1':'?_blockManager=1'
url+=anchor
ips.utils.history.pushState({artificial:true},'pagebuilder',url)}
this.scope.addClass('cWidgetsManaging');},closeSidebarManager(e){e?.preventDefault();if(this._inManagingState){this.scope.removeClass('cWidgetsManaging');this._hideManager();try{this.triggerOn('core.front.widgets.area','managingFinished.widgets');}catch(e){Debug.error(e);}
this.scope.addClass('cWidgetsManaging');},closeSidebarManager(e){e?.preventDefault();if(this._inManagingState){document.querySelectorAll('.ipsMenu[data-page-editor-menu]').forEach(element=>{element.dispatchEvent(new CustomEvent('closeMenu'));element.remove();})
this.scope.removeClass('cWidgetsManaging');this._hideManager();try{this.triggerOn('core.front.widgets.area','managingFinished.widgets');}catch(e){Debug.error(e);}
if(ips.utils.url.getParam('_blockManager')){if(ips.utils.history.getState('pagebuilder').artificial){window.history.back()}
setTimeout(()=>ips.utils.history.replaceState({},'pagebuilder',window.location.href.replace(/\?(.*?)&?_blockManager=[^&]*/,'?$1').replace(/[?&]+$/,'')))}}},_setUpDragging(){this.elem.querySelectorAll('[data-role="availableBlocks"] ul').forEach(list=>{list.style.zIndex=ips.ui.zIndex();list.querySelectorAll(':scope > .cSidebarManager_block').forEach(item=>this._setupDraggingOnItem(item));})},_setupDraggingOnItem(item){item.setAttribute('draggable','true');const wrapBehavior=item.dataset.widgetLayouts?.split(',')?.[0]?.trim()||'table'
item.addEventListener('dragstart',function(e){e.stopPropagation();e.dataTransfer.clearData();const data={blockID:e.target.dataset.blockid,blockTitle:e.target.dataset.blocktitle,allowReuse:e.target.dataset.allowreuse,config:!!e.target.dataset.blockconfig,blank:e.target.dataset.blockerrormessage,menustyle:e.target.dataset.menustyle,ipsWrapBehavior:wrapBehavior,};e.dataTransfer.setData('application/x.ipsblock',JSON.stringify(data));ipsSettings.__pageeditor_last_dragged_widget_data__=data;item.addEventListener('dragend',e=>{delete ipsSettings.__pageeditor_last_dragged_widget_data__;},{once:true});})},async _showManager(){this.scope.find('#elSidebarManager').removeAttr('hidden');this._fadeUnmanagedRoots();if(!this._loadedManager&&!this._loadingManager){try{const response=await ips.fetch(ips.getSetting('baseURL')+'index.php?app=core&module=system&controller=widgets&do=getBlockList',{data:{pageApp:$('body').attr('data-pageApp')}})
+1 -1
View File
@@ -44,7 +44,7 @@ var div=$('<div data-role="autoCompleteWrapper" />').html(this.scope.contents())
var self=this;var autoCompleteObj=ips.ui.autocomplete.getObj(this._autoComplete);this.scope.find('[data-action="showAutocomplete"]').hide();this.scope.find('[data-role="autoCompleteWrapper"]').show();this.scope.closest('.ipsFieldRow').find('.ipsFieldRow__label').show();setTimeout(function(){if(self._closedTagging){self.scope.find('[data-action="addToken"]').click();}else{autoCompleteObj.focus();}},100);}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.global.core.prefixedAutocomplete',{initialize:function(){this.setup();this.on('autoCompleteReady',this.autoCompleteReady);this.on('tokenAdded',this.tokensChanged);this.on('tokenDeleted',this.tokensChanged);this.on('menuItemSelected','[data-role="prefixButton"]',this.prefixSelected);this.scope.find('[data-ipsAutocomplete]').trigger('reissueReady');},setup:function(){this._prefixRow=this.scope.find('[data-role="prefixRow"]');this._prefixValue=this.scope.find('[data-role="prefixValue"]');this._prefixButton=this.scope.find('[data-role="prefixButton"]');this._prefixMenu=this.scope.find('[data-role="prefixMenu"]');},autoCompleteReady:function(e,data){var tokens=data.currentValues;if(this._prefixValue&&tokens.length){this._prefixMenu.html(this._buildTokenList(tokens,this._prefixValue.val()));this._prefixButton.find('span').html(this._getPrefixText(_.escape(this._prefixValue.val())));this._prefixRow.show();}},tokensChanged:function(e,data){if(data.totalTokens>0&&!this._prefixRow.is(':visible')){ips.utils.anim.go('fadeIn',this._prefixRow);}else if(data.totalTokens===0&&this._prefixRow.is(':visible')){ips.utils.anim.go('fadeOut',this._prefixRow);this._prefixRow.find('input[type="checkbox"]').prop('checked',false);}
if(e&&e.type=='tokenDeleted'&&data.token==this._prefixValue.val()){this._prefixButton.find('span').html(ips.getString('selectPrefix'));this._prefixValue.val('');}
var value=this._prefixValue.val();var list=this._buildTokenList(data.tokenList,value);this._prefixMenu.html(list);},prefixSelected:function(e,data){data.originalEvent.preventDefault();var itemValue=(data.selectedItemID=='-')?'':data.selectedItemID;var selectedText=this._getPrefixText(data.selectedItemID);this._prefixButton.find('span').html(selectedText);this._prefixValue.val(itemValue);this._prefixRow.find('input[type="checkbox"]').prop('checked',true);},_buildTokenList:function(tokens,value){var output='';output+=ips.templates.render('core.menus.menuItem',{value:'',title:ips.getString('selectedNone'),checked:(value=='')});output+=ips.templates.render('core.menus.menuSep');$.each(tokens,function(i,item){output+=ips.templates.render('core.menus.menuItem',{value:item,title:_.unescape(item),checked:(item==value)});});Debug.log(output);return output;},_getPrefixText:function(prefix){var selectedText='';if(prefix&&prefix!='-'){selectedText=ips.getString('selectedPrefix',{tag:prefix});}else{selectedText=ips.getString('selectedPrefix',{tag:ips.getString('selectedNone')});}
var value=this._prefixValue.val();var list=this._buildTokenList(data.tokenList,value);this._prefixMenu.html(list);},prefixSelected:function(e,data){data.originalEvent.preventDefault();var itemValue=(data.selectedItemID=='-')?'':data.selectedItemID;var selectedText=this._getPrefixText(data.selectedItemID);this._prefixButton.find('span').html(selectedText);this._prefixValue.val(itemValue);this._prefixRow.find('input[type="checkbox"]').prop('checked',true);},_buildTokenList:function(tokens,value){var output='';output+=ips.templates.render('core.menus.menuItem',{value:'',title:ips.getString('selectedNone'),checked:(value=='')});output+=ips.templates.render('core.menus.menuSep');$.each(tokens,function(i,item){output+=ips.templates.render('core.menus.menuItem',{value:item,title:_.unescape(item),checked:(item==value)});});return output;},_getPrefixText:function(prefix){var selectedText='';if(prefix&&prefix!='-'){selectedText=ips.getString('selectedPrefix',{tag:prefix});}else{selectedText=ips.getString('selectedPrefix',{tag:ips.getString('selectedNone')});}
return selectedText;}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.global.core.table',{_urlParams:{},_baseURL:'',_otherParams:[],_pageParam:'page',_updateURL:true,_currentPage:1,_seoPagination:false,_initialURL:'',_ajax:null,initialize:function(){this.on('paginationClicked paginationJump',this.paginationClicked);this.on('refreshResults',this.refreshResults);this.on('buttonAction',this.buttonAction);this.on('click','[data-action="tableFilter"]',this.changeFiltering);this.on('menuItemSelected','[data-role="tableFilterMenu"]',this.changeFilteringFromMenu);this.on('click','tr[data-tableClickTarget]',this.rowClick);this.setup();},setup:function(){if(this.scope.attr('data-pageParam')&&this.scope.attr('data-pageParam')!='page'){this._pageParam=this.scope.attr('data-pageParam');}
this._otherParams.push(this._pageParam);this._baseURL=this.scope.attr('data-baseurl');const safeURL=[...(new TextEncoder()).encode(this.scope.attr('data-baseurl')?ips.utils.url.pageParamToPath(this._cleanUpURL(this.scope.attr('data-baseurl')),this._pageParam,1):'')].map(char=>String.fromCodePoint(char)).join('');this._stateKey=`table${btoa(safeURL)}`;this._originalBaseURL=this._baseURL;this._currentPage=ips.utils.url.getPageNumber(this._pageParam,window.location.href);this._cleanUpBaseURL();if(this._baseURL.match(/\?/)){if(this._baseURL.slice(-1)!='?'){this._baseURL+='&';}}else{this._baseURL+='?';}