forked from LiveCarta/LiveCartaWP
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Template Name: Resource Item
|
|
*/
|
|
|
|
get_header();
|
|
|
|
if (have_posts()):
|
|
while (have_posts()):
|
|
the_post();
|
|
?>
|
|
<div class="content">
|
|
<?= the_content(); ?>
|
|
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
const btn = document.querySelector("#submit");
|
|
btn.addEventListener("click", ( event ) => {
|
|
btn.classList.add("btn-loading");
|
|
},false);
|
|
document.addEventListener( 'wpcf7invalid', ( event ) => {
|
|
btn.classList.remove("btn-loading");
|
|
},false);
|
|
document.addEventListener( 'wpcf7mailfailed', ( event ) => {
|
|
btn.classList.remove("btn-loading");
|
|
},false);
|
|
|
|
document.addEventListener( 'wpcf7mailsent', ( event ) => {
|
|
if (typeof pdfUrl === "undefined") {
|
|
console.warn("please add pdfUrl");
|
|
return;
|
|
}
|
|
window.open(pdfUrl, "_self");
|
|
}, false );
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<?php
|
|
endwhile;
|
|
endif;
|
|
|
|
get_footer();
|