Last active
January 4, 2020 08:32
-
-
Save ci7lus/95d2574e41d5852164196691ca2dfab5 to your computer and use it in GitHub Desktop.
Azure DevOps Commit Log Emoji Replacer
This file contains 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 Azure DevOps Commit Log Emoji Replacer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Azure DevOps コミットログ絵文字置換スクリプト | |
// @author kokoro | |
// @match https://dev.azure.com/*/_git/*/commits | |
// @grant none | |
// @require https://cdn.jsdelivr.net/npm/emoji-js@3.4.1/lib/emoji.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const emojiRegex = new RegExp(/\:([A-Za-z0-9_-]+)\:/); | |
const emoji = new EmojiConvertor(); | |
setTimeout(() => { | |
Array.from(document.querySelectorAll("div.repos-commits-table-content > div > div > div")).map(message => { | |
const text = message.textContent; | |
const match = emojiRegex.exec(text); | |
if (match) { | |
const converted = emoji.replace_colons(match[0]); | |
message.textContent = text.replace(match[0], converted); | |
} | |
}) | |
}, 100); | |
// Your code here... | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment