Last active
August 29, 2015 14:28
-
-
Save JakeSidSmith/9237059b77d97ce8366e to your computer and use it in GitHub Desktop.
HipChat Emoticon Bookmarklet (Work in progress)
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
/* global $ */ | |
/* | |
* JSFiddle: http://jsfiddle.net/dswf3mh6/ | |
*/ | |
(function () { | |
'use strict'; | |
$.get('https://www.hipchat.com/emoticons', function (response) { | |
var emoticons = $(response) | |
.find('.emoticon-block') | |
.attr('style', 'position:relative;float:left;width:20%;height:50px;text-align:center;overflow:hidden;font-size:12px;margin-bottom:20px;'); | |
emoticons.find('div') | |
.attr('style', 'position:absolute;width:100%;bottom:0;'); | |
var modalContent = $('<div>') | |
.attr('style', 'position:relative;width:100%;height:100%;overflow:auto;') | |
.append(emoticons); | |
var modal = $('<div>') | |
.attr('style', 'position:relative;margin:20px auto;width:540px;height:540px;background-color:white;border-radius:2px;overflow:auto;padding:10px 0;') | |
.append(modalContent); | |
$('<div>') | |
.attr('style', 'position:fixed;width:100%;height:100%;z-index:9999;background-color:rgba(0,0,0,0.8);overflow:auto;font-family:arial,helvetica,sans-serif;color:#777;') | |
.append(modal) | |
.appendTo($('body')); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment