1"use strict"; 2 3( function( $ ) { 4 5 /* 6 * AJAX subscription 7 */ 8 $( document ).on( 'submit', '.pk-subscribe-form-wrap form', function( e ) { 9 10 var form = $( this ); 11 12 // Remove messages. 13 $( form ).closest('.pk-subscribe-form-wrap').find( '.pk-alert' ).remove(); 14 15 // Policies. 16 var privacy = $( form ).closest( '.pk-subscribe-form-wrap' ).find( 'input[name="pk-privacy"]' ); 17 18 if ( $( privacy ).length > 0 && ! $( privacy ).prop( 'checked' ) ) { 19 $( privacy ).parent().after( '<p class="pk-alert pk-alert-warning">' + window.opt_in.warning_privacy + '</p>' ); 20 21 return false; 22 } 23 24 if ( !$( form ).hasClass( 'pk-loading' ) ) { 25 $.ajax( { 26 type: 'POST', 27 url: window.opt_in.ajax_url + '?action=powerkit_subscription', 28 data: $( form ).serialize(), 29 beforeSend: function() { 30 $( form ).addClass( 'pk-loading' ); 31 }, 32 success: function( data ) { 33 $( form ).removeClass( 'pk-loading' ); 34 35 if ( data.success ) { 36 $( form ).after( '<p class="pk-alert pk-alert-success">' + data.data + '</p>' ); 37 } else { 38 $( form ).after( '<p class="pk-alert pk-alert-warning">' + data.data + '</p>' ); 39 } 40 }, 41 error: function() { 42 $( form ).after( '<p class="pk-alert pk-alert-warning">Error server!</p>' ); 43 44 $( form ).removeClass( 'pk-loading' ); 45 } 46 } ); 47 48 } 49 return false; 50 } ); 51 52} )( jQuery );
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.