1(function(gravityformsautoplaceholders, $, undefined) { 2 function init(){ 3 create_placeholders(); 4 add_modernizr_placeholders_for_ie(); 5 } 6 7 function add_modernizr_placeholders_for_ie() { 8 if(!Modernizr.input.placeholder){$("input,textarea").each(function(){if($(this).val()=="" && $(this).attr("placeholder")!=""){$(this).val($(this).attr("placeholder"));$(this).focus(function(){if($(this).val()==$(this).attr("placeholder")) $(this).val("");});$(this).blur(function(){if($(this).val()=="") $(this).val($(this).attr("placeholder"));});}});} 9 } 10 11 function create_placeholders() { 12 var scope = gravityformsautoplaceholders.class_specific ? '.gfap_placeholder' : '.gform_wrapper'; 13 create_placeholders_from_gravity_form_labels(scope); 14 } 15 16 function create_placeholders_from_gravity_form_labels(scope) { 17 $('input[type="text"], textarea', scope).each(function(){ 18 var self = $(this); 19 var id = self.attr('id'); 20 var form = self.parents('form'); 21 var label = form.find('label[for="' + id + '"]'); 22 if (label.length) { 23 var text = label.last().text(); 24 var container_text = self.parents('.gfield').eq(0).find('label').first().text(); 25 if (text === 'First' && text !== container_text) { 26 text = 'First ' + container_text; 27 } 28 else if (text === 'Last' && text !== container_text) { 29 text = 'Last ' + container_text; 30 } 31 self.attr('placeholder', text); 32 label.hide(); 33 } 34 }); 35 } 36 37 $(document).ready(function(){ 38 init(); 39 }); 40}(window.gravityformsautoplaceholders = window.gravityformsautoplaceholders || {}, 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.