PageSourceSearch

https://www.arkona-russia.com/wp-content/plugins/wp-subscribe-form…/includes/js/sfba-form-ajax.js?ver=5.4.23

js arkona-russia.com collected 2026-10-02 12:48:45 UTC 6,432 bytes, 165 lines download raw bytes

1jQuery( document ).ready( function($) {
2	/* Submit Form */
3	$( '.sfba_subscribe_form' ).submit( function() {
4		var form_id = jQuery(this).attr('id');
5		var sfba_page_link	= jQuery( '#' + form_id + ' .sfba_page_link' ).val();
6		var post_id 		= jQuery( '#' + form_id + ' .sfba_post_type_id' ).val();
7		var sfba_form_name 	= jQuery( '#' + form_id + ' .sfba-form-name' ).val();
8  		var sfba_form_email = jQuery( '#' + form_id + ' .sfba-form-email' ).val();
9		var redirect_url 	= jQuery( '#' + form_id + ' .sfba_redirect_after_submission_url' ).val();
10  		var open_new_tab 	= jQuery( '#' + form_id + ' .sfba_open_new_tab' ).val();		
11  		if( sfba_form_name == null ) {
12  			data = {
13				action : 'sfba_ajax', 'subscriberemail':sfba_form_email,'post_id':post_id,'sfba_page_link':sfba_page_link
14			};
15		} else {
16			data = {
17				action : 'sfba_ajax', 'subscribername':sfba_form_name,'subscriberemail':sfba_form_email,'post_id':post_id,'sfba_page_link':sfba_page_link
18			};
19		}
20		$.post( the_ajax_script.ajaxurl , data , function( response ) {
21			
22			if ( $('form#'+ form_id).hasClass('hide_subscriber_form') ) {
23				$( 'form#'+ form_id ).slideToggle('slow');
24				$( '#' + form_id + ' .sfba_thanks_container').hide();
25			} else if ( typeof redirect_url !== 'undefined' && redirect_url != '' ) {
26				if ( typeof open_new_tab !== 'undefined' && open_new_tab != '' ) {
27					$( '#' + form_id + ' .sfba_thanks_container' ).css({
28						"opacity":"0",
29						"display":"flex",
30					}).show().animate({opacity:1})
31					window.open( redirect_url, '_blank' );
32				} else {
33					window.location.href = redirect_url;
34				}
35			} else {
36				$( '#' + form_id + ' .sfba_thanks_container').css({
37					"opacity":"0",
38					"display":"flex",
39				}).show().animate({opacity:1})
40			}
41			$('#sfba-form-name').val('');
42			$('#sfba-form-email').val('');
43			if ( typeof $( 'form#'+ form_id + ' input[type=checkbox]' ).prop( 'checked') !== 'undefined' && $( 'form#'+ form_id + ' input[type=checkbox]' ).prop( 'checked' ) !== false ){
44				$( 'form#'+ form_id + ' input[type=checkbox]' ).prop( 'checked' ,'')
45			}
46			
47			
48		} );
49		return false;
50	} );
51	/* Delete Record */
52	jQuery( '.sfba_delete_entry' ).on( 'click', function(){
53		var deleterowid = $( this ).attr( 'data-delete' );
54		var wpappp_confirm_delete = window.confirm( 'Are you sure you want to delete Record with ID# ' + deleterowid );
55		var wpapp_redirect_refresh = window.location.href;
56		if ( wpappp_confirm_delete == true ) {
57			jQuery.ajax({
58				type: 'POST',
59				url: the_ajax_script.ajaxurl,
60				data: { "action": "sfba_delete_db_record","id":deleterowid },
61				success: function( data ){
62					location.href = wpapp_redirect_refresh;
63				},
64				error: function( XMLHttpRequest, textStatus, errorThrown ) {
65					alert( 'Status: ' + textStatus ); 
66					alert( 'Error: ' + errorThrown );
67				}
68			});
69		}
70		// Prevents default submission of the form after clicking on the submit button.
71		return false;
72	} );
73	/* Delete All Record */
74	jQuery( '#sfba_delete_all_data' ).on( 'click', function(){
75		var wpappp_confirm_delete = window.confirm( 'Are you sure you want to delete all subscribers from the database?' );
76		var wpapp_redirect_refresh = window.location.href;
77		if ( wpappp_confirm_delete == true ) {
78			jQuery.ajax({
79				type: 'POST',
80				url: the_ajax_script.ajaxurl,
81				data: { "action": "sfba_delete_db_data" },
82				success: function( data ){
83					location.href = wpapp_redirect_refresh;
84				},
85				error: function( XMLHttpRequest, textStatus, errorThrown ) {
86					alert( 'Status: ' + textStatus ); 
87					alert('Error: ' + errorThrown );
88				}
89			} );
90		}
91		// Prevents default submission of the form after clicking on the submit button.
92		return false;
93	} );
94	/*Check conset field check or not*/
95	$( '.sfba-form-submit-button' ).on( 'click', function ( event ){
96		var form_id = jQuery( this ).data( 'form-id' );
97		var rand_id = jQuery( this ).data( 'rand-id' );
98		if ( typeof $( 'form#'+ rand_id + ' .' + form_id + ' input[type=checkbox]' ).prop( 'checked') !== 'undefined' && $( 'form .' + form_id + ' input[type=checkbox]' ).prop( 'checked' ) !== true ){
99			$( 'form#'+ rand_id + ' .' + form_id + ' .sfba-conset-field-error' ).show();
100			event.preventDefault();
101			return false;
102		} else {
103			$( 'form#'+ rand_id + ' .' + form_id + ' .sfba-conset-field-error' ).hide();
104		}
105		
106		if ( $( 'form#'+ rand_id + ' .' + form_id + ' #sfba-form-email' ).val() === '' ){
107			$( 'form#'+ rand_id + ' .' + form_id + ' .sfba-email-field-error' ).show();
108			event.preventDefault();
109		} else {
110			$( 'form#'+ rand_id + ' .' + form_id + ' .sfba-email-field-error' ).hide();
111		}
112	} );
113	$( 'form#sfba-integrations-form #sfba-integrations' ).on( 'click', function( event ){
114		var submit_from = jQuery( 'form#sfba-integrations-form' ).seri
114alize();
115		$( '#sfba-intgration-loader').show();
116		$( '#sfba-integrations-form').addClass( 'sfba-loader-overly' );
117		$.ajax({
118			type: 'POST',
119			url: the_ajax_script.ajaxurl,
120			data:'action=sfba_subscriber_integration&' + submit_from,
121			dataType: 'json',
122			success: function( data ){
123				$( '#sfba-intgration-loader' ).hide();
124				$( '#sfba-integrations-form' ).removeClass( 'sfba-loader-overly' );
125				if ( typeof data.error !== 'undefined' ){
126					$( '#sfba-integrations-popup-error' ).html( data.message );
127					$( '#sfba-integrations-popup-error' ).dialog({
128						resizable: false,
129						modal: true,
130						draggable: false,
131						height: 'auto',
132						width: 400,
133						buttons: {
134							"OK": function () {
135								$( this ).dialog( 'close' );
136							},
137						}
138					});
139				} else {
140					$( '#sfba-integrations-popup-success' ).html( data.message );
141					$( '#sfba-integrations-popup-success' ).dialog({
142						resizable: false,
143						modal: true,
144						draggable: false,
145						height: 'auto',
146						width: 400,
147						buttons: {
148							"OK": function () {
149								$( this ).dialog( 'close' );
150							},
151						}
152					});
153				}
154			}
155		});
156		event.preventDefault();
157	} );
158	/*Play button animation with duration */
159	$( '.sfba-main-form-container' ).on( 'animationend MSAnimationEnd webkitAnimationEnd oAnimationEnd', function() {
160		$( this ).removeClass( 'animation-start' );
161	} );
162	var refreshId = setInterval( function() {
163		$( '.sfba-main-form-container' ).addClass( 'animation-start' );
164	}, 3500 );
165} );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.