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.
2015-08-24 17:54:23 +01:00
|
|
|
function inject_image(ident, classes) {
|
2015-08-25 10:45:40 +01:00
|
|
|
console.log("Injecting Images in to " + ident);
|
2015-08-24 17:54:23 +01:00
|
|
|
classes = classes || "";
|
|
|
|
$(ident).each(function() {
|
2015-08-25 10:45:40 +01:00
|
|
|
decoder = image_decoder.images;
|
|
|
|
for (var i = 0; i < decoder.length; i++) {
|
|
|
|
key = Object.keys(decoder[i]);
|
|
|
|
image = decoder[i][key];
|
|
|
|
key = "(" + key + ")";
|
2015-08-24 21:42:23 +01:00
|
|
|
$(this).html($(this).html().replace(key,
|
2015-08-24 17:54:23 +01:00
|
|
|
"<img class='" + classes + "' style='height: 30px; width: 30px;' src='" + image + "'/>"
|
|
|
|
));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-08-24 21:42:23 +01:00
|
|
|
console.log("Injection");
|
|
|
|
|
2015-08-24 17:54:23 +01:00
|
|
|
var image_decoder = %image_decoder%
|