From 690ad40828cb6ae85ad064d6ea863dff6036cc74 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Mon, 9 Jun 2014 15:30:20 +0100 Subject: [PATCH] Censorship. --- web/changelog.txt | 2 +- web/incl/footer.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/web/changelog.txt b/web/changelog.txt index b03656655..fb2b1b792 100644 --- a/web/changelog.txt +++ b/web/changelog.txt @@ -3,7 +3,7 @@ r1.0 48 **sigh* r1.0 47 *Added a config option to disable the references in the flowers' tooltips. Though, be warned, I hate you if you do <3 -*Added a tease for (redacted). +*Added a tease for ----------. *Added two new generating flowers, the Entropinnyum and the Kekimurus. Help, I'm running out of names :c *Buffed the output of the Rosa Arcana. *Fixed Composite lenses not being localized. diff --git a/web/incl/footer.js b/web/incl/footer.js index 7a0b5ba80..8471358c1 100644 --- a/web/incl/footer.js +++ b/web/incl/footer.js @@ -1,6 +1,9 @@ +const censorChars = 'abcdefghijklmnopkrstuvwxyz'; var animating = false; $(function() { + setInterval(changeCensor, 100); + var remove = $.cookie('show-footer'); if(remove === 'true') { $('#footer').css( { bottom: '-50px' } ); @@ -47,4 +50,17 @@ $(".hashlink").click(function() { if(hash == 'Back to top') $('html, body').animate({ scrollTop: 0 }, 500); else $('html, body').animate({ scrollTop: $("#" + hash + "-fake").offset().top - 100 }, 1000); -}); \ No newline at end of file +}); + +function changeCensor() { + $('.censored').each(function() { + $(this).text(randomStr($(this).text().length)); + }); +} + +function randomStr(length) { + var str = ''; + for(var i = 0; i < length; i++) + str += censorChars.charAt(Math.floor(Math.random() * censorChars.length)); + return str; +} \ No newline at end of file