Created
July 21, 2012 00:58
-
-
Save georgestephanis/3154101 to your computer and use it in GitHub Desktop.
Snag the typekit js and pop it in the TinyMCE Editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| links = document.head.getElementsByTagName('link'); | |
| tkCss = ''; | |
| for(l in links){ | |
| li = links[l]; | |
| if( li.rel == 'stylesheet' && li.href.match(/use.typekit.com/) ) | |
| tkCss = li.href; | |
| } | |
| if( tkCss.length ){ | |
| s=document.createElement('link'); | |
| s.setAttribute( 'rel', 'stylesheet' ); | |
| s.setAttribute( 'href', tkCss ); | |
| iframe = document.getElementById('content_ifr'); | |
| doc = iframe.document || iframe.contentDocument || iframe.contentWindow && iframe.contentWindow.document || null; | |
| doc.head.appendChild( s ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment