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 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 unzip main.zip
mv panoramaviewer/ PanoramaViewer mv panoramaviewer/ PanoramaViewer
``` ```
@ -21,7 +21,7 @@ The script for Panorama feature is imported from [Pannellum].
[arc-hive]: https://arc-hive.zone/ [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/ [Pannellum]: https://pannellum.org/
[Omeka S]: https://omeka.org/s [Omeka S]: https://omeka.org/s
[MIT]: http://opensource.org/licenses/MIT [MIT]: http://opensource.org/licenses/MIT

View File

@ -25,6 +25,7 @@ return [
'width' => 600, 'width' => 600,
'ratio' => '2', 'ratio' => '2',
'autoLoad' => false, 'autoLoad' => false,
'renderSourceLink' => true,
'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;', 'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;',
//'imgStyle' => '', //'imgStyle' => '',
'ui_background' => 'rgba(0,0,0,0.1)', '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([ $this->add([
'name' => 'o:block[__blockIndex__][o:data][width]', 'name' => 'o:block[__blockIndex__][o:data][width]',
'type' => Element\Number::class, '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][width]' => $data['width'],
'o:block[__blockIndex__][o:data][ratio]' => $data['ratio'], 'o:block[__blockIndex__][o:data][ratio]' => $data['ratio'],
'o:block[__blockIndex__][o:data][autoLoad]' => $data['autoLoad'], 'o:block[__blockIndex__][o:data][autoLoad]' => $data['autoLoad'],
'o:block[__blockIndex__][o:data][renderSourceLink]' => $data['renderSourceLink'],
]); ]);
$form->prepare(); $form->prepare();
@ -102,6 +103,7 @@ class PanoramaViewer extends AbstractBlockLayout
'width' => $width, 'width' => $width,
'height' => $height, 'height' => $height,
'autoLoad' => $block->dataValue('autoLoad'), 'autoLoad' => $block->dataValue('autoLoad'),
'renderSourceLink' => $block->dataValue('renderSourceLink'),
'urls' => $urls, 'urls' => $urls,
'id' => 'pv-' . ++$id, 'id' => 'pv-' . ++$id,
'mediaTypes' => $media_types, 'mediaTypes' => $media_types,

View File

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