User:Eliyak/common.js

jQuery( document ).ready( function( $ ) {       $( '.randomlist li' )                .css( 'display', 'none' );        $( '.randomlist' )                .each(function( index, element ){ var size = $( element ).find( 'li' ).length; var count = $( element ).children( '#length' ).html; if (count > size) { count = size; }                       var a = []; var idx; var i;                       for (i = 0; i < size; i++) { a[i] = i;                       } for (i = 0; i < count; i++) { idx = Math.floor( Math.random * (size - i) ); $( element ).find( 'li' ).eq( a.splice(idx, 1) ).css( 'display', 'list-item' ); }               } ); } );

//jQuery.getScript('//en.wikisource.org/w/index.php?title=User:Eliyak/PageNumbers.js&action=raw&ctype=text/javascript');