first commit

This commit is contained in:
2026-02-08 21:16:11 +01:00
commit e17b7026fd
8881 changed files with 1160453 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
<?php
/**
* @copyright
* @package RIE - Random Image Extended for Joomla! 3.x
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version 3.4.0-FREE - 2020-09-01
* @link https://kubik-rubik.de/rie-random-image-extended
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('_JEXEC') || die('Restricted access');
use Joomla\CMS\Helper\ModuleHelper;
use RandomImageExtended\Helper;
require_once __DIR__ . '/src/Helper.php';
$allPics = (bool)$params->get('allPics', true);
$caption = htmlspecialchars($params->get('caption'));
$height = (int)$params->get('height', 200);
$imageName = (bool)$params->get('imageName', false);
$imageRotator = (bool)$params->get('imageRotator', false);
$imageRotatorDuration = (int)$params->get('imageRotatorDuration', 6);
$informationFile = (bool)$params->get('informationFile', false);
$lightbox = (bool)$params->get('lightbox', true);
$lightboxShow = $params->get('lightboxShow', 'venobox');
$link = $params->get('link', '');
$linkFolder = (bool)$params->get('linkFolder', false);
$moduleclassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
$newWindow = (bool)$params->get('newWindow', false);
$subFolder = (bool)$params->get('subFolder', false);
$width = (int)$params->get('width', 200);
$start = new Helper();
$folder = $start->getFolder($params);
$images = $start->getImages($params, $folder, $subFolder);
$start->loadHeadData($lightboxShow, 1);
$layout = 'noimages';
if (count($images)) {
$linksInfo = [];
if (!empty($informationFile)) {
$linksInfo = $start->getFileInfo($folder);
}
$imagesDisplay = $start->getRandomImages($params, $images, $width, $height, $imageRotator, $linksInfo);
if ($lightbox) {
$start->loadHeadData($lightboxShow, 2);
$lightboxAttribute = $start->lightboxAttribute($lightboxShow);
}
if ($imageRotator) {
$start->loadHeadData($lightboxShow, 3, $width, $height, $imageRotatorDuration);
}
$layout = 'default';
}
require ModuleHelper::getLayoutPath('mod_random_image_extended', $layout);

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="module" version="3.9" client="site" method="upgrade">
<name>MOD_RANDOM_IMAGE_EXTENDED</name>
<version>3.4.0-FREE</version>
<creationDate>2020-09-01</creationDate>
<license>http://www.gnu.org/licenses/gpl</license>
<copyright>Copyright 2020 Viktor Vogel. All rights reserved.</copyright>
<author>Viktor Vogel</author>
<authorEmail>admin@kubik-rubik.de</authorEmail>
<authorUrl>https://kubik-rubik.de/</authorUrl>
<description>MOD_RANDOM_IMAGE_EXTENDED_XML_DESCRIPTION</description>
<files>
<filename module="mod_random_image_extended">mod_random_image_extended.php</filename>
<filename module="mod_random_image_extended">index.html</filename>
<folder module="mod_random_image_extended">tmpl</folder>
<folder module="mod_random_image_extended">src</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/en-GB.mod_random_image_extended.ini</language>
<language tag="en-GB">language/en-GB/en-GB.mod_random_image_extended.sys.ini</language>
<language tag="de-DE">language/de-DE/de-DE.mod_random_image_extended.ini</language>
<language tag="de-DE">language/de-DE/de-DE.mod_random_image_extended.sys.ini</language>
</languages>
<scriptfile>src/Script.php</scriptfile>
<updateservers>
<server type="extension" priority="1" name="MOD_RANDOM_IMAGE_EXTENDED">https://check.kubik-rubik.de/updates/mod_random_image_extended.xml</server>
</updateservers>
<config>
<fields name="params" addfieldpath="/modules/mod_random_image_extended/src/fields">
<fieldset name="settings">
<field type="krdonationcodecheck"/>
<field type="krtitle" name="spacer_thumbnails" label="MOD_RANDOM_IMAGE_EXTENDED_SPACER_THUMBNAILS"/>
<field name="width" type="text" default="200" filter="integer" label="MOD_RANDOM_IMAGE_EXTENDED_WIDTH" description="MOD_RANDOM_IMAGE_EXTENDED_WIDTHDESC"/>
<field name="height" type="text" default="200" filter="integer" label="MOD_RANDOM_IMAGE_EXTENDED_HEIGHT" description="MOD_RANDOM_IMAGE_EXTENDED_HEIGHTDESC"/>
<field name="ratio" type="list" default="1" label="MOD_RANDOM_IMAGE_EXTENDED_RATIO" description="MOD_RANDOM_IMAGE_EXTENDED_RATIODESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="type" type="text" default="jpg,gif,png" label="MOD_RANDOM_IMAGE_EXTENDED_IMAGETYPE" description="MOD_RANDOM_IMAGE_EXTENDED_IMAGETYPEDESC"/>
<field name="folder" type="text" default="images" label="MOD_RANDOM_IMAGE_EXTENDED_IMAGEFOLDER" description="MOD_RANDOM_IMAGE_EXTENDED_IMAGEFOLDERDESC"/>
<field name="subFolder" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_SUBFOLDER" description="MOD_RANDOM_IMAGE_EXTENDED_SUBFOLDERDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="linkFolder" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_LINKFOLDER" description="MOD_RANDOM_IMAGE_EXTENDED_LINKFOLDERDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="overwrite" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_OVERWRITE" description="MOD_RANDOM_IMAGE_EXTENDED_OVERWRITEDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field type="krtitle" name="spacer_output" label="MOD_RANDOM_IMAGE_EXTENDED_SPACER_OUTPUT"/>
<field name="quantity" type="text" default="1" filter="integer" label="MOD_RANDOM_IMAGE_EXTENDED_QUANTITY" description="MOD_RANDOM_IMAGE_EXTENDED_QUANTITYDESC"/>
<field name="informationFile" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_INFORMATIONFILE" description="MOD_RANDOM_IMAGE_EXTENDED_INFORMATIONFILEDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="allPicsRandom" type="list" default="1" label="MOD_RANDOM_IMAGE_EXTENDED_ALLPICSRANDOM" description="MOD_RANDOM_IMAGE_EXTENDED_ALLPICSRANDOMDESC">
<option value="1">JYES</option>
<option value="2">MOD_RANDOM_IMAGE_EXTENDED_JYESNOTFIRST</option>
<option value="0">JNO</option>
</field>
<field name="imageName" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_IMAGENAME" description="MOD_RANDOM_IMAGE_EXTENDED_IMAGENAMEDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="caption" type="text" default="" label="MOD_RANDOM_IMAGE_EXTENDED_CAPTION" description="MOD_RANDOM_IMAGE_EXTENDED_CAPTIONDESC"/>
<field name="link" type="text" default="" label="MOD_RANDOM_IMAGE_EXTENDED_LINK" description="MOD_RANDOM_IMAGE_EXTENDED_LINKDESC"/>
<field name="newWindow" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_NEWWINDOW" description="MOD_RANDOM_IMAGE_EXTENDED_NEWWINDOWDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="imageRotator" type="list" default="0" label="MOD_RANDOM_IMAGE_EXTENDED_IMAGEROTATOR" description="MOD_RANDOM_IMAGE_EXTENDED_IMAGEROTATORDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="imageRotatorDuration" type="text" default="6" filter="integer" label="MOD_RANDOM_IMAGE_EXTENDED_IMAGEROTATORDURATION" description="MOD_RANDOM_IMAGE_EXTENDED_IMAGEROTATORDURATIONDESC"/>
<field type="krtitle" name="spacer_lightbox" label="MOD_RANDOM_IMAGE_EXTENDED_SPACER_LIGHTBOX"/>
<field name="lightbox" type="list" default="1" label="MOD_RANDOM_IMAGE_EXTENDED_LIGHTBOX" description="MOD_RANDOM_IMAGE_EXTENDED_LIGHTBOXDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="lightboxShow" type="list" default="venobox" label="MOD_RANDOM_IMAGE_EXTENDED_LIGHTBOXSELECT" description="MOD_RANDOM_IMAGE_EXTENDED_LIGHTBOXSELECTDESC">
<option value="venobox">Venobox</option>
<option value="shadowbox">Shadowbox</option>
<option value="slimbox">Slimbox</option>
<option value="milkbox">Milkbox</option>
</field>
<field name="allPics" type="list" default="1" label="MOD_RANDOM_IMAGE_EXTENDED_ALLPICS" description="MOD_RANDOM_IMAGE_EXTENDED_ALLPICSDESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="advanced">
<field type="krdonationcodecheck"/>
<field name="moduleclass_sfx" type="text" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"/>
<field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
<option value="1">Use global</option>
<option value="0">No caching</option>
</field>
</fieldset>
<fieldset name="donation">
<field type="krdonationcodecheck" name="donation"/>
<field name="donation_code" type="text" default="" size="40" label="KR_DONATION_CODE" description="KR_DONATION_CODE_DESC"/>
<field type="krprobutton" name="mod_random_image_extended"/>
</fieldset>
</fields>
</config>
</extension>

View File

@@ -0,0 +1,515 @@
<?php
/**
* @copyright
* @package RIE - Random Image Extended for Joomla! 3.x
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version 3.4.0-FREE - 2020-09-01
* @link https://kubik-rubik.de/rie-random-image-extended
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace RandomImageExtended;
defined('_JEXEC') || die('Restricted access');
use Joomla\CMS\{Factory, Uri\Uri, HTML\HTMLHelper};
use Joomla\String\StringHelper;
class Helper
{
/**
* Gets the image for the output and prepare other images for the gallery if selected
*
* @param object $params
* @param array $images
* @param int $width
* @param int $height
* @param bool $imageRotator
* @param array $linksInfo
*
* @return mixed
* @since 3.4.0-FREE
*/
public function getRandomImages(object $params, array &$images, int $width, int $height, bool $imageRotator, array $linksInfo = [])
{
$imagesDisplay = [];
$ratio = (bool)$params->get('ratio', true);
$linkFolder = (bool)$params->get('linkFolder', false);
$overwrite = (bool)$params->get('overwrite', false);
$allPicsRandom = (int)$params->get('allPicsRandom', 1);
$allPics = (bool)$params->get('allPics', true);
$quantity = (int)$params->get('quantity', 1);
if ($quantity > count($images)) {
$quantity = count($images);
}
$this->setImageProperties($images, $linksInfo);
if (!empty($allPicsRandom)) {
if ($allPicsRandom == 2 && $allPics == 1) {
$image = $images[0];
unset($images[0]);
} else {
$random = mt_rand(0, count($images) - 1);
$image = $images[$random];
unset($images[$random]);
}
$imagesDisplay[] = $image;
$quantity--;
if ($allPics == 1) {
shuffle($images);
} else {
$images = array_values($images);
}
}
if ($quantity >= 1 && empty($imageRotator)) {
for ($i = 0; $i < $quantity; $i++) {
$imagesDisplay[] = $images[$i];
unset($images[$i]);
}
}
foreach ($imagesDisplay as &$image) {
// Calculate correct image size
$this->calculateImageSize($image, $ratio, $width, $height);
if ($linkFolder) {
$this->createThumbnails($image, $overwrite);
}
}
if ($imageRotator) {
foreach ($images as &$imageTail) {
$this->calculateImageSize($imageTail, $ratio, $width, $height);
if ($linkFolder) {
$this->createThumbnails($imageTail, $overwrite);
}
}
}
return $imagesDisplay;
}
/**
* Sets the properties of the images from the text file if provided
* Private function - called in the function getRandomImage
*
* @param array $images
* @param array $linkInfo
*
* @since 3.4.0-FREE
*/
private function setImageProperties(array &$images, array $linkInfo)
{
if (!empty($linkInfo)) {
$imagesInfo = [];
foreach ($linkInfo as $imageName => $imageInfo) {
foreach ($images as $key => $image) {
if ($imageName == $image->link) {
$image->name = $imageInfo[0];
$image->linkto = $imageInfo[1];
$imagesInfo[] = $image;
// Unset this image in the images array to avoid unnecessary loops
unset($images[$key]);
break;
}
}
}
if (!empty($imageInfo)) {
$images = array_merge($imagesInfo, $images);
}
}
// Set the needed properties for images with no entry in the text file or if the text file is not used at all
foreach ($images as &$image) {
// If name is not set, then generate it from the image name - remove extensions of the file
// name, remove special characters and uppercase the first character of each word in a string
if (empty($image->name)) {
$image->name = htmlspecialchars(ucwords(str_replace(['_', '-', '+', '=', '#', '?'], ' ', substr($image->link, 0, -4))));
}
// Linkto property is set to an empty string
if (!isset($image->linkto)) {
$image->linkto = '';
}
}
}
/**
* Calculates the image size
*
* @param object $image
* @param bool $ratio
* @param int $width
* @param int $height
*
* @since 3.4.0-FREE
*/
private function calculateImageSize(object &$image, bool $ratio, int $width, int $height)
{
$size = getimagesize(JPATH_BASE . '/' . $image->folder . '/' . $image->link);
if ($ratio || empty($width) || empty($height)) {
if (empty($width)) {
$width = 200;
}
if ($size[0] < $width) {
$width = $size[0];
}
$coeff = $size[0] / $size[1];
if (empty($height)) {
$height = (int)($width / $coeff);
} else {
$newHeight = min($height, (int)($width / $coeff));
if ($newHeight < $height) {
$height = $newHeight;
} else {
$width = $height * $coeff;
}
}
}
$image->width = $width;
$image->height = $height;
}
/**
* Creates thumbnails of the images to improve loading speed and quality
*
* @param object $image
* @param bool $overwrite
*
* @since 3.4.0-FREE
*/
private function createThumbnails(object $image, bool $overwrite)
{
if (!is_dir(JPATH_SITE . '/' . $image->folder . '/thumbs')) {
mkdir(JPATH_SITE . '/' . $image->folder . '/thumbs', 0755);
$fp = fopen(JPATH_SITE . '/' . $image->folder . '/thumbs/index.html', 'w');
fclose($fp);
}
$filename = $image->folder . '/thumbs/' . $image->link;
if (!file_exists($filename) || $overwrite) {
$size = getimagesize(JPATH_BASE . '/' . $image->folder . '/' . $image->link);
if ($size['mime'] == 'image/gif') {
$imageOriginal = imagecreatefromgif($image->folder . '/' . $image->link);
$imageThumbnail = imagecreatetruecolor($image->width, $image->height);
imagecopyresampled($imageThumbnail, $imageOriginal, 0, 0, 0, 0, $image->width, $image->height, $size[0], $size[1]);
imagegif($imageThumbnail, $image->folder . '/thumbs/' . $image->link);
} elseif ($size['mime'] == 'image/jpeg') {
$imageOriginal = imagecreatefromjpeg($image->folder . '/' . $image->link);
$imageThumbnail = imagecreatetruecolor($image->width, $image->height);
imagecopyresampled($imageThumbnail, $imageOriginal, 0, 0, 0, 0, $image->width, $image->height, $size[0], $size[1]);
imagejpeg($imageThumbnail, $image->folder . '/thumbs/' . $image->link, 90);
} elseif ($size['mime'] == 'image/png') {
$imageOriginal = imagecreatefrompng($image->folder . '/' . $image->link);
$imageThumbnail = imagecreatetruecolor($image->width, $image->height);
imagecopyresampled($imageThumbnail, $imageOriginal, 0, 0, 0, 0, $image->width, $image->height, $size[0], $size[1]);
imagepng($imageThumbnail, $image->folder . '/thumbs/' . $image->link);
}
if (!empty($imageOriginal) && is_resource($imageOriginal)) {
imagedestroy($imageOriginal);
}
if (!empty($imageThumbnail) && is_resource($imageThumbnail)) {
imagedestroy($imageThumbnail);
}
}
}
/**
* Gets the cleaned image folder
*
* @param object $params
*
* @return string
* @since 3.4.0-FREE
*/
public function getFolder(object $params): string
{
$folder = htmlspecialchars($params->get('folder', 'images'));
if (StringHelper::strpos($folder, Uri::base()) === 0) {
$folder = str_replace(Uri::base(), '', $folder);
}
if (StringHelper::strpos($folder, JPATH_SITE) === 0) {
$folder = str_replace(JPATH_BASE, '', $folder);
}
return str_replace('\\', '/', $folder);
}
/**
* Gets images from the specified folder, if specified with all subfolders
*
* @param object $params
* @param string $folder
* @param bool $subFolder
*
* @return array
* @since 3.4.0-FREE
*/
function getImages(object $params, string $folder, bool $subFolder = false): array
{
if ($subFolder) {
return $this->getImagesSubfolder($params, $folder);
}
$images = [];
$dir = JPATH_BASE . '/' . $folder;
if (is_dir($dir)) {
$files = [];
if ($handle = opendir($dir)) {
while (($file = readdir($handle)) !== false) {
if ($file != '.' && $file != '..' && $file != 'index.html') {
$files[] = $file;
}
}
}
closedir($handle);
$i = 0;
$types = array_map('trim', explode(',', $params->get('type', 'jpg,gif,png')));
foreach ($files as $img) {
if (!is_dir($dir . '/' . $img)) {
foreach ($types as $type) {
if (preg_match('@' . $type . '$@i', $img)) {
$images[$i] = new \stdClass();
$images[$i]->link = $img;
$images[$i]->folder = str_replace('\\', '/', $folder);
$i++;
break;
}
}
}
}
}
return $images;
}
/**
* Gets images from the specified folder and all subfolders
*
* @param object $params
* @param string $folder
*
* @return array
* @since 3.4.0-FREE
*/
public function getImagesSubfolder(object $params, string $folder): array
{
$images = [];
if (is_dir($folder)) {
$handle = opendir($folder);
if ($handle) {
$types = array_map('trim', explode(',', $params->get('type', 'jpg,gif,png')));
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && $file != 'thumbs' && $file != 'index.html') {
$name = $folder . '/' . $file;
if (is_file($name)) {
if (in_array(strtolower(pathinfo($name, PATHINFO_EXTENSION)), $types, true)) {
$imageObject = new \stdClass();
$imageObject->link = pathinfo($name, PATHINFO_BASENAME);
$imageObject->folder = str_replace('\\', '/', pathinfo($name, PATHINFO_DIRNAME));
$images[] = $imageObject;
}
} elseif (is_dir($name)) {
$imagesSubfolder = $this->getImagesSubfolder($params, $name);
$images = array_merge($images, $imagesSubfolder);
}
}
}
}
closedir($handle);
}
return $images;
}
/**
* Loads needed JS and CSS files and instructions to the head section of the page
*
* @param string $lightboxShow
* @param integer $type
* @param mixed $width
* @param mixed $height
* @param bool $imageRotatorDuration
*
* @since 3.4.0-FREE
*/
public function loadHeadData($lightboxShow, $type, $width = false, $height = false, $imageRotatorDuration = false)
{
$document = Factory::getDocument();
if ($type == 1) {
$css = '.random_image_extended {text-align: center; margin: 10px 0;}' . "\n";
$css .= '.random_image_extended_single {display: inline-block; padding: 4px;}' . "\n";
$css .= '.random_image_extended_small {text-align: right; font-size: 0.85em; margin-top: 15px;}' . "\n";
$document->addStyleDeclaration($css);
} elseif ($type == 2) {
$head = [];
if ($lightboxShow == 'slimbox') {
HTMLHelper::_('behavior.framework');
$head[] = '<link rel="stylesheet" href="modules/mod_random_image_extended/src/slimbox/css/slimbox.css" type="text/css" media="screen" />';
$head[] = '<script type="text/javascript" src="modules/mod_random_image_extended/src/slimbox/js/slimbox.js"></script>';
} elseif ($lightboxShow == 'milkbox') {
HTMLHelper::_('behavior.framework', 'more');
$head[] = '<link rel="stylesheet" href="modules/mod_random_image_extended/src/milkbox/milkbox.css" type="text/css" media="screen" />';
$head[] = '<script type="text/javascript" src="modules/mod_random_image_extended/src/milkbox/milkbox.js"></script>';
} elseif ($lightboxShow == 'shadowbox') {
$head[] = '<link rel="stylesheet" href="modules/mod_random_image_extended/src/shadowbox/shadowbox.css" type="text/css" media="screen" />';
$head[] = '<script type="text/javascript" src="modules/mod_random_image_extended/src/shadowbox/shadowbox.js"></script>';
$head[] = '<script type="text/javascript">Shadowbox.init();</script>';
} elseif ($lightboxShow == 'venobox') {
HTMLHelper::_('jquery.framework');
$head[] = '<script type="text/javascript" src="modules/mod_random_image_extended/src/venobox/venobox.js"></script>';
$head[] = '<script type="text/javascript">jQuery(document).ready(function(){jQuery(\'.venobox\').venobox();});</script>';
$head[] = '<link rel="stylesheet" href="modules/mod_random_image_extended/src/venobox/venobox.css" type="text/css" media="screen" />';
}
$head = "\n" . implode("\n", $head) . "\n";
$document->addCustomTag($head);
} elseif ($type == 3) {
$css = '#slideshow-container {width: ' . $width . 'px; height: ' . $height . 'px; position: relative; overflow: hidden; text-align: left; margin: auto;}' . "\n";
$css .= '#slideshow-container img {display: inline-block; position: absolute; top: 0; left: 0; z-index: 1; opacity: 0.0}';
$css .= '#slideshow-container img:first-child {opacity: 1.0}';
$css .= '#slideshow-container img.active {z-index: 3;}';
$css .= '#slideshow-container img.last-active {z-index: 2;}';
$document->addStyleDeclaration($css);
HTMLHelper::_('jquery.framework');
// Inspired by http://jonraasch.com/blog/a-simple-jquery-slideshow
$imageRotator = 'function slideSwitch() {
var $all = jQuery(\'#slideshow-container img\');
var $active = jQuery(\'#slideshow-container img.active\');
if ( $active.length == 0 ) $active = jQuery(\'#slideshow-container img:last\');
var $next = $active.next().length ? $active.next()
: jQuery(\'#slideshow-container img:first\');
$all.css({opacity: 0.0});
$active.css({opacity: 1.0})
.addClass(\'last-active\')
.animate({opacity: 0.0}, 1000);
$next.css({opacity: 0.0})
.addClass(\'active\')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass(\'active last-active\');
});
}
jQuery(document).ready(function(){
setInterval( "slideSwitch()", ' . $imageRotatorDuration . '000 );
});';
$document->addScriptDeclaration($imageRotator, 'text/javascript');
}
}
/**
* Loads information from a text file which has to be uploaded in the image folder with the name info.txt
*
* The entries in the info.txt have this structure:
*
* IMAGENAME.EXT|TITLE|LINK
*
* Each line one entry!
*
* @param string $folder
*
* @return array
* @since 3.4.0-FREE
*/
public function getFileInfo(string $folder): array
{
$linksInfo = [];
$linksTextFile = $folder . '/info.txt';
if (file_exists($linksTextFile)) {
$linksFile = file($linksTextFile);
$count = 0;
foreach ($linksFile as $value) {
$linksLine = explode('|', $value);
if (empty($linksLine[2])) {
$linksLine[2] = '';
}
$linksInfo[$linksLine[0]] = [htmlspecialchars($linksLine[1]), htmlspecialchars($linksLine[2])];
$count++;
}
}
return $linksInfo;
}
/**
* Creates the correct lightbox attribute for the template file
*
* @param string $lightboxShow
*
* @return string
* @since 3.4.0-FREE
*/
public function lightboxAttribute(string $lightboxShow): string
{
if ($lightboxShow == 'slimbox') {
return 'rel="lightbox.random"';
} elseif ($lightboxShow == 'milkbox') {
return 'data-milkbox="milkbox"';
} elseif ($lightboxShow == 'shadowbox') {
return 'rel="shadowbox[random]"';
} elseif ($lightboxShow == 'venobox') {
return 'class="venobox" data-gall="venobox"';
}
return '';
}
}

View File

@@ -0,0 +1,100 @@
<?php
/**
* @copyright
* @package RIE - Random Image Extended for Joomla! 3.x
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version 3.4.0-FREE - 2020-09-01
* @link https://kubik-rubik.de/rie-random-image-extended
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('_JEXEC') || die('Restricted access');
class Mod_Random_Image_ExtendedInstallerScript
{
const MIN_VERSION_JOOMLA = '3.9.0';
const MIN_VERSION_PHP = '7.3.0';
/**
* Name of extension that is used in the error message
*
* @var string
* @since 3.4.0-FREE
*/
protected $extensionName = 'Random Image Extended';
/**
* Checks compatibility in the preflight event
*
* @param $type
* @param $parent
*
* @return bool
* @throws Exception
* @since 3.4.0-FREE
*/
public function preflight($type, $parent)
{
if (!$this->checkVersionJoomla()) {
return false;
}
if (!$this->checkVersionPhp()) {
return false;
}
return true;
}
/**
* Checks whether the Joomla! version meets the requirement
*
* @return bool
* @throws Exception
* @since 3.4.0-FREE
*/
private function checkVersionJoomla()
{
// Using deprecated JVersion, JFactory and JText classes to avoid exceptions in old Joomla! versions
$version = new JVersion();
if (!$version->isCompatible(self::MIN_VERSION_JOOMLA)) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('KRJE_FREE_ERROR_JOOMLA_VERSION', $this->extensionName, self::MIN_VERSION_JOOMLA), 'error');
return false;
}
return true;
}
/**
* Checks whether the PHP version meets the requirement
*
* @return bool
* @throws Exception
* @since 3.4.0-FREE
*/
private function checkVersionPhp()
{
if (!version_compare(phpversion(), self::MIN_VERSION_PHP, 'ge')) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('KRJE_FREE_ERROR_PHP_VERSION', $this->extensionName, self::MIN_VERSION_PHP), 'error');
return false;
}
return true;
}
}

