1(function ($) { 2 var jWP_form = (function ($) { 3 return { 4 init: function(useCustomValidation) { 5 var needSupport = !this.supportAttribute("input", "required") || (this.isAgent("safari") && !this.isAgent("chrome")); 6 if (useCustomValidation || needSupport) { 7 $("input[required],textarea[required],select[required]").removeAttr("required"); 8 } 9 if (needSupport) { 10 $(".widget_form").wp_placeholder_fallback(); 11 } 12 }, 13 isAgent: function(userAgentString) { 14 return navigator.userAgent.toLowerCase().match(userAgentString); 15 }, 16 supportAttribute: function(element, attribute) { 17 return attribute in document.createElement(element); 18 } 19 }; 20 }(jQuery)); 21 22 $(function() { 23 var customValidation = false; 24 if ($("#jwpform-validation").hasClass('custom')) { 25 customValidation = true; 26 } 27 28 jWP_form.init(customValidation); 29 }); 30}(jQuery));
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.