In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1401 [In-Portal CMS] Front End feature request N/A 2012-09-16 06:55 2012-10-19 09:16
alex  
alex  
normal  
resolved 5.2.0  
fixed  
 
none 5.2.1-B1  
https://groups.google.com/d/topic/in-portal-dev/jBAfg7_i7p0/discussion
Adds support for TypeKit library in CKEditor
1
0001401: Using Typekit font library
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.
patch typekit_core_feat.patch (7,762) 2012-10-19 09:12
http://tracker.in-portal.org/file_download.php?file_id=1837&type=bug
patch typekit_themes_feat.patch (886) 2012-10-19 09:12
http://tracker.in-portal.org/file_download.php?file_id=1838&type=bug
Issue History
2012-10-19 09:16 alex Changeset attached 5.2.x r15593
2012-10-19 09:16 alex Note Added: 0005239
2012-10-19 09:16 alex Status reviewed and tested => resolved
2012-10-19 09:16 alex Fixed in Version => 5.2.1-B1
2012-10-19 09:16 alex Resolution open => fixed
2012-10-19 09:16 alex Assigned To !COMMUNITY => alex
2012-10-19 09:15 alex Changeset attached 1.2.x r15592
2012-10-19 09:14 alex Note Added: 0005238
2012-10-19 09:14 alex Status needs testing => reviewed and tested
2012-10-19 09:14 alex Assigned To => !COMMUNITY
2012-10-19 09:14 alex Developer => alex
2012-10-19 09:14 alex Status active => needs testing
2012-10-19 09:12 alex File Added: typekit_themes_feat.patch
2012-10-19 09:12 alex File Added: typekit_core_feat.patch
2012-09-16 06:55 alex New Issue
2012-09-16 06:55 alex Reference => https://groups.google.com/d/topic/in-portal-dev/jBAfg7_i7p0/discussion
2012-09-16 06:55 alex Change Log Message => Adds support for TypeKit library in CKEditor
2012-09-16 06:55 alex Estimate Points => 1

Notes
(0005238)
alex   
2012-10-19 09:14   
Will test all together later.
(0005239)
alex   
2012-10-19 09:16   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001401: Using Typekit font library