From: Radek Czajka Date: Tue, 7 Sep 2010 10:50:55 +0000 (+0200) Subject: fixes 807: convert to lowercase scriptlet X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/12d6c8f9c5b3edfe3c86a0a3b3ca1adcec706668 fixes 807: convert to lowercase scriptlet --- diff --git a/redakcja/static/js/button_scripts.js b/redakcja/static/js/button_scripts.js index a7c54603..de3b5ee9 100644 --- a/redakcja/static/js/button_scripts.js +++ b/redakcja/static/js/button_scripts.js @@ -186,24 +186,7 @@ function ScriptletCenter() this.scriptlets['lowercase'] = function(context, params, text, move_forward, done) { if(!text) done(text, move_forward); - - var lcase = text.toLowerCase(); - var ucase = text.toUpperCase(); - - if(lcase == text) repl = ucase; /* was lowercase */ - else if(ucase != text) repl = lcase; /* neither lower- or upper-case */ - else { /* upper case -> camel-case */ - var words = $.map(lcase.split(/\s/), function(word) { - if(word.length > 0) { - return word[0].toUpperCase() + word.slice(1); - } else { - return ''; - } - }); - text = words.join(' '); - } - - done(text, move_forward); + done(text.toLowerCase(), move_forward); }.bind(this);