Archive.org-omeka-module/view/common/block-layout/archiveOrg.phtml

60 lines
1.2 KiB
PHTML

<?php
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
'ArchiveOrg'));
?>
<div class="archive-item-block archive_org-wrap">
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<?php
if ($title !== false && $title !== "") {
$title = sprintf('<p id="achive_org_media-title">%s</p>', $title);
} else {
$title = false;
}
?>
<iframe
id="<?= $id ?>"
src="<?= $url ?>"
frameborder="0"
webkitallowfullscreen="true"
mozallowfullscreen="true"
width="<?= $width ?>%"
height="<?= $height ?>"
user_defined_ratio="<?= $ratio ?>"
media_type="<?= $media_type ?>"
allowfullscreen >
</iframe>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
</div>
<script>
function adjust_height() {
$(".archive_org-wrap").each(function() {
var iframe = $(this).find('iframe')
if ($(iframe).attr("media_type") == 'video') {
var height = get_height(iframe, $(iframe).attr("user_defined_ratio"))
$(iframe).prop("height", height)
}
});
}
jQuery(document).ready(function() {
adjust_height();
});
$(window).resize(function() {
adjust_height();
});
</script>