Skip to content

Instantly share code, notes, and snippets.

View anakadote's full-sized avatar

anakadote

View GitHub Profile
@anakadote
anakadote / plugin.min.js
Last active March 8, 2017 22:46
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.
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";
@anakadote
anakadote / plugin.min.js
Last active September 7, 2017 08:35
A TinyMCE 4.* plugin to add support for Typekit fonts - place in a new folder at tinymce/plugins/typekit/ and replace kitId value. Don't forget to add "typekit" to your TinyMCE "plugins" config array.
tinymce.PluginManager.add('typekit', function(editor) {
editor.on('init', function() {
// Get the DOM document object for the IFRAME
var doc = this.getDoc();
// Create the script we will add to the header asynchronously
var jscript = "(function(d) {\n\
var config = {\n\
kitId: 'xxxxxxx',\n\