/home/desid573/verdenaturopathy.com.au/wp-content/plugins/popup-builder/public/js
NameSizeModeActions
Backend.js563420644editdlrm
Banner.js26810644editdlrm
bootstrap.min.js396800644editdlrm
ExtensionsNotification.js21680644editdlrm
FloatingButton.js72650644editdlrm
gutenbergBlock.min.js67080644editdlrm
MediaButton.js57510644editdlrm
Modals.js49180644editdlrm
Newsletter.js24230644editdlrm
NotificationCenter.js33490644editdlrm
Popup.js388750644editdlrm
PopupBuilder.js789510644editdlrm
PopupConfig.js60100644editdlrm
select2.min.js744380644editdlrm
sgpbDetect.js68920644editdlrm
sgpbSelect2.js12130644editdlrm
sgPopupRangeSlider.js176470644editdlrm
Subscribers.js102900644editdlrm
Subscription.js106690644editdlrm
Validate.js242780644editdlrm
Edit: /home/desid573/verdenaturopathy.com.au/wp-content/plugins/popup-builder/public/js/Subscribers.js (10290B)
function SGPBSubscribers(){} SGPBSubscribers.prototype.init=function() {this.deleteSubscribers();this.toggleCheckedSubscribers();this.popupsTableRowColorChange();this.deleteButtonHideShow();this.exportSubscribers();this.modal=new SGPBModals();this.modal.modalInit();this.subscriberFileUploader();this.importSubscriber();this.addSubscribers();};SGPBSubscribers.prototype.deleteSubscribers=function() {var checkedSubscribersList=[];var that=this;jQuery('.sg-subs-delete-button').bind('click',function(){var data={};data.ajaxNonce=jQuery(this).attr('data-ajaxNonce');jQuery('.subs-delete-checkbox').each(function(){var isChecked=jQuery(this).prop('checked');if(isChecked){var subscriberId=jQuery(this).attr('data-delete-id');checkedSubscribersList.push(subscriberId);}});if(checkedSubscribersList.length===0){alert('Please select at least one subscriber.');} else{var isSure=confirm(SGPB_JS_LOCALIZATION.areYouSure);if(isSure){that.deleteSubscribersAjax(checkedSubscribersList,data);}}});};SGPBSubscribers.prototype.subscriberFileUploader=function() {var uploadButton=jQuery('#js-import-subscriber-button');var supportedAudioTypes=['text/plain','text/x-csv','text/csv'];if(!uploadButton.length){return false;} var uploader;uploadButton.bind('click',function(e){e.preventDefault();if(uploader){uploader.open();return false;} uploader=wp.media.frames.file_frame=wp.media({titleFF:SGPB_JS_LOCALIZATION.changeSound,button:{text:SGPB_JS_LOCALIZATION.changeSound},library:{type:supportedAudioTypes},multiple:false});uploader.on('select',function(){var attachment=uploader.state().get('selection').first().toJSON();if(supportedAudioTypes.indexOf(attachment.mime)===-1){alert(SGPB_JS_LOCALIZATION.audioSupportAlertMessage);return;} jQuery('#js-import-subscriber-file-url').val(attachment.url);});uploader.open();});};SGPBSubscribers.prototype.importSubscriber=function() {var importSubscriber=jQuery('.sgpb-import-subscriber-to-list');var that=this;if(!importSubscriber.length){return false;} importSubscriber.bind('click',function(){var popupSubscriptionList=jQuery('.js-sg-import-list').val();var importListURL=jQuery('#js-import-subscriber-file-url').val();if(!importListURL.length) return;var data={action:'sgpb_import_subscribers',nonce:SGPB_JS_PARAMS.nonce,popupSubscriptionList:popupSubscriptionList,importListURL:importListURL,beforeSend:function(){importSubscriber.prop('disabled',true);}};jQuery.post(ajaxurl,data,function(response){importSubscriber.prop('disabled',false);that.modal.changeModalContent(jQuery('.sgpb-modal'),jQuery(response),jQuery('.sgpb-modal').data('target'));that.removeAllValuesOnModalDestroy();that.saveImportValue();that.disableSelectedValue();});});};SGPBSubscribers.prototype.removeAllValuesOnModalDestroy=function(){jQuery('.sgpb-add-subscriber-input:selected').prop('selected',false);jQuery('.sgpb-add-subscriber-input').val('');jQuery('#js-import-subscriber-file-url').val('')};SGPBSubscribers.prototype.disableSelectedValue=function(){var selectOptioon=jQuery('.sgpb-our-fields-keys');if(!selectOptioon.length){return false;} selectOptioon.bind('change',function(){var currentVal=jQuery(this).val();jQuery('.sgpb-our-fields-keys option[value="'+jQuery(this).attr('data-saved-value')+'"]').removeAttr('disabled');jQuery(this).attr('data-saved-value',currentVal);jQuery('.sgpb-our-fields-keys option[value="'+currentVal+'"]').not(jQuery(this)).attr('disabled','disabled');});};SGPBSubscribers.prototype.saveImportValue=function() {var importSubscriber=jQuery('.sgpb-import-subscriber-to-list');var mapping={};var data={action:'sgpb_save_imported_subscribers',nonce:SGPB_JS_PARAMS.nonce,popupSubscriptionList:jQuery('.sgpb-to-import-popup-id').val(),importListURL:jQuery('.sgpb-imported-file-url').val(),};jQuery('.sgpb-save-subscriber').bind('click',function(){mapping={};var ourFields=jQuery('.sgpb-our-fields-keys');ourFields.each(function(){var currentValue=jQuery('option:selected',this).val();if(currentValue){mapping[currentValue]=jQuery(this).attr('data-index');}});data.namesMapping=mapping;data.popupId=jQuery('.sgpb-to-import-popup-id').val();data.beforeSend=function(){jQuery('.sgpb-save-subscriber').prop('disabled',true);};jQuery.post(ajaxurl,data,function(response){window.location.reload();jQuery('.sgpb-save-subscriber').prop('disabled',false);});});};SGPBSubscribers.prototype.addSubscribers=function() {var that=this;jQuery('.sgpb-add-to-list-js').bind('click',function(){jQuery('.sgpb-subscription-error').addClass('sg-hide-element');jQuery('.sgpb-email-error').addClass('sg-hide-element');var email=jQuery('.sgpb-add-subscribers-email').val();var firstName=jQuery('.sgpb-add-subscribers-first-name').val();var lastName=jQuery('.sgpb-add-subscribers-last-name').val();var subscriptionPopups=[];jQuery('.js-sg-newsletter-forms > option').each(function(){if(jQuery(this).prop('selected')){subscriptionPopups.push(jQuery(this).val());}});var validationString=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var validEmail=email.search(validationString);if(jQuery('.js-sg-newsletter-forms > option').is(':checked')===false&&validEmail===-1){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;} if(jQuery('.js-sg-newsletter-forms > option').is(':checked')===false){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');return;} if(validEmail===-1){jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;} jQuery('.sgpb-email-error').addClass('sg-hide-element');var data={action:'sgpb_add_subscribers',nonce:SGPB_JS_PARAMS.nonce,firstName:firstName,lastName:lastName,email:email,popups:subscriptionPopups,beforeSend:function(){jQuery('.js-sgpb-add-spinner').removeClass('sg-hide-element');}};that.addToSubscribersAjax(data);});};SGPBSubscribers.prototype.exportSubscribers=function() {var that=this;jQuery('#sgpb-subscription-popup').on('change',function(){jQuery('.sgpb-subscription-popup-id').val(jQuery(this).val());});jQuery('#sgpb-subscribers-dates').on('change',function(){jQuery('.sgpb-subscribers-date').val(jQuery(this).val());});jQuery('.sgpb-export-subscriber').bind('click',function(){var parameters='';var params={};params['sgpb-subscription-popup-id']=that.getUrlParameter('sgpb-subscription-popup-id');params['s']=that.getUrlParameter('s');params['sgpb-subscribers-date']=that.getUrlParameter('sgpb-subscribers-date');params['orderby']=that.getUrlParameter('orderby');params['order']=that.getUrlParameter('order');for(var i in params){if(typeof params[i]!=='undefined'&¶ms[i]!==''){parameters+='&'+i+'='+params[i];}} window.location.href=SGPB_JS_ADMIN_URL.url+'?action=csv_file'+parameters;});};SGPBSubscribers.prototype.getUrlParameter=function(key) {var pageUrl=window.location.search.substring(1);var urlVariables=pageUrl.split('&');for(var i=0;i