Last active
November 22, 2017 09:11
-
-
Save krmax44/8e7a89622b0fa9372fb305c7fab516cf to your computer and use it in GitHub Desktop.
Mockify everything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Mockify text on the fly with this small script | |
How to use: Create a new bookmark in your browser, name it Mockify or something and as URL paste the following: | |
Click on the bookmark, enter your text and it will copy your mockified text to your clipboard. | |
*/ | |
javascript:(function(){ var input = prompt("Mockify:", ""); var out = ""; for (i = 0; i < input.length; i++) { if (i % 2) { out += input[i].toUpperCase(); } else { out += input[i].toLowerCase(); } } var tbx = document.createElement('input'); document.body.appendChild(tbx); tbx.value = out; tbx.focus(); tbx.setSelectionRange(0, tbx.value.length); document.execCommand("copy"); document.body.removeChild(tbx); })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
the source, if you need it for some reason | |
*/ | |
function(){ | |
// mock the text | |
var input = prompt("Mockify:", ""); | |
var out = ""; | |
for (i = 0; i < input.length; i++) { | |
if (i % 2) { | |
out += input[i].toUpperCase(); | |
} | |
else { | |
out += input[i].toLowerCase(); | |
} | |
} | |
// copy to clipboard | |
var tbx = document.createElement('input'); | |
document.body.appendChild(tbx); | |
tbx.value = out; | |
tbx.focus(); | |
tbx.setSelectionRange(0, tbx.value.length); | |
document.execCommand("copy"); | |
document.body.removeChild(tbx); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment