1(function($) { 2 $.fn.wp_placeholder_fallback = function(){ 3 4 return this.each(function(){ 5 var form = $(this); 6 var init = init || init_form(); 7 8 function init_form() { 9 form.submit(function() { 10 $(this).find('input[placeholder], textarea[placeholder]').each(function(i, el) { 11 removePlaceHolder($(this)); 12 }); 13 }); 14 15 form.find('input[placeholder], textarea[placeholder]').each(function(i, el) { 16 var self = $(this); 17 addPlaceHolder(self); 18 self.focus(function() { 19 removePlaceHolder(self); 20 }); 21 self.blur(function() { 22 addPlaceHolder(self); 23 }); 24 }); 25 return true; 26 } 27 28 function addPlaceHolder(el) { 29 if (el.val() === ''){ 30 el.val(el.attr('placeholder')).addClass('placeholder'); 31 } 32 } 33 34 function removePlaceHolder(el) { 35 if (el.val() === el.attr('placeholder')){ 36 el.val('').removeClass('placeholder'); 37 } 38 } 39 }); 40 }; 41})(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.