From 12d6c8f9c5b3edfe3c86a0a3b3ca1adcec706668 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 7 Sep 2010 12:50:55 +0200 Subject: [PATCH 1/1] fixes 807: convert to lowercase scriptlet --- redakcja/static/js/button_scripts.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) 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); -- 2.20.1