Skip to content

Instantly share code, notes, and snippets.

@jnowland
Created April 10, 2014 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnowland/10348686 to your computer and use it in GitHub Desktop.
Save jnowland/10348686 to your computer and use it in GitHub Desktop.
Enables Typekit to be embed inside of CK Editor Field.
var typkitID = 'XXXXXX';
CKEDITOR.on(
'instanceReady',
function(ev) {
var $script = document.createElement('script'),
$editor_instance = CKEDITOR.instances[ev.editor.name];
$script.src = '//use.typekit.com/'+typkitID+'.js';
$script.onload = function() {
try{$editor_instance.window.$.Typekit.load();}catch(e){}
};
$editor_instance.document.getHead().$.appendChild($script);
}
);
@joelpittet
Copy link

Remember to flush your browser cache after putting this in;) Thanks did the trick even with 4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment