Hi guys !
I use this code to add my font to CKEditor from Typekit :
CKEDITOR.on('instanceReady', function(ev) { var $script = document.createElement('script'), $editor_instance = CKEDITOR.instances[ev.editor.name]; $script.src = '//use.typekit.com/xxxxxx.js'; $script.onload = function() { try{$editor_instance.window.$.Typekit.load();}catch(e){} }; $editor_instance.document.getHead().$.appendChild($script); } );
My issue is that if I click on the source button and then re-click on it to come to the editor the font is not reload... I think I should use an other event thant instanceReady but which one ?
Thanks a lot !
No solutions ?
No solutions ?
Need to pay ?
Sorry to ask this but I asked 2 question in december and no anwsers... Do we have to buy a licence to have forum support ?
Thanks
Does the script get stripped
Does the script get stripped or is it simply not working? If it gets stripped it might be ACF filtering the code. You can completely turn off ACF to see if that's the problem by setting CKEDITOR.config.allowedContent to true (check the documentation).
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Thanks for your reply.
Thanks for your reply.
No it works perfectly, the ACF does not care of it because it's lauch by the JQuery script that launch CKEditor. So at first launch of CKEditor it works the script is added in the header of the iframe, but when clicking on the source button, the iframe became a div to show the code and when clicking again on the source button to go back to the wysiwyg the script is not added. This is maybe because I'm using instanceReady event to add the script and when doing this clicking on "source" button it's not creating the instance the same way so the instanceReady event is not trigger.
Ok, every time you switch
Ok, every time you switch between the WYSIWYG area and source the information is scrapped, so you have to reapply it each time. Talked to some of the guys and it appears you have to create a CKEditor instance and use contentDom.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
I've read the doc but not
I've read the doc but not sure if it's what I need because it look like this event is fired for every changed in the dom of the editor so it will relaunch too often ?
Just a simple question about that, there is no "event" in the editor about click or switching from source to wysiwyg ?
Thanks !
I tried it and it works but I
I tried it and it works but I don't understand how contentDom works ? I mean is it launch only when source is diplayed or other buttons do the same ?
The advice above about
The advice above about contentDom was helpful, but just for the benefit of anyone else who runs into this issue, it took me a little experimenting to figure out how to make this work...
(I actually did mine in coffeescript and translated this by hand, so I won't absolutely guarantee it's perfect :)).
The key things I ran in to that took a while to figure out were -
This works with most browsers
This works with most browsers but it appears that Safari 8 in OSX 10.10 Yosemite throws a 403 (Forbidden) error when using this technique. Any thoughts??