1(function($) { 2 3 $(document).ready(function() { 4 fixDemForms(); 5 }); 6 7 function fixDemForms() { 8 //Input form id's here 9 var forms = ['#gform_1', '#gform_3']; 10 $.each(forms, function(formIndex, formValue) { 11 var $form = $('.gform_wrapper '+formValue); 12 // Set form as a bootstrap Form 13 $form.addClass('md-form'); 14 // Sets each field as position relative 15 var $topField = $('li.gfield', $form); 16 $topField.css({ 17 'position' : 'relative', 18 }) 19 // Sets the top label position appropriately 20 var topLabel = $('> label', $topField); 21 $.each(topLabel, function(labelIndex, labelValue) { 22 var $tLabel = $(labelValue); 23 if($($tLabel).hasClass('gfield_label_before_complex')) { 24 $(this).css({ 25 'position' : 'relative', 26 'margin-bottom' : '25px', 27 }) 28 } else { 29// console.log($tLabel); 30// $(this).css({ 31// 'display' : 'block', 32// 'font-size' : '.813em', 33// 'letter-spacing' : '.5pt', 34// ' white-space' : 'nowrap', 35// }) 36 } 37 }) 38 // Sets spans of complex fields as position relative 39 $('li.gfield span', $form).css({ 40 'position':'relative', 41 }) 42 // Textarea inputs 43 $('textarea', $form).addClass('md-textarea'); 44 // Text inputs 45 var texts = $('input[type=text]', $form); 46 texts.css({ 47 'margin' : '10px 0 0', 48 }) 49 $.each(texts, function(textIndex, textValue) { 50 var textID = $(textValue).attr('id'); 51 if(textID !== undefined) { 52 var $textLabel = $('label[for='+textID+']'); 53 $textLabel.css({ 54 'display' : 'block', 55 'font-size' : '.813em', 56 'letter-spacing' : '.5pt', 57 ' white-space' : 'nowrap', 58 }) 59 //takes the input ID and uses it to find the field ID of text input 60 var $textField = $('#'+textID.replace("input_","field_")); 61 if($textField.length) { 62 $textField.on('focusin',function() { 63 $(this).children('label:not(.gfield_label_before_complex)').css({ 64 '-webkit-transform' : 'translateY(-2px) scale(0.8)', 65 'transform' : 'translateY(-2px) scale(0.8)', 66 }) 67 }) 68 } 69 } 70 }) 71 // Radio Fields 72 var radios = $('ul.gfield_radio', $form); 73 $.each(radios, function(radioIndex, radioValue) { 74 var radioID = $(radioValue).attr('id'); 75 if(radioID !== undefined) { 76 var $radioField = $('#'+radioID.replace("input_","field_")); 77 if($radioField.length) { 78 var $radioLabel = $('label', $radioField); 79 $radioLabel.css({ 80 'position' : 'relative', 81 }) 82 } 83 } 84 }) 85 // Checkbox Fields 86 var checks = $('ul.gfield_checkbox', $form); 87 $.each(checks, function(checkIndex, checkValue) { 88 var checkID = $(checkValue).attr('id'); 89 if(checkID !== undefined) { 90 var $checkField = $('#'+checkID.replace("input_","field_")); 91 if($checkField.length) { 92 var $checkLabel = $('label', $checkField); 93 $checkLabel.css({ 94 'position' : 'relative', 95 }) 96 } 97 } 98 }) 99 // Upload Fields 100 var uploads = $('input[type=file]', $form); 101 $.each(uploads, function(uploadIndex, uploadValue) { 102 var uploadID = $(uploadValue).attr('id'); 103 if(uploadID !== undefined) { 104 var $uploadField = $('#'+uploadID.replace("input_","field_")); 105 if($uploadField.length) { 106 var $uploadLabel = $('label', $uploadField); 107 $uploadLabel.css({ 108 'position' : 'relative', 109 'margin-bottom' : '15px', 110 }) 111 } 112 } 113 }) 114 // CAPTCHA Fields 115 var captchas = $('.ginput_recaptcha', $form); 116 $.each(captchas, function(captchaIndex, captchaValue) { 117 var captchaID = $(captchaValue).attr('id'); 118 if(captchaID !== undefined) { 119 var $captchaField = $('#'+captchaID.replace("input_","field_")); 120 if($captchaField.length) { 121 var $captchaLabel = $('label', $captchaField); 122 $captchaLabel.css({ 123 'display' : 'none', 124 }) 125 } 126 } 127 }) 128 }) 129 } 130 131 132})(jQuery); 133
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.