mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Gallery now working again but with jquery Re-save preferences if previously installed.
This commit is contained in:
@@ -7,44 +7,50 @@
|
|||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
e107::getJS()->headerFile("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js",1);
|
e107::js('gallery', 'jslib/lightbox/js/lightbox.js','jquery');
|
||||||
e107::getJs()->headerPlugin('gallery', 'jslib/lightbox/js/lightbox.js');
|
e107::css('gallery', 'jslib/lightbox/css/lightbox.css','jquery');
|
||||||
e107::getJs()->pluginCSS('gallery', 'jslib/lightbox/css/lightbox.css');
|
|
||||||
|
|
||||||
e107::getJS()->headerFile("https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js",1);
|
e107::js('gallery', 'jslib/jquery.cycle.all.js','jquery');
|
||||||
e107::getJS()->headerFile("https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?load=effects",1);
|
e107::css('gallery', 'gallery_style.css');
|
||||||
e107::getJs()->headerPlugin('gallery', 'jslib/carousel.js');
|
|
||||||
e107::getJs()->pluginCSS('gallery', 'gallery_style.css');
|
|
||||||
|
|
||||||
$gp = e107::getPlugPref('gallery');
|
$gp = e107::getPlugPref('gallery');
|
||||||
|
|
||||||
e107::getJs()->footerInline("
|
e107::js('inline',"
|
||||||
new Carousel('gallery-slideshow-wrapper', $$('#gallery-slideshow-content .slide'), $$('a.carousel-control', 'a.gallery-slide-jumper' ),
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#gallery-slideshow-content').cycle({
|
||||||
|
fx: '".varset($gp['slideshow_effect'],'scrollHorz')."',
|
||||||
|
next: '.gal-next',
|
||||||
|
prev: '.gal-prev',
|
||||||
|
speed: 1000, // speed of the transition (any valid fx speed value)
|
||||||
|
timeout: 4000,
|
||||||
|
slideExpr: '.slide',
|
||||||
|
|
||||||
|
activePagerClass: '.gallery-slide-jumper-selected',//,
|
||||||
|
before: function(currSlideElement, nextSlideElement, options, forwardFlag)
|
||||||
{
|
{
|
||||||
duration: ".varset($gp['slideshow_duration'],1).",
|
var nx = $(nextSlideElement).attr('id').split('item-');
|
||||||
auto: ".varset($gp['slideshow_auto'],0).",
|
var th = $(currSlideElement).attr('id').split('item-');
|
||||||
frequency: ".varset($gp['slideshow_freq'],3).",
|
$('#gallery-jumper-'+th[1]).removeClass('gallery-slide-jumper-selected');
|
||||||
circular: ".varset($gp['slideshow_circular'],1).",
|
$('#gallery-jumper-'+nx[1]).addClass('gallery-slide-jumper-selected');
|
||||||
wheel: true,
|
}
|
||||||
visibleSlides: 1,
|
|
||||||
effect: '".varset($gp['slideshow_effect'],'scroll')."',
|
|
||||||
transition: '".varset($gp['slideshow_transition'],'sinoidal')."',
|
|
||||||
jumperClassName: 'gallery-slide-jumper',
|
|
||||||
selectedClassName: 'gallery-slide-jumper-selected'
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var aj = $$('.gallery-slide-jumper')[0];
|
|
||||||
if (!aj.hasClassName('gallery-slide-jumper-selected')) aj.toggleClassName('gallery-slide-jumper-selected');
|
|
||||||
");
|
|
||||||
/*
|
|
||||||
|
|
||||||
jumperClassName: 'scroller-jumper',
|
|
||||||
selectedClassName: 'scroller-selected',
|
$('.gallery-slide-jumper').click(function() {
|
||||||
var aj = $$('.donwload-jumper')[0];
|
var nid = $(this).attr('id');
|
||||||
if (!aj.hasClassName('scroller-selected')) aj.toggleClassName('scroller-selected');
|
var id = nid.split('-jumper-');
|
||||||
*/
|
|
||||||
|
var go = parseInt(id[1]) - 1;
|
||||||
|
$('#gallery-slideshow-content').cycle(go);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
");
|
||||||
|
|
||||||
|
|
||||||
unset($gp);
|
unset($gp);
|
||||||
|
|
||||||
|
@@ -31,9 +31,12 @@ class gallery_shortcodes extends e_shortcode
|
|||||||
function sc_gallery_thumb($parm='')
|
function sc_gallery_thumb($parm='')
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
$w = 190; $h = 150;
|
||||||
|
|
||||||
$class = ($this->slideMode == TRUE) ? 'gallery-slideshow-thumb' : 'gallery-thumb';
|
$class = ($this->slideMode == TRUE) ? 'gallery-slideshow-thumb' : 'gallery-thumb';
|
||||||
$att = ($parm) ?$parm : 'aw=190&ah=150';
|
$rel = ($this->slideMode == TRUE) ? 'lightbox.SlideGallery' : 'lightbox.Gallery';
|
||||||
$text = "<a class='".$class."' title='".$tp->toAttribute($this->var['media_caption'])."' href='".e107::getParser()->replaceConstants($this->var['media_url'],'abs')."' rel='lightbox.Gallery' >";
|
$att = ($parm) ?$parm : 'aw='.$w.'&ah='.$h ; // 'aw=190&ah=150';
|
||||||
|
$text = "<a class='".$class."' title='".$tp->toAttribute($this->var['media_caption'])."' href='".e107::getParser()->replaceConstants($this->var['media_url'],'abs')."' rel='{$rel}' >";
|
||||||
$text .= "<img class='".$class."' src='".e107::getParser()->thumbUrl($this->var['media_url'],$att)."' alt='' />";
|
$text .= "<img class='".$class."' src='".e107::getParser()->thumbUrl($this->var['media_url'],$att)."' alt='' />";
|
||||||
$text .= "</a>";
|
$text .= "</a>";
|
||||||
return $text;
|
return $text;
|
||||||
@@ -76,7 +79,7 @@ class gallery_shortcodes extends e_shortcode
|
|||||||
function sc_gallery_slides($parm)
|
function sc_gallery_slides($parm)
|
||||||
{
|
{
|
||||||
$this->slideMode = TRUE;
|
$this->slideMode = TRUE;
|
||||||
$amount = ($parm) ? intval($parm) : vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3);
|
$amount = ($parm) ? intval($parm) : 3; // vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3);
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$list = e107::getMedia()->getImages('gallery_'.$this->sliderCat);
|
$list = e107::getMedia()->getImages('gallery_'.$this->sliderCat);
|
||||||
$item_template = e107::getTemplate('gallery','gallery','SLIDESHOW_SLIDE_ITEM');
|
$item_template = e107::getTemplate('gallery','gallery','SLIDESHOW_SLIDE_ITEM');
|
||||||
@@ -114,7 +117,7 @@ class gallery_shortcodes extends e_shortcode
|
|||||||
for($i=1; $i < ($this->slideCount +1); $i++)
|
for($i=1; $i < ($this->slideCount +1); $i++)
|
||||||
{
|
{
|
||||||
$val = ($parm == 'space') ? " " : $i;
|
$val = ($parm == 'space') ? " " : $i;
|
||||||
$text .= '<a href="#" class="gallery-slide-jumper" rel="gallery-item-'.$i.'">'.$val.'</a>';
|
$text .= '<a href="#" class="gallery-slide-jumper" id="gallery-jumper-'.$i.'">'.$val.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
@@ -26,19 +26,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once("../../class2.php");
|
require_once("../../class2.php");
|
||||||
if (!getperms("P") || !plugInstalled('gallery'))
|
if (!plugInstalled('gallery'))
|
||||||
{
|
{
|
||||||
header('location:'.e_BASE.'index.php');
|
header('location:'.e_BASE.'index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//e107::getJS()->headerFile("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js",1);
|
|
||||||
//e107::getJs()->headerPlugin('gallery', 'jslib/lightbox/js/lightbox.js');
|
|
||||||
//e107::getJs()->pluginCSS('gallery', 'jslib/lightbox/css/lightbox.css');
|
|
||||||
//e107::getJs()->pluginCSS('gallery', 'gallery_style.css');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
@@ -84,7 +77,7 @@ class gallery
|
|||||||
$sc = e107::getScBatch('gallery',TRUE);
|
$sc = e107::getScBatch('gallery',TRUE);
|
||||||
|
|
||||||
$sc->total = e107::getMedia()->countImages($cat);
|
$sc->total = e107::getMedia()->countImages($cat);
|
||||||
$sc->amount = 9; // TODO Add Pref.
|
$sc->amount = 9; // TODO Add Pref. amount per page.
|
||||||
$sc->curCat = $cat;
|
$sc->curCat = $cat;
|
||||||
$sc->from = ($_GET['frm']) ? intval($_GET['frm']) : 0;
|
$sc->from = ($_GET['frm']) ? intval($_GET['frm']) : 0;
|
||||||
|
|
||||||
@@ -111,33 +104,6 @@ class gallery
|
|||||||
|
|
||||||
new gallery;
|
new gallery;
|
||||||
|
|
||||||
|
|
||||||
echo '<a class="backward">prev</a>
|
|
||||||
|
|
||||||
<!-- container for the slides -->
|
|
||||||
<div class="images">
|
|
||||||
|
|
||||||
<!-- first slide -->
|
|
||||||
<div>Lorem ipsum ..</div>
|
|
||||||
|
|
||||||
<!-- second slide -->
|
|
||||||
<div>Lorem ipsum the 2nd..</div>
|
|
||||||
|
|
||||||
<!-- third slide -->
|
|
||||||
<div>Lorem ipsum the 3rd</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- "next slide" button -->
|
|
||||||
<a class="forward">next</a>
|
|
||||||
|
|
||||||
<!-- the tabs -->
|
|
||||||
<div class="slidetabs">
|
|
||||||
<a href="#"></a>
|
|
||||||
<a href="#"></a>
|
|
||||||
<a href="#"></a>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
@@ -126,21 +126,35 @@ class gallery_cat_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
|
|
||||||
protected $prefs = array(
|
protected $prefs = array(
|
||||||
'slideshow_category' => array('title'=> 'Slideshow category', 'type' => 'dropdown', 'data' => 'integer', 'help'=>'The category of images which should be used.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
'slideshow_category' => array('title'=> 'Slideshow category', 'type' => 'dropdown', 'data' => 'integer', 'help'=>'Images from this category will be used in the sliding menu.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
'slideshow_perslide' => array('title'=> 'Images per slide', 'type' => 'number', 'data' => 'integer', 'help'=>'Number of images to show per slide.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
// 'slideshow_thumb_w' => array('title'=> 'Thumbnail Width', 'type' => 'number', 'data' => 'integer', 'help'=>'Width in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
|
// 'slideshow_thumb_h' => array('title'=> 'Thumbnail Height', 'type' => 'number', 'data' => 'integer', 'help'=>'Height in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
|
|
||||||
|
// 'slideshow_perslide' => array('title'=> 'Images per slide', 'type' => 'number', 'data' => 'integer', 'help'=>'Number of images to show per slide.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
'slideshow_duration' => array('title'=> 'Slide duration', 'type' => 'number', 'data' => 'integer', 'help'=>'The duration (in seconds) of a full jump.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
'slideshow_duration' => array('title'=> 'Slide duration', 'type' => 'number', 'data' => 'integer', 'help'=>'The duration (in seconds) of a full jump.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
'slideshow_auto' => array('title'=> 'Slide auto-start', 'type'=>'boolean', 'data' => 'integer','help' => 'When enabled image-rotation begins automatically when the page is loaded.'),
|
'slideshow_auto' => array('title'=> 'Slide auto-start', 'type'=>'boolean', 'data' => 'integer','help' => 'When enabled image-rotation begins automatically when the page is loaded.'),
|
||||||
'slideshow_freq' => array('title'=> 'Slide frequency', 'type' => 'number', 'data' => 'integer', 'help'=>'When auto-start is enabled, this dictates how long a slides stays put before the next jump. '), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
'slideshow_freq' => array('title'=> 'Slide frequency', 'type' => 'number', 'data' => 'integer', 'help'=>'When auto-start is enabled, this dictates how long a slides stays put before the next jump. '), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
|
||||||
'slideshow_circular' => array('title'=> 'Slide circular-mode', 'type' => 'boolean', 'data' => 'integer', 'help'=>'By default when the first/last slide is reached, calling prev/next does nothing. If you want the effect to continue enable this option.'), //
|
// 'slideshow_circular' => array('title'=> 'Slide circular-mode', 'type' => 'boolean', 'data' => 'integer', 'help'=>'By default when the first/last slide is reached, calling prev/next does nothing. If you want the effect to continue enable this option.'), //
|
||||||
'slideshow_effect' => array('title'=> 'Slide effect', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of effect. '), //
|
'slideshow_effect' => array('title'=> 'Slide effect', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of effect. '), //
|
||||||
'slideshow_transition' => array('title'=> 'Slide transition', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of transition. ') //
|
// 'slideshow_transition' => array('title'=> 'Slide transition', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of transition. ') //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
$effects = array('scroll'=>'scroll','fade'=>'fade');
|
$effects = array(
|
||||||
|
'scrollHorz' => 'slide left',
|
||||||
|
'scrollVert' => 'slide down',
|
||||||
|
// 'turnDown' => 'turn Down',
|
||||||
|
// 'turnUp' => 'turn Up',
|
||||||
|
// 'curtainX' => 'curtainX',
|
||||||
|
// 'curtainY' => 'curtainY',
|
||||||
|
'fade' => 'fade',
|
||||||
|
// 'zoom' => 'zoom'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$this->prefs['slideshow_effect']['writeParms'] = $effects;
|
$this->prefs['slideshow_effect']['writeParms'] = $effects;
|
||||||
$this->prefs['slideshow_effect']['readParms'] = $effects;
|
$this->prefs['slideshow_effect']['readParms'] = $effects;
|
||||||
|
|
||||||
|
@@ -1,465 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2009 Victor Stanciu - http://www.victorstanciu.ro
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
|
||||||
obtaining a copy of this software and associated documentation
|
|
||||||
files (the "Software"), to deal in the Software without
|
|
||||||
restriction, including without limitation the rights to use,
|
|
||||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
||||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
||||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Carousel = Class.create(Abstract, {
|
|
||||||
initialize: function (scroller, slides, controls, options) {
|
|
||||||
this.scrolling = false;
|
|
||||||
this.scroller = $(scroller);
|
|
||||||
this.slides = slides;
|
|
||||||
this.controls = controls;
|
|
||||||
|
|
||||||
|
|
||||||
this.options = Object.extend({
|
|
||||||
duration: 1,
|
|
||||||
auto: false,
|
|
||||||
frequency: 3,
|
|
||||||
visibleSlides: 1,
|
|
||||||
controlClassName: 'carousel-control',
|
|
||||||
jumperClassName: 'carousel-jumper',
|
|
||||||
disabledClassName: 'carousel-disabled',
|
|
||||||
selectedClassName: 'carousel-selected',
|
|
||||||
circular: false,
|
|
||||||
wheel: true,
|
|
||||||
effect: 'scroll',
|
|
||||||
transition: 'sinoidal'
|
|
||||||
|
|
||||||
}, options || {});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.options.effect == 'fade') {
|
|
||||||
this.options.circular = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//scroll-circular fix by SecretR @ free-source.net
|
|
||||||
if (this.options.effect == 'scroll' && this.options.circular && this.slides.length > 1) {
|
|
||||||
var fixel = Element.clone(this.slides[0], true);
|
|
||||||
fixel.identify();
|
|
||||||
this.slides[this.slides.length] = fixel;
|
|
||||||
Element.insert(this.slides[0].up(), {
|
|
||||||
bottom: fixel
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.slides.each(function(slide, index) {
|
|
||||||
slide._index = index;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.controls) {
|
|
||||||
this.controls.invoke('observe', 'click', this.click.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.wheel) {
|
|
||||||
this.scroller.observe('mousewheel', this.wheel.bindAsEventListener(this)).observe('DOMMouseScroll', this.wheel.bindAsEventListener(this));;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.auto) {
|
|
||||||
this.start();
|
|
||||||
// this.slides.invoke('observe', 'mouseover', this.pause.bind(this));
|
|
||||||
// this.slides.invoke('observe', 'mouseout', this.resume.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.initial) {
|
|
||||||
|
|
||||||
var initialIndex = this.slides.indexOf($(this.options.initial));
|
|
||||||
|
|
||||||
if (initialIndex > (this.options.visibleSlides - 1) && this.options.visibleSlides > 1) {
|
|
||||||
if (initialIndex > this.slides.length - (this.options.visibleSlides + 1)) {
|
|
||||||
initialIndex = this.slides.length - this.options.visibleSlides;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveTo(this.slides[initialIndex]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.container) {
|
|
||||||
this.container = $(this.options.container);
|
|
||||||
this.jumpers = this.container.select('a.'+this.options.jumperClassName);
|
|
||||||
} else {
|
|
||||||
this.jumpers = $$('a.'+ this.options.jumperClassName);
|
|
||||||
}
|
|
||||||
|
|
||||||
//this.current = this.slides[0];
|
|
||||||
},
|
|
||||||
|
|
||||||
click: function (event) {
|
|
||||||
this.stop();
|
|
||||||
|
|
||||||
var element = event.findElement('a');
|
|
||||||
|
|
||||||
if (!element.hasClassName(this.options.disabledClassName)) {
|
|
||||||
if (element.hasClassName(this.options.controlClassName)) {
|
|
||||||
eval("this." + element.rel + "()");
|
|
||||||
} else if (element.hasClassName(this.options.jumperClassName)) {
|
|
||||||
this.moveTo(element.rel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.deactivateControls();
|
|
||||||
|
|
||||||
event.stop();
|
|
||||||
},
|
|
||||||
|
|
||||||
moveTo: function (element) {
|
|
||||||
if (this.slides.length > 1) {
|
|
||||||
if (this.options.selectedClassName && this.jumpers) {
|
|
||||||
this.jumpers.each(function(jump,b){
|
|
||||||
if (jump.hasClassName(this.options.selectedClassName)) {
|
|
||||||
jump.removeClassName(this.options.selectedClassName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jump.rel == element || jump.rel == element.id ) {
|
|
||||||
jump.addClassName(this.options.selectedClassName);
|
|
||||||
}
|
|
||||||
|
|
||||||
}.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.beforeMove && (typeof this.options.beforeMove == 'function')) {
|
|
||||||
this.options.beforeMove();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.previous = this.current ? this.current : this.slides[0];
|
|
||||||
this.current = $(element);
|
|
||||||
|
|
||||||
var scrollerOffset = this.scroller.cumulativeOffset();
|
|
||||||
var elementOffset = this.current.cumulativeOffset();
|
|
||||||
|
|
||||||
if (this.scrolling) {
|
|
||||||
this.scrolling.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (this.options.effect) {
|
|
||||||
case 'fade':
|
|
||||||
this.scrolling = new Effect.Opacity(this.scroller, {
|
|
||||||
from: 1.0,
|
|
||||||
to: 0,
|
|
||||||
duration: this.options.duration,
|
|
||||||
afterFinish: (function () {
|
|
||||||
this.scroller.scrollLeft = elementOffset[0] - scrollerOffset[0];
|
|
||||||
this.scroller.scrollTop = elementOffset[1] - scrollerOffset[1];
|
|
||||||
|
|
||||||
new Effect.Opacity(this.scroller, {
|
|
||||||
from: 0,
|
|
||||||
to: 1.0,
|
|
||||||
duration: this.options.duration,
|
|
||||||
afterFinish: (function () {
|
|
||||||
if (this.controls) {
|
|
||||||
this.activateControls();
|
|
||||||
}
|
|
||||||
if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
|
|
||||||
this.options.afterMove();
|
|
||||||
}
|
|
||||||
}).bind(this)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
).bind(this)});
|
|
||||||
break;
|
|
||||||
case 'scroll':
|
|
||||||
default:
|
|
||||||
var transition;
|
|
||||||
switch (this.options.transition) {
|
|
||||||
case 'spring':
|
|
||||||
transition = Effect.Transitions.spring;
|
|
||||||
break;
|
|
||||||
case 'sinoidal':
|
|
||||||
default:
|
|
||||||
transition = Effect.Transitions.sinoidal;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.scrolling = new Effect.SmoothScroll(this.scroller, {
|
|
||||||
duration: this.options.duration,
|
|
||||||
x: (elementOffset[0] - scrollerOffset[0]),
|
|
||||||
y: (elementOffset[1] - scrollerOffset[1]),
|
|
||||||
transition: transition,
|
|
||||||
afterFinish: (function () {
|
|
||||||
|
|
||||||
if (this.controls) {
|
|
||||||
this.activateControls();
|
|
||||||
}
|
|
||||||
if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
|
|
||||||
this.options.afterMove();
|
|
||||||
}
|
|
||||||
this.scrolling = false;
|
|
||||||
}).bind(this)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
prev: function () {
|
|
||||||
if (this.current) {
|
|
||||||
var currentIndex = this.current._index;
|
|
||||||
var prevIndex = (currentIndex == 0) ? (this.options.circular ? this.slides.length - 1 : 0) : currentIndex - 1;
|
|
||||||
} else {
|
|
||||||
var prevIndex = (this.options.circular ? this.slides.length - 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prevIndex == (this.slides.length - 1) && this.options.circular && this.options.effect != 'fade') {
|
|
||||||
this.scroller.scrollLeft = (this.slides.length - 1) * this.slides.first().getWidth();
|
|
||||||
this.scroller.scrollTop = (this.slides.length - 1) * this.slides.first().getHeight();
|
|
||||||
prevIndex = this.slides.length - 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveTo(this.slides[prevIndex]);
|
|
||||||
},
|
|
||||||
|
|
||||||
next: function () {
|
|
||||||
if (this.current) {
|
|
||||||
var currentIndex = this.current._index;
|
|
||||||
var nextIndex = (this.slides.length - 1 == currentIndex) ? (this.options.circular ? 0 : currentIndex) : currentIndex + 1;
|
|
||||||
} else {
|
|
||||||
var nextIndex = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextIndex == 0 && this.options.circular && this.options.effect != 'fade') {
|
|
||||||
this.scroller.scrollLeft = 0;
|
|
||||||
this.scroller.scrollTop = 0;
|
|
||||||
nextIndex = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextIndex > this.slides.length - (this.options.visibleSlides + 1)) {
|
|
||||||
nextIndex = this.slides.length - this.options.visibleSlides;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.moveTo(this.slides[nextIndex]);
|
|
||||||
},
|
|
||||||
|
|
||||||
first: function () {
|
|
||||||
this.moveTo(this.slides[0]);
|
|
||||||
},
|
|
||||||
|
|
||||||
last: function () {
|
|
||||||
this.moveTo(this.slides[this.slides.length - 1]);
|
|
||||||
},
|
|
||||||
|
|
||||||
toggle: function () {
|
|
||||||
if (this.previous) {
|
|
||||||
this.moveTo(this.slides[this.previous._index]);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
stop: function () {
|
|
||||||
if (this.timer) {
|
|
||||||
clearTimeout(this.timer);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
start: function () {
|
|
||||||
this.periodicallyUpdate();
|
|
||||||
},
|
|
||||||
|
|
||||||
pause: function (event) {
|
|
||||||
this.stop();
|
|
||||||
this.activateControls();
|
|
||||||
this.scroller.addClassName('test-over')
|
|
||||||
},
|
|
||||||
|
|
||||||
resume: function (event) {
|
|
||||||
if (event) {
|
|
||||||
var related = event.relatedTarget || event.toElement;
|
|
||||||
if (!related || (!this.slides.include(related) && !this.slides.any(function (slide) { return related.descendantOf(slide); }))) {
|
|
||||||
this.start();
|
|
||||||
this.scroller.removeClassName('test-over')
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.start();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
periodicallyUpdate: function () {
|
|
||||||
if (this.timer != null) {
|
|
||||||
clearTimeout(this.timer);
|
|
||||||
this.next();
|
|
||||||
}
|
|
||||||
this.timer = setTimeout(this.periodicallyUpdate.bind(this), this.options.frequency * 1000);
|
|
||||||
},
|
|
||||||
|
|
||||||
wheel: function (event) {
|
|
||||||
/*
|
|
||||||
event.cancelBubble = true;
|
|
||||||
event.stop();
|
|
||||||
|
|
||||||
var delta = 0;
|
|
||||||
if (!event) {
|
|
||||||
event = window.event;
|
|
||||||
}
|
|
||||||
if (event.wheelDelta) {
|
|
||||||
delta = event.wheelDelta / 120;
|
|
||||||
} else if (event.detail) {
|
|
||||||
delta = -event.detail / 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.scrolling) {
|
|
||||||
this.deactivateControls();
|
|
||||||
if (delta > 0) {
|
|
||||||
this.prev();
|
|
||||||
} else {
|
|
||||||
this.next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.round(delta); //Safari Round
|
|
||||||
*/
|
|
||||||
},
|
|
||||||
deactivateControls: function () {
|
|
||||||
this.controls.invoke('addClassName', this.options.disabledClassName);
|
|
||||||
},
|
|
||||||
|
|
||||||
activateControls: function () {
|
|
||||||
this.controls.invoke('removeClassName', this.options.disabledClassName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
Effect.SmoothScroll = Class.create();
|
|
||||||
Object.extend(Object.extend(Effect.SmoothScroll.prototype, Effect.Base.prototype), {
|
|
||||||
initialize: function (element) {
|
|
||||||
this.element = $(element);
|
|
||||||
var options = Object.extend({ x: 0, y: 0, mode: 'absolute' } , arguments[1] || {});
|
|
||||||
this.start(options);
|
|
||||||
},
|
|
||||||
|
|
||||||
setup: function () {
|
|
||||||
if (this.options.continuous && !this.element._ext) {
|
|
||||||
this.element.cleanWhitespace();
|
|
||||||
this.element._ext = true;
|
|
||||||
this.element.appendChild(this.element.firstChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.originalLeft = this.element.scrollLeft;
|
|
||||||
this.originalTop = this.element.scrollTop;
|
|
||||||
|
|
||||||
if (this.options.mode == 'absolute') {
|
|
||||||
this.options.x -= this.originalLeft;
|
|
||||||
this.options.y -= this.originalTop;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
update: function (position) {
|
|
||||||
this.element.scrollLeft = this.options.x * position + this.originalLeft;
|
|
||||||
this.element.scrollTop = this.options.y * position + this.originalTop;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var FSfader = Class.create({
|
|
||||||
initialize: function(wrapper,fader,items,options){
|
|
||||||
this.wrapper = $(wrapper);
|
|
||||||
this.fader = $(fader);
|
|
||||||
this.items = $$(items);
|
|
||||||
|
|
||||||
this.options = Object.extend({
|
|
||||||
layout: 'vertical',
|
|
||||||
itemstyle: 'top',
|
|
||||||
toShow: 4,
|
|
||||||
jumperClass: 'jump',
|
|
||||||
transition: Effect.Transitions.EaseTo
|
|
||||||
}, arguments[3] || {});
|
|
||||||
|
|
||||||
this.controls = $$( '#'+wrapper + ' a.'+ this.options.jumperClass);
|
|
||||||
this.controls.invoke('observe', 'click', this.click.bind(this));
|
|
||||||
|
|
||||||
this.current = 0;
|
|
||||||
this.p = new Effect.Parallel([]);
|
|
||||||
if (!this.options.itemWidth) { this.options.itemWidth = this.items[0].getWidth(); }
|
|
||||||
|
|
||||||
this.space = Math.round((this.fader.getWidth() - this.options.itemWidth*this.options.toShow)/(this.options.toShow+1));
|
|
||||||
|
|
||||||
var a=0, b=0;
|
|
||||||
this.arrGroup = new Array;
|
|
||||||
|
|
||||||
this.items.each(function(item,i){
|
|
||||||
item.hide();
|
|
||||||
|
|
||||||
if (a >= this.options.toShow) {
|
|
||||||
a=0;
|
|
||||||
b++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof this.arrGroup[b] == 'undefined') this.arrGroup[b] = new Array;
|
|
||||||
this.arrGroup[b].push(item);
|
|
||||||
a++;
|
|
||||||
}.bind(this));
|
|
||||||
this.showGroup(this.arrGroup[0]);
|
|
||||||
},
|
|
||||||
|
|
||||||
showGroup: function(group) {
|
|
||||||
group.each(function(item,i){
|
|
||||||
item.setStyle({"left": (this.options.itemWidth*i + this.space*(i+1)) + "px"});
|
|
||||||
}.bind(this));
|
|
||||||
new Effect.multiple(group,Effect.Appear,{ speed: 0.1, duration: 0.4});
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
hideGroup: function(group) {
|
|
||||||
this.p.cancel();
|
|
||||||
group.each(function(item,i){
|
|
||||||
var eff = new Effect.Fade(item, {duration: 0.3, from: 1, to: 0, delay: 0.1*i, sync: true});
|
|
||||||
this.p.effects.push(eff);
|
|
||||||
}.bind(this));
|
|
||||||
this.p.start({
|
|
||||||
afterFinish: function () {
|
|
||||||
this.showGroup(this.arrGroup[this.toShow]);
|
|
||||||
this.current=this.toShow;
|
|
||||||
}.bind(this)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
next: function() {
|
|
||||||
if (!this.toShow || this.toShow != this.current+1) {
|
|
||||||
if (this.current != this.arrGroup.length-1 ) {
|
|
||||||
this.toShow = this.current + 1;
|
|
||||||
} else {
|
|
||||||
this.toShow = 0;
|
|
||||||
}
|
|
||||||
this.hideGroup(this.arrGroup[this.current])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
prev: function() {
|
|
||||||
if (!this.toShow || this.toShow != this.current-1) {
|
|
||||||
if (this.current != 0 ) {
|
|
||||||
this.toShow = this.current - 1;
|
|
||||||
} else {
|
|
||||||
this.toShow = this.arrGroup.length-1;
|
|
||||||
}
|
|
||||||
this.hideGroup(this.arrGroup[this.current])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
click: function (event) {
|
|
||||||
event.stop();
|
|
||||||
var element = event.findElement('a');
|
|
||||||
if (!this.running) {
|
|
||||||
eval("this." + element.rel + "()");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
1545
e107_plugins/gallery/jslib/jquery.cycle.all.js
Normal file
1545
e107_plugins/gallery/jslib/jquery.cycle.all.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -17,12 +17,9 @@
|
|||||||
</mainPrefs>
|
</mainPrefs>
|
||||||
<pluginPrefs>
|
<pluginPrefs>
|
||||||
<pref name="slideshow_category">1</pref>
|
<pref name="slideshow_category">1</pref>
|
||||||
<pref name="slideshow_perslide">4</pref>
|
|
||||||
<pref name="slideshow_duration">1</pref>
|
<pref name="slideshow_duration">1</pref>
|
||||||
<pref name="slideshow_auto">1</pref>
|
<pref name="slideshow_auto">1</pref>
|
||||||
<pref name="slideshow_freq">4</pref>
|
<pref name="slideshow_freq">4</pref>
|
||||||
<pref name="slideshow_circular">1</pref>
|
<pref name="slideshow_effect">scrollHorz</pref>
|
||||||
<pref name="slideshow_effect">scroll</pref>
|
|
||||||
<pref name="slideshow_transition">sinoidal</pref>
|
|
||||||
</pluginPrefs>
|
</pluginPrefs>
|
||||||
</e107Plugin>
|
</e107Plugin>
|
||||||
|
@@ -45,20 +45,20 @@ $GALLERY_TEMPLATE['CAT_END'] =
|
|||||||
";
|
";
|
||||||
|
|
||||||
// {GALLERY_SLIDESHOW=X} X = Gallery Category. Default: 1 (ie. 'gallery_1') Overrides preference in admin.
|
// {GALLERY_SLIDESHOW=X} X = Gallery Category. Default: 1 (ie. 'gallery_1') Overrides preference in admin.
|
||||||
// {GALLERY_SLIDES=X} X = number of items per slide. (Overrides preference in admin.)
|
// {GALLERY_SLIDES=X} X = number of items per slide.
|
||||||
// {GALLERY_JUMPER=space} will remove numbers and just leave spaces.
|
// {GALLERY_JUMPER=space} will remove numbers and just leave spaces.
|
||||||
|
|
||||||
$GALLERY_TEMPLATE['SLIDESHOW_WRAPPER'] = '
|
$GALLERY_TEMPLATE['SLIDESHOW_WRAPPER'] = '
|
||||||
|
|
||||||
<div id="gallery-slideshow-wrapper">
|
<div id="gallery-slideshow-wrapper">
|
||||||
<div id="gallery-slideshow-content">
|
<div id="gallery-slideshow-content">
|
||||||
{GALLERY_SLIDES}
|
{GALLERY_SLIDES=4}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="gallery-slideshow-controls">
|
<div class="gallery-slideshow-controls">
|
||||||
<a href="javascript:" class="carousel-control ico-next" rel="next" style="float: right">Next ›</a>
|
<a href="#" class="carousel-control gal-next" style="float: right">Next ›</a>
|
||||||
<a href="javascript:" class="carousel-control ico-prev" rel="prev">‹ Previous</a>
|
<a href="#" class="carousel-control gal-prev" >‹ Previous</a>
|
||||||
<span class="gallery-slide-jumper-container">{GALLERY_JUMPER}</span>
|
<span class="gallery-slide-jumper-container">{GALLERY_JUMPER}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user