renders source link and subtitle

This commit is contained in:
buttle 2021-05-31 19:20:44 +02:00
parent 286487db95
commit 74a0c3e8ca
5 changed files with 39 additions and 13 deletions

View File

@ -9,7 +9,7 @@ Built using HTML5, CSS3, JavaScript, and WebGL, it is plug-in free.
```
cd ./modules
https://git.hangar.org/arcHIVE-tech/PanoramaViewer/archive/main.zip
https://git.hangar.org/arcHIVE-tech/PanoramaViewer-omeka-module/archive/main.zip
unzip main.zip
mv panoramaviewer/ PanoramaViewer
```
@ -21,7 +21,7 @@ The script for Panorama feature is imported from [Pannellum].
[arc-hive]: https://arc-hive.zone/
[Panorama Viewer]: https://git.hangar.org/arcHIVE-tech/PanoramaViewer
[Panorama Viewer]: https://git.hangar.org/arcHIVE-tech/PanoramaViewer-omeka-module
[Pannellum]: https://pannellum.org/
[Omeka S]: https://omeka.org/s
[MIT]: http://opensource.org/licenses/MIT

View File

@ -25,6 +25,7 @@ return [
'width' => 600,
'ratio' => '2',
'autoLoad' => false,
'renderSourceLink' => true,
'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;',
//'imgStyle' => '',
'ui_background' => 'rgba(0,0,0,0.1)',

View File

@ -20,14 +20,6 @@ class PanoramaViewerBlockForm extends Form
],
]);
$this->add([
'name' => 'o:block[__blockIndex__][o:data][title]',
'type' => Element\Text::class,
'options' => [
'label' => 'Title (option)',
]
]);
$this->add([
'name' => 'o:block[__blockIndex__][o:data][width]',
'type' => Element\Number::class,
@ -59,5 +51,24 @@ class PanoramaViewerBlockForm extends Form
],
]);
$this->add([
'type' => Element\Checkbox::class,
'name' => 'o:block[__blockIndex__][o:data][renderSourceLink]',
'options' => [
'label' => 'Display a link to the item',
//'use_hidden_element' => true,
'checked_value' => true,
'unchecked_value' => false,
],
]);
$this->add([
'name' => 'o:block[__blockIndex__][o:data][title]',
'type' => Element\Text::class,
'options' => [
'label' => 'Sub-title',
]
]);
}
}

View File

@ -52,6 +52,7 @@ class PanoramaViewer extends AbstractBlockLayout
'o:block[__blockIndex__][o:data][width]' => $data['width'],
'o:block[__blockIndex__][o:data][ratio]' => $data['ratio'],
'o:block[__blockIndex__][o:data][autoLoad]' => $data['autoLoad'],
'o:block[__blockIndex__][o:data][renderSourceLink]' => $data['renderSourceLink'],
]);
$form->prepare();
@ -102,6 +103,7 @@ class PanoramaViewer extends AbstractBlockLayout
'width' => $width,
'height' => $height,
'autoLoad' => $block->dataValue('autoLoad'),
'renderSourceLink' => $block->dataValue('renderSourceLink'),
'urls' => $urls,
'id' => 'pv-' . ++$id,
'mediaTypes' => $media_types,

View File

@ -28,8 +28,13 @@
}
</style>
<div class="pannellum-wrap">
<div class="archive-item pannellum-wrap">
<?php if ($panorama_type == "video") { ?>
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<video id="<?= $id ?>"
class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="none"
@ -45,11 +50,18 @@
</p>
</video>
<?php } else { ?>
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<div id="<?= $id ?>" class="panorama-viewer"></div>
<?php } ?>
<div class="more-item-info">
<a href="<?= $item_url ?>"><?= $item_title ?></a>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
</div>
<script>