I'm trying to load TypeKit fonts into an instance of the CKEditor via jQuery. Here's my code:
$('.ck-blog textarea').ckeditor(function () {
CKEDITOR.scriptLoader.load(
"http://use.typekit.com/zku8fnp.js",
function (success) {
Typekit.load();
alert(success); },
null,
true);
},
{
resize_enabled: false,
skin: 'kama',
height: '500px',
toolbarCanCollapse: false,
toolbar_Full: toolbar,
forcePasteAsPlainText: true,
autoGrow_onStartup: true,
templates_replaceContent: false,
extraPlugins: 'autogrow,wordcount',
removePlugins: 'resize',
contentsCss: '/areas/admin/content/css/ckeditor-blog.css',
templates_files: ['/areas/admin/scripts/ckeditor-templates.js'],
autoParagraph: false
});
I'm getting the success alert after TypeKit is supposed to load but I am not see the fonts load. Any idea what I may be doing wrong?
Here what I've managed to assemble after 3 hours of digging over Internet:
Trick here is to use CKEditor's "window" object, that comes from iframe.