Skip to content

Instantly share code, notes, and snippets.

@AstroCB
Last active June 4, 2020 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AstroCB/cd49769aafba9ab7c91d to your computer and use it in GitHub Desktop.
Save AstroCB/cd49769aafba9ab7c91d to your computer and use it in GitHub Desktop.
Automatically changes your Stack Exchange chat messages to Sᴍᴀʟʟᴄᴀᴘs
// ==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