Contact Form 7 Style - Version 3.1.7

Version Description

Release Date: March 6th, 2018

  • Major Fix Fixed I/O process with reducing the json requests from the servers
  • [Major Fix] Fixed the problem where the form was missing some settings when multiple form were selected in the custom style part
  • Improvement Added settings to hide/show Contact Form 7 Style link
Download this release

Release Info

Developer mlehelsz
Plugin Icon 128x128 Contact Form 7 Style
Version 3.1.7
Comparing to
See all releases

Code changes from version 3.1.6 to 3.1.7

admin/js/admin-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){function t(e){return/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i.test(e)}function a(t){t.find("label").length<1&&e('.button[data-property="label"]').hide(),t.find("p").length<1&&e('.button[data-property="p"]').hide(),t.find("fieldset").length<1&&e('.button[data-property="fieldset"]').hide(),t.find("select").length<1&&e('.button[data-property="select"]').hide(),t.find('input[type="checkbox"]').length<1&&e('.button[data-property="checkbox"]').hide(),t.find('input[type="radio"]').length<1&&e('.button[data-property="radio"]').hide()}function n(e,t){"valid"==t?e.css("border-color","#ddd"):e.css("border-color","red")}function i(t){e(".google-fontos").remove(),"none"!=t&&void 0!==t&&(e("head").append('<link class="google-fontos" rel="stylesheet" href="https://fonts.googleapis.com/css?family='+t+':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese" />'),e(".cf7-style.preview-zone p").css("font-family","'"+t+"', sans-serif"),e(".preview-form-container .wpcf7").css("font-family","'"+t+"', sans-serif"))}function r(){e("input[type='number']").on("change",function(){var t=e(this),a=t.val(),n=t.parent().index(),i=t.parent().parent().find("input[type=number]");switch(n){case 1:i.each(function(){parseFloat(e(this).attr("step"))==parseFloat(t.attr("step"))&&e(this).val(a)});break;case 2:parseFloat(i.eq(3).attr("step"))==parseFloat(t.attr("step"))&&i.eq(3).val(a)}})}function l(t){if(e('input[name="cf7styleallvalues"]').length>0){var a=e('input[name="cf7styleallvalues"]').val(),n=e.parseJSON(a.replace(/'/g,'"'));e(".place-style").remove(),e.each(n,function(a,i){if(a.indexOf("unit")<0&&("hover"==t&&a.indexOf("hover")>0||"hover"!=t&&a.indexOf("hover")<0)){var r=a.split("_"),l=r[0],s="hover"==t&&a.indexOf("hover")>0?n[a.replace("hover","")+"unit_hover"]:n[a+"_unit"];if("placeholder"==r[0]&&""!=i){var o=i+(s=void 0===s||""==i?"":s),c=e("<style>").attr("class","place-style");return c.text(".preview-form-container ::-webkit-input-placeholder { "+r[1]+": "+o+";}.preview-form-container ::-moz-placeholder { "+r[1]+": "+o+";}.preview-form-container :-ms-input-placeholder { "+r[1]+": "+o+";}.preview-form-container :-moz-placeholder { "+r[1]+": "+o+";}"),void c.appendTo("head")}"submit"==r[0]&&(l="input[type='submit']"),"form"==r[0]&&(l=".wpcf7"),"wpcf7-not-valid-tip"!=r[0]&&"wpcf7-validation-errors"!=r[0]&&"wpcf7-mail-sent-ok"!=r[0]||(l="."+r[0]);o=i+(s=void 0===s||""==i?"":s);"background-image"==r[1]&&(o="url("+i+")"),e(".preview-form-container "+(l="radio"==l?'input[type="radio"]':"checkbox"==l?'input[type="checkbox"]':l)).css(r[1],o)}})}}function s(t,a,n,i){var r=t.find(".active").index()+1,l=t.find("li"),s=t.find("ul"),o=t.find(".narrow"),c=t.find(".narrow.left"),p=t.find(".narrow.right"),d=t.find("li").length;p.addClass("visible"),s.css("width",d*a),0==i&&t.mouseenter(function(){t.find(".visible").stop().show()}).mouseleave(function(){t.find(".visible").stop().hide()}),o.on("click",function(t){t.stopPropagation(),t.preventDefault();var i=e(this).attr("data-direction");"left"==i&&1!==r&&(s.stop(!0,!0).animate({marginLeft:"+="+a+"px"},n),r--),"right"==i&&r!==d&&(s.stop(!0,!0).animate({marginLeft:-a*r+"px"},n),r++),1==r&&(c.hide().removeClass("visible"),p.show().addClass("visible")),r==d&&p.hide().removeClass("visible"),r<d&&p.show().addClass("visible"),r>1&&c.show().addClass("visible"),l.removeClass("active").eq(r-1).addClass("active")}),s.css({"margin-left":"-"+(r-1)*a+"px"})}function o(t){var a="",n=e.parseJSON(e('input[name="cf7styleallvalues"]').val().replace(/'/g,'"'));e.each(t.serializeObject(),function(e,t){0==n.length&&(n={}),n[e.replace(/cf7stylecustom\[/g,"").replace(/]/g,"")]=t}),a=(a=JSON.stringify(n)).replace(/cf7stylecustom\[/g,"").replace(/]/g,"").replace(/"/g,"'"),e('input[name="cf7styleallvalues"]').val(a),e('input[name="cf7styleallvalues"]').attr("value",a)}function c(){e('.wpcf7 input[aria-required="true"]').each(function(){e('<span role="alert" class="wpcf7-not-valid-tip">Required field message example.</span>').insertAfter(e(this))}),e(".wpcf7").each(function(){e('<div class="wpcf7-response-output wpcf7-display-none wpcf7-validation-errors" style="display: block;" role="alert">Error message example.</div>').appendTo(e(this)),e('<div class="wpcf7-response-output wpcf7-display-none wpcf7-mail-sent-ok" style="display: block;" role="alert">Thank you message example.</div>').appendTo(e(this))})}function p(){var t=e(".cf7-style-upload-field");t.addClass("hidden"),t.each(function(){var t=e(this);e('<span class="image-info-box"></span>').insertAfter(t),""!=t.val()&&t.parent().find(".image-info-box").text(t.val().filename("yes"))}),e(".upload-btn").length<=0&&(e("<a href='javascript: void(0);' class='remove-btn button'>Remove</a>").insertAfter(t),e("<a href='javascript: void(0);' class='upload-btn button'>Upload</a>").insertAfter(t)),e(".upload-btn").on("click",function(){var t=e(this),a=t.parent().find(".cf7-style-upload-field");tb_show("New Banner","media-upload.php?type=image&TB_iframe=1"),window.send_to_editor=function(n){a.val(e(n).attr("src")),a.trigger("change"),t.parent().find(".image-info-box").text(e(n).attr("src").filename("yes")),tb_remove()}}),e(".remove-btn").on("click",function(){var t=e(this),a=t.parent().find(".cf7-style-upload-field");a.val(" "),a.attr("value"," "),a.trigger("change"),t.parent().find(".image-info-box").text("")})}function d(){e(".wp-picker-container").each(function(){e(this).parent().find('label[for*="_color"]').length<1&&e('<label><input type="checkbox" class="transparent-box" name="transparent-box">Transparent</label>').insertAfter(e(this))}),e(".transparent-box").each(function(){"transparent"==e(this).parent().parent().find(".cf7-style-color-field").val()&&e(this).prop("checked",!0)}),e(".transparent-box").on("click",function(){var t=e(this).parent().parent();e(this).is(":checked")?(t.find(".cf7-style-color-field").val("transparent"),t.find(".cf7-style-color-field").attr("value","transparent"),t.find(".wp-color-result").css("background-color","transparent")):(t.find(".cf7-style-color-field").val(""),t.find(".cf7-style-color-field").attr("value","")),o(e(this).parents(".panel").find('[name^="cf7stylecustom"]'))})}function u(e){return"%"==e.val()||"em"==e.val()?"0.01":"1"}function f(){e('.panel input[type="number"]:not([id*="opacity"])').each(function(){var t=e(this);t.attr("step",u(t.next()))}),e('.panel select[name*="unit"]').off("change").on("change",function(){var t=e(this);if(t.prev().attr("step",u(t)),"px"==t.val()){var a=Math.floor(t.prev().val());t.prev().val(a),t.prev().attr("value",a)}})}var h=e(".cf7style-name"),v=e(".cf7style-email"),m=e(".cf7style-message"),F=e(".cf7style-status-submit");F.on("click",function(a){if(a.preventDefault(),e(".cf7style-input").each(function(t,a){""==e(this).val()?n(e(this),"error"):n(e(this),"valid")}),""!==h.val()&&""!==v.val())if(t(v.val())){n(v,"valid");var i=e("<div />");e(".cf7style-status-table").each(function(t,a){var n=e("<table />");n.html(e(this).html()),i.append(n)}),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_send_status_report",name:h.val(),email:v.val(),message:m.val(),report:i.html()},beforeSend:function(){F.text("Sending...")},success:function(t){"success"==e.trim(t)?F.text("Report sent").removeClass("cf7style-status-submit").attr("disabled","disabled"):F.text("Something went wrong!").removeClass("cf7style-status-submit").attr("disabled","disabled")}})}else n(v,"error");else console.log("error 1")}),e(".cf7style-status-info").on("click",function(t){t.preventDefault(),e(".cf7style-status-table").toggle()}),String.prototype.filename=function(e){var t=this.replace(/\\/g,"/");return t=t.substring(t.lastIndexOf("/")+1),e?t.replace(/[?#].+$/,""):t.split(".")[0]},e.fn.serializeObject=function(){var t={},a=this.serializeArray();return e.each(a,function(){void 0!==t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(this.value||"")):t[this.name]=this.value||""}),t},e(".cf7style-no-forms-added").length>0?e(".generate-preview-button, .generate-preview-option").show():e(".generate-button-hidden").show(),e(".generate-preview-button").on("click",function(t){t.preventDefault(),e(".cf7style-no-forms-added").hide();var n=e(this).attr("data-attr-id"),i=e(this).attr("data-attr-title");e(this).prop("disabled",!0),e(this).parents("tr").find("input").prop("checked",!0);var r=e("<p />");e(".preview-form-tag").prepend(r),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_generate_preview_dashboard",form_id:n,form_title:i},beforeSend:function(){r.text("Loading..."),e(".multiple-form-generated-preview").hide()},success:function(t){t&&(r.remove(),e(".preview-form-tag").append(t),e(".multiple-form-generated-preview").eq(e(".multiple-form-generated-preview").length-1).show(),l(),c(),a(e(".preview-form-container form:visible")))}})});var y=e(".generate-preview"),b=e(".post-type-cf7_style"),g=e("#select_all"),w=e('select[name="cf7_style_font_selector"]'),x=e(".cf7-style-slider-wrap"),_=e(".preview-form-container"),k={change:function(t,a){var n=e(this);n.parents(".wp-picker-container").parent().find(".transparent-box").prop("checked",!1),setTimeout(function(){o(n.parents(".panel").find('[name^="cf7stylecustom"]'))},0),"hover"==e('input[name="element-type"]:checked').val()?l("hover"):l()}};if(e(".cf7-style-color-field").wpColorPicker(k),y.length>0&&function(t){e(window).scroll(function(){if(e(window).width()>1600){t.find(".panel-header").offset();var a=e("#cf7_style_meta_box_style_customizer").offset(),n=e(window).scrollTop()-a.top;n>0&&t.find(".panel-header").css("top",n),n<=0&&t.find(".panel-header").css("top",0)}e(window).scrollTop()>700?e(".fixed-save-style").show():e(".fixed-save-style").hide()}).trigger("scroll")}(y),b.length>0){e("#cf7_style_manual_style").length>0&&CodeMirror.fromTextArea(document.getElementById("cf7_style_manual_style"),{lineNumbers:!0,theme:"default",mode:"text/css"}),p(),r(),c();_=e(".preview-form-container").not(".hidden");e(".post-new-php").length<1&&a(_),g.on("click",function(){e(".cf7style_body_select_all input").prop("checked",!!e(this).is(":checked"))}),i(w.val()),w.on("change",function(){i(e(this).val())}),function(){l(),e("#form-tag a.button").on("click",function(t){t.preventDefault();var a=e(this),n=e("."+a.attr("data-property")+"-panel"),i=0;0==e(".modified-style-here").length?(a.hasClass("button-primary")||(e(".panel").stop(!0,!0).animate({opacity:0},300,function(){0===i&&(i++,e(".panel").addClass("hidden"),e(".panel").html(""),n.css("opacity","0"),n.removeClass("hidden"),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_load_property",property:a.attr("data-property")},beforeSend:function(){a.parent().find("a").prop("disabled","true"),e(".panel-options .loading").removeClass("hidden")},success:function(t){a.parent().find("a").prop("disabled","false"),i=0,n.html(t),e(".panel-options .loading").addClass("hidden");var l=e('input[name="cf7styleallvalues"]').val(),s=e.parseJSON(l.replace(/'/g,'"'));n.find('[name^="cf7stylecustom"]').each(function(){e(this).attr("id")in s&&""!=s[e(this).attr("id")]&&e(this).val(s[e(this).attr("id")])}),n.find(".cf7-style-color-field").wpColorPicker(k),r(),p(),n.stop(!0,!0).animate({opacity:1},300),d(),f()}}))}),e(".element-selector input:eq(0)").prop("checked",!0)),e("#form-tag a.button").removeClass("button-primary"),a.addClass("button-primary"),e('input[name="cf7styleactivepane"]').val(a.attr("data-property"))):e(".panel-options .decision").removeClass("hidden")}),e(".panel-options .cancel-btn").on("click",function(t){t.preventDefault(),e(".panel-options .decision").addClass("hidden")}),e(".element-selector input").on("change",function(){e(".element-selector input").prop("checked",!1),e(this).prop("checked",!0),"hover"==e(this).val()?(e(".panel:visible li").addClass("hidden"),e(".panel:visible li.hover-element").removeClass("hidden"),l("hover")):(e(".panel:visible li.hover-element").addClass("hidden"),e(".panel:visible li").not(".hover-element").removeClass("hidden"),l())}),e("#form-preview").on("change",function(){e(".preview-form-container").addClass("hidden"),e(".preview-form-container").eq(e(this).val()).removeClass("hidden")});var t=0;e(document).on("change",'[name^="cf7stylecustom"]',function(){0==t&&(t++,e(this).parents(".panel").addClass("modified-style-here")),o(e(this).parents(".panel").find('[name^="cf7stylecustom"]')),"hover"==e('input[name="element-type"]:checked').val()?l("hover"):l()}),e(document).on("keyup",'[name^="cf7stylecustom"]',function(){o(e(this).parents(".panel").find('[name^="cf7stylecustom"]')),"hover"==e('input[name="element-type"]:checked').val()?l("hover"):l()})}(),_.find('input[type="hidden"]').remove(),_.find('input[type="submit"]').on("click",function(e){e.preventDefault()})}x.length>0&&function(t){s(t,202,500,!0),t.find("li").on("click",function(){e(this).hasClass("current-saved")||(t.find("li").removeClass("current-saved"),e(this).addClass("current-saved"),t.find(".overlay em").html("Not Active"),e(this).find(".overlay em").html("Active"),e(".cf7style_template").removeAttr("checked"),e(this).find(".cf7style_template").attr("checked","checked"))})}(x),e(".close-cf7-panel").on("click",function(t){t.preventDefault(),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_remove_welcome_box"},success:function(t){e(".welcome-container").fadeOut("slow")}})}),d(),f()});
1
+ jQuery(document).ready(function(e){function t(t){t.find("label").length<1?e('.button[data-property="label"]').hide():e('.button[data-property="label"]').show(),t.find("p").length<1?e('.button[data-property="p"]').hide():e('.button[data-property="p"]').show(),t.find("fieldset").length<1?e('.button[data-property="fieldset"]').hide():e('.button[data-property="fieldset"]').show(),t.find("select").length<1?e('.button[data-property="select"]').hide():e('.button[data-property="select"]').show(),t.find('input[type="checkbox"]').length<1?e('.button[data-property="checkbox"]').hide():e('.button[data-property="checkbox"]').show(),t.find('input[type="radio"]').length<1?e('.button[data-property="radio"]').hide():e('.button[data-property="radio"]').show()}function a(e,t){"valid"==t?e.css("border-color","#ddd"):e.css("border-color","red")}var n=e(".cf7style-name"),i=e(".cf7style-email"),r=e(".cf7style-message"),o=e(".cf7style-status-submit");function s(t){e(".google-fontos").remove(),"none"!=t&&void 0!==t&&(e("head").append('<link class="google-fontos" rel="stylesheet" href="https://fonts.googleapis.com/css?family='+t+':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese" />'),e(".cf7-style.preview-zone p").css("font-family","'"+t+"', sans-serif"),e(".preview-form-container .wpcf7").css("font-family","'"+t+"', sans-serif"))}function l(){e("input[type='number']").on("change",function(){var t=e(this),a=t.val(),n=t.parent().index(),i=t.parent().parent().find("input[type=number]");switch(n){case 1:i.each(function(){parseFloat(e(this).attr("step"))==parseFloat(t.attr("step"))&&e(this).val(a)});break;case 2:parseFloat(i.eq(3).attr("step"))==parseFloat(t.attr("step"))&&i.eq(3).val(a)}})}function c(t){if(e('input[name="cf7styleallvalues"]').length>0){var a=e('input[name="cf7styleallvalues"]').val(),n=e.parseJSON(a.replace(/'/g,'"'));e(".place-style").remove(),e.each(n,function(a,i){if(a.indexOf("unit")<0&&("hover"==t&&a.indexOf("hover")>0||"hover"!=t&&a.indexOf("hover")<0)){var r=a.split("_"),o=r[0],s="hover"==t&&a.indexOf("hover")>0?n[a.replace("hover","")+"unit_hover"]:n[a+"_unit"];if("placeholder"==r[0]&&""!=i){var l=i+(s=void 0===s||""==i?"":s),c=e("<style>").attr("class","place-style");return c.text(".preview-form-container ::-webkit-input-placeholder { "+r[1]+": "+l+";}.preview-form-container ::-moz-placeholder { "+r[1]+": "+l+";}.preview-form-container :-ms-input-placeholder { "+r[1]+": "+l+";}.preview-form-container :-moz-placeholder { "+r[1]+": "+l+";}"),void c.appendTo("head")}"submit"==r[0]&&(o="input[type='submit']"),"form"==r[0]&&(o=".wpcf7"),"wpcf7-not-valid-tip"!=r[0]&&"wpcf7-validation-errors"!=r[0]&&"wpcf7-mail-sent-ok"!=r[0]||(o="."+r[0]);l=i+(s=void 0===s||""==i?"":s);"background-image"==r[1]&&(l="url("+i+")"),e(".preview-form-container "+(o="radio"==o?'input[type="radio"]':"checkbox"==o?'input[type="checkbox"]':o)).css(r[1],l)}})}}function p(t){var a="",n=e.parseJSON(e('input[name="cf7styleallvalues"]').val().replace(/'/g,'"'));e.each(t.serializeObject(),function(e,t){0==n.length&&(n={}),n[e.replace(/cf7stylecustom\[/g,"").replace(/]/g,"")]=t}),a=(a=JSON.stringify(n)).replace(/cf7stylecustom\[/g,"").replace(/]/g,"").replace(/"/g,"'"),e('input[name="cf7styleallvalues"]').val(a),e('input[name="cf7styleallvalues"]').attr("value",a)}function d(){e('.wpcf7 input[aria-required="true"]').each(function(){e('<span role="alert" class="wpcf7-not-valid-tip">Required field message example.</span>').insertAfter(e(this))}),e(".wpcf7").each(function(){e('<div class="wpcf7-response-output wpcf7-display-none wpcf7-validation-errors" style="display: block;" role="alert">Error message example.</div>').appendTo(e(this)),e('<div class="wpcf7-response-output wpcf7-display-none wpcf7-mail-sent-ok" style="display: block;" role="alert">Thank you message example.</div>').appendTo(e(this))})}function u(){var t=e(".cf7-style-upload-field");t.addClass("hidden"),t.each(function(){var t=e(this);e('<span class="image-info-box"></span>').insertAfter(t),""!=t.val()&&t.parent().find(".image-info-box").text(t.val().filename("yes"))}),e(".upload-btn").length<=0&&(e("<a href='javascript: void(0);' class='remove-btn button'>Remove</a>").insertAfter(t),e("<a href='javascript: void(0);' class='upload-btn button'>Upload</a>").insertAfter(t)),e(".upload-btn").on("click",function(){var t=e(this),a=t.parent().find(".cf7-style-upload-field");tb_show("New Banner","media-upload.php?type=image&TB_iframe=1"),window.send_to_editor=function(n){a.val(e(n).attr("src")),a.trigger("change"),t.parent().find(".image-info-box").text(e(n).attr("src").filename("yes")),tb_remove()}}),e(".remove-btn").on("click",function(){var t=e(this),a=t.parent().find(".cf7-style-upload-field");a.val(" "),a.attr("value"," "),a.trigger("change"),t.parent().find(".image-info-box").text("")})}function f(){e(".wp-picker-container").each(function(){e(this).parent().find('label[for*="_color"]').length<1&&e('<label><input type="checkbox" class="transparent-box" name="transparent-box">Transparent</label>').insertAfter(e(this))}),e(".transparent-box").each(function(){"transparent"==e(this).parent().parent().find(".cf7-style-color-field").val()&&e(this).prop("checked",!0)}),e(".transparent-box").on("click",function(){var t=e(this).parent().parent();e(this).is(":checked")?(t.find(".cf7-style-color-field").val("transparent"),t.find(".cf7-style-color-field").attr("value","transparent"),t.find(".wp-color-result").css("background-color","transparent")):(t.find(".cf7-style-color-field").val(""),t.find(".cf7-style-color-field").attr("value","")),p(e(this).parents(".panel").find('[name^="cf7stylecustom"]'))})}function h(e){return"%"==e.val()||"em"==e.val()?"0.01":"1"}function v(){e('.panel input[type="number"]:not([id*="opacity"])').each(function(){var t=e(this);t.attr("step",h(t.next()))}),e('.panel select[name*="unit"]').off("change").on("change",function(){var t=e(this);if(t.prev().attr("step",h(t)),"px"==t.val()){var a=Math.floor(t.prev().val());t.prev().val(a),t.prev().attr("value",a)}})}o.on("click",function(t){if(t.preventDefault(),e(".cf7style-input").each(function(t,n){""==e(this).val()?a(e(this),"error"):a(e(this),"valid")}),""!==n.val()&&""!==i.val())if(l=i.val(),/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i.test(l)){a(i,"valid");var s=e("<div />");e(".cf7style-status-table").each(function(t,a){var n=e("<table />");n.html(e(this).html()),s.append(n)}),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_send_status_report",name:n.val(),email:i.val(),message:r.val(),report:s.html()},beforeSend:function(){o.text("Sending...")},success:function(t){"success"==e.trim(t)?o.text("Report sent").removeClass("cf7style-status-submit").attr("disabled","disabled"):o.text("Something went wrong!").removeClass("cf7style-status-submit").attr("disabled","disabled")}})}else a(i,"error");else console.log("error 1");var l}),e(".cf7style-status-info").on("click",function(t){t.preventDefault(),e(".cf7style-status-table").toggle()}),String.prototype.filename=function(e){var t=this.replace(/\\/g,"/");return t=t.substring(t.lastIndexOf("/")+1),e?t.replace(/[?#].+$/,""):t.split(".")[0]},e.fn.serializeObject=function(){var t={},a=this.serializeArray();return e.each(a,function(){void 0!==t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(this.value||"")):t[this.name]=this.value||""}),t},e(".cf7style-no-forms-added").length>0?e(".generate-preview-button, .generate-preview-option").show():e(".generate-button-hidden").show(),e(".generate-preview-button").on("click",function(a){a.preventDefault(),e(".cf7style-no-forms-added").hide();var n=e(this).attr("data-attr-id"),i=e(this).attr("data-attr-title");e(this).prop("disabled",!0),e(this).parents("tr").find("input").prop("checked",!0);var r=e("<p />");e(".preview-form-tag").prepend(r),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_generate_preview_dashboard",form_id:n,form_title:i},beforeSend:function(){r.text("Loading..."),e(".multiple-form-generated-preview").hide()},success:function(a){a&&(r.remove(),e(".preview-form-tag").append(a),e(".multiple-form-generated-preview").eq(e(".multiple-form-generated-preview").length-1).show(),c(),d(),t(e(".preview-form-container form:visible")))}})});var m,y,F,b,g,w,x,k,_,C,D,A,z,O=e(".generate-preview"),E=e(".post-type-cf7_style"),S=e("#select_all"),T=e('select[name="cf7_style_font_selector"]'),j=e(".cf7-style-slider-wrap"),q=e(".preview-form-container"),N={change:function(t,a){var n=e(this);n.parents(".wp-picker-container").parent().find(".transparent-box").prop("checked",!1),setTimeout(function(){p(n.parents(".panel").find('[name^="cf7stylecustom"]'))},0),"hover"==e('input[name="element-type"]:checked').val()?c("hover"):c()}};if(e(".cf7-style-color-field").wpColorPicker(N),O.length>0&&(m=O,e(window).scroll(function(){if(e(window).width()>1600){m.find(".panel-header").offset();var t=e("#cf7_style_meta_box_style_customizer").offset(),a=e(window).scrollTop()-t.top;a>0&&m.find(".panel-header").css("top",a),a<=0&&m.find(".panel-header").css("top",0)}e(window).scrollTop()>700?e(".fixed-save-style").show():e(".fixed-save-style").hide()}).trigger("scroll")),E.length>0){e("#cf7_style_manual_style").length>0&&CodeMirror.fromTextArea(document.getElementById("cf7_style_manual_style"),{lineNumbers:!0,theme:"default",mode:"text/css"}),u(),l(),d();q=e(".preview-form-container").not(".hidden");e(".post-new-php").length<1&&t(q),S.on("click",function(){e(".cf7style_body_select_all input").prop("checked",!!e(this).is(":checked"))}),s(T.val()),T.on("change",function(){s(e(this).val())}),function(){c(),e("#form-tag a.button").on("click",function(t){t.preventDefault();var a=e(this),n=e("."+a.attr("data-property")+"-panel"),i=0;0==e(".modified-style-here").length?(a.hasClass("button-primary")||(e(".panel").stop(!0,!0).animate({opacity:0},300,function(){0===i&&(i++,e(".panel").addClass("hidden"),e(".panel").html(""),n.css("opacity","0"),n.removeClass("hidden"),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_load_property",property:a.attr("data-property")},beforeSend:function(){a.parent().find("a").prop("disabled","true"),e(".panel-options .loading").removeClass("hidden")},success:function(t){a.parent().find("a").prop("disabled","false"),i=0,n.html(t),e(".panel-options .loading").addClass("hidden");var r=e('input[name="cf7styleallvalues"]').val(),o=e.parseJSON(r.replace(/'/g,'"'));n.find('[name^="cf7stylecustom"]').each(function(){e(this).attr("id")in o&&""!=o[e(this).attr("id")]&&e(this).val(o[e(this).attr("id")])}),n.find(".cf7-style-color-field").wpColorPicker(N),l(),u(),n.stop(!0,!0).animate({opacity:1},300),f(),v()}}))}),e(".element-selector input:eq(0)").prop("checked",!0)),e("#form-tag a.button").removeClass("button-primary"),a.addClass("button-primary"),e('input[name="cf7styleactivepane"]').val(a.attr("data-property"))):e(".panel-options .decision").removeClass("hidden")}),e(".panel-options .cancel-btn").on("click",function(t){t.preventDefault(),e(".panel-options .decision").addClass("hidden")}),e(".element-selector input").on("change",function(){e(".element-selector input").prop("checked",!1),e(this).prop("checked",!0),"hover"==e(this).val()?(e(".panel:visible li").addClass("hidden"),e(".panel:visible li.hover-element").removeClass("hidden"),c("hover")):(e(".panel:visible li.hover-element").addClass("hidden"),e(".panel:visible li").not(".hover-element").removeClass("hidden"),c())}),e("#form-preview").on("change",function(){e(".preview-form-container").addClass("hidden"),e(".preview-form-container").eq(e(this).val()).removeClass("hidden"),t(e(".preview-form-container").eq(e(this).val()))});var a=0;e(document).on("change",'[name^="cf7stylecustom"]',function(){0==a&&(a++,e(this).parents(".panel").addClass("modified-style-here")),p(e(this).parents(".panel").find('[name^="cf7stylecustom"]')),"hover"==e('input[name="element-type"]:checked').val()?c("hover"):c()}),e(document).on("keyup",'[name^="cf7stylecustom"]',function(){p(e(this).parents(".panel").find('[name^="cf7stylecustom"]')),"hover"==e('input[name="element-type"]:checked').val()?c("hover"):c()})}(),q.find('input[type="hidden"]').remove(),q.find('input[type="submit"]').on("click",function(e){e.preventDefault()})}j.length>0&&(b=202,g=500,w=!0,x=(F=y=j).find(".active").index()+1,k=F.find("li"),_=F.find("ul"),C=F.find(".narrow"),D=F.find(".narrow.left"),A=F.find(".narrow.right"),z=F.find("li").length,A.addClass("visible"),_.css("width",z*b),0==w&&F.mouseenter(function(){F.find(".visible").stop().show()}).mouseleave(function(){F.find(".visible").stop().hide()}),C.on("click",function(t){t.stopPropagation(),t.preventDefault();var a=e(this).attr("data-direction");"left"==a&&1!==x&&(_.stop(!0,!0).animate({marginLeft:"+="+b+"px"},g),x--),"right"==a&&x!==z&&(_.stop(!0,!0).animate({marginLeft:-b*x+"px"},g),x++),1==x&&(D.hide().removeClass("visible"),A.show().addClass("visible")),x==z&&A.hide().removeClass("visible"),x<z&&A.show().addClass("visible"),x>1&&D.show().addClass("visible"),k.removeClass("active").eq(x-1).addClass("active")}),_.css({"margin-left":"-"+(x-1)*b+"px"}),y.find("li").on("click",function(){e(this).hasClass("current-saved")||(y.find("li").removeClass("current-saved"),e(this).addClass("current-saved"),y.find(".overlay em").html("Not Active"),e(this).find(".overlay em").html("Active"),e(".cf7style_template").removeAttr("checked"),e(this).find(".cf7style_template").attr("checked","checked"))})),e(".close-cf7-panel").on("click",function(t){t.preventDefault(),e.ajax({url:ajaxurl,method:"POST",data:{action:"cf7_style_remove_welcome_box"},success:function(t){e(".welcome-container").fadeOut("slow")}})}),f(),v()});
admin/js/admin.js CHANGED
@@ -15,21 +15,33 @@ jQuery(document).ready(function($) {
15
  function hideShowBtns(previewForm) {
16
  if (previewForm.find('label').length < 1) {
17
  $('.button[data-property="label"]').hide();
 
 
18
  }
19
  if (previewForm.find('p').length < 1) {
20
  $('.button[data-property="p"]').hide();
 
 
21
  }
22
  if (previewForm.find('fieldset').length < 1) {
23
  $('.button[data-property="fieldset"]').hide();
 
 
24
  }
25
  if (previewForm.find('select').length < 1) {
26
  $('.button[data-property="select"]').hide();
 
 
27
  }
28
  if (previewForm.find('input[type="checkbox"]').length < 1) {
29
  $('.button[data-property="checkbox"]').hide();
 
 
30
  }
31
  if (previewForm.find('input[type="radio"]').length < 1) {
32
  $('.button[data-property="radio"]').hide();
 
 
33
  }
34
  }
35
 
@@ -431,6 +443,7 @@ jQuery(document).ready(function($) {
431
  $('#form-preview').on('change', function() {
432
  $('.preview-form-container').addClass('hidden');
433
  $('.preview-form-container').eq($(this).val()).removeClass('hidden');
 
434
  });
435
  var once = 0;
436
  $(document).on("change", '[name^="cf7stylecustom"]', function() {
15
  function hideShowBtns(previewForm) {
16
  if (previewForm.find('label').length < 1) {
17
  $('.button[data-property="label"]').hide();
18
+ } else {
19
+ $('.button[data-property="label"]').show();
20
  }
21
  if (previewForm.find('p').length < 1) {
22
  $('.button[data-property="p"]').hide();
23
+ } else {
24
+ $('.button[data-property="p"]').show();
25
  }
26
  if (previewForm.find('fieldset').length < 1) {
27
  $('.button[data-property="fieldset"]').hide();
28
+ } else {
29
+ $('.button[data-property="fieldset"]').show();
30
  }
31
  if (previewForm.find('select').length < 1) {
32
  $('.button[data-property="select"]').hide();
33
+ } else {
34
+ $('.button[data-property="select"]').show();
35
  }
36
  if (previewForm.find('input[type="checkbox"]').length < 1) {
37
  $('.button[data-property="checkbox"]').hide();
38
+ } else {
39
+ $('.button[data-property="checkbox"]').show();
40
  }
41
  if (previewForm.find('input[type="radio"]').length < 1) {
42
  $('.button[data-property="radio"]').hide();
43
+ } else {
44
+ $('.button[data-property="radio"]').show();
45
  }
46
  }
47
 
443
  $('#form-preview').on('change', function() {
444
  $('.preview-form-container').addClass('hidden');
445
  $('.preview-form-container').eq($(this).val()).removeClass('hidden');
446
+ hideShowBtns( $('.preview-form-container').eq($(this).val()) );
447
  });
448
  var once = 0;
449
  $(document).on("change", '[name^="cf7stylecustom"]', function() {
cf7-style.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Contact Form 7 Style
4
  Plugin URI: http://wordpress.reea.net/contact-form-7-style/
5
  Description: Simple style customization and templating for Contact Form 7 forms. Requires Contact Form 7 plugin installed.
6
- Version: 3.1.6
7
  Author: Johnny, dorumarginean, mlehelsz, MirceaR
8
  Author URI: http://cf7style.com
9
  License: GPL2
@@ -20,7 +20,7 @@ if ( !defined( 'ABSPATH' ) ) {
20
  define( 'WPCF7S_PLUGIN', __FILE__ );
21
  define( 'WPCF7S_PLUGIN_DIR', untrailingslashit( dirname( WPCF7S_PLUGIN ) ) );
22
  define( 'WPCF7S_LOCATION',plugin_dir_url( WPCF7S_PLUGIN ) );
23
- define( 'WPCF7S_PLUGIN_VER', '3.1.6' );
24
  define( 'WPCF7S_REQ_PLUGIN', 'contact-form-7/wp-contact-form-7.php' );
25
 
26
  /*
3
  Plugin Name: Contact Form 7 Style
4
  Plugin URI: http://wordpress.reea.net/contact-form-7-style/
5
  Description: Simple style customization and templating for Contact Form 7 forms. Requires Contact Form 7 plugin installed.
6
+ Version: 3.1.7
7
  Author: Johnny, dorumarginean, mlehelsz, MirceaR
8
  Author URI: http://cf7style.com
9
  License: GPL2
20
  define( 'WPCF7S_PLUGIN', __FILE__ );
21
  define( 'WPCF7S_PLUGIN_DIR', untrailingslashit( dirname( WPCF7S_PLUGIN ) ) );
22
  define( 'WPCF7S_LOCATION',plugin_dir_url( WPCF7S_PLUGIN ) );
23
+ define( 'WPCF7S_PLUGIN_VER', '3.1.7' );
24
  define( 'WPCF7S_REQ_PLUGIN', 'contact-form-7/wp-contact-form-7.php' );
25
 
26
  /*
css/admin-bar.css CHANGED
@@ -1 +1 @@
1
- #wp-admin-bar-cf7-style a{display:block;float:right}.remove_template_notice{float:right}#wpadminbar .admin-style-icon{float:right;padding-top:7px;display:block;margin-right:-4px;margin-left:10px}#wpadminbar .admin-style-icon:after{color:#000;content:".";font-size:10px;left:22px;position:absolute;top:-6px}.cf7_style_page_cf7style-settings .form-table td,.cf7_style_page_cf7style-settings .form-table th{padding-top:5px;padding-bottom:5px}.cf7_style_page_cf7style-settings .form-table th{width:auto}.cf7_style_page_cf7style-settings .form-table td label{font-style:italic;text-decoration:underline;padding:5px 0;position:relative;line-height:150%}.cf7_style_page_cf7style-settings .form-table td .cf7style-tooltip{cursor:pointer;display:inline-block;top:3px;position:relative;margin-left:50px}.cf7style-tooltip i{color:#E74C3C;font-size:16px}.cf7_style_page_cf7style-settings .cf7style-tooltip-content{position:absolute;padding:5px 10px;background-color:#E74C3C;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;color:#FFF;border:1px solid #E74C3C;z-index:100;width:280px;cursor:auto;font-style:normal;top:-380%;left:160%;display:none;flex-direction:column;justify-content:center}.cf7_style_page_cf7style-settings .cf7style-tooltip-content.show{display:flex}.cf7_style_page_cf7style-settings .cf7style-tooltip-content p,.cf7_style_page_cf7style-settings .cf7style-tooltip-content p small{font-size:12px;margin-bottom:10px}.cf7_style_page_cf7style-settings .cf7style-tooltip-content a{color:#FFF;font-weight:700}.post-type-cf7_style .postbox .hndle{cursor:default}
1
+ #wp-admin-bar-cf7-style a{display:block;float:right}.remove_template_notice{float:right}#wpadminbar .admin-style-icon{float:right;padding-top:7px;display:block;margin-right:-4px;margin-left:10px}#wpadminbar .admin-style-icon:after{color:#000;content:".";font-size:10px;left:22px;position:absolute;top:-6px}.cf7_style_page_cf7style-settings .form-table td,.cf7_style_page_cf7style-settings .form-table th{padding-top:5px;padding-bottom:5px}.cf7_style_page_cf7style-settings .form-table th{width:auto}.cf7_style_page_cf7style-settings .form-table td label{font-style:italic;text-decoration:underline;padding:5px 0;position:relative;line-height:150%}.cf7_style_page_cf7style-settings .form-table td .cf7style-tooltip{cursor:pointer;display:inline-block;top:3px;position:relative;margin-left:50px}.cf7style-tooltip i{color:#E74C3C;font-size:12px;border:1px solid #E74C3C;background-color:#FFF;display:inline-block;width:16px;text-align:center;line-height:16px;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}.cf7_style_page_cf7style-settings .cf7style-tooltip-content{position:absolute;padding:5px 10px;background-color:#E74C3C;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;color:#FFF;border:1px solid #E74C3C;z-index:100;width:280px;cursor:auto;font-style:normal;top:-380%;left:160%;display:none;flex-direction:column;justify-content:center}.cf7_style_page_cf7style-settings .cf7style-tooltip-content.show{display:flex}.cf7_style_page_cf7style-settings .cf7style-tooltip-content p,.cf7_style_page_cf7style-settings .cf7style-tooltip-content p small{font-size:12px;margin-bottom:10px}.cf7_style_page_cf7style-settings .cf7style-tooltip-content a{color:#FFF;font-weight:700}.post-type-cf7_style .postbox .hndle{cursor:default}
inc/add_required_admin_scripts.php CHANGED
@@ -23,7 +23,6 @@ function cf7_style_admin_scripts($hook){
23
  wp_enqueue_script( 'media-upload' );
24
  }
25
  if( 'plugins.php'== $hook || 'cf7_style' == $post_type || 'toplevel_page_wpcf7' == $hook || 'cf7_style_page_cf7style-css-editor' == $hook || 'cf7_style_page_system-status' == $hook || 'cf7_style_page_cf7style-settings' == $hook ){
26
- /*wp_enqueue_style('cf7-style-font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');*/
27
  wp_enqueue_style( "cf7-style-fontello-ie7", WPCF7S_LOCATION . "admin/css/fontello-ie7.css", false, WPCF7S_PLUGIN_VER, "all");
28
  wp_enqueue_style( "cf7-style-fontello", WPCF7S_LOCATION . "admin/css/fontello.css", false, WPCF7S_PLUGIN_VER, "all");
29
  wp_enqueue_style( "cf7-style-admin-style", WPCF7S_LOCATION . "admin/css/admin.css", false, WPCF7S_PLUGIN_VER, "all");
23
  wp_enqueue_script( 'media-upload' );
24
  }
25
  if( 'plugins.php'== $hook || 'cf7_style' == $post_type || 'toplevel_page_wpcf7' == $hook || 'cf7_style_page_cf7style-css-editor' == $hook || 'cf7_style_page_system-status' == $hook || 'cf7_style_page_cf7style-settings' == $hook ){
 
26
  wp_enqueue_style( "cf7-style-fontello-ie7", WPCF7S_LOCATION . "admin/css/fontello-ie7.css", false, WPCF7S_PLUGIN_VER, "all");
27
  wp_enqueue_style( "cf7-style-fontello", WPCF7S_LOCATION . "admin/css/fontello.css", false, WPCF7S_PLUGIN_VER, "all");
28
  wp_enqueue_style( "cf7-style-admin-style", WPCF7S_LOCATION . "admin/css/admin.css", false, WPCF7S_PLUGIN_VER, "all");
inc/adminbar_add_link.php CHANGED
@@ -5,17 +5,20 @@ if ( !defined( 'ABSPATH' ) ) {
5
  }
6
 
7
  function cf7style_toolbar_link($wp_admin_bar) {
8
- $args = array(
9
- 'id' => 'cf7-style',
10
- 'title' => 'Contact Form 7 Style',
11
- 'href' => admin_url("edit.php?post_type=cf7_style"),
12
- 'meta' => array(
13
- 'class' => 'contact-style',
14
- 'title' => 'Contact Form 7 Style',
15
- 'html' => '<span class="admin-style-icon"><i class="dashicons-before dashicons-twitter" aria-hidden="true"></i></span>'
16
- )
17
- );
18
- $wp_admin_bar->add_node($args);
 
 
 
19
  }
20
 
21
  add_action('admin_bar_menu', 'cf7style_toolbar_link', 999);
5
  }
6
 
7
  function cf7style_toolbar_link($wp_admin_bar) {
8
+ $render_cfs_bar = get_option( 'cf7_style_adminbar');
9
+ if( $render_cfs_bar == '1' ){
10
+ $args = array(
11
+ 'id' => 'cf7-style',
12
+ 'title' => 'Contact Form 7 Style',
13
+ 'href' => admin_url("edit.php?post_type=cf7_style"),
14
+ 'meta' => array(
15
+ 'class' => 'contact-style',
16
+ 'title' => 'Contact Form 7 Style',
17
+ 'html' => '<span class="admin-style-icon"><i class="dashicons-before dashicons-twitter" aria-hidden="true"></i></span>'
18
+ )
19
+ );
20
+ $wp_admin_bar->add_node($args);
21
+ }
22
  }
23
 
24
  add_action('admin_bar_menu', 'cf7style_toolbar_link', 999);
inc/check_cfstyle_version.php CHANGED
@@ -10,6 +10,7 @@ function cf7_style_create_posts(){
10
  update_option( 'cf7_style_update_saved', 'yes' );
11
  update_option( 'cf7_style_allow_tracking', '5' );
12
  update_option( 'cf7_style_add_categories', '0' );
 
13
  }
14
 
15
  function cf7style_update_db_check() {
10
  update_option( 'cf7_style_update_saved', 'yes' );
11
  update_option( 'cf7_style_allow_tracking', '5' );
12
  update_option( 'cf7_style_add_categories', '0' );
13
+ update_option( 'cf7_style_adminbar', '1' );
14
  }
15
 
16
  function cf7style_update_db_check() {
inc/editor_page.php CHANGED
@@ -51,7 +51,7 @@ class init_sections_register_fields {
51
  add_filter( 'admin_init' , array( $this , 'register_new_fields' ) );
52
  }
53
  function cf7style_render_checkbox( $option, $args, $description, $tulip ){
54
- $tulip = $tulip ? '<div class="cf7style-tooltip" title="more info"><i class="fa fa-question-circle" aria-hidden="true"></i><div class="cf7style-tooltip-content">'.$tulip.'<div/></div>' : '';
55
  return '<label><input type="checkbox" value="1" '.checked( 1, $option,false).' id="'.$args[0].'[' . $args[0] . ']" name="'.$args[0].'" />'.__( $description, 'contact-form-7-style' ).'</label>'.$tulip;
56
  }
57
  function cf7style_collection_structure( $args ) {
@@ -106,6 +106,20 @@ class init_sections_register_fields {
106
  return $html;
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  function register_new_fields() {
110
  add_settings_section(
111
  'cf7styleeditor',
@@ -128,6 +142,7 @@ class init_sections_register_fields {
128
  'cf7_style_deleted' => __('Import predefined Contact Form 7 Style templates', 'contact-form-7-style'),
129
  'cf7_style_form_tooltip' => __( 'Display form edit tooltip on frontend?', 'contact-form-7-style' ),
130
  'cf7_style_forcecss' => __( 'Active theme overrides your form styling?', 'contact-form-7-style' ),
 
131
  );
132
  foreach ( $set_fields as $field => $value ) {
133
  add_settings_field(
@@ -158,13 +173,14 @@ class init_sections_register_fields {
158
 
159
  if(isset( $_POST[ $args[0] ] )){
160
  update_option( $args[0], 1 );
 
161
  } else {
162
  if(isset($_POST[ 'cf7styletracking' ])){
163
  update_option( $args[0], 0 );
164
  }
165
  if( isset( $_POST['cf7_style_form_tooltip'] ) ) {
166
  update_option( $args[0], 0 );
167
- }
168
  }
169
  switch($args[0]) {
170
  case 'cf7_style_allow_tracking' :
@@ -179,7 +195,11 @@ class init_sections_register_fields {
179
  case 'cf7_style_forcecss' :
180
  echo $this->cf7style_forcecss_structure( $args );
181
  break;
 
 
 
182
  }
 
183
  }
184
  function text_inputs( $args ) {
185
  if ( isset( $_POST[ $args[0] ] ) ) {
51
  add_filter( 'admin_init' , array( $this , 'register_new_fields' ) );
52
  }
53
  function cf7style_render_checkbox( $option, $args, $description, $tulip ){
54
+ $tulip = $tulip ? '<div class="cf7style-tooltip" title="more info"><i class="fa fa-question-circle" aria-hidden="true">?</i><div class="cf7style-tooltip-content">'.$tulip.'<div/></div>' : '';
55
  return '<label><input type="checkbox" value="1" '.checked( 1, $option,false).' id="'.$args[0].'[' . $args[0] . ']" name="'.$args[0].'" />'.__( $description, 'contact-form-7-style' ).'</label>'.$tulip;
56
  }
57
  function cf7style_collection_structure( $args ) {
106
  return $html;
107
  }
108
 
109
+ function cf7style_adminbar_structure( $args ) {
110
+ $html = "";
111
+ $html .= '</tr>';
112
+ $html .= '<tr><td colspan="2">';
113
+ $option = get_option( $args[0] );
114
+ if( isset( $_POST[ 'cf7_style_adminbar' ] ) ) {
115
+ update_option( 'cf7_style_adminbar', '1' );
116
+
117
+ }
118
+ $html .= $this->cf7style_render_checkbox( $option, $args, 'Add Contact Form 7 Style in the adminbar', '' );
119
+ $html .= '</td></tr><tr><td colspan="2">';
120
+ return $html;
121
+ }
122
+
123
  function register_new_fields() {
124
  add_settings_section(
125
  'cf7styleeditor',
142
  'cf7_style_deleted' => __('Import predefined Contact Form 7 Style templates', 'contact-form-7-style'),
143
  'cf7_style_form_tooltip' => __( 'Display form edit tooltip on frontend?', 'contact-form-7-style' ),
144
  'cf7_style_forcecss' => __( 'Active theme overrides your form styling?', 'contact-form-7-style' ),
145
+ 'cf7_style_adminbar' => __( 'Display Contact Form 7 Style in admin bar?', 'contact-form-7-style' )
146
  );
147
  foreach ( $set_fields as $field => $value ) {
148
  add_settings_field(
173
 
174
  if(isset( $_POST[ $args[0] ] )){
175
  update_option( $args[0], 1 );
176
+ echo "<script>location.reload();</script>";
177
  } else {
178
  if(isset($_POST[ 'cf7styletracking' ])){
179
  update_option( $args[0], 0 );
180
  }
181
  if( isset( $_POST['cf7_style_form_tooltip'] ) ) {
182
  update_option( $args[0], 0 );
183
+ }
184
  }
185
  switch($args[0]) {
186
  case 'cf7_style_allow_tracking' :
195
  case 'cf7_style_forcecss' :
196
  echo $this->cf7style_forcecss_structure( $args );
197
  break;
198
+ case 'cf7_style_adminbar' :
199
+ echo $this->cf7style_adminbar_structure( $args );
200
+ break;
201
  }
202
+
203
  }
204
  function text_inputs( $args ) {
205
  if ( isset( $_POST[ $args[0] ] ) ) {
inc/init_style.php CHANGED
@@ -23,21 +23,10 @@ function get_predefined_cf7_style_template_data() {
23
  }// end of get_predefined_cf7_style_template_data
24
 
25
  function cf7_style_set_style_category_on_publish( $ID, $post ) {
26
- $temporizator = 0;
27
- $tpl_data = get_predefined_cf7_style_template_data();
28
- if( $tpl_data ){
29
- foreach ( $tpl_data as $predefined_post_titles ) {
30
- if( $post->post_title == $predefined_post_titles[ "title" ] ){
31
- $temporizator++;
32
- }
33
- }
34
- }
35
- if( 0 == $temporizator ) {
36
- wp_set_object_terms( $ID, 'custom style', 'style_category' );
37
- }
38
  } // end cf7_style_set_style_category_on_publish
39
 
40
- function cf7_style_create_post( $slug, $title, $image) {
41
  // Initialize the page ID to -1. This indicates no action has been taken.
42
  $post_id = -1;
43
  $was_deleted = get_option('cf7_style_deleted');
@@ -60,8 +49,8 @@ function cf7_style_create_post( $slug, $title, $image) {
60
  echo $error . '<br>';
61
  }
62
  } else {
63
- //wp_set_object_terms( $post_id, $category, 'style_category', false );
64
  update_post_meta( $post_id, 'cf7_style_image_preview', $image );
 
65
  }
66
  // Otherwise, we'll stop
67
  } else {
@@ -138,35 +127,18 @@ function cf7style_load_elements(){
138
  );
139
  //register tax
140
  register_taxonomy( 'style_category', array( 'cf7_style' ), $args );
141
- $tpl_data = get_predefined_cf7_style_template_data();
142
- if( $tpl_data ){
143
- foreach ( $tpl_data as $style ) {
144
- cf7_style_create_post( strtolower( str_replace( " ", "-", $style['title'] ) ), $style['title'], $style['image'] );
145
- }
146
- if( get_option( 'cf7_style_add_categories', 0 ) == 0 ){
147
- $cf7_style_args = array(
148
- 'post_type' => 'cf7_style',
149
- 'posts_per_page' => '-1'
150
- );
151
-
152
- $cf7_style_query = new WP_Query( $cf7_style_args );
153
- if ( $cf7_style_query->have_posts() ) {
154
- while ( $cf7_style_query->have_posts() ) {
155
- $cf7_style_query->the_post();
156
- $temp_title = get_the_title();
157
- $temp_ID = get_the_ID();
158
-
159
- foreach ( $tpl_data as $style ) {
160
- if( $temp_title == wptexturize( $style[ 'title' ] ) ) {
161
- wp_set_object_terms( $temp_ID, $style[ 'category' ], 'style_category' );
162
- }
163
- }
164
- }
165
- wp_reset_postdata();
166
- update_option( 'cf7_style_add_categories', 1 );
167
  }
 
168
  }
 
169
  }
 
170
  $cf7_style_update_saved = get_option( 'cf7_style_update_saved' );
171
  if( $cf7_style_update_saved == "yes" ) {
172
  $cf7_style_args = array(
23
  }// end of get_predefined_cf7_style_template_data
24
 
25
  function cf7_style_set_style_category_on_publish( $ID, $post ) {
26
+ wp_set_object_terms( $ID, 'custom style', 'style_category' );
 
 
 
 
 
 
 
 
 
 
 
27
  } // end cf7_style_set_style_category_on_publish
28
 
29
+ function cf7_style_create_post( $slug, $title, $image, $temp_cat) {
30
  // Initialize the page ID to -1. This indicates no action has been taken.
31
  $post_id = -1;
32
  $was_deleted = get_option('cf7_style_deleted');
49
  echo $error . '<br>';
50
  }
51
  } else {
 
52
  update_post_meta( $post_id, 'cf7_style_image_preview', $image );
53
+ wp_set_object_terms( $post_id, $temp_cat, 'style_category' );
54
  }
55
  // Otherwise, we'll stop
56
  } else {
127
  );
128
  //register tax
129
  register_taxonomy( 'style_category', array( 'cf7_style' ), $args );
130
+ $add_post_or_not = get_option( 'cf7_style_add_categories', 0 );
131
+ if( $add_post_or_not == 0 ){
132
+ $tpl_data = get_predefined_cf7_style_template_data();
133
+ if( $tpl_data ){
134
+ foreach ( $tpl_data as $style ) {
135
+ cf7_style_create_post( strtolower( str_replace( " ", "-", $style['title'] ) ), $style['title'], $style['image'], $style[ 'category' ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
137
+ update_option( 'cf7_style_add_categories', 1 );
138
  }
139
+
140
  }
141
+
142
  $cf7_style_update_saved = get_option( 'cf7_style_update_saved' );
143
  if( $cf7_style_update_saved == "yes" ) {
144
  $cf7_style_args = array(
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ionut.iclanzan, dorumarginean, mlehelsz, mircear
3
  Donate link: http://cf7style.com/back-this-project/
4
  Tags: contact form 7, contact form 7 style, contact form 7 templates, contact form 7 styling, CF7, CF7 style, styling contact form, styling contact form 7, multiple form styling, custom form styling, CF7 addon, customize, templates, valentine's day templates, Christmas templates, manual styling, live preview, hover state styling, CF7 form messages styling
5
  Requires at least: 3.0.1
6
- Tested up to: 4.9
7
- Stable tag: 3.1.6
8
  Requires PHP: 5.6.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -76,6 +76,15 @@ Please check our FAQ page where you'll find answers to some of your questions on
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
 
 
 
79
  = 3.1.6 =
80
 
81
  Release Date: November 7th, 2017
@@ -94,7 +103,6 @@ Release Date: November 4th, 2017
94
 
95
  * [Major Fix](https://wordpress.org/support/topic/dont-show-background-image/) Background image rendering fixed ( added "url()" )
96
 
97
-
98
  = 3.1.3 =
99
 
100
  Release Date: November 3rd, 2017
@@ -265,6 +273,8 @@ Release Date: November 3rd, 2017
265
  * First plugin version.
266
 
267
  == Upgrade Notice ==
268
- = Contact Form 7 Style Version 3.1.6 =
269
 
270
- * [Major Fix](https://wordpress.org/support/topic/u-have-a-problem-with-ure-update/) Fixed slash error and added extra condition to check for response
 
 
3
  Donate link: http://cf7style.com/back-this-project/
4
  Tags: contact form 7, contact form 7 style, contact form 7 templates, contact form 7 styling, CF7, CF7 style, styling contact form, styling contact form 7, multiple form styling, custom form styling, CF7 addon, customize, templates, valentine's day templates, Christmas templates, manual styling, live preview, hover state styling, CF7 form messages styling
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.9.4
7
+ Stable tag: 3.1.7
8
  Requires PHP: 5.6.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
76
 
77
  == Changelog ==
78
 
79
+ = 3.1.7 =
80
+
81
+ Release Date: March 6th, 2018
82
+
83
+ * [Major Fix](https://wordpress.org/support/topic/increased-i-o/) Fixed I/O process with reducing the json requests from the servers
84
+ * [Major Fix] Fixed the problem where the form was missing some settings when multiple form were selected in the custom style part
85
+ * [Improvement](https://wordpress.org/support/topic/hide-contact-form-7-style-from-admin-bar/) Added settings to hide/show Contact Form 7 Style link
86
+
87
+
88
  = 3.1.6 =
89
 
90
  Release Date: November 7th, 2017
103
 
104
  * [Major Fix](https://wordpress.org/support/topic/dont-show-background-image/) Background image rendering fixed ( added "url()" )
105
 
 
106
  = 3.1.3 =
107
 
108
  Release Date: November 3rd, 2017
273
  * First plugin version.
274
 
275
  == Upgrade Notice ==
276
+ = Contact Form 7 Style Version 3.1.7 =
277
 
278
+ * [Major Fix](https://wordpress.org/support/topic/increased-i-o/) Fixed I/O process with reducing the json requests from the servers
279
+ * [Major Fix] Fixed the problem where the form was missing some settings when multiple form were selected in the custom style part
280
+ * [Improvement](https://wordpress.org/support/topic/hide-contact-form-7-style-from-admin-bar/) Added settings to hide/show Contact Form 7 Style link