1angular.module('BoligSilkeborg').directive('maxLength', function () { 2 "use strict"; 3 return { 4 restrict: 'A', 5 link: function (scope, element, attrs) { 6 $(element).on('keydown', function (event) { 7 var key = event.which || event.keyCode; 8 9 if (attrs.maxLength) { 10 var maxLength = parseInt(attrs.maxLength); 11 if (element.context.value.length < maxLength) { 12 return true; 13 } 14 if (!event.shiftKey && !event.altKey && !event.ctrlKey && 15 //backspace Enter 16 key === 8 || key === 13 || 17 // Home and End 18 key === 35 || key === 36 || 19 // left and right arrows 20 key === 37 || key === 39 || 21 // Del and Tab 22 key === 46 || key === 9) { 23 return true; 24 } 25 26 } 27 28 return false; 29 }); 30 } 31 } 32});
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.