2021-08-28 17:31:03 +02:00
|
|
|
<?php
|
|
|
|
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
|
|
|
|
'ArchiveOrg'));
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="archive_org-wrap">
|
2021-04-17 19:13:22 +02:00
|
|
|
|
2021-06-27 13:45:44 +02:00
|
|
|
<?php if ($renderSourceLink) { ?>
|
|
|
|
<div class="source-link">
|
|
|
|
<a href="<?= $item_url ?>">Source</a>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
2021-04-17 19:13:22 +02:00
|
|
|
<?php
|
|
|
|
if ($title !== false && $title !== "") {
|
2021-04-17 19:39:48 +02:00
|
|
|
$title = sprintf('<p id="achive_org_media-title">%s</p>', $title);
|
2021-04-17 19:13:22 +02:00
|
|
|
} else {
|
|
|
|
$title = false;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2021-04-17 19:39:48 +02:00
|
|
|
<iframe
|
|
|
|
id="<?= $id ?>"
|
|
|
|
src="<?= $url ?>"
|
|
|
|
frameborder="0"
|
|
|
|
webkitallowfullscreen="true"
|
|
|
|
mozallowfullscreen="true"
|
2021-08-28 17:31:03 +02:00
|
|
|
width="<?= $width ?>%"
|
|
|
|
height="<?= $height ?>"
|
|
|
|
user_defined_ratio="<?= $ratio ?>"
|
|
|
|
media_type="<?= $media_type ?>"
|
2021-04-17 19:39:48 +02:00
|
|
|
allowfullscreen >
|
|
|
|
</iframe>
|
2021-04-17 19:13:22 +02:00
|
|
|
|
2021-06-27 13:45:44 +02:00
|
|
|
<?php if ($title) { ?>
|
|
|
|
<div class="item_title">
|
|
|
|
<?= $title ?>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
2021-04-17 19:13:22 +02:00
|
|
|
</div>
|
2021-08-28 17:31:03 +02:00
|
|
|
|
|
|
|
<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>
|