1/* 2Plugin Name: WP Subscribe Pro 3Plugin URI: http://mythemeshop.com/plugins/wp-subscribe-pro/ 4Description: WP Subscribe is a simple but powerful subscription plugin which supports MailChimp, Aweber and Feedburner. 5Author: MyThemeShop 6Author URI: http://mythemeshop.com/ 7*/ 8 9/* global wp_subscribe*/ 10jQuery(document).ready(function($) { 11 12 // AJAX subscribe form 13 // not working on Feedburner 14 $( '.wp-subscribe-form' ).submit( function( event ) { 15 16 event.preventDefault(); 17 18 var form = $(this), 19 $widget = form.closest('.wp-subscribe').addClass('loading'), 20 fields = {}; 21 22 $widget.find('.error').hide(); 23 $widget.find('.thanks').hide(); 24 25 if ( form.hasClass('wp-subscribe-feedburner') ) { 26 27 var original = window.open; 28 window.open = function( url, name, specs, replace ) { 29 var popup = original( url, name, specs, replace ); 30 31 if( ! popup ) { 32 return popup; 33 } 34 35 if( ! url.includes( 'feedburner.google.com' ) ) { 36 return popup; 37 } 38 39 var interval = setInterval( function() { 40 41 if( popup && popup.closed ) { 42 clearInterval( interval ); 43 44 form.hide(); 45 $widget.removeClass('loading'); 46 $widget.find('.error').hide(); 47 $widget.find('.thanks').show(); 48 49 var thanks_page_url = $widget.data('thanks_page_url'); 50 if ( parseInt($widget.data('thanks_page'), 10) === 1 && thanks_page_url !== '') { 51 window.location.href = thanks_page_url; 52 } 53 } 54 }, 300 ); 55 56 return popup; 57 }; 58 59 window.open( form.attr('action') + '&' + form.serialize() , 'popupwindow', 'scrollbars=yes,width=550,height=520' ); 60 61 window.open = original; 62 63 return false; 64 } 65 66 $.map( form.serializeArray(), function( item ){ 67 fields[ item['name'] ] = item['value']; 68 }); 69 70 $.ajax({ 71 72 url: wp_subscribe.ajaxurl, 73 type: 'POST', 74 data: { 75 action: 'validate_subscribe', 76 wps_data: fields 77 } 78 79 }).done( function( data ) { 80 81 $widget.removeClass('loading'); 82 83 if( data.success ) { 84 85 form.hide(); 86 $widget.find('.error').hide(); 87 $widget.find('.thanks').show(); 88 89 var thanks_page_url = $widget.data('thanks_page_url'); 90 if ( parseInt($widget.data('thanks_page'), 10) === 1 && thanks_page_url !== '') { 91 window.location.href = thanks_page_url; 92 } 93 } 94 else { 95 if ( data.error ) { 96 $widget.find('.error').html(data.error).show(); 97 } 98 else { 99 $widget.find('.error').show(); 100 } 101 } 102 }); 103 104 }); 105});
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.