Last active
February 13, 2020 13:27
-
-
Save jayjanssen/6b83c2c06e89c679367d8224be23cb53 to your computer and use it in GitHub Desktop.
ServiceNow Modify TinyMCE Settings -- Client Script, onLoad, Tested on Madrid
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
function onLoad() { | |
tinymce.on('AddEditor', function(e) { | |
e.editor.settings.block_formats = 'Paragraph=p;Preformatted=pre;Quote=blockquote;Heading 1=h1;Heading 2=h2;Heading 3=h3;None=removeformat'; | |
e.editor.settings.forced_root_block = false; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This client script intercepts editors as they are added but prior to initialization so you can tweak settings. Other methods I've found either just don't work or have race conditions so they work inconsistently across browsers (i.e., addAfterPageLoadedEvent hook).