Anonymous | Login | Signup for a new account | 2024-03-29 03:37 CDT |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Dependency Graph | [ View Issue ] [ Relation Graph ] [ Vertical ] | |||
|
||||
|
Viewing Issue Simple Details | |||||
ID | Category | Type | Reproducibility | Date Submitted | Last Update |
0001401 | [In-Portal CMS] Front End | feature request | N/A | 2012-09-16 06:55 | 2012-10-19 09:16 |
Reporter | alex | View Status | public | ||
Assigned To | alex | ||||
Priority | normal | Resolution | fixed | ||
Status | resolved | ||||
Summary | 0001401: Using Typekit font library | ||||
Description |
There is an Adobe website called Typekit - https://typekit.com/, which allows you to use custom nice looking fonts on your website. To use it you need first to generate a typekit and then it it's ID in following JavaScript code that should be present on all pages: <script type="text/javascript" src="//use.typekit.com/TYPEKIT_ID_HERE.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> However, when you try to edit content blocks of website, these nice fonts won't be working inside CKEditor. To make them work we need some extra JavaScript code to be added into Admin Console: CKEDITOR.on( 'instanceReady', function(ev) { var $script = document.createElement('script'), $editor_instance = CKEDITOR.instances[ev.editor.name]; $script.src = '//use.typekit.com/ TYPEKIT_ID_HERE.js'; $script.onload = function() { try{$editor_instance.window.$.Typekit.load();}catch(e){} }; $editor_instance.document.getHead().$.appendChild($script); } ); As you can see both code fragments share TYPEKIT_ID_HERE, which we can move out into a new system setting. When preset we can make CKEditor use it automatically. |
||||
Additional Information |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic In-Portal Open Source CMS |