1
Fork 0

Renamed image decoder, and modified identifier for github comment form

This commit is contained in:
Jake Howard 2015-08-25 14:48:58 +01:00
parent 157a2c92df
commit fcb056d385
6 changed files with 13 additions and 11 deletions

View file

@ -22,10 +22,10 @@ image_decoder = {"images":images}
image_decoder_json = json.dumps(image_decoder, indent=2, sort_keys=True) image_decoder_json = json.dumps(image_decoder, indent=2, sort_keys=True)
js_file = None js_file = None
with open('src/image-decoder.js', "r") as file: with open('src/injector.js', "r") as file:
js_file = file.read() js_file = file.read()
js_file = js_file.replace("%image_decoder%", image_decoder_json) js_file = js_file.replace("%image_decoder%", image_decoder_json)
with open('build/image-decoder.js', 'w') as file: with open('build/injector.js', 'w') as file:
file.write(js_file) file.write(js_file)

View file

@ -5,8 +5,8 @@ cp -r src/decoder.json build/
rm -rf build/injections/* rm -rf build/injections/*
mkdir -p build/src/injections mkdir -p build/src/injections
uglifyjs build/image-decoder.js --compress --screw-ie8 --define --keep-fnames -o build/image-decoder.js uglifyjs build/injector.js --compress --screw-ie8 --define --keep-fnames -o build/injector.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 for f in src/injections/*; do uglifyjs "build/injector.js" "src/lib/jquery.js" $f --compress --screw-ie8 --define --stats --keep-fnames -o build/$f; done
cp -rp build/src/* build/ cp -rp build/src/* build/
rm -rf build/src rm -rf build/src

View file

@ -30,7 +30,7 @@ for site in site_decoder:
site = list(site.items())[0] site = list(site.items())[0]
temp = {} temp = {}
temp['matches'] = ["*://" + site[0] + '/*'] temp['matches'] = ["*://" + site[0] + '/*']
temp['js'] = ['data/lib/jquery.js', 'data/image-decoder.js', 'data/injections/' + site[1]] temp['js'] = ['data/lib/jquery.js', 'data/injector.js', 'data/injections/' + site[1]]
content_scripts.append(temp) content_scripts.append(temp)

View file

@ -3,7 +3,7 @@
{ {
"js": [ "js": [
"data/lib/jquery.js", "data/lib/jquery.js",
"data/image-decoder.js", "data/injector.js",
"data/injections/facebook.js" "data/injections/facebook.js"
], ],
"matches": [ "matches": [
@ -13,7 +13,7 @@
{ {
"js": [ "js": [
"data/lib/jquery.js", "data/lib/jquery.js",
"data/image-decoder.js", "data/injector.js",
"data/injections/github.js" "data/injections/github.js"
], ],
"matches": [ "matches": [

View file

@ -10,9 +10,11 @@ $('.js-comment-container').on('load change', change_comments);
$('#readme').on('load change', change_readme); $('#readme').on('load change', change_readme);
$('.timeline-comment textarea[placeholder="Leave a comment"]').on('change input', function() { $('form .timeline-comment textarea[placeholder="Leave a comment"]').on('change input', function() {
markdown_injector('.timeline-comment textarea[placeholder="Leave a comment"]'); markdown_injector('form .timeline-comment textarea[placeholder="Leave a comment"]');
}); });
change_comments(); $(document).on('ready', function() {
change_readme(); change_comments();
change_readme();
});