MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
getRandomNumber: write the output directly in the page, allowing to use the value as parameter in the built in parser functions of the wiki...
(Added a simple function to return a random number. It'll be used in the new VideoGallery template...)
(getRandomNumber: write the output directly in the page, allowing to use the value as parameter in the built in parser functions of the wiki...)
Line 220: Line 220:


// Return a random number between the specified range
// Return a random number between the specified range
function getRandomNumber(range) {
function getRandomNumber(range,out) {
     randomNumber = Math.floor((Math.random()*range)+1);
     randomNumber = Math.floor((Math.random()*range)+1);
     return randomNumber;
     document.getElementById(out).innerHTML=randomNumber;
}
}


$( createNavigationBarToggleButton );
$( createNavigationBarToggleButton );

Navigation menu