View File

@@ -0,0 +1,242 @@
<?php
/**
* @copyright
* @package Field - Donation Code Check
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version Joomla! 3 - 3.3.1 - 2020-05-22
* @link https://kubik-rubik.de/
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('JPATH_PLATFORM') || die('Restricted access');
use Joomla\CMS\{Form\FormField, Factory, Uri\Uri, Language\Text, User\UserHelper, Http\HttpFactory};
use Joomla\Registry\Registry;
/**
* Form Field class for Kubik-Rubik Joomla! Extensions.
* Provides a donation code check.
*/
class JFormFieldKrDonationCodeCheck extends FormField
{
protected $type = 'krDonationCodeCheck';
protected $validationDomain = 'https://check.kubik-rubik.de';
protected $validationDomainFallBack = 'http://check.kubik-rubik.eu';
/**
* @return mixed|string
*/
protected function getInput()
{
$fieldSet = $this->form->getFieldset();
$donationCode = '';
if (empty($this->group)) {
$donationCode = $fieldSet['jform_donation_code']->value;
} elseif ($this->group == 'params') {
$donationCode = $fieldSet['jform_params_donation_code']->value;
}
$session = Factory::getSession();
$fieldValueSession = $session->get('field_value', '', 'krdonationcodecheck');
$fieldValueHeadSession = $session->get('field_value_head', '', 'krdonationcodecheck');
$donationCodeSession = $session->get('donation_code', '', 'krdonationcodecheck');
if ($fieldValueSession === 1 && ($donationCode === $donationCodeSession)) {
$fieldValue = '';
if ($this->id == 'jform_params_donation' || $this->id == 'jform_donation') {
$fieldValue .= '<div class="' . $this->randomClassName($session, 'success') . '">' . Text::_('KR_DONATION_CODE_CHECK_SUCCESS') . '</div>';
$this->setHeadDataSession($session);
}
return $fieldValue;
} elseif (!empty($fieldValueSession) && !empty($fieldValueHeadSession) && ($donationCode == $donationCodeSession)) {
$this->addHeadData($fieldValueHeadSession);
return $fieldValueSession;
}
$session->clear('field_value', 'krdonationcodecheck');
$session->clear('field_value_head', 'krdonationcodecheck');
$session->clear('donation_code', 'krdonationcodecheck');
$host = Uri::getInstance()->getHost();
$session->set('donation_code', $donationCode, 'krdonationcodecheck');
if ($host == 'localhost') {
$fieldValue = '<div class="' . $this->randomClassName($session) . '">' . Text::_('KR_DONATION_CODE_CHECK_DEFAULT_LOCALHOST') . '</div>';
if (!empty($donationCode)) {
$fieldValue .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . Text::_('KR_DONATION_CODE_CHECK_ERROR_LOCALHOST') . '</div>';
}
$session->set('field_value', $fieldValue, 'krdonationcodecheck');
$this->setHeadDataSession($session);
return $fieldValue;
}
$donationCodeCheck = $this->getDonationCodeStatus($host, $donationCode);
if ($donationCodeCheck !== 1) {
$fieldValue = '<div class="' . $this->randomClassName($session) . '">' . Text::sprintf('KR_DONATION_CODE_CHECK_DEFAULT', $host) . '</div>';
if ($donationCodeCheck === -1) {
$fieldValue .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . Text::_('KR_DONATION_CODE_CHECK_ERROR_SERVER') . '</div>';
}
if ($donationCodeCheck === -2) {
$fieldValue .= '<div class="' . $this->randomClassName($session, 'warning') . '">' . Text::_('KR_DONATION_CODE_CHECK_ERROR') . '</div>';
}
$session->set('field_value', $fieldValue, 'krdonationcodecheck');
$this->setHeadDataSession($session);
return $fieldValue;
}
$fieldValue = '';
if ($this->id == 'jform_params_donation' || $this->id == 'jform_donation') {
$fieldValue .= '<div class="' . $this->randomClassName($session, 'success') . '">' . Text::_('KR_DONATION_CODE_CHECK_SUCCESS') . '</div>';
}
$session->set('field_value', 1, 'krdonationcodecheck');
$this->setHeadDataSession($session);
return $fieldValue;
}
/**
* Creates random classes for the div containers
*
* @param object $session
* @param string $type
*
* @return string
*/
private function randomClassName(object $session, $type = 'error'): string
{
$fieldValueHeadSession = $session->get('field_value_head', '', 'krdonationcodecheck');
$characters = range('a', 'z');
$className = $characters[mt_rand(0, count($characters) - 1)];
$classNameLength = mt_rand(6, 12);
$className .= UserHelper::genRandomPassword($classNameLength);
$headData = '<style type="text/css">div.' . $className . '{border-radius: 2px; padding: 5px; font-size: 120%; margin: 4px 0 4px;';
if ($type == 'error') {
$headData .= ' border: 1px solid #DD87A2; background-color: #F9CAD9;';
} elseif ($type == 'success') {
$headData .= ' border: 1px solid #73F26F; background-color: #CBF7CA;';
} elseif ($type == 'warning') {
$headData .= ' border: 1px solid #F2DB82; background-color: #F7EECA;';
}
$headData .= '} @media(min-width:482px){div.' . $className . '{margin: 4px 0 4px -180px;}}</style>';
$session->set('field_value_head', $fieldValueHeadSession . $headData, 'krdonationcodecheck');
return $className;
}
/**
* Sets the CSS instructions (stored in the session) to the head
*
* @param object $session
*/
private function setHeadDataSession(object $session)
{
// Set the style data to the head of the page
$fieldValueHeadSession = $session->get('field_value_head', '', 'krdonationcodecheck');
if (!empty($fieldValueHeadSession)) {
$this->addHeadData($fieldValueHeadSession);
}
}
/**
* Add the style data to the head
*
* @param string $data
*/
private function addHeadData(string $data)
{
static $dataLoaded = false;
if (empty($dataLoaded)) {
$document = Factory::getDocument();
$document->addCustomTag($data);
$dataLoaded = true;
}
}
/**
* Check the entered donation code with the validation script that is located on a main and a fall back server
*
* @param string $host
* @param string $donationCode
*
* @return int|string
*/
private function getDonationCodeStatus(string $host, string $donationCode)
{
$donationCodeCheck = 0;
if (HttpFactory::getAvailableDriver(new Registry) == false) {
return -2;
}
if (!empty($host) && !empty($donationCode)) {
// First try it with the main validation server and with HTTPS
$urlCheck = $this->validationDomain . '/donationcode/validation.php?key=' . rawurlencode($donationCode) . '&host=' . rawurlencode($host);
try {
$donationCodeRequest = HttpFactory::getHttp()->get($urlCheck);
} catch (Exception $e) {
// Try it with the fall back server and without HTTPS
$urlCheckFallback = $this->validationDomainFallBack . '/donationcode/validation.php?key=' . rawurlencode($donationCode) . '&host=' . rawurlencode($host);
try {
$donationCodeRequest = HttpFactory::getHttp()->get($urlCheckFallback);
} catch (Exception $e) {
return -1;
}
}
if (!empty($donationCodeRequest->body)) {
if (preg_match('@(error|access denied)@i', $donationCodeRequest->body)) {
return -1;
}
$donationCodeCheck = (int)$donationCodeRequest->body;
}
}
return $donationCodeCheck;
}
/**
* @return string
*/
protected function getLabel()
{
return '';
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* @copyright
* @package Field - Kubik-Rubik Pro Available
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version Joomla! 3 - 3.1.1 - 2020-05-22
* @link https://kubik-rubik.de/
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('JPATH_PLATFORM') || die('Restricted access');
use Joomla\CMS\{Form\FormField, Factory};
/**
* Form Field class for Kubik-Rubik Joomla! Extensions.
* Adds a Pro action button with a link to the Pro landing page.
*/
class JFormFieldKrProButton extends FormField
{
protected $type = 'krProButton';
protected function getLabel()
{
return '';
}
protected function getInput()
{
$proLink = 'https://kubik-rubik.de/pro';
if (Factory::getApplication()->getLanguage()->getTag() === 'de-DE') {
$proLink = 'https://kubik-rubik.de/de/pro';
}
if (!empty($this->fieldname)) {
$proLink .= '?extension=' . $this->fieldname;
}
$proButton = '<div class="btn-wrapper" id="toolbar-pro"><a href="' . $proLink . '" title="Kubik-Rubik Joomla! Pro Extensions" target="_blank"><button class="btn btn-small btn-inverse"><span class="icon-cube icon-white" aria-hidden="true"></span> PRO</button></a></div>';
$document = Factory::getDocument();
$scriptDeclaration = 'jQuery(function($){$("#toolbar").append(\'' . $proButton . '\');});';
$document->addScriptDeclaration($scriptDeclaration);
return '';
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* @copyright
* @package Field - Kubik-Rubik Pro Input
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version Joomla! 3 - 3.0.1 - 2020-05-22
* @link https://kubik-rubik.de/
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('JPATH_PLATFORM') || die('Restricted access');
use Joomla\CMS\Form\FormField;
/**
* Form Field class for Kubik-Rubik Joomla! Extensions.
*/
class JFormFieldKrProInput extends FormField
{
protected $type = 'krProInput';
protected function getInput()
{
return '<span style="color: red; padding-top: 5px; display: inline-block;">PRO FEATURE</span>';
}
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* @copyright
* @package Field - Kubik-Rubik Title
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version Joomla! 3 - 3.5.1 - 2020-05-22
* @link https://kubik-rubik.de/
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('JPATH_PLATFORM') || die('Restricted access');
use Joomla\CMS\{Form\FormField, Factory, Language\Text};
/**
* Form Field class for Kubik-Rubik Joomla! Extensions.
* Provides a custom title and description field.
*/
class JFormFieldKrTitle extends FormField
{
protected $type = 'krTitle';
protected function getInput()
{
return '';
}
protected function getLabel()
{
// Use static variable to execute the CSS instruction only once
static $executeOnce = false;
if (empty($executeOnce)) {
$document = Factory::getDocument();
// Set label instruction only for option tabs
$fieldsets = $this->form->getFieldsets();
foreach ($fieldsets as $fieldset) {
$scriptDeclaration = 'jQuery(function($){$("div#attrib-' . $fieldset->name . ' .control-label:has(.clr)").addClass("krtitle");});';
if (empty($this->group)) {
$scriptDeclaration = 'jQuery(function($){$("div#' . $fieldset->name . ' .control-label:has(.clr)").addClass("krtitle");});';
}
$document->addScriptDeclaration($scriptDeclaration);
$document->addStyleDeclaration('div#attrib-' . $fieldset->name . ' .control-label.krtitle, div#' . $fieldset->name . ' .control-label.krtitle {width: 100%;}');
$document->addStyleDeclaration('div#attrib-' . $fieldset->name . ' .control-label, div#' . $fieldset->name . ' .control-label {width: 20em;}');
// Legacy
$document->addStyleDeclaration('div#attrib-' . $fieldset->name . ' label, div#' . $fieldset->name . ' label {width: 20em;}');
}
$document->addScriptDeclaration('jQuery(function($){$(".control-group:has(.krtitle-hidden)").remove();});');
$document->addStyleDeclaration('div.krtitle-title {padding: 5px 5px 5px 0; font-size: 16px; font-weight: bold;}');
$document->addStyleDeclaration('div.krtitle-description {padding: 5px 5px 5px 0; font-size: 14px;}');
$executeOnce = true;
}
$filterDonationCode = (string)$this->element['filter'];
if ($filterDonationCode === 'donation') {
$fieldValueSession = Factory::getSession()->get('field_value', '', 'krdonationcodecheck');
if ($fieldValueSession === 1) {
return '<div class="krtitle-hidden"></div>';
}
}
$label = '<div class="clr"></div>';
if ($this->element['label']) {
$label .= '<div class="krtitle-title">' . Text::_((string)$this->element['label']) . '</div>';
} else {
$label .= parent::getLabel();
}
if ($this->element['description']) {
$label .= '<div class="krtitle-description">' . Text::_((string)$this->element['description']) . '</div>';
}
return $label;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,106 @@
/* MILKBOX CSS */
#mbox-overlay{
background-color: #000; /* set the Milkbox overlay color // opacity: see the js options */
z-index:50000;
cursor: pointer;
}
/* Main box */
#mbox-mainbox{
/* For default width and height, see the js options */
top:10%;/* overwritten in the js options to properly position the main box when activated in a scrolled window */
background-color: #fff;/* set the main box background color */
border: 5px solid #fff;/* set the main box border */
padding:5px;/* set the main box padding */
}
/* Where the files actually are injected */
#mbox-filebox{ margin:0; padding:0; border:none; overflow:hidden; }
#mbox-filebox img,
#mbox-filebox iframe,
#mbox-filebox swf{
border:none;
}
/*this class is for styling the inner file box*/
/*these styles will be visible after the first is loaded */
.mbox-filebox-decorations{
border:none;
padding:0;
}
/* *** BOTTOM *** */
/* container for controls and caption */
#mbox-bottom {
/* set text options */
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 12px;
color: #656565;
line-height: 1.4em;
text-align: left;
padding-top:8px;
margin:0;
}
/* controls/navigation */
/* be careful if you change buttons dimensions */
#mbox-controls{
/*background-color:#0f0;*/
float:right;
width:27px;
padding-top:3px;
border-left:1px solid #9c9c9c;/* set nav border */
}
#mbox-count{
overflow:hidden;
padding-top:1px;
float:right;
text-align:right;
font-size:9px; /* count font size */
}
#mbox-close,
#mbox-prev,
#mbox-next,
#mbox-playpause{
float:right;
height:19px;
}
#mbox-prev,#mbox-next{ width:15px; }
#mbox-prev{ background: url(prev.gif) no-repeat; }/* IMAGE: prev */
#mbox-next{ background: url(next.gif) no-repeat; }/* IMAGE: next */
#mbox-playpause{ width:13px; }
#mbox-playpause{ background: url(play-pause.gif) no-repeat; }/* IMAGE: prev */
#mbox-close{
width:17px;
background:url(close.gif) no-repeat;/* IMAGE: close */
}
#mbox-prev:hover,
#mbox-next:hover,
#mbox-close:hover,
#mbox-playpause:hover{
background-position:0 -22px;
}
/* description */
#mbox-caption{
/*background-color:#f00;*/
margin-right:27px;
padding:0px 10px 0 0;
font-weight: normal;
text-align:justify;
overflow-x: hidden; /* make sure the controls at the right remain accessible, even for small images with very large filenames: those would otherwise overlap those controls at right */
}
.mbox-loading{ background:url(loading.gif) no-repeat center; }/* IMAGE: loading gif */
.mbox-reset{ clear:both; height:0; margin:0; padding:0; font-size:0; overflow:hidden; }

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

View File

@@ -0,0 +1,30 @@
#sb-title-inner,#sb-info-inner,#sb-loading-inner,div.sb-message{font-family:"HelveticaNeue-Light","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:200;color:#fff;}
#sb-container{position:fixed;margin:0;padding:0;top:0;left:0;z-index:999;text-align:left;visibility:hidden;display:none;}
#sb-overlay{position:relative;height:100%;width:100%;}
#sb-wrapper{position:absolute;visibility:hidden;width:100px;}
#sb-wrapper-inner{position:relative;border:1px solid #303030;overflow:hidden;height:100px;}
#sb-body{position:relative;height:100%;}
#sb-body-inner{position:absolute;height:100%;width:100%;}
#sb-player.html{height:100%;overflow:auto;}
#sb-body img{border:none;}
#sb-loading{position:relative;height:100%;}
#sb-loading-inner{position:absolute;font-size:14px;line-height:24px;height:24px;top:50%;margin-top:-12px;width:100%;text-align:center;}
#sb-loading-inner span{background:url(loading.gif) no-repeat;padding-left:34px;display:inline-block;}
#sb-body,#sb-loading{background-color:#060606;}
#sb-title,#sb-info{position:relative;margin:0;padding:0;overflow:hidden;}
#sb-title,#sb-title-inner{height:26px;line-height:26px;}
#sb-title-inner{font-size:16px;}
#sb-info,#sb-info-inner{height:20px;line-height:20px;}
#sb-info-inner{font-size:12px;}
#sb-nav{float:right;height:16px;padding:2px 0;width:45%;}
#sb-nav a{display:block;float:right;height:16px;width:16px;margin-left:3px;cursor:pointer;background-repeat:no-repeat;}
#sb-nav-close{background-image:url(close.png);}
#sb-nav-next{background-image:url(next.png);}
#sb-nav-previous{background-image:url(previous.png);}
#sb-nav-play{background-image:url(play.png);}
#sb-nav-pause{background-image:url(pause.png);}
#sb-counter{float:left;width:45%;}
#sb-counter a{padding:0 4px 0 0;text-decoration:none;cursor:pointer;color:#fff;}
#sb-counter a.sb-counter-current{text-decoration:underline;}
div.sb-message{font-size:12px;padding:10px;text-align:center;}
div.sb-message a:link,div.sb-message a:visited{color:#fff;text-decoration:underline;}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

View File

@@ -0,0 +1,84 @@
/* SLIMBOX */
#lbOverlay {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #000;
cursor: pointer;
}
#lbCenter, #lbBottomContainer {
position: absolute;
z-index: 9999;
overflow: hidden;
background-color: #fff;
}
.lbLoading {
background: #fff url(loading.gif) no-repeat center;
}
#lbImage {
position: absolute;
left: 0;
top: 0;
border: 10px solid #fff;
background-repeat: no-repeat;
}
#lbPrevLink, #lbNextLink {
display: block;
position: absolute;
top: 0;
width: 50%;
outline: none;
background-color: transparent;
}
#lbPrevLink {
left: 0;
}
#lbPrevLink:hover {
background: transparent url(prevlabel.gif) no-repeat 0 15%;
}
#lbNextLink {
right: 0;
}
#lbNextLink:hover {
background: transparent url(nextlabel.gif) no-repeat 100% 15%;
}
#lbBottom {
font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
font-size: 10px;
color: #666;
line-height: 1.4em;
text-align: left;
border: 10px solid #fff;
border-top-style: none;
}
#lbCloseLink {
display: block;
float: right;
width: 66px;
height: 22px;
background: transparent url(closelabel.gif) no-repeat center;
margin: 5px 0;
outline: none;
}
#lbCaption, #lbNumber {
margin-right: 71px;
}
#lbCaption {
font-weight: bold;
}

View File

@@ -0,0 +1,16 @@
/*!
Slimbox v1.8 - The ultimate lightweight Lightbox clone
(c) 2007-2011 Christophe Beyls <http://www.digitalia.be>
MIT-style license.
*/
var Slimbox=(function(){var F=window,n=Browser.ie6,u,g,G=-1,o,w,E,v,y,M,s,m={},t=new Image(),K=new Image(),I,a,h,q,J,e,H,c,A,L,x,i,d,C;F.addEvent("domready",function(){$(document.body).adopt($$(I=new Element("div#lbOverlay",{events:{click:D}}),a=new Element("div#lbCenter"),H=new Element("div#lbBottomContainer")).setStyle("display","none"));h=new Element("div#lbImage").inject(a).adopt(q=new Element("div",{styles:{position:"relative"}}).adopt(J=new Element("a#lbPrevLink[href=#]",{events:{click:B}}),e=new Element("a#lbNextLink[href=#]",{events:{click:f}})));c=new Element("div#lbBottom").inject(H).adopt(new Element("a#lbCloseLink[href=#]",{events:{click:D}}),A=new Element("div#lbCaption"),L=new Element("div#lbNumber"),new Element("div",{styles:{clear:"both"}}))});function z(){var N=F.getScroll(),O=F.getSize();$$(a,H).setStyle("left",N.x+(O.x/2));if(v){I.setStyles({left:N.x,top:N.y,width:O.x,height:O.y})}}function l(N){["object",n?"select":"embed"].forEach(function(P){Array.forEach(document.getElementsByTagName(P),function(Q){if(N){Q._slimbox=Q.style.visibility}Q.style.visibility=N?"hidden":Q._slimbox})});I.style.display=N?"":"none";var O=N?"addEvent":"removeEvent";F[O]("scroll",z)[O]("resize",z);document[O]("keydown",p)}function p(O){var N=O.code;return u.closeKeys.contains(N)?D():u.nextKeys.contains(N)?f():u.previousKeys.contains(N)?B():false}function B(){return b(w)}function f(){return b(E)}function b(N){if(N>=0){G=N;o=g[N][0];w=(G||(u.loop?g.length:0))-1;E=((G+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";m=new Image();m.onload=k;m.src=o}return false}function k(){a.className="";d.set(0);h.setStyles({backgroundImage:"url("+o+")",display:""});q.setStyle("width",m.width);$$(q,J,e).setStyle("height",m.height);A.set("html",g[G][1]||"");L.set("html",(((g.length>1)&&u.counterText)||"").replace(/{x}/,G+1).replace(/{y}/,g.length));if(w>=0){t.src=g[w][0]}if(E>=0){K.src=g[E][0]}M=h.offsetWidth;s=h.offsetHeight;var P=Math.max(0,y-(s/2)),N=0,O;if(a.offsetHeight!=s){N=i.start({height:s,top:P})}if(a.offsetWidth!=M){N=i.start({width:M,marginLeft:-M/2})}O=function(){H.setStyles({width:M,top:P+s,marginLeft:-M/2,visibility:"hidden",display:""});d.start(1)};if(N){i.chain(O)}else{O()}}function j(){if(w>=0){J.style.display=""}if(E>=0){e.style.display=""}C.set(-c.offsetHeight).start(0);H.style.visibility=""}function r(){m.onload=null;m.src=t.src=K.src=o;i.cancel();d.cancel();C.cancel();$$(J,e,h,H).setStyle("display","none")}function D(){if(G>=0){r();G=w=E=-1;a.style.display="none";x.cancel().chain(l).start(0)}return false}Element.implement({slimbox:function(N,O){$$(this).slimbox(N,O);return this}});Elements.implement({slimbox:function(N,Q,P){Q=Q||function(R){return[R.href,R.title]};P=P||function(){return true};var O=this;O.removeEvents("click").addEvent("click",function(){var R=O.filter(P,this);return Slimbox.open(R.map(Q),R.indexOf(this),N)});return O}});return{open:function(P,O,N){u=Object.append({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},N||{});x=new Fx.Tween(I,{property:"opacity",duration:u.overlayFadeDuration});i=new Fx.Morph(a,Object.append({duration:u.resizeDuration,link:"chain"},u.resizeTransition?{transition:u.resizeTransition}:{}));d=new Fx.Tween(h,{property:"opacity",duration:u.imageFadeDuration,onComplete:j});C=new Fx.Tween(c,{property:"margin-top",duration:u.captionAnimationDuration});if(typeof P=="string"){P=[[P,O]];O=0}y=F.getScrollTop()+(F.getHeight()/2);M=u.initialWidth;s=u.initialHeight;a.setStyles({top:Math.max(0,y-(s/2)),width:M,height:s,marginLeft:-M/2,display:""});v=n||(I.currentStyle&&(I.currentStyle.position!="fixed"));if(v){I.style.position="absolute"}x.set(0).start(u.overlayOpacity);z();l(1);g=P;u.loop=u.loop&&(g.length>1);return b(O)}}})();
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
$$("a[rel^=lightbox]").slimbox({/* Put custom options here */}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
};
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
window.addEvent("domready", Slimbox.scanPage);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,811 @@
/*
* VenoBox - jQuery Plugin
* version: 1.9.1
* @requires jQuery >= 1.7.0
*
* Examples at http://veno.es/venobox/
* License: MIT License
* License URI: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE
* Copyright 2013-2020 Nicola Franchini - @nicolafranchini
*
*/
/* global jQuery */
(function($){
"use strict";
var autoplay, bgcolor, blockleft, blocknum, blockshare, blocktitle, border, core, container, content, dest, extraCss,
framewidth, frameheight, gallItems, infinigall, items, keyNavigationDisabled, margine, numeratio,
overlayColor, overlay, title, thisgall, thenext, theprev, nextok, prevok, preloader, $preloader, navigation,
obj, gallIndex, startouch, vbheader, images, startY, startX, endY, endX, diff, diffX, diffY, threshold,
share, sharelinks, vbfooter, sharepos;
var pinIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.372-12 12 0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z" fill-rule="evenodd" clip-rule="evenodd"/></svg>';
var fbIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z"/></svg>';
var twitterIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z"/></svg>';
var linkedinIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z"/></svg>';
var downloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm2 9h-4v-1h4v1zm0-3v1h-4v-1h4zm-2 13l-6-6h4v-3h4v3h4l-6 6z"/></svg>';
$.fn.extend({
//plugin name - venobox
venobox: function(options) {
var plugin = this;
// default options
var defaults = {
arrowsColor : '#B6B6B6',
autoplay : false, // same as data-autoplay - thanks @codibit
bgcolor: '#fff',
border: '0',
closeBackground : 'transparent',
closeColor : "#d2d2d2",
framewidth: '',
frameheight: '',
gallItems: false,
infinigall: false,
htmlClose : '&times;',
htmlNext : '<span>Next</span>',
htmlPrev : '<span>Prev</span>',
numeratio: false,
numerationBackground : '#161617',
numerationColor : '#d2d2d2',
numerationPosition : 'top', // 'top' || 'bottom'
overlayClose: true, // disable overlay click-close - thanx @martybalandis
overlayColor : 'rgba(23,23,23,0.85)',
spinner : 'double-bounce', // available: 'rotating-plane' | 'double-bounce' | 'wave' | 'wandering-cubes' | 'spinner-pulse' | 'chasing-dots' | 'three-bounce' | 'circle' | 'cube-grid' | 'fading-circle' | 'folding-cube'
spinColor : '#d2d2d2',
titleattr: 'title', // specific attribute to get a title (e.g. [data-title]) - thanx @mendezcode
titleBackground: '#161617',
titleColor: '#d2d2d2',
titlePosition : 'top', // 'top' || 'bottom'
share: [], // ['facebook', 'twitter', 'linkedin', 'pinterest', 'download']
cb_pre_open: function(){ return true; }, // Callbacks - thanx @garyee
cb_post_open: function(){},
cb_pre_close: function(){ return true; },
cb_post_close: function(){},
cb_post_resize: function(){},
cb_after_nav: function(){},
cb_content_loaded: function(){},
cb_init: function(){}
};
var option = $.extend(defaults, options);
// callback plugin initialization
option.cb_init(plugin);
return this.each(function() {
obj = $(this);
// Prevent double initialization - thanx @matthistuff
if (obj.data('venobox')) {
return true;
}
// method to be used outside the plugin
plugin.VBclose = function() {
closeVbox();
};
obj.addClass('vbox-item');
obj.data('framewidth', option.framewidth);
obj.data('frameheight', option.frameheight);
obj.data('border', option.border);
obj.data('bgcolor', option.bgcolor);
obj.data('numeratio', option.numeratio);
obj.data('gallItems', option.gallItems);
obj.data('infinigall', option.infinigall);
obj.data('overlaycolor', option.overlayColor);
obj.data('titleattr', option.titleattr);
obj.data('share', option.share);
obj.data('venobox', true);
obj.on('click', function(e){
e.preventDefault();
obj = $(this);
// callback plugin initialization
var cb_pre_open = option.cb_pre_open(obj);
if (cb_pre_open === false) {
return false;
}
// methods to be used outside the plugin
plugin.VBnext = function() {
navigateGall(thenext);
};
plugin.VBprev = function() {
navigateGall(theprev);
};
overlayColor = obj.data('overlay') || obj.data('overlaycolor');
framewidth = obj.data('framewidth');
frameheight = obj.data('frameheight');
// set data-autoplay="true" for vimeo and youtube videos - thanx @zehfernandes
autoplay = obj.data('autoplay') || option.autoplay;
border = obj.data('border');
bgcolor = obj.data('bgcolor');
nextok = false;
prevok = false;
keyNavigationDisabled = false;
// set a different url to be loaded using data-href="" - thanx @pixeline
dest = obj.data('href') || obj.attr('href');
extraCss = obj.data( 'css' ) || '';
title = obj.attr(obj.data('titleattr')) || '';
share = obj.data('share');
preloader = '<div class="vbox-preloader">';
switch (option.spinner) {
case 'rotating-plane':
preloader += '<div class="sk-rotating-plane"></div>';
break;
case 'double-bounce':
preloader += '<div class="sk-double-bounce">'+
'<div class="sk-child sk-double-bounce1"></div>'+
'<div class="sk-child sk-double-bounce2"></div>'+
'</div>';
break;
case 'wave':
preloader += '<div class="sk-wave">'+
'<div class="sk-rect sk-rect1"></div>'+
'<div class="sk-rect sk-rect2"></div>'+
'<div class="sk-rect sk-rect3"></div>'+
'<div class="sk-rect sk-rect4"></div>'+
'<div class="sk-rect sk-rect5"></div>'+
'</div>';
break;
case 'wandering-cubes':
preloader += '<div class="sk-wandering-cubes">'+
'<div class="sk-cube sk-cube1"></div>'+
'<div class="sk-cube sk-cube2"></div>'+
'</div>';
break;
case 'spinner-pulse':
preloader += '<div class="sk-spinner sk-spinner-pulse"></div>';
break;
case 'chasing-dots':
preloader += '<div class="sk-chasing-dots">'+
'<div class="sk-child sk-dot1"></div>'+
'<div class="sk-child sk-dot2"></div>'+
'</div>';
break;
case 'three-bounce':
preloader += '<div class="sk-three-bounce">'+
'<div class="sk-child sk-bounce1"></div>'+
'<div class="sk-child sk-bounce2"></div>'+
'<div class="sk-child sk-bounce3"></div>'+
'</div>';
break;
case 'circle':
preloader += '<div class="sk-circle">'+
'<div class="sk-circle1 sk-child"></div>'+
'<div class="sk-circle2 sk-child"></div>'+
'<div class="sk-circle3 sk-child"></div>'+
'<div class="sk-circle4 sk-child"></div>'+
'<div class="sk-circle5 sk-child"></div>'+
'<div class="sk-circle6 sk-child"></div>'+
'<div class="sk-circle7 sk-child"></div>'+
'<div class="sk-circle8 sk-child"></div>'+
'<div class="sk-circle9 sk-child"></div>'+
'<div class="sk-circle10 sk-child"></div>'+
'<div class="sk-circle11 sk-child"></div>'+
'<div class="sk-circle12 sk-child"></div>'+
'</div>';
break;
case 'cube-grid':
preloader += '<div class="sk-cube-grid">'+
'<div class="sk-cube sk-cube1"></div>'+
'<div class="sk-cube sk-cube2"></div>'+
'<div class="sk-cube sk-cube3"></div>'+
'<div class="sk-cube sk-cube4"></div>'+
'<div class="sk-cube sk-cube5"></div>'+
'<div class="sk-cube sk-cube6"></div>'+
'<div class="sk-cube sk-cube7"></div>'+
'<div class="sk-cube sk-cube8"></div>'+
'<div class="sk-cube sk-cube9"></div>'+
'</div>';
break;
case 'fading-circle':
preloader += '<div class="sk-fading-circle">'+
'<div class="sk-circle1 sk-circle"></div>'+
'<div class="sk-circle2 sk-circle"></div>'+
'<div class="sk-circle3 sk-circle"></div>'+
'<div class="sk-circle4 sk-circle"></div>'+
'<div class="sk-circle5 sk-circle"></div>'+
'<div class="sk-circle6 sk-circle"></div>'+
'<div class="sk-circle7 sk-circle"></div>'+
'<div class="sk-circle8 sk-circle"></div>'+
'<div class="sk-circle9 sk-circle"></div>'+
'<div class="sk-circle10 sk-circle"></div>'+
'<div class="sk-circle11 sk-circle"></div>'+
'<div class="sk-circle12 sk-circle"></div>'+
'</div>';
break;
case 'folding-cube':
preloader += '<div class="sk-folding-cube">'+
'<div class="sk-cube1 sk-cube"></div>'+
'<div class="sk-cube2 sk-cube"></div>'+
'<div class="sk-cube4 sk-cube"></div>'+
'<div class="sk-cube3 sk-cube"></div>'+
'</div>';
break;
}
preloader += '</div>';
navigation = '<a class="vbox-next">' + option.htmlNext + '</a><a class="vbox-prev">' + option.htmlPrev + '</a>';
vbheader = '<div class="vbox-title"></div><div class="vbox-left"><div class="vbox-num">0/0</div></div><div class="vbox-close">' + option.htmlClose + '</div>';
vbfooter = '<div class="vbox-share"></div>';
core = '<div class="vbox-overlay ' + extraCss + '" style="background:'+ overlayColor +'">'+
preloader + '<div class="vbox-container"><div class="vbox-content"></div></div>' + vbheader + navigation + vbfooter + '</div>';
$('body').append(core).addClass('vbox-open');
$('.vbox-preloader div:not(.sk-circle) .sk-child, .vbox-preloader .sk-rotating-plane, .vbox-preloader .sk-rect, .vbox-preloader div:not(.sk-folding-cube) .sk-cube, .vbox-preloader .sk-spinner-pulse').css('background-color', option.spinColor);
overlay = $('.vbox-overlay');
container = $('.vbox-container');
content = $('.vbox-content');
blockleft = $('.vbox-left');
blocknum = $('.vbox-num');
blockshare = $('.vbox-share');
blocktitle = $('.vbox-title');
$preloader = $('.vbox-preloader');
$preloader.show();
if (option.titlePosition == 'top') {
sharepos = 'bottom';
} else {
sharepos = 'top';
}
blockshare.css(sharepos, '-1px');
blockshare.css({
'color' : option.titleColor,
'fill' : option.titleColor,
'background-color' : option.titleBackground
});
blocktitle.css(option.titlePosition, '-1px');
blocktitle.css({
'color' : option.titleColor,
'background-color' : option.titleBackground
});
$('.vbox-close').css({
'color' : option.closeColor,
'background-color' : option.closeBackground
});
blockleft.css(option.numerationPosition, '-1px');
blockleft.css({
'color' : option.numerationColor,
'background-color' : option.numerationBackground
});
$('.vbox-next span, .vbox-prev span').css({
'border-top-color' : option.arrowsColor,
'border-right-color' : option.arrowsColor
});
content.html('');
content.css('opacity', '0');
overlay.css('opacity', '0');
checknav();
// fade in overlay
overlay.animate({opacity:1}, 250, function(){
if (obj.data('vbtype') == 'iframe') {
loadIframe();
} else if (obj.data('vbtype') == 'inline') {
loadInline();
} else if (obj.data('vbtype') == 'ajax') {
loadAjax();
} else if (obj.data('vbtype') == 'video') {
loadVid(autoplay);
} else {
content.html('<img src="'+dest+'">');
preloadFirst();
}
option.cb_post_open(obj, gallIndex, thenext, theprev);
});
/* -------- KEYBOARD ACTIONS -------- */
$('body').keydown(keyboardHandler);
/* -------- PREVGALL -------- */
$('.vbox-prev').on('click', function(){
navigateGall(theprev);
});
/* -------- NEXTGALL -------- */
$('.vbox-next').on('click', function(){
navigateGall(thenext);
});
return false;
}); // click
/* -------- CHECK NEXT / PREV -------- */
function checknav(){
thisgall = obj.data('gall');
numeratio = obj.data('numeratio');
gallItems = obj.data('gallItems');
infinigall = obj.data('infinigall');
share = obj.data('share');
blockshare.html('');
if ( obj.data('vbtype') !== 'iframe' && obj.data('vbtype') !== 'inline' && obj.data('vbtype') !== 'ajax' ) {
sharelinks = {
pinterest : '<a target="_blank" href="https://pinterest.com/pin/create/button/?url='+obj.prop('href')+'&media='+obj.prop('href')+'&description='+title+'">'+pinIcon+'</a>',
facebook : '<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='+obj.prop('href')+'">'+fbIcon+'</a>',
twitter : '<a target="_blank" href="https://twitter.com/intent/tweet?text='+title+'&url='+obj.prop('href')+'">'+twitterIcon+'</a>',
linkedin : '<a target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url='+obj.prop('href')+'">'+linkedinIcon+'</a>',
download : '<a target="_blank" href="'+obj.prop('href')+'">'+downloadIcon+'</a>'
};
$.each( share, function( key, value ) {
blockshare.append(sharelinks[value]);
});
}
if (gallItems) {
items = gallItems;
} else {
items = $('.vbox-item[data-gall="' + thisgall + '"]');
}
if (items.length < 2) {
infinigall = false;
numeratio = false;
}
thenext = items.eq( items.index(obj) + 1 );
theprev = items.eq( items.index(obj) - 1 );
if (!thenext.length && infinigall === true) {
thenext = items.eq(0);
}
// update gall numeration
if (items.length >= 1) {
gallIndex = items.index(obj)+1;
blocknum.html(gallIndex + ' / ' + items.length);
} else {
gallIndex = 1;
}
if (numeratio === true) {
blocknum.show();
} else {
blocknum.hide();
}
// update title
if (title !== '') {
blocktitle.show();
} else {
blocktitle.hide();
}
// update navigation arrows
if (!thenext.length && infinigall !== true) {
$('.vbox-next').css('display', 'none');
nextok = false;
} else {
$('.vbox-next').css('display', 'block');
nextok = true;
}
if (items.index(obj) > 0 || infinigall === true) {
$('.vbox-prev').css('display', 'block');
prevok = true;
} else {
$('.vbox-prev').css('display', 'none');
prevok = false;
}
// activate swipe
if (prevok === true || nextok === true) {
content.on(TouchMouseEvent.DOWN, onDownEvent);
content.on(TouchMouseEvent.MOVE, onMoveEvent);
content.on(TouchMouseEvent.UP, onUpEvent);
}
}
/* -------- gallery navigation -------- */
function navigateGall(destination) {
if (destination.length < 1) {
return false;
}
if (keyNavigationDisabled) {
return false;
}
keyNavigationDisabled = true;
overlayColor = destination.data('overlay') || destination.data('overlaycolor');
framewidth = destination.data('framewidth');
frameheight = destination.data('frameheight');
border = destination.data('border');
bgcolor = destination.data('bgcolor');
dest = destination.data('href') || destination.attr('href');
autoplay = destination.data('autoplay');
title = (destination.data('titleattr') && destination.attr(destination.data('titleattr'))) || '';
// swipe out item
if (destination === theprev) {
content.addClass('vbox-animated').addClass('swipe-right');
}
if (destination === thenext) {
content.addClass('vbox-animated').addClass('swipe-left');
}
$preloader.show();
content.animate({
opacity : 0,
}, 500, function(){
overlay.css('background',overlayColor);
content
.removeClass('vbox-animated')
.removeClass('swipe-left')
.removeClass('swipe-right')
.css({'margin-left': 0,'margin-right': 0});
if (destination.data('vbtype') == 'iframe') {
loadIframe();
} else if (destination.data('vbtype') == 'inline') {
loadInline();
} else if (destination.data('vbtype') == 'ajax') {
loadAjax();
} else if (destination.data('vbtype') == 'video') {
loadVid(autoplay);
} else {
content.html('<img src="'+dest+'">');
preloadFirst();
}
obj = destination;
checknav();
keyNavigationDisabled = false;
option.cb_after_nav(obj, gallIndex, thenext, theprev);
});
}
/* -------- KEYBOARD HANDLER -------- */
function keyboardHandler(e) {
if (e.keyCode === 27) { // esc
closeVbox();
}
if (e.keyCode == 37 && prevok === true) { // left
navigateGall(theprev);
}
if (e.keyCode == 39 && nextok === true) { // right
navigateGall(thenext);
}
}
/* -------- CLOSE VBOX -------- */
function closeVbox(){
var cb_pre_close = option.cb_pre_close(obj, gallIndex, thenext, theprev);
if (cb_pre_close === false) {
return false;
}
$('body').off('keydown', keyboardHandler).removeClass('vbox-open');
obj.focus();
overlay.animate({opacity:0}, 500, function(){
overlay.remove();
keyNavigationDisabled = false;
option.cb_post_close();
});
}
/* -------- CLOSE CLICK -------- */
var closeclickclass = '.vbox-overlay';
if(!option.overlayClose){
closeclickclass = '.vbox-close'; // close only on X
}
$('body').on('click touchstart', closeclickclass, function(e){
if ($(e.target).is('.vbox-overlay') ||
$(e.target).is('.vbox-content') ||
$(e.target).is('.vbox-close') ||
$(e.target).is('.vbox-preloader') ||
$(e.target).is('.vbox-container')
) {
closeVbox();
}
});
startX = 0;
endX = 0;
diff = 0;
threshold = 50;
startouch = false;
function onDownEvent(e){
content.addClass('vbox-animated');
startY = endY = e.pageY;
startX = endX = e.pageX;
startouch = true;
}
function onMoveEvent(e){
if (startouch === true) {
endX = e.pageX;
endY = e.pageY;
diffX = endX - startX;
diffY = endY - startY;
var absdiffX = Math.abs(diffX);
var absdiffY = Math.abs(diffY);
if ((absdiffX > absdiffY) && (absdiffX <= 100)) {
e.preventDefault();
content.css('margin-left', diffX);
}
}
}
function onUpEvent(e){
if (startouch === true) {
startouch = false;
var subject = obj;
var change = false;
diff = endX - startX;
if (diff < 0 && nextok === true) {
subject = thenext;
change = true;
}
if (diff > 0 && prevok === true) {
subject = theprev;
change = true;
}
if (Math.abs(diff) >= threshold && change === true) {
navigateGall(subject);
} else {
content.css({'margin-left': 0,'margin-right': 0});
}
}
}
/* == GLOBAL DECLERATIONS == */
var TouchMouseEvent = {
DOWN: "touchmousedown",
UP: "touchmouseup",
MOVE: "touchmousemove"
};
/* == EVENT LISTENERS == */
var onMouseEvent = function(event) {
var type;
switch (event.type) {
case "mousedown": type = TouchMouseEvent.DOWN; break;
case "mouseup": type = TouchMouseEvent.UP; break;
case "mouseout": type = TouchMouseEvent.UP; break;
case "mousemove": type = TouchMouseEvent.MOVE; break;
default:
return;
}
var touchMouseEvent = normalizeEvent(type, event, event.pageX, event.pageY);
$(event.target).trigger(touchMouseEvent);
};
var onTouchEvent = function(event) {
var type;
switch (event.type) {
case "touchstart": type = TouchMouseEvent.DOWN; break;
case "touchend": type = TouchMouseEvent.UP; break;
case "touchmove": type = TouchMouseEvent.MOVE; break;
default:
return;
}
var touch = event.originalEvent.touches[0];
var touchMouseEvent;
if (type == TouchMouseEvent.UP) {
touchMouseEvent = normalizeEvent(type, event, null, null);
} else {
touchMouseEvent = normalizeEvent(type, event, touch.pageX, touch.pageY);
}
$(event.target).trigger(touchMouseEvent);
};
/* == NORMALIZE == */
var normalizeEvent = function(type, original, x, y) {
return $.Event(type, {
pageX: x,
pageY: y,
originalEvent: original
});
};
/* == LISTEN TO ORIGINAL EVENT == */
if ("ontouchstart" in window) {
$(document).on("touchstart", onTouchEvent);
$(document).on("touchmove", onTouchEvent);
$(document).on("touchend", onTouchEvent);
} else {
$(document).on("mousedown", onMouseEvent);
$(document).on("mouseup", onMouseEvent);
$(document).on("mouseout", onMouseEvent);
$(document).on("mousemove", onMouseEvent);
}
/* -------- LOAD AJAX -------- */
function loadAjax(){
$.ajax({
url: dest,
cache: false
}).done(function( msg ) {
content.html('<div class="vbox-inline">'+ msg +'</div>');
preloadFirst();
}).fail(function() {
content.html('<div class="vbox-inline"><p>Error retrieving contents, please retry</div>');
updateoverlay();
});
}
/* -------- LOAD IFRAME -------- */
function loadIframe(){
content.html('<iframe class="venoframe" src="'+dest+'"></iframe>');
// $('.venoframe').load(function(){ // valid only for iFrames in same domain
updateoverlay();
// });
}
/* -------- LOAD VIDEOs -------- */
function loadVid(autoplay){
var player;
var videoObj = parseVideo(dest);
// set rel=0 to hide related videos at the end of YT + optional autoplay
var stringAutoplay = autoplay ? "?rel=0&autoplay=1" : "?rel=0";
var queryvars = stringAutoplay + getUrlParameter(dest);
if (videoObj.type == 'vimeo') {
player = 'https://player.vimeo.com/video/';
} else if (videoObj.type == 'youtube') {
player = 'https://www.youtube.com/embed/';
}
content.html('<iframe class="venoframe vbvid" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="autoplay" frameborder="0" src="'+player+videoObj.id+queryvars+'"></iframe>');
updateoverlay();
}
/**
* Parse Youtube or Vimeo videos and get host & ID
*/
function parseVideo (url) {
url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
var type;
if (RegExp.$3.indexOf('youtu') > -1) {
type = 'youtube';
} else if (RegExp.$3.indexOf('vimeo') > -1) {
type = 'vimeo';
}
return {
type: type,
id: RegExp.$6
};
}
/**
* get additional video url parameters
*/
function getUrlParameter(name) {
var result = '';
var sPageURL = decodeURIComponent(name);
var firstsplit = sPageURL.split('?');
if (firstsplit[1] !== undefined) {
var sURLVariables = firstsplit[1].split('&');
var sParameterName;
var i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
result = result + '&'+ sParameterName[0]+'='+ sParameterName[1];
}
}
return encodeURI(result);
}
/* -------- LOAD INLINE -------- */
function loadInline(){
content.html('<div class="vbox-inline">'+$(dest).html()+'</div>');
updateoverlay();
}
/* -------- PRELOAD IMAGE -------- */
function preloadFirst(){
images = content.find('img');
if (images.length) {
images.each(function(){
$(this).one('load', function() {
updateoverlay();
});
});
} else {
updateoverlay();
}
}
/* -------- FADE-IN THE NEW CONTENT -------- */
function updateoverlay(){
blocktitle.html(title);
content.find(">:first-child").addClass('vbox-figlio').css({
'width': framewidth,
'height': frameheight,
'padding': border,
'background': bgcolor
});
$('img.vbox-figlio').on('dragstart', function(event) {
event.preventDefault();
});
// reset content scroll
container.scrollTop(0);
updateOL();
content.animate({
'opacity': '1'
},'slow', function(){
$preloader.hide();
});
option.cb_content_loaded(obj, gallIndex, thenext, theprev);
}
/* -------- CENTER FRAME -------- */
function updateOL(){
var sonH = content.outerHeight();
var finH = $(window).height();
if (sonH + 60 < finH) {
margine = (finH - sonH)/2;
} else {
margine = '30px';
}
content.css('margin-top', margine);
content.css('margin-bottom', margine);
option.cb_post_resize();
}
$(window).resize(function(){
if($('.vbox-content').length){
setTimeout(updateOL(), 800);
}
});
}); // each
} // venobox
}); // extend
})(jQuery);

View File

@@ -0,0 +1,93 @@
<?php
/**
* @copyright
* @package RIE - Random Image Extended for Joomla! 3.x
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version 3.4.0-FREE - 2020-09-01
* @link https://kubik-rubik.de/rie-random-image-extended
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('_JEXEC') || die('Restricted access');
use Joomla\CMS\HTML\HTMLHelper;
echo '<!-- RIE - Random Image Extended - Kubik-Rubik Joomla! Extensions - Viktor Vogel -->';
?>
<div class="random_image_extended <?php echo $moduleclassSfx ?>">
<?php if ($imageRotator) : ?>
<?php $image = $imagesDisplay[0]; ?>
<div id="slideshow-container">
<?php if (empty($linkFolder)) : ?>
<?php echo HTMLHelper::_('image', $image->folder . '/' . $image->link, $image->name, ['width' => $image->width, 'height' => $image->height, 'class' => 'active']); ?>
<?php else : ?>
<?php echo HTMLHelper::_('image', $image->folder . '/thumbs/' . $image->link, $image->name, ['width' => $image->width, 'height' => $image->height, 'class' => 'active']); ?>
<?php endif; ?>
<?php foreach ($images as $image) : ?>
<?php if (empty($linkFolder)) : ?>
<?php echo HTMLHelper::_('image', $image->folder . '/' . $image->link, $image->name, ['width' => $image->width, 'height' => $image->height]); ?>
<?php else : ?>
<?php echo HTMLHelper::_('image', $image->folder . '/thumbs/' . $image->link, $image->name, ['width' => $image->width, 'height' => $image->height]); ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php else : ?>
<?php foreach ($imagesDisplay as $image) : ?>
<?php if (empty($linkFolder)) : ?>
<?php $imagePath = HTMLHelper::_('image', $image->folder . '/' . $image->link, $image->name, ['width' => $image->width]); ?>
<?php else : ?>
<?php $imagePath = HTMLHelper::_('image', $image->folder . '/thumbs/' . $image->link, $image->name, ['width' => $image->width]); ?>
<?php endif; ?>
<div class="random_image_extended_single">
<?php if ($lightbox && (empty($link) && empty($image->linkto))) : ?>
<a href="<?php echo $image->folder . '/' . $image->link ?>" title="<?php echo $image->name; ?>" <?php echo $lightboxAttribute; ?>>
<?php echo $imagePath; ?>
</a>
<?php endif; ?>
<?php if (!empty($link) || !empty($image->linkto)) : ?>
<?php if (!empty($image->linkto)) : ?>
<a href="<?php echo $image->linkto; ?>" title="<?php echo $image->name; ?>" <?php echo ($newWindow) ? 'target="_blank"' : ''; ?>>
<?php echo $imagePath; ?>
</a>
<?php elseif (!empty($link)) : ?>
<a href="<?php echo $link; ?>" title="<?php echo $link; ?>" <?php echo ($newWindow) ? 'target="_blank"' : ''; ?>>
<?php echo $imagePath; ?>
</a>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($caption)) : ?>
<div class="random_image_extended <?php echo $moduleclassSfx ?>">
<em>
<?php echo $caption; ?>
</em>
</div>
<?php endif; ?>
<?php if ($imageName) : ?>
<div class="random_image_extended <?php echo $moduleclassSfx ?>">
<strong>
<?php echo $image->name; ?>
</strong>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php if ($allPics && $lightbox && empty($link)) : ?>
<?php foreach ($images as $image) : ?>
<a <?php echo $lightboxAttribute; ?> href="<?php echo $image->folder . '/' . $image->link; ?>" title="<?php echo $image->name; ?>"></a>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,34 @@
<?php
/**
* @copyright
* @package RIE - Random Image Extended for Joomla! 3.x
* @author Viktor Vogel <admin@kubik-rubik.de>
* @version 3.4.0-FREE - 2020-09-01
* @link https://kubik-rubik.de/rie-random-image-extended
*
* @license GNU/GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
defined('_JEXEC') || die('Restricted access');
use Joomla\CMS\Language\Text;
echo '<!-- RIE - Random Image Extended - Kubik-Rubik Joomla! Extensions - Viktor Vogel -->';
?>
<div class="random_image_extended <?php echo $moduleclassSfx ?>">
<p>
<?php echo Text::_('MOD_RANDOM_IMAGE_EXTENDED_NOIMAGES'); ?>
</p>
</div>