PageSourceSearch

https://www.htr.ch/fileadmin/htr/_js/shuffle.js

js htr.ch collected 2026-10-02 08:18:45 UTC 605 bytes, 24 lines download raw bytes

1(function($){
2 
3    $.fn.shuffle = function() {
4 
5        var allElems = this.get(),
6            getRandom = function(max) {
7                return Math.floor(Math.random() * max);
8            },
9            shuffled = $.map(allElems, function(){
10                var random = getRandom(allElems.length),
11                    randEl = $(allElems[random]).clone(true)[0];
12                allElems.splice(random, 1);
13                return randEl;
14           });
15 
16        this.each(function(i){
17            $(this).replaceWith($(shuffled[i]));
18        });
19 
20        return $(shuffled);
21 
22    };
23 
24})(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.