Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ function saswp_schema_datepicker(){jQuery(".saswp-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_select2(){var e=jQuery(".saswp-select2");e.length>0&&jQuery(e).each(function(e,t){var a=jQuery(this),s=jQuery("option[value]:not([selected])",a),r=[];s.each(function(){var e=jQuery(this);r.push({id:e.attr("value"),text:e.text()})});var n=a.attr("data-type"),l=ajaxurl+"?action=saswp_get_select2_data&saswp_security_nonce="+saswp_localize_data.saswp_security_nonce+"&type="+n;a.select2({ajax:{url:l,delay:250,cache:!1},minimumInputLength:2,minimumResultsForSearch:50,dataAdapter:jQuery.fn.select2.amd.require("select2/data/extended-ajax"),defaultResults:r})})}var clone=function(){jQuery(".structured-clone").off("click").click(function(){var e=jQuery(this).closest(".saswp-placement-group").attr("data-id"),t=jQuery(document).find("#call_html_template_sdwp").html();nextId=jQuery(this).parents("tbody").find("tr").length,t=(t=t.replace(/\[0\]/g,"["+nextId+"]")).replace(/\[group-0\]/g,"[group-"+e+"]"),jQuery(this).parents("tr").after(t),removeHtml(),clone(),saswp_select2(),saswp_schema_datepicker()})},removeHtml=function(){jQuery(".structured-delete").off("click").click(function(){1==jQuery(".saswp-placement-group").length?jQuery(this).parents("tbody").find("tr").length>1&&jQuery(this).parents("tr").remove():1==jQuery(this).parents("tbody").find("tr").length?jQuery(this).parents(".saswp-placement-group").remove():jQuery(this).parents("tr").remove()})};function taxonomyDataCall(){jQuery("select.ajax-output").change(function(){if("ef_taxonomy"==jQuery(this).closest("tr").find(".select-post-type").val()){parentSelector=jQuery(this).parents("td").find(".insert-ajax-select");var e=jQuery(this).val(),t=jQuery(this).attr("name").split("[")[1].replace("]",""),a=jQuery("#saswp_select_name_nonce").val();parentSelector.find(".ajax-output-child").remove(),parentSelector.find(".spinner").attr("style","visibility:visible"),parentSelector.children(".spinner").addClass("show");var s=saswp_localize_data.ajax_url,r=jQuery(this).closest(".saswp-placement-group").attr("data-id");jQuery.ajax({url:s,method:"POST",data:{action:"create_ajax_select_sdwp_taxonomy",id:e,number:t,group_number:r,saswp_call_nonce:a},beforeSend:function(){},success:function(e){parentSelector.find(".ajax-output-child").remove(),parentSelector.find(".select2-container").next().remove(),parentSelector.children(".spinner").removeClass("show"),parentSelector.find(".spinner").attr("style","visibility:hidden").hide(),parentSelector.append(e),saswp_select2(),saswp_schema_datepicker()},error:function(e){console.log("Failed Ajax Request"),console.log(e)}})}})}jQuery(document).ready(function(e){e("#saswp-dayofweek-opens-time").timepicker({timeFormat:"H:i:s"}),e("#saswp-dayofweek-closes-time").timepicker({timeFormat:"H:i:s"}),e(".saswp-placement-or-group").on("click",function(t){t.preventDefault();var a="",s=(a=e(".saswp-placement-group").length,jQuery(document).find("#call_html_template_sdwp").html()),r="";r+='',r+=s=s.replace(/\[group-0\]/g,"[group-"+a+"]");var n="";n+='
',n+='Or',n+=r+="
",n+="",e(".saswp-placement-group[data-id="+(a-1)+"]").after(n),a++,clone(),removeHtml(),saswp_select2(),saswp_schema_datepicker()});var t=e("#saswp_amp_select").find("table.widefat tr").html();e("body").append("