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

+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,_));;