diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:25:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-14 14:25:28 -0700 |
commit | 3a66e1bf9c45ac16169c3b6d4a096d5af3ba6929 (patch) | |
tree | b18bfe33c2caa9b9305214fb50e70b0117aa664e | |
parent | Merge branch 'tr/diff-submodule-no-reuse-worktree' (diff) | |
parent | gitweb: Avoid overflowing page body frame with large images (diff) | |
download | tgif-3a66e1bf9c45ac16169c3b6d4a096d5af3ba6929.tar.xz |
Merge branch 'ak/gitweb-fit-image'
Instead of allowing an <img> to be shown in whatever size, force
scaling it to fit on the page with max-height/max-width css style
attributes.
* ak/gitweb-fit-image:
gitweb: Avoid overflowing page body frame with large images
-rwxr-xr-x | gitweb/gitweb.perl | 2 | ||||
-rw-r--r-- | gitweb/static/gitweb.css | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 3bc0f0b5ca..79057b7d0e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -7094,7 +7094,7 @@ sub git_blob { git_print_page_path($file_name, "blob", $hash_base); print "<div class=\"page_body\">\n"; if ($mimetype =~ m!^image/!) { - print qq!<img type="!.esc_attr($mimetype).qq!"!; + print qq!<img class="blob" type="!.esc_attr($mimetype).qq!"!; if ($file_name) { print qq! alt="!.esc_attr($file_name).qq!" title="!.esc_attr($file_name).qq!"!; } diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 3b4d833823..3212601032 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -32,6 +32,11 @@ img.avatar { vertical-align: middle; } +img.blob { + max-height: 100%; + max-width: 100%; +} + a.list img.avatar { border-style: none; } |