Skip to content

Instantly share code, notes, and snippets.

@starzonmyarmz
Created September 21, 2012 16:47
Show Gist options
  • Save starzonmyarmz/3762577 to your computer and use it in GitHub Desktop.
Save starzonmyarmz/3762577 to your computer and use it in GitHub Desktop.
Add a link to open http://emoji-cheat-sheet.com/ in a modal window
$('a[href*="github-flavored-markdown"]').after(' | <a href="#" target="_blank" id="emoji-cheat-sheet">Emoji Cheat Sheet</a>');
$('#emoji-cheat-sheet').click(function() {
$('body').append('<div id="emoji-modal-wrapper" style="background:rgba(0,0,0,.8);height:100%;left:0;position:fixed;top:0;width:100%;z-index:10000;"><div id="emoji-modal" style="height:600px;left:50%;margin: -300px 0 0 -400px;position:fixed;top:50%;width:800px;"><iframe src="http://emoji-cheat-sheet.com" height="600" width="800"></iframe><a href="#" id="emoji-close" style="background:#fff;border:3px solid #000;border-radius:100%;display:block;font-size:18px;font-weight:bold;line-height:24px;position:absolute;right:-12px;text-align:center;top:-12px;width:24px;">&times;</a></div></div>');
return false;
});
$('#emoji-close, #emoji-modal-wrapper').live('click', function() {
$('#emoji-modal-wrapper').remove();
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment