diff options
| author | tim b <timb@camcompu.home> | 2010-06-14 22:02:41 -0700 |
|---|---|---|
| committer | tim b <timb@camcompu.home> | 2010-06-14 22:02:41 -0700 |
| commit | 02b4185b2e77dc5cbb367514bf58c8bd72d64ee6 (patch) | |
| tree | aba8362244e62956e714c14da0831853dc321740 /static/js/pichat.js | |
| parent | 91ec3a6721b0b05830a043eb5ee1e47fc53ff001 (diff) | |
annoying caps
Diffstat (limited to 'static/js/pichat.js')
| -rw-r--r-- | static/js/pichat.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index c19ff6b..8245582 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -68,7 +68,25 @@ function getImagesAsArray(text) { function linkify(text) { LastMsgContainsImage = false - return text.replace(URLRegex, linkReplace); + text = annoyingCaps(text) + text = text.replace(URLRegex, linkReplace); + return text +} + +function annoyingCaps(text){ + var chunks = text.split(" ") + console.log(chunks) + for(var i=0; i<chunks.length; i++){ + var chunk = chunks[i] + if (!chunk.length || chunk.substr(0,4) == 'http') continue; + var letters=chunk.split("") + for(var j = 0; j<letters.length; j++){ + if (j % 2) letters[j] = letters[j].toUpperCase() + else letters[j] = letters[j].toLowerCase() + } + chunks[i] = letters.join("") + } + return chunks.join(" ") } // durty hack to use a global to check this... but otherwise i'd have to rewrite the String.replace function? :/ |
