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