'; //add to container $(".item-container").append(html); } page_filter++; adjustPlayerWidth(); lockScroll = false; } else { lockScroll = true; } }, error:function(xhr, textStatus, errorThrown){ console.log(errorThrown); } }); } } }); $("#btn-send-contact").click(function(event){ event.preventDefault(); var error = ""; //validate var valid = true; $('#podcast-page-contact-form').find(':input:not(button)').each(function(){ var name = $(this).attr("name"); var value = $(this).val(); if (typeof name != 'undefined' && value == ""){ valid = false; return false; } }); if(valid){ //submit form var datastring = $("#podcast-page-contact-form").serialize(); $.ajax({ type: "POST", url: "https://web-support.libsyn.com/contact/submit", data: datastring, dataType: "json", success: function(data) { if(data == false){ error = "Error Your message could not be sent at this time. Please try again later."; $("#podcast-page-contact-form-error").html(error).fadeIn().delay(5000).fadeOut(); } else { $('#podcast-page-contact-form').find(":input").val("").hide(); $('#podcast-page-contact-form').fadeOut(); $("#podcast-page-contact-form-success").show(); } }, error: function() { error = "Error Your message could not be sent at this time. Please try again later."; $("#podcast-page-contact-form-error").html(error).fadeIn().delay(5000).fadeOut(); } }); } else { error = "Error Please fill out all fields and submit again."; $("#podcast-page-contact-form-error").html(error).fadeIn().delay(5000).fadeOut(); return false; } }); var playerStatusRequestSent = false; var href = null; /* $(document).on('click', ".read_more", function (e){ var iframeId = $(this).data("iframe-id"); if (document.getElementById(iframeId).contentWindow) { e.preventDefault(); href = $(this).attr("href"); var addColon = $("#"+iframeId).attr("src").indexOf(":") == -1 ? ':' : ''; var iframeHref = 0 + $("#"+iframeId).attr("src"); var receiver = document.getElementById(iframeId).contentWindow; window.addEventListener('message', receiveMessage); receiver.postMessage('player_status_request', iframeHref); playerStatusRequestSent = true; } }); */ function receiveMessage(e) { if(playerStatusRequestSent){ try { var playerData = JSON.parse(e.data); if(typeof(playerData.elapsed) != "undefined" && playerData.elapsed != "00:00:00"){ localStorage.setItem(href, JSON.stringify(playerData)); } if(href !== null){ window.location = href; } } catch (e) { return false; } } }