1 2 function RndStr() { 3 this.str = ''; 4 this.pattern = /^[a-zA-Z0-9]+$/; 5 6 this.setStr = function(n) { 7 if (!/^[0-9]+$/.test(n)) n = 0x10; 8 this.str = ''; 9 for (var i = 0; i < n; i++) { 10 this.rndchar(); 11 } 12 } 13 14 this.setType = function(s) { 15 switch (s) { 16 case '09': this.pattern = /^[0-9]+$/; break; 17 case 'az': this.pattern = /^[a-z]+$/; break; 18 case 'AZ': this.pattern = /^[A-Z]+$/; break; 19 case 'azAZ': this.pattern = /^[a-zA-Z]+$/; break; 20 case 'az09': this.pattern = /^[a-z0-9]+$/; break; 21 case 'AZ09': this.pattern = /^[A-Z0-9]+$/; break; 22 default: this.pattern = /^[a-zA-Z0-9]+$/; 23 } 24 } 25 26 this.getStr = function() { 27 return this.str; 28 } 29 30 this.rndchar = function() { 31 var rnd = Math.round(Math.random() * 1000); 32 33 if (!this.pattern.test(String.fromCharCode(rnd))) { 34 this.rndchar(); 35 } else { 36 this.str += String.fromCharCode(rnd); 37 } 38 } 39 } 40 41 42 function controlImage(imgid, rzwidth) { 43 var jObj = $('img#' + imgid); 44 var w = jObj.width(); 45 var maxWidth = rzwidth < 1 ? $('img#' + imgid).parentsUntil('div').parent().width() : rzwidth; 46 jObj.css({ visibility: 'hidden'}); 47 48 if (w <= 0) { 49 window.setTimeout("controlImage('" + imgid + "')", 10); 50 } else { 51 if (w > maxWidth) { 52 jObj.width(maxWidth); 53 } 54 jObj.css({ visibility: 'visible'}); 55 } 56 } 57 58 59 function fitImageSize(obj, maxWidth, maxHeight) { 60 var image = new Image(); 61 image.onload = function(){ 62 var width = image.width; 63 var height = image.height; 64 var scalex = maxWidth / width; 65 var scaley = maxHeight / height; if (maxHeight == 0) scaley = maxWidth * height / width; 66 var scale = (scalex < scaley) ? scalex : scaley; 67 if (scale > 1) scale = 1; 68 69 obj.width = scale * width; 70 obj.height = scale * height; 71 obj.style.display = "inline"; 72 } 73 image.src = obj.src; 74 }
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.