1 2 3(function(jQuery){ 4 5 6 7 if(jQuery(".wpcf7c-elm-step1").length != 0) { 8 // 対象æã 9 10 jQuery(".wpcf7c-elm-step1").each(function(){ 11 // 親ã®ãã©ã¼ã ãæ¤ç´¢ 12 var parent = jQuery(this).parents("form"); 13 if(parent.attr("wpcf7c") == undefined) { 14 // elm-submitãsubmitãã¿ã³ã¸ãã»ãã 15 parent.find(".wpcf7-submit").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 16 parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 17 18 // ajaxç¨IDéé¿,å¦çæ¸ã¿ãã©ã°ã»ãã 19 var hidden_wpcf7 = parent.find("input[name=_wpcf7]"); 20 var _wpcf7 = hidden_wpcf7.val(); 21 parent.attr("wpcf7c", _wpcf7); 22 23 parent.attr("step", 1); 24 25 hidden_wpcf7.after('<input type="hidden" name="_wpcf7c" value="step1" />'); 26 27 //parent.find("input[name=_wpcf7]").val(""); 28 29 // ä¸è¦è¦ç´ é表示 30 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 31 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 32 parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide"); 33 34 // æ»ã£ã¦ç·¨éãã¿ã³æå 35 parent.find(".wpcf7c-btn-back").on("click", function(){ 36 wpcf7c_to_step1(parent, true); 37 return false; 38 }); 39 } 40 41 }); 42 43 } 44 45})(jQuery); 46 47var wpcf7c_to_step1 = function(parent, scroll){ 48 parent.find(".wpcf7c-conf").each(function(){ 49 // 親ãã©ã¼ã 50 var parent_form = jQuery(this).parents("form"); 51 52 jQuery(this).removeAttr("disabled").removeAttr("readonly").removeClass("wpcf7c-conf"); 53 54 }); 55 56 jQuery(".wpcf7c-conf-hidden").remove(); 57 58 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 59 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 60 parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide"); 61 62 parent.find("input[name=_wpcf7c]").val("step1"); 63 64 var responseOutput = parent.find('div.wpcf7-response-output'); 65 responseOutput.removeClass("wpcf7c-force-hide"); 66 responseOutput.removeClass("wpcf7-mail-sent-ng"); 67 responseOutput.css("display", "none"); 68 69 parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 70 71 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 72 if(scroll) { 73 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 74 setTimeout(function() { wpcf7c_scroll(parent.find("input[name=_wpcf7_unit_tag]").val()) }, 100); 75 } 76 // 確èªãã¿ã³æå 2021/09/09 Y.Asakawa 77parent.find(".wpcf7c-btn-confirm").on("click", function() { 78 responseOutput.css("display", ""); 79}); 80 81} 82 83 84var wpcf7c_step1 = function(unit_tag){ 85 // 確èªå®äº 86 87 // 対象ãã©ã¼ã æ¤ç´¢ 88 //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]"); 89 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 90 if(jQuery(this).val() == unit_tag) { 91 var parent = jQuery(this).parents("form"); 92 93 94 var responseOutput = parent.find('div.wpcf7-response-output'); 95 responseOutput.addClass("wpcf7c-force-hide"); 96 97 // 確èªç»é¢è¡¨ç¤º 98 // ããã¹ãã¨ãªã¢ã伸ã°ã 99 parent.find("textarea").each(function(){ 100 if(this.scrollHeight > this.offsetHeight){ 101 this.style.height = (this.scrollHeight + 10) + 'px'; 102 } 103 }); 104 parent.find("textarea").attr("readonly", true).addClass("wpcf7c-conf"); 105 parent.find("select").each(function(){ 106 jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf"); 107 jQuery(this).after( 108 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 109 ); 110 }); 111 parent.find("input").each(function(){ 112 switch(jQuery(this).attr("type")) { 113 case "submit": 114 case "button": 115 case "hidden": 116 case "image": 117 // ãªã«ãããªã 118 break; 119 case "radio": 120 case "checkbox": 121 // 鏿ããã¦ãããã®ã ãå¯¾å¦ 122 jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf"); 123 if(jQuery(this).is(":checked")) { 124 jQuery(this).after( 125 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 126 ); 127 } 128 break; 129 case "file": 130 jQuery(this).attr("readonly", true).addClass("wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 131 jQuery(this).after( 132 jQuery('<input type="text" />').attr("name", (jQuery(this).attr("name") + "_conf")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden").addClass("wpcf7c-conf").attr("readonly", true).attr("disabled", true) 133 ); 134 135 break; 136 default: 137 jQuery(this).attr("readonly", true).addClass("wpcf7c-conf"); 138 jQuery(this).after( 139 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 140 ); 141 break; 142 } 143 }); 144 145 // è¡¨ç¤ºåæ¿ 146 parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 147 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 148 parent.find(".wpcf7c-elm-step2").removeClass("wpcf7c-force-hide"); 149 150 parent.find(".ajax-loader").removeClass("wpcf7c-force-hide"); 151 152 parent.find("input[name=_wpcf7c]").val("step2"); 153 154 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 155 setTimeout(function() { wpcf7c_scroll(unit_tag) }, 100); 156 157 158 } 159 }); 160} 161 162var wpcf7c_scroll = function(unit_tag) { 163 // ã¨ã©ã¼ã®æãªã©ã«ã¢ã³ã«ã¼ã¾ã§ã¹ã¯ãã¼ã« 164 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 165 if(jQuery(this).val() == unit_tag) { 166 var parent = jQuery(this).parents("form"); 167 var speed = 1000; 168 var position = parent.offset().top; 169 if(jQuery('.wpcf7c-anchor').length != 0) { 170 position = jQuery('.wpcf7c-anchor').offset().top; 171 } 172 jQuery("html, body").animate({scrollTop:position}, speed, "swing"); 173 } 174 }); 175} 176 177var wpcf7c_step2 = function(unit_tag){ 178 // 確èªå®äº 179 180 // 対象ãã©ã¼ã æ¤ç´¢ 181 //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]"); 182 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 183 if(jQuery(this).val() == unit_tag) { 184 var parent = jQuery(this).parents("form"); 185 186 187 var responseOutput = parent.find('div.wpcf7-response-output'); 188 responseOutput.removeClass("wpcf7c-force-hide"); 189 190 // step1ç¶æ ã®ç»é¢è¡¨ç¤º 191 wpcf7c_to_step1(parent); 192 193 // step3ã®è¦ç´ ãããã°ãããã«åãæ¿ãã 194 if(parent.find(".wpcf7c-elm-step3").length != 0) { 195 // è¡¨ç¤ºåæ¿ 196 parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 197 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 198 parent.find(".wpcf7c-elm-step3").removeClass("wpcf7c-force-hide"); 199 } 200 201 202 } 203 }); 204} 205 206var wpcf7c_step2_error = function(unit_tag) { 207 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 208 if(jQuery(this).val() == unit_tag) { 209 var parent = jQuery(this).parents("form"); 210 211 var responseOutput = parent.find('div.wpcf7-response-output'); 212 responseOutput.removeClass("wpcf7c-force-hide"); 213 } 214 }); 215 216} 217 218 219// DOMã®ããããã£ã夿´ã«ãªã£ããã¨ã§ã³ã³ã¿ã¯ããã©ã¼ã ã®ã¦ãããã¿ã°ã 220//Contact Form 7 add confirmã«æ¸¡ããªããªã£ãåé¡ãä¿®æ£ 2021/09/09 Y.Asakawa 221 222document.addEventListener( 'wpcf7submit', function( event ) { 223 switch ( event.detail.status ) { 224 case 'wpcf7c_confirmed': 225 wpcf7c_step1(event.detail.unitTag); //wpcf7c_step1(event.detail.id);ãwpcf7c_step1(event.detail.unitTag);ã«å¤æ´ 226 break; 227 case 'mail_sent': 228 wpcf7c_step2(event.detail.unitTag); //wpcf7c_step2(event.detail.id);ãwpcf7c_step2(event.detail.unitTag);ã«å¤æ´ 229 break; 230 231 } 232}, false );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.