|
|
|
@ -1,23 +1,49 @@
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
document.addEventListener('DOMContentLoaded',function(){
|
|
|
|
|
var img = document.getElementsByName('issue_attachment_picture');
|
|
|
|
|
function getImgNaturalStyle(img,callback) {
|
|
|
|
|
var nWidth, nHeight
|
|
|
|
|
if (typeof img.naturalWidth == "undefined"|| img.naturalWidth == 0) { // 现代浏览器
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getImgNaturalStyle(img, callback) {
|
|
|
|
|
var nWidth, nHeight;
|
|
|
|
|
if (typeof img.naturalWidth == "undefined"|| img.naturalWidth == 0) {
|
|
|
|
|
var image = new Image();
|
|
|
|
|
image.src = img.src;
|
|
|
|
|
nWidth = image.width;
|
|
|
|
|
nHeight = image.height;
|
|
|
|
|
} else {
|
|
|
|
|
nWidth = img.naturalWidth;
|
|
|
|
|
nHeight = img.naturalHeight;
|
|
|
|
|
if (image.complete) {
|
|
|
|
|
callback(image);
|
|
|
|
|
} else {
|
|
|
|
|
image.onload = function () {
|
|
|
|
|
callback(image);
|
|
|
|
|
image.onload = null;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return [nWidth, nHeight]
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (img.complete) {
|
|
|
|
|
nWidth = img.naturalWidth;
|
|
|
|
|
nHeight = img.naturalHeight;
|
|
|
|
|
} else {
|
|
|
|
|
img.onload = function () {
|
|
|
|
|
nWidth = img.naturalWidth;
|
|
|
|
|
nHeight = img.naturalHeight;
|
|
|
|
|
image.onload = null;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return [nWidth, nHeight];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UpdateImageInformation(image) {
|
|
|
|
|
return [image.width,image.height];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(i=0;i<img.length;i++)
|
|
|
|
|
{
|
|
|
|
|
imgNatural = getImgNaturalStyle(img[i]);
|
|
|
|
|
imgNatural = getImgNaturalStyle(img[i],UpdateImageInformation);
|
|
|
|
|
var width = imgNatural[0];
|
|
|
|
|
var height = imgNatural[1];
|
|
|
|
|
if (width<100)
|
|
|
|
@ -29,7 +55,10 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="attachments" style="font-weight:normal;">
|
|
|
|
|
<% is_float ||= false %>
|
|
|
|
|
<% for attachment in attachments %>
|
|
|
|
|