1(function($){ 2 $.fn.extend({ 3 limit: function(limit,element) { 4 5 var interval, f; 6 var self = $(this); 7 8 $(this).focus(function(){ 9 interval = window.setInterval(substring,100); 10 }); 11 12 $(this).blur(function(){ 13 clearInterval(interval); 14 substring(); 15 }); 16 17 substringFunction = "function substring(){ var val = $(self).val();var length = val.length;if(length > limit){$(self).val($(self).val().substring(0,limit));}"; 18 if(typeof element != 'undefined') 19 substringFunction += "if($(element, self.parent()).html() != limit-length){$(element, self.parent()).html((limit-length<=0)?'0':limit-length);}" 20 21 substringFunction += "}"; 22 23 eval(substringFunction); 24 25 26 27 substring(); 28 29 } 30 }); 31})(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.