Last active
December 17, 2021 04:50
-
-
Save dmitryuk/05768cc3386dffecc5d22d9f827f24d8 to your computer and use it in GitHub Desktop.
Tamper monkey script to add hotkey to add Monospace with Ctrl+m
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 New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://jira.* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let waitForTinyMce = function () { | |
if (window.tinyMCE) { | |
window.tinyMCE.on("AddEditor", function (event) { | |
event.editor.on('keyUp', function (keyEvent) { | |
if (keyEvent.ctrlKey && keyEvent.key==='m') { | |
document.querySelector('[data-operation="monospace-inline"]').click(); | |
} | |
}) | |
}); | |
} else { | |
setTimeout(waitForTinyMce, 1000) | |
} | |
} | |
waitForTinyMce(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment