$(function () {
const thumbInners = document.querySelectorAll('.thumbinner')
const imgs = document.querySelectorAll('img:not([class])')
const thumbImgs = document.querySelectorAll('img.thumbimage')
const infoboxes = document.querySelectorAll('table.infobox')
const ths = document.querySelectorAll('th')
thumbInners.forEach(
function(thumbInner, currentIndex, listObj) {
var thumbImage = thumbInner.querySelector('.thumbimage')
var height = thumbImage.getAttribute('height')
var fileWidth = thumbImage.getAttribute('data-file-width')
var fileHeight = thumbImage.getAttribute('data-file-height')
var calcWidth = 250 * fileWidth / fileHeight
thumbInner.style.removeProperty('width')
//thumbInner.style.setProperty('height', height + 'px')
thumbInner.style.setProperty('height', '250px')
thumbInner.style.setProperty('max-height', '250px')
thumbImage.style.setProperty('width', calcWidth + 'px')
thumbImage.style.setProperty('height', '250px')
},
'argument'
)
imgs.forEach(
function(img, currentIndex, listObj) {
var height = img.getAttribute('height')
var width = img.getAttribute('width')
var fileWidth = img.getAttribute('data-file-width')
var fileHeight = img.getAttribute('data-file-height')
var calcWidth = 250 * fileWidth / fileHeight
img.style.setProperty('max-height', '250px')
if (width == 300) {
img.style.setProperty('height', '250px')
img.style.setProperty('width', calcWidth + 'px')
}
},
'argument'
)
infoboxes.forEach(
function(infobox, currentIndex, listObj) {
infobox.style.removeProperty('width')
infobox.style.setProperty('height', '30%')
infobox.style.setProperty('max-height', '22em')
},
'argument'
)
ths.forEach(
function(th, currentIndex, listObj) {
var width = th.style['width']
if (width) {
th.style.removeProperty('width')
th.style.setProperty('height', width)
}
},
'argument'
)
}());