1/*! 2 * Uni-Form v1.3 3 * http://sprawsm.com/uni-form/ 4 * 5 * by Dragan Babic [Superawesome Industries] 6 * Some rights reserved - http://creativecommons.org/licenses/by-sa/2.5/ 7 */ 8jQuery.fn.uniform = function(settings) { 9 settings = jQuery.extend({ 10 valid_class : 'valid', 11 invalid_class : 'invalid', 12 focused_class : 'focused', 13 holder_class : 'ctrlHolder', 14 field_selector : 'input, select, textarea' 15 }, settings); 16 17 return this.each(function() { 18 var form = jQuery(this); 19 20 // Focus specific control holder 21 var focusControlHolder = function(element) { 22 var parent = element.parent(); 23 24 while(typeof(parent) == 'object') { 25 if(parent) { 26 if(parent[0] && (parent[0].className.indexOf(settings.holder_class) >= 0)) { 27 parent.addClass(settings.focused_class); 28 return; 29 } // if 30 } // if 31 parent = jQuery(parent.parent()); 32 } // while 33 }; 34 35 // Select form fields and attach them higlighter functionality 36 form.find(settings.field_selector).focus(function() { 37 form.find('.' + settings.focused_class).removeClass(settings.focused_class); 38 focusControlHolder(jQuery(this)); 39 }).blur(function() { 40 form.find('.' + settings.focused_class).removeClass(settings.focused_class); 41 }); 42 }); 43}; 44 45// Auto set on page load... 46$(document).ready(function() { 47 jQuery('form.uniForm').uniform(); 48});
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.