1
Fork 0
This commit is contained in:
Jake Howard 2015-08-24 21:42:23 +01:00
parent bc468d61a9
commit 53a0f8d35e
5 changed files with 15 additions and 13 deletions

View file

@ -4,7 +4,9 @@ cp -r src/lib/* build/lib/
cp -r src/decoder.json build/
rm -rf build/injections/*
mkdir -p build/src/injections
uglifyjs build/image-decoder.js --compress --screw-ie8 --define --keep-fnames -o build/image-decoder.js
for f in src/injections/*; do uglifyjs "build/image-decoder.js" "src/lib/jquery.js" $f --compress --screw-ie8 --define --stats --keep-fnames -o build/$f; done
cp -rp build/src/* build/
rm -rf build/src

View file

@ -6,7 +6,6 @@ for (var i = 0; i < sites.length; i++) {
site = Object.keys(sites[i]);
script = sites[i][site];
site = '*.' + site;
console.log("SS: " + site + " " + script);
pageMod.PageMod({
include: site,
contentScriptFile: './injections/' + script,

View file

@ -4,7 +4,7 @@
"description": "Use hipchat emoticons on other sites",
"main": "src/index.js",
"scripts": {
"create-dirs": "mkdir -p firefox/data chrome/data build/injections",
"create-dirs": "mkdir -p firefox/data chrome/data build/injections build/lib",
"build-extensions": "npm run build-firefox && npm run build-chrome",
"build-firefox": "cd firefox/ && jpm xpi && cd -",
"build-chrome": "crx pack chrome -o chrome/hipchat-emoticons-for-all.crx -p chrome/key.pem",

View file

@ -4,12 +4,13 @@ function inject_image(ident, classes) {
for (var i = 0; i < image_decoder.length; i++) {
key = Object.keys(image_decoder[i]);
image = image_decoder[key];
$(this).html($(this).html().replace(
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%