Created
November 16, 2010 22:55
-
-
Save capndesign/702689 to your computer and use it in GitHub Desktop.
My staging version of the Typekit Colophon bookmarklet
This file contains 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
javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/702689/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')})(); |
This file contains 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
(function() { | |
var a = document.getElementsByTagName('script'), | |
i, l, result, | |
rurl = /^http(s?):\/\/use\.typekit\.com\/([0-9A-Za-z]+)\.js/; | |
for (i = 0, l = a.length - 1; i < l; i++) { | |
if (result = rurl.exec(a[i].getAttribute('src'))) { | |
window.location.assign('http://typekit.com/colophons/' + result[1]); | |
break; | |
} | |
} | |
if (!result) { | |
alert('This site doesn\'t use Typekit!'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment