/* ########################################################################## © JuTho-Agentur, www.jutho.com Version INDI ~~~~~~~~~~~~~~~~~~ Einbindung ~~~~~~~~~~~~~~~~~~ ########################################################################## */ var confirm_form_url_indi = "scripts/ajax/linkconfirm.php?load_js=false&id=7316"; $(document).ready(function() { //console.log("LinkConfirm (c) by www.jutho.com"); $('a.confirm_extern_indi').on("click", function(e) { e.preventDefault(); var href = $(this).attr('href'); var target = $(this).attr('target'); var form = $(this).attr('data-confirm'); if(form) { confirm_form_url_indi+="&form="+form; } // console.log(confirm_form_url_indi); // console.log(href); // console.log(target); $.ajax({ url: confirm_form_url_indi, dataType: "json", // jsonpCallback: 'callback', type: 'GET', success: function (confirm_form) { // console.log(confirm_form); if(confirm_form.html!="") { $("body").prepend(""); $("#confirm_link_overlay").on("click", function(event) { if(event.target==this) { linkconfirm_close(); } }); $("body #confirm_link_extern form").on("submit", function(e) { e.preventDefault; if(check_user_confirm($(this))===true) { linkconfirm_close(); if(typeof(target)=="undefined" || target=="_top") { document.location.href=href; } else { window.open(href); } } else { $('#confirm_link_extern').addClass("error"); setTimeout(function() { $("#confirm_link_extern").removeClass('error'); }, 1000); //alert("Bitte bestätigen Sie die angezeigten Punkte!"); } return false; }); } } }); }); }); function check_user_confirm(f) { var ok=true; $(f).find("input[type=checkbox]:not(:checked)").each(function() { ok=false; }); return ok; } function linkconfirm_close() { $("#confirm_link_extern").remove(); $("#confirm_link_overlay").remove(); $(".linkconfirm_overflow").css("overflow", "inherit"); $(".linkconfirm_overflow").removeClass("linkconfirm_overflow"); } function iframeconfirm_close(lay_id, ok) { if(ok===true) { $("#"+lay_id).prev("iframe").removeClass("unconfirmed"); $("#"+lay_id).prev("iframe").removeClass("disabled"); $("#"+lay_id).remove(); } else { //$("#"+lay_id).prev("iframe").addClass("disabled"); $("#"+lay_id).addClass('declined'); } }