More actions
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
className: 'april-fools', | className: 'april-fools', | ||
frequency: 0.1, | frequency: 0.1, | ||
expiryThresholdMs: | expiryThresholdMs: 8000, | ||
changeInterval: 4000, | |||
addStyleIntvl: null, | addStyleIntvl: null, | ||
clearStyleIntvl: null, | clearStyleIntvl: null, | ||
maxFlicks: 18, | maxFlicks: 18, | ||
minFlicks: 6, | minFlicks: 6, | ||
flickerTiming: 1000, | |||
}; | }; | ||
| Line 21: | Line 23: | ||
function startUpAprilFools(){ | function startUpAprilFools(){ | ||
opts.addStyleIntvl = setInterval(function() {addStyleToRandomWordsInJQueryObject($(opts.pageSelector + ' .mw-parser-output'), opts)}, | opts.addStyleIntvl = setInterval(function() {addStyleToRandomWordsInJQueryObject($(opts.pageSelector + ' .mw-parser-output'), opts)}, opts.changeInterval); | ||
addStyleToRandomWordsInJQueryObject($(opts.pageSelector + " .mw-parser-output"), opts); | addStyleToRandomWordsInJQueryObject($(opts.pageSelector + " .mw-parser-output"), opts); | ||
opts.clearStyleIntvl = setInterval(function() {removeExpiredStyles(opts)}, | opts.clearStyleIntvl = setInterval(function() {removeExpiredStyles(opts)}, opts.changeInterval); | ||
opts.AprilFoolEnable = true; | opts.AprilFoolEnable = true; | ||
} | } | ||
| Line 98: | Line 100: | ||
{ | { | ||
spans.toggleClass('april-fools'); | spans.toggleClass('april-fools'); | ||
sleep = Math.round(Math.random() * | sleep = Math.round(Math.random() * opts.flickerTiming) | ||
//await sleep(Math.round(Math.random() * 100)); | //await sleep(Math.round(Math.random() * 100)); | ||
setTimeout(function() {spans.toggleClass('april-fools');}, sleep ) | setTimeout(function() {spans.toggleClass('april-fools');}, sleep ) | ||
| Line 112: | Line 114: | ||
for(var iter = 0; iter < amount; iter++) | for(var iter = 0; iter < amount; iter++) | ||
{ | { | ||
sleep = Math.round(Math.random() * | sleep = Math.round(Math.random() * opts.flickerTiming); | ||
setTimeout(function() {trigs.toggle(); origs.toggle();}, sleep ) | setTimeout(function() {trigs.toggle(); origs.toggle();}, sleep ) | ||
} | } | ||