This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* mainpageQuoteOnce.js */ | |
| (function () { | |
| if (mw.config.get('wgIsMainPage') !== true) return; | |
| var $ = jQuery; | |
| function pickOne(arr) { | |
| return arr[Math.floor(Math.random() * arr.length)]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* mainpageQuoteOnce.js — shows ONE random quote from a bulleted list page */ | |
| (function () { | |
| // Optional: only run on the main page. Delete the next 2 lines to allow everywhere. | |
| if (mw.config.get('wgIsMainPage') !== true) return; | |
| var $ = window.jQuery; | |
| function pickOne(arr) { | |
| if (!arr || !arr.length) return null; | |
| return arr[Math.floor(Math.random() * arr.length)]; |