1(function($) { 2 $.fn.annalka = function(targetString, options) { 3 var settings = $.extend({}, $.fn.annalka.defaults, options); 4 var self = this; 5 6 var text = $(self).text(); 7 var step = 0; 8 var solved = 0; 9 10 var interval = setInterval(function () { 11 if (step > settings.steps) { 12 step = 0; 13 if (targetString.length < text.length) { 14 text = text.substring(0, text.length - 1); 15 } else if (targetString.length > text.length) { 16 text += randomChar(settings.chars); 17 } else { 18 text = stringReplaceAt(text, solved, targetString[solved]); 19 solved++; 20 } 21 } 22 step += 1; 23 24 if (text === targetString) { 25 clearInterval(interval); 26 settings.callback(); 27 } else { 28 text = stringReplaceAt(text, Math.floor(Math.random() * (text.length - solved)) + solved, randomChar(settings.chars)); 29 } 30 31 $(self).text(text); 32 33 }, settings.tick); 34 35 return this; 36 }; 37 38 $.fn.annalka.defaults = { 39 tick: 15, 40 steps: 4, 41 chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 42 callback: function() {} 43 }; 44 45 function stringReplaceAt(str, index, character) { 46 return str.substring(0, index) + character + str.substring(index+character.length); 47 } 48 49 function randomChar(possible) { 50 return possible[Math.floor(Math.random() * possible.length)]; 51 } 52})(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.