Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -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'));}
|
||||
|
||||
Reference in new issue
Block a user