Last active
June 4, 2020 08:05
Automatically changes your Stack Exchange chat messages to Sᴍᴀʟʟᴄᴀᴘs
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
// ==UserScript== | |
// @name Smallcaps.SE | |
// @author Cameron Bernhardt (AstroCB) | |
// @description Automatically changes your Stack Exchange chat messages to Sᴍᴀʟʟᴄᴀᴘs | |
// @version 1.1 | |
// @namespace http://github.com/AstroCB | |
// @include *://chat.meta.stackexchange.com/rooms/* | |
// @include *://chat.stackexchange.com/rooms/* | |
// @include *://chat.stackoverflow.com/rooms/* | |
// ==/UserScript== | |
var smallCaps = { | |
"a": "ᴀ", | |
"b": "ʙ", | |
"c": "ᴄ", | |
"d": "ᴅ", | |
"e": "ᴇ", | |
"f": "ғ", | |
"g": "ɢ", | |
"h": "ʜ", | |
"i": "ɪ", | |
"j": "ᴊ", | |
"k": "ᴋ", | |
"l": "ʟ", | |
"m": "ᴍ", | |
"n": "ɴ", | |
"o": "ᴏ", | |
"p": "ᴘ", | |
"q": "ǫ", | |
"r": "ʀ", | |
"s": "s", | |
"t": "ᴛ", | |
"u": "ᴜ", | |
"v": "ᴠ", | |
"w": "ᴡ", | |
"x": "x", | |
"y": "ʏ", | |
"z": "ᴢ" | |
} | |
var field = document.getElementById("input"); | |
field.addEventListener("keyup", function() { | |
var text = field.value; | |
text = text.replace(/([a-z])/g, function(match) { | |
return smallCaps[match]; | |
}); | |
field.value = text; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment