Last active
March 8, 2017 22:46
-
-
Save anakadote/d2e6cba41305fa98d25b3a057ecb1b59 to your computer and use it in GitHub Desktop.
A TinyMCE 4.* plugin to add support for Fonts.com fonts - place in a new folder at tinymce/plugins/fontsdotcom/ and replace src URL. Don't forget to add "fontsdotcom" to your TinyMCE "plugins" config array.
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
tinymce.PluginManager.add('fontsdotcom', function(editor) { | |
editor.on('init', function() { | |
// Get the DOM document object for the IFRAME | |
var doc = this.getDoc(); | |
// Create a script element and insert the Fonts.com URL into it | |
var script = doc.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "//fast.fonts.net/jsapi/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.js"; | |
// Add the script to the header | |
doc.getElementsByTagName('head')[0].appendChild(script); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment