Browse Source

add spaced text

master
mark 2 years ago
parent
commit
e1b80fd2d5
2 changed files with 5 additions and 1 deletions
  1. +1
    -0
      index.html
  2. +4
    -1
      script.js

+ 1
- 0
index.html View File

@@ -27,6 +27,7 @@
<option value="sm64">Super Mario 64 (sm64)</option>
<option value="emoji">Emoji (regonal_indicator)</option>
<option value="clapping">Clapping Text 👏</option>
<option value="spaced">S P A C E D T E X T</option>
</select>
<textarea placeholder="Input Text" id="inputBox"></textarea>
<textarea id="outputBox" disabled></textarea>


+ 4
- 1
script.js View File

@@ -49,6 +49,10 @@ var replaceMapping = {
replace: '👏',
postReplaceMatch: [ /$/ ],
postReplace: [ '👏' ]
},
spaced: {
regexp: /./g,
replace: '$& '
}
}

@@ -57,7 +61,6 @@ function updateOutput() {
let selectedEmote = $('#emoteType').val();
let mapping = replaceMapping[selectedEmote];
let regexp = mapping.regexp;
let replaceStr = mapping.replace;
let outString = inString.replace(regexp, replaceStr).toLowerCase();


Loading…
Cancel
Save