1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
hipchat-emoticons-for-all/src/image-decoder.js

19 lines
556 B
JavaScript

function inject_image(ident, classes) {
console.log("Injecting Images in to " + ident);
classes = classes || "";
$(ident).each(function() {
decoder = image_decoder.images;
for (var i = 0; i < decoder.length; i++) {
key = Object.keys(decoder[i]);
image = decoder[i][key];
key = "(" + key + ")";
$(this).html($(this).html().replace(key,
"<img class='" + classes + "' style='height: 30px; width: 30px;' src='" + image + "'/>"
));
}
});
}
console.log("Injection");
var image_decoder = %image_decoder%