function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var i=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+i).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("
").addClass("tooltip-arrow").addClass(t.vertical).addClass(t.horizontal).appendTo(this)}}})}function wd_insert_placeholder(e,t){var i=document.getElementById(e);if(tinyMCE.get(e)&&tinyMCE.get(e).focus(),"none"!=i.style.display)if(i.focus(),document.selection)sel=document.selection.createRange(),sel.text=t;else if(i.selectionStart||"0"==i.selectionStart){var a=i.selectionStart,n=i.selectionEnd;i.value=i.value.substring(0,a)+"{"+t+"}"+i.value.substring(n,i.value.length)}else i.value+="{"+t+"}";else tinyMCE.execCommand("mceInsertContent",!1,"{"+t+"}")}function fm_toggle_postbox(e){jQuery(e).parent(".postbox").toggleClass("closed")}function fm_option_tabs_mail_validation(){return!0}function fm_clear_input_value(e){jQuery("#"+e).val("")}function set_no_items(){jQuery(".colspanchange").attr("colspan",jQuery(".wd-form table.adminlist>thead>tr>th:visible").length+jQuery(".wd-form table.adminlist>thead>tr>td:visible").length)}function search(e){var t=jQuery(e).parents("form");t.attr("action",window.location+"&paged=1&s="+jQuery("input[name='s']").val()),t.submit()}function input_search(e,t){return 13==(e.keyCode?e.keyCode:e.which)&&search(t),!0}function input_pagination(e,t){if(13==(e.keyCode?e.keyCode:e.which)){var i=jQuery(t).parents("form"),a=jQuery(t).val();if(a<=jQuery(t).parents(".pagination-links").data("pages-count")&&0
Changes made in this table should be saved.
");var i=a;jQuery(".fm_order").each(function(e){jQuery(this).find("input").val()&&jQuery(this).find("input").val(i++)})}}),jQuery("#tbody_arr").sortable("enable"),jQuery("#tbody_arr").find(".handle").show(0),jQuery("#tbody_arr").find(".handle").attr("class","handle connectedSortable"),jQuery("#th_order").hide(0),jQuery("#tbody_arr").find(".fm_order").hide(0),jQuery("#show_hide_weights").val("Show order column"))}function fm_popup(e){if(void 0===e)e="";var a,r,s;(a=function(){var e,t,i=jQuery("#TB_window"),a=jQuery(window).height(),n=jQuery(window).width();e=r&&r'+(e.attr("title")||"")+"":'
'+(jQuery(this).attr("title")||"")+"",jQuery("#TB_title").css({"background-color":"#222",color:"#dfdfdf"}),jQuery("#TB_closeAjaxWindow").css({float:"right"}),jQuery("#TB_ajaxWindowTitle").css({float:"left"}).html(t),jQuery("#TB_iframeContent").width("100%"),a(),!1}),jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1})}function bwg_inputs(){jQuery(".fm_int_input").keypress(function(e){var t=e.which||e.paramlist_keyCode;return!(31
Items Successfully Deleted.
").insertBefore("#blocked_ips"),set_no_items()})}})}function fm_save_ip(t){var i=jQuery("#ip"+t).val();url=jQuery("#blocked_ips").attr("action"),jQuery.ajax({type:"POST",url:url,data:{ip:i,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip"},success:function(e){jQuery("#td_ip_"+t).html(''+i+""),jQuery(".insert, .error").hide(),jQuery("#fm_blocked_ips_message").html("Items Successfully Inserted.
"),jQuery("#fm_blocked_ips_message").show()}})}function fm_insert_blocked_ip(){jQuery("#tr .loading").css("display","initial");var e=jQuery("#fm_ip").val(),t=window.location.href;jQuery.ajax({type:"POST",url:t,data:{ip:e,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip",last_id:1},success:function(e){jQuery("#blocked_ips").parent(".wrap").load(t+" #blocked_ips",function(){window.history.pushState(null,null,t),0!=jQuery(".updated").length?jQuery(".updated p strong").html("Items Successfully Saved"):jQuery("Items Successfully Saved.
").insertBefore("#blocked_ips")})}})}function fm_edit_ip(e){var t='';t+='',t+="
",jQuery("#td_ip_"+e).html(t)}function fm_enter_ip(e){if(13==e.which){if(fm_check_required("fm_ip","IP"))return!1;e.preventDefault(),fm_insert_blocked_ip()}}function fm_update_blocked_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var t=jQuery("#ip"+e).val(),i=window.location.href;jQuery.ajax({type:"POST",url:i,data:{ip:t,current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"update_blocked_ip"},success:function(e){jQuery(".wrap").load(i+" #blocked_ips",function(){0!=jQuery(".updated").length?(window.history.pushState(null,null,i),jQuery(".updated p strong").html("Items Successfully Updated")):jQuery("Items Successfully Updated.
").insertBefore("#blocked_ips")})}})}function onEnableChange(e,t,i){var a=jQuery("#"+e+" #"+t);"1"==i?a.removeClass("hidden"):a.addClass("hidden")}function show_stats(){var e=jQuery(".fm-statistics .fm_error_sorted_label_key");""!=jQuery("#sorted_label_key").val()?(e.hide(),jQuery(".fm-div_stats-loading").addClass("is-active"),jQuery.ajax({dataType:"json",type:"POST",url:show_stats_url,data:{sorted_label_key:jQuery("#sorted_label_key").val(),startdate:jQuery("#startstats").val(),enddate:jQuery("#endstats").val(),nonce:fm_ajax.ajaxnonce},beforeSend:function(e){},error:function(e){},success:function(e){jQuery(".fm-div_stats-loading").removeClass("is-active"),e.html&&jQuery("#div_stats").html(e.html)}})):e.show()}function fm_loading_show(){jQuery("#fm_loading").show()}function fm_loading_hide(){jQuery("#fm_loading").hide(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items()}function getFormLocalStorage(){var e={};formId=getAllUrlParams().current_id;var t=localStorage.getItem("fm_form"+formId);return null!=t&&(e=jQuery.parseJSON(t)),e}function getAllUrlParams(e){var t=e?e.split("?")[1]:window.location.search.slice(1),i={};if(t)for(var a=(t=t.split("#")[0]).split("&"),n=0;n'+""+form_maker_manage.add_new_field+'');t.prepend(i),i.after('')}function sortable_columns(){jQuery("#take").sortable({cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".form_id_tempform_view_img .fm-ico-draggable",items:"> .wdform-page-and-images",axis:"y",update:function(e,t){refresh_page_numbers()}}),jQuery(".wdform_page").sortable({connectWith:".wdform_page",cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".wdform_row_handle",cancel:".add-new-field, .page_toolbar",items:"> .wdform_section",create:function(e,t){jQuery(e.target).find(".wdform_section").each(function(){fm_row_handle(this)})},start:function(e,t){jQuery(".wdform_row_empty").hide()},stop:function(e,t){fm_rows_refresh(),jQuery(".wdform_row_empty").show()}}),jQuery(".wdform_column").sortable({connectWith:".wdform_column",cursor:"move",placeholder:"highlight",tolerance:"pointer",cancel:".wdform_section_handle",items:"> .wdform_row, #add_field",start:function(e,t){jQuery(".add-new-button").off("click"),jQuery(".wdform_column").removeClass("fm-hidden"),jQuery("#cur_column").removeAttr("id")},stop:function(e,t){return"add_field_cont"!=t.item.parent().attr("id")&&("add_field"==t.item.attr("id")&&"add_field_cont"!=t.item.parent().attr("id")?(fm_check_something_really_important()||(nextID=jQuery("#add_field").next(".wdform_row").attr("wdid"),jQuery("#add_field").parent().attr("id","cur_column"),popup_ready(),Enable(),jQuery(".add-new-button").removeAttr("onclick")),!1):(jQuery(".wdform_column:not(#add_field_cont):empty").addClass("fm-hidden"),void fm_columns_refresh()))}})}function all_sortable_events(){fm_rows_refresh(),fm_columns_refresh(),jQuery(".wdform_row, .wdform_tr_section_break").off("hover, touchstart").on("hover, touchstart",function(e){if(!jQuery(this).find(".wdform_arrows").is(":visible"))return jQuery(".wdform_arrows").hide(),jQuery(this).find(".wdform_arrows").show(),e.preventDefault(),!1}).off("mouseleave").on("mouseleave",function(){jQuery(this).find(".wdform_arrows").hide()}),jQuery(".wdform_section_handle, .wdform_row_handle").off("hover, touchstart").on("hover, touchstart",function(e){jQuery(this).parent().addClass("fm-hover")}).off("mouseleave").on("mouseleave",function(){jQuery(this).parent().removeClass("fm-hover")})}function fm_change_radio(e){jQuery(e).hasClass("fm-yes")?(jQuery(e).val("0"),jQuery(e).next().val("0"),jQuery(e).removeClass("fm-yes").addClass("fm-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).val("1"),jQuery(e).next().val("1"),jQuery(e).find("span").animate({right:0},400,function(){jQuery(e).removeClass("fm-no").addClass("fm-yes")})),"mail_verify"==jQuery(e).next().attr("name")&&show_verify_options(1==jQuery(e).val())}function enable_drag(){jQuery(".wdform_column").sortable("enable"),jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_field").css("cursor",""),jQuery("#add_field .wdform_field").css("cursor",""),all_sortable_events()}function refresh_(){document.getElementById("counter").value=gen,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.find("[id^=page_next_]").removeAttr("src"),e.find("[id^=page_previous_]").removeAttr("src"),e.find(".form_id_tempform_view_img").remove()}),jQuery("#take div").removeClass("ui-sortable ui-sortable-disabled ui-sortable-handle"),jQuery("#add_field_cont").remove(),document.getElementById("form_front").value=document.getElementById("take").innerHTML}function fm_add_submission_email(e,t,i,a){var n=jQuery("#"+t).val();if(n){var r=jQuery("").attr("class","fm_mail_input").prependTo("#"+i);jQuery("").attr("class","mail_name").text(n).appendTo(r),jQuery("").attr("class","dashicons dashicons-trash").attr("onclick","fm_delete_mail(this, '"+n+"')").attr("title","Delete Email").appendTo(r),jQuery("#"+t).val(""),jQuery("#"+e).val(jQuery("#"+e).val()+n+",")}}function fm_delete_mail(e,t){jQuery(e).parent().remove(),jQuery("#mail").val(jQuery("#mail").val().replace(t+",",""))}function form_maker_options_tabs(e){return jQuery("#fieldset_id").val(e),jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive"),jQuery("#"+e+"_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+e).addClass("active"),!1}function set_type(e){switch(e){case"post":document.getElementById("post").removeAttribute("style"),document.getElementById("page").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"page":document.getElementById("page").removeAttribute("style"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"custom_text":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").removeAttribute("style"),document.getElementById("url").setAttribute("style","display:none");break;case"url":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").removeAttribute("style");break;case"none":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none")}}function check_isnum(e){var t=e.which||e.keyCode;return!(31'+t+'x';-1===n.html().indexOf('data-post_id="'+i+'"')&&(n.append(s),""===r.val()?r.val(i):r.val(function(e,t){return t+","+i}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),i=t.val(),a=e.data("post_id");if(-1!==i.indexOf(a)){var n,r=-1!==i.indexOf(","+a)?","+a:a+",";r=-1!==i.indexOf(",")?r:a;n=i.replace(r,""),t.val(n)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var i=jQuery('input[name="display_on_categories[]"]:checked').length,a=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(i-=1),t.prop("checked",!1),i==a&&t.prop("checked",!0)}})}),function(o){o.fn.serializeObject=function(){var n=this,r={},t={},s={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,i){return e[t]=i,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},o.each(o(this).serializeArray(),function(){if(s.validate.test(this.name)){for(var e,t=this.name.match(s.key),i=this.value,a=this.name;void 0!==(e=t.pop());)a=a.replace(new RegExp("\\["+e+"\\]$"),""),e.match(s.push)?i=n.build([],n.push_counter(a),i):e.match(s.fixed)?i=n.build([],e,i):e.match(s.named)&&(i=n.build({},e,i));r=o.extend(!0,r,i)}}),r}}(jQuery),jQuery(document).on("dblclick",".wdform_row, .wdform_tr_section_break",function(){edit(jQuery(this).attr("wdid"))});