Skip to content

Commit

Permalink
[v.1.55] Ready to release
Browse files Browse the repository at this point in the history
Added missing gk_box style and few small fixes
  • Loading branch information
dziudek committed Jul 30, 2016
1 parent c3beb58 commit efc712c
Show file tree
Hide file tree
Showing 9 changed files with 594 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mod_image_show_gk4/mod_image_show_gk4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="module" version="3.0" client="site" method="upgrade">
<name>Image Show GK4</name>
<author>GavickPro</author>
<creationDate>24/03/2016</creationDate>
<creationDate>30/07/2016</creationDate>
<copyright>Copyright (C) 2011-2016 GavickPro. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<authorEmail>info@gavick.com</authorEmail>
<authorUrl>www.gavickpro.com</authorUrl>
<version>1.54.1</version>
<version>1.55</version>
<description><![CDATA[
<style type="text/css">
span.readonly { padding: 10px; font-family: Arial; font-size:13px !important; font-weight: normal !important; text-align: justify; color: #4d4d4d; line-height: 24px; }
Expand All @@ -21,7 +21,7 @@
span.readonly p.license { border-top: 1px solid #eee; font-size: 11px; margin: 30px 26px 0; padding: 6px 0; }
</style>
<span class="readonly"><h1>Image Show GK4<small>ver. 1.54.1</small></h1><p>GK4 is new generation of our extensions dedicated to Joomla 1.6+.</p><p>With Image Show GK4 module, you can create slideshow on a site which include various images and article fragments or texts defined by a user. Thanks to slide management system integrated in the module, its support is very easy, intuitive and fast. With the new method of creating module styles you can easily move your slideshow style from one template to other template.</p> <p class='homepage'><a href='http://tools.gavick.com/image-show.html' target='_blank'>Learn more at the Image Show GK4 project website.</a></p><p class='license'>Image Show GK4 is released under the <a target="_blank" href="http://www.gnu.org/licenses/gpl-2.0.html">GNU/GPL v2 license.</a></p></span>
<span class="readonly"><h1>Image Show GK4<small>ver. 1.55</small></h1><p>GK4 is new generation of our extensions dedicated to Joomla 1.6+.</p><p>With Image Show GK4 module, you can create slideshow on a site which include various images and article fragments or texts defined by a user. Thanks to slide management system integrated in the module, its support is very easy, intuitive and fast. With the new method of creating module styles you can easily move your slideshow style from one template to other template.</p> <p class='homepage'><a href='http://tools.gavick.com/image-show.html' target='_blank'>Learn more at the Image Show GK4 project website.</a></p><p class='license'>Image Show GK4 is released under the <a target="_blank" href="http://www.gnu.org/licenses/gpl-2.0.html">GNU/GPL v2 license.</a></p></span>
<span class='tooltip-content'>Advanced slideshow module for Joomla! 3.x</span>
]]></description>
Expand Down
15 changes: 15 additions & 0 deletions mod_image_show_gk4/styles/gk_box/class.image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @author: GavickPro
* @copyright: 2008-2012
**/

// no direct access
defined('_JEXEC') or die('Restricted access');

class GKIS_Box_Image extends GKIS_Image {

}

/* eof */
136 changes: 136 additions & 0 deletions mod_image_show_gk4/styles/gk_box/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?php

/**
* GK Image Show - main PHP file
* @package Joomla!
* @Copyright (C) 2009-2012 Gavick.com
* @ All rights reserved
* @ Joomla! is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @ version $Revision: GK4 1.0 $
**/

// no direct access
defined('_JEXEC') or die;
// Image class loading
require_once (dirname(__FILE__).DS.'class.image.php');
// Model class loading
require_once (dirname(__FILE__).DS.'model.php');

class GKIS_gk_box_Controller {
// configuration array
private $config;
// module info
private $module;
// article data
private $articles;
private $articlesK2;
// constructor
function __construct($module, $config) {
// init the style config
$this->config = $config;
// init the module info
$this->module = $module;
// init the articles array
$this->articles = array();
$this->articlesK2 = array();
// check the module images
$this->checkImages();
// get the articles data
$this->getArticleData();
// generate the view
$this->generateView();
}
// check the images
function checkImages() {
// if the thumbnail generation is enabled
if($this->config['generate_thumbnails'] == 1) {
// basic images params
$img_width = $this->config['config']->gk_box->gk_box_image_width;
$img_height = $this->config['config']->gk_box->gk_box_image_height;
$thumb_width = $this->config['config']->gk_box->gk_box_thumb_width;
$thumb_height = $this->config['config']->gk_box->gk_box_thumb_height;
$img_bg = $this->config['config']->gk_box->gk_box_image_bg;
$quality = $this->config['config']->gk_box->gk_box_quality;
// check the slides
foreach($this->config['image_show_data'] as $slide) {
$stretch = ($slide->stretch == 'nostretch') ? false : true;
GKIS_Box_Image::createThumbnail($slide->image, $this->config, $img_width, $img_height, $img_bg, $stretch, $quality);
// Small hack to create a different width thumbnail ;)
$thumb_config = $this->config;
$thumb_config['module_id'] = '-thumb-' . $thumb_config['module_id'];
GKIS_Box_Image::createThumbnail($slide->image, $thumb_config, $thumb_width, $thumb_height, $img_bg, $stretch, $quality);
}
}
}
// get the articles data
function getArticleData() {
// create the array
$ids = array();
$idsK2 = array();
// generate the content of the array
foreach($this->config['image_show_data'] as $slide) {
if($slide->type == 'article') {
if($slide->art_id) {
array_push($ids, $slide->art_id);
} else {
array_push($ids, 0);
}
}

if($slide->type == 'k2') {
if($slide->artK2_id) {
array_push($idsK2, $slide->artK2_id);
} else {
array_push($idsK2, 0);
}
}
}
// get the data
if(count($idsK2) > 0) {
$this->articlesK2 = GKIS_gk_box_Model::getDataK2($idsK2);
}
if(count($ids) > 0) {
$this->articles = GKIS_gk_box_Model::getData($ids);
}
}
// generate view
function generateView() {
// generate the head section
$document = JFactory::getDocument();
$uri = JURI::getInstance();
// get the head data
$headData = $document->getHeadData();
// generate keys of script section
$headData_js_keys = array_keys($headData["scripts"]);
// generate keys of css section
$headData_css_keys = array_keys($headData["style"]);
// set variables for false
$engine_founded = false;
$css_founded = false;
// searching engine in scripts paths
if(array_search($uri->root().'modules/mod_image_show_gk4/styles/'.$this->config['styles'].'/engine.js', $headData_js_keys) > 0) {
$engine_founded = true;
}
// searching css in CSSs paths
if(array_search($uri->root().'modules/mod_image_show_gk4/styles/'.$this->config['styles'].'/style.css', $headData_css_keys) > 0) {
$css_founded = true;
}
// if mootools file doesn't exists in document head section
if(!$engine_founded){
// add new script tag connected with mootools from module
$document->addScript($uri->root().'modules/mod_image_show_gk4/styles/'.$this->config['styles'].'/engine.js');
}
// if CSS not found
if(!$css_founded && $this->config['use_style_css'] == 1) {
// add stylesheets to document header
$document->addStyleSheet($uri->root().'modules/mod_image_show_gk4/styles/'.$this->config['styles'].'/style.css' );
}
// add script fragment
$document->addScriptDeclaration('try {$Gavick;}catch(e){$Gavick = {};};$Gavick["gkIs-'.$this->config['module_id'].'"] = { "anim_speed": '.$this->config['config']->gk_box->gk_box_animation_speed.', "anim_interval": '.$this->config['config']->gk_box->gk_box_animation_interval.', "autoanim": '.$this->config['config']->gk_box->gk_box_autoanimation.', "slide_links": '.$this->config['config']->gk_box->gk_box_slide_links.' };');
// load view
require(dirname(__FILE__).DS.'view.php');
}
}

// EOF
112 changes: 112 additions & 0 deletions mod_image_show_gk4/styles/gk_box/engine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
jQuery(window).load(function () {
jQuery('.gkIsWrapper-gk_box').each(function(i, el) {
el = jQuery(el);
var elID = el.attr("id");
var wrapper = jQuery('#' + elID);
var $G = $Gavick[elID];
var slides = [];
var links = [];
var imagesToLoad = [];
// animation variables
$G['animation_timer'] = false;
// blank flag
$G['blank'] = false;
// load the images
wrapper.find('.gkIsSlide').each(function(i, el) {
el = jQuery(el);
var newImg = new jQuery('<img title="'+el.attr('title')+'" data-link="'+el.attr('data-link') + '" class="gkIsImage" style="z-index: '+el.css('z-index')+';" src="'+el.attr('data-path') + '">');
imagesToLoad.push(newImg);
newImg.insertBefore(el);
el.remove();
});
//
var time = setInterval(function() {
var process = 0;
jQuery(imagesToLoad).each(function(i, el) {
if (jQuery(el)[0].complete){ process++; }
});
//
if (process === imagesToLoad.length) {
clearInterval(time);
//
$G['actual_slide'] = 0;
//
wrapper.find('.gkIsImage').each(function(i, elmt) {
slides[i] = jQuery(elmt);
links[i] = slides[i].attr('data-link');
});
//
if ($G['slide_links']) {
wrapper.find('.gkIsImage').on('click', function() {
window.location = links[$G['actual_slide']];
});

wrapper.find('.gkIsImage').css('cursor', 'pointer');
}
//
wrapper.find('.gkIsPagination li').each(function(i, item) {
jQuery(item).click(function() {
if (i !== $G['actual_slide']) {
$G['blank'] = true;
gk_box_autoanimate($G, wrapper, 'next', i);
}
});
});
// auto-animation
if ($G['autoanim'] == 1) {
$G['animation_timer'] = setTimeout(function() {
gk_box_autoanimate($G, wrapper, 'next', null);
}, $G['anim_interval']);
}
}
}, 250);
});
});

var gk_box_animate = function($G, wrapper, imgPrev, imgNext) {
//
jQuery(imgNext).animate({
opacity: 1
}, $G['anim_speed'], function() {
jQuery(imgPrev).removeClass('active');
jQuery(imgNext).addClass('active');

if ($G['autoanim'] == 1) {
clearTimeout($G['animation_timer']);

$G['animation_timer'] = setTimeout(function() {
if ($G['blank']) {
$G['blank'] = false;
clearTimeout($G['animation_timer']);

$G['animation_timer'] = setTimeout(function() {
gk_box_autoanimate($G, wrapper, 'next', null);
}, $G['anim_interval']);
} else {
gk_box_autoanimate($G, wrapper, 'next', null);
}
}, $G['anim_interval']);
}
});

jQuery(imgPrev).animate({
opacity: 0
}, $G['anim_speed']);
};

var gk_box_autoanimate = function($G, wrapper, dir, next) {
var i = $G['actual_slide'];
var imgs = wrapper.find('.gkIsImage');

if (next == null) {
next = (dir == 'next') ? ((i < imgs.length - 1) ? i + 1: 0) : ((i == 0) ? imgs.length - 1: i - 1);
}

gk_box_animate($G, wrapper, imgs[i], imgs[next]);
$G['actual_slide'] = next;

wrapper.find('.gkIsPagination li').removeClass('active');
wrapper.find('.gkIsPagination li').eq(next).addClass('active');
wrapper.find('.gkIsText li').removeClass('active');
wrapper.find('.gkIsText li').eq(next).addClass('active');
};
1 change: 1 addition & 0 deletions mod_image_show_gk4/styles/gk_box/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body></body></html>
24 changes: 24 additions & 0 deletions mod_image_show_gk4/styles/gk_box/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<style>
<info>
<name>gk_box</name>
<author>GavickPro</author>
<desc>Image Show GK4 style for Box template.</desc>
<version>1.0</version>
</info>
<config>
<field type="text" name="image_width" label="Image width" desc="Slide image width in pixels" default="780" unit="px" />
<field type="text" name="image_height" label="Image height" desc="Slide image height in pixels" default="860" unit="px" />
<field type="text" name="thumb_width" label="Thumbnail width" desc="Slide thumbnail image width in pixels" default="80" unit="px" />
<field type="text" name="thumb_height" label="Thumbnail height" desc="Slide thumbnail image height in pixels" default="92" unit="px" />
<field type="text" name="image_bg" label="Image background color" desc="Slide image background as hexdecimal value" default="#ffffff" unit="" />
<field type="text" name="quality" label="Image quality" desc="Quality of images (used in the JPG images) - percentage value between 0 and 100." default="95" unit="%" />
<field type="switch" name="show_text_block" label="Show text block" default="1" desc="You can enable showing block with slide text." class="gk_switch" />
<field type="text" name="text_block_length" label="Text block length" desc="Maximal number of chars in the text block" default="80" />
<field type="switch" name="pagination" label="Pagination" desc="You can enable showing pagination." default="1" class="gk_switch" />
<field type="switch" name="slide_links" label="Slide links" desc="You can enable links in the slides." default="1" class="gk_switch" />
<field type="text" name="animation_speed" label="Animation speed" desc="Animation speed in miliseconds" default="500" unit="ms" />
<field type="text" name="animation_interval" label="Animation interval" desc="Animation interval in miliseconds" default="5000" unit="ms" />
<field type="switch" name="autoanimation" label="Autoanimation" desc="Autoanimation of the slides" default="1" class="gk_switch" />
</config>
</style>
Loading

0 comments on commit efc712c

Please sign in to comment.