Compare commits
No commits in common. "8f612dac0de568ffc9b8849e3fa05698333d8341" and "7310d43c3cc45c1a49c824120282b0f92074260a" have entirely different histories.
8f612dac0d
...
7310d43c3c
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
```
|
```
|
||||||
cd ./modules
|
cd ./modules
|
||||||
wget https://git.hangar.org/arcHIVE-tech/ImageGallery-omeka-module/archive/main.zip
|
https://git.hangar.org/arcHIVE-tech/ImageGallery-omeka-module
|
||||||
unzip main.zip
|
unzip main.zip
|
||||||
mv imagegallery-omeka-module/ ImageGallery
|
mv ImageGallery-omeka-module/ ImageGallery
|
||||||
rm main.zip
|
rm main.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
}
|
}
|
||||||
.archive-gallery .gallery__selector:checked + .gallery__img {
|
.archive-gallery .gallery__selector:checked + .gallery__img {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
height: 200px;
|
|
||||||
}
|
}
|
||||||
.archive-gallery .gallery__selector:checked ~ .gallery__thumb > img {
|
.archive-gallery .gallery__selector:checked ~ .gallery__thumb > img {
|
||||||
box-shadow: 0 0 0 3px #0be2f6;
|
box-shadow: 0 0 0 3px #0be2f6;
|
||||||
|
|
|
@ -70,46 +70,22 @@ class ImageGallery extends AbstractBlockLayout
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
//$thumbnails = [];
|
$thumbnails = [];
|
||||||
static $gallery_id = 0;
|
static $id = 0;
|
||||||
$images = [];
|
|
||||||
|
|
||||||
/*
|
|
||||||
$media = $attachments[0]->item()->media()[0];
|
$media = $attachments[0]->item()->media()[0];
|
||||||
$item = $attachments[0]->item();
|
$item = $attachments[0]->item();
|
||||||
$item_url = null;
|
$item_url = null;
|
||||||
if ($block->dataValue('renderSourceLink')) {
|
if ($block->dataValue('renderSourceLink')) {
|
||||||
$item_url = $attachments[0]->item()->url();
|
$item_url = $attachments[0]->item()->url();
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
foreach ($attachments as $attachment)
|
|
||||||
{
|
|
||||||
$img_id = 0;
|
|
||||||
foreach($attachment->item()->media() as $media)
|
|
||||||
{
|
|
||||||
$mediaType = $media->mediaType();
|
|
||||||
$mediaRenderer = $media->renderer();
|
|
||||||
if ((strpos($mediaType, 'image/') !== false) || (strpos($mediaRenderer, 'youtube') !== false)) {
|
|
||||||
array_push($images, ["media_url" => $media->originalUrl(),
|
|
||||||
"item_url" => $attachment->item()->url(),
|
|
||||||
"img_id" => 'gi_' . $gallery_id . '_' . $img_id,
|
|
||||||
]);
|
|
||||||
$img_id = $img_id +1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$max_width = $block->dataValue('width');
|
$max_width = $block->dataValue('width');
|
||||||
return $view->partial('common/block-layout/imageGallery', [
|
return $view->partial('common/block-layout/imageGallery', [
|
||||||
'gallery_id' => 'ig_' . ++$gallery_id,
|
'gallery_id' => 'ig-' . ++$id,
|
||||||
'title' => $block->dataValue('title'),
|
'title' => $block->dataValue('title'),
|
||||||
//'item' => $item,
|
//'item' => $item,
|
||||||
'images' => $images,
|
'images' => $item->media(),
|
||||||
//'images' => $item->media(),
|
'item_url' => $item_url,
|
||||||
//'item_url' => $item_url,
|
|
||||||
//'renderSourceLink' => $block->dataValue('renderSourceLink'),
|
//'renderSourceLink' => $block->dataValue('renderSourceLink'),
|
||||||
'width' => $block->dataValue('width'),
|
'width' => $block->dataValue('width'),
|
||||||
'max_width' => $max_width,
|
'max_width' => $max_width,
|
||||||
|
|
|
@ -7,9 +7,11 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGal
|
||||||
|
|
||||||
|
|
||||||
<div class="archive-gallery">
|
<div class="archive-gallery">
|
||||||
|
<?php if ($item_url) { ?>
|
||||||
<div class="source-link">
|
<div class="source-link">
|
||||||
<a href="">Source</a>
|
<a href="<?= $item_url ?>">Source</a>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<section id="<?= $gallery_id ?>"
|
<section id="<?= $gallery_id ?>"
|
||||||
class="gallery"
|
class="gallery"
|
||||||
|
@ -26,15 +28,12 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGal
|
||||||
class="gallery__selector"/>
|
class="gallery__selector"/>
|
||||||
<img class="gallery__img"
|
<img class="gallery__img"
|
||||||
style=""
|
style=""
|
||||||
src="<?= $image['media_url'] ?>"
|
src="<?= $image->primaryMedia()->originalUrl() ?>"
|
||||||
item_url="<?= $image['item_url'] ?>"
|
alt="<?= $image->primaryMedia()->source() ?>"
|
||||||
alt=""
|
|
||||||
/>
|
/>
|
||||||
<label for="<?= $img_id ?>" class="gallery__thumb">
|
<label for="<?= $img_id ?>" class="gallery__thumb">
|
||||||
<img src="<?= $image['media_url'] ?>"
|
<img src="<?= $image->primaryMedia()->thumbnailUrl('large') ?>"
|
||||||
alt=""
|
alt="Thumbnail: <?= $image->primaryMedia()->source() ?>"
|
||||||
item_url="<?= $image['item_url'] ?>"
|
|
||||||
onclick="updateSourceURL(this)"
|
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,19 +52,6 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/gallery.css', 'ImageGal
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function updateSourceURL(thumbnail){
|
|
||||||
$(thumbnail).closest(".archive-gallery")
|
|
||||||
.find('.source-link')
|
|
||||||
.find('a').prop('href', $(thumbnail).attr('item_url'));
|
|
||||||
}
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$('.archive-gallery').each(function(i, el){
|
|
||||||
var first_thumbnail = $(el).find('.gallery__img:first')
|
|
||||||
updateSourceURL(first_thumbnail)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
var gallery_image_height=0;
|
var gallery_image_height=0;
|
||||||
$( ".gallery__img" ).each(function( index ) {
|
$( ".gallery__img" ).each(function( index ) {
|
||||||
|
@ -73,10 +59,8 @@ jQuery(document).ready(function() {
|
||||||
gallery_image_height = $(this).height();
|
gallery_image_height = $(this).height();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$( ".gallery__img" ).each(function( index ) {
|
|
||||||
$(this).css('height', gallery_image_height)
|
|
||||||
});
|
|
||||||
$('section.gallery').css('padding-top', gallery_image_height)
|
$('section.gallery').css('padding-top', gallery_image_height)
|
||||||
|
//$(".gallery__thumb:first-of-type").css('margin-left', 0)
|
||||||
|
//$(".gallery__thumb:last-of-type").css('margin-right', 0)
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue