Skip to content

Instantly share code, notes, and snippets.

@georgestephanis
Created July 21, 2012 00:58
Show Gist options
  • Select an option

  • Save georgestephanis/3154101 to your computer and use it in GitHub Desktop.

Select an option

Save georgestephanis/3154101 to your computer and use it in GitHub Desktop.
Snag the typekit js and pop it in the TinyMCE Editor
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