mirror of
https://github.com/e107inc/e107.git
synced 2025-07-16 20:41:27 +02:00
Gallery jumper added
This commit is contained in:
@@ -19,7 +19,7 @@ e107::getJs()->pluginCSS('gallery', 'gallery_style.css');
|
||||
$gp = e107::getPlugPref('gallery');
|
||||
|
||||
e107::getJs()->footerInline("
|
||||
new Carousel('gallery-slideshow-wrapper', $$('#gallery-slideshow-content .slide'), $$('a.carousel-control', 'a.carousel-jumper' ),
|
||||
new Carousel('gallery-slideshow-wrapper', $$('#gallery-slideshow-content .slide'), $$('a.carousel-control', 'a.gallery-slide-jumper' ),
|
||||
{
|
||||
duration: ".varset($gp['slideshow_duration'],1).",
|
||||
auto: ".varset($gp['slideshow_auto'],0).",
|
||||
@@ -28,11 +28,24 @@ e107::getJs()->footerInline("
|
||||
wheel: true,
|
||||
visibleSlides: 1,
|
||||
effect: '".varset($gp['slideshow_effect'],'scroll')."',
|
||||
transition: '".varset($gp['slideshow_transition'],'sinoidal')."'
|
||||
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',
|
||||
var aj = $$('.donwload-jumper')[0];
|
||||
if (!aj.hasClassName('scroller-selected')) aj.toggleClassName('scroller-selected');
|
||||
*/
|
||||
|
||||
unset($gp);
|
||||
|
||||
|
||||
|
@@ -17,6 +17,7 @@ class gallery_shortcodes extends e_shortcode
|
||||
public $curCat = null;
|
||||
public $sliderCat = 1;
|
||||
public $slideMode = FALSE;
|
||||
public $slideCount = 1;
|
||||
|
||||
function sc_gallery_caption($parm='')
|
||||
{
|
||||
@@ -85,25 +86,41 @@ class gallery_shortcodes extends e_shortcode
|
||||
{
|
||||
$this->setParserVars($row);
|
||||
|
||||
$inner .= ($count == 1) ? "\n\n<!-- SLIDE ".$count." -->\n<div class='slide'>\n" : "";
|
||||
$inner .= ($count == 1) ? "\n\n<!-- SLIDE ".$count." -->\n<div class='slide' id='gallery-item-".$this->slideCount."'>\n" : "";
|
||||
$inner .= "\n\t".$tp->parseTemplate($item_template,TRUE)."\n";
|
||||
$inner .= ($count == $amount) ? "\n</div>\n\n" : "";
|
||||
|
||||
if($count == $amount)
|
||||
{
|
||||
$count = 1;
|
||||
$this->slideCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$count++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$inner .= ($count != 1) ? "</div><!-- END SLIDES -->" : "";
|
||||
return $inner;
|
||||
}
|
||||
|
||||
function sc_gallery_jumper($parm)
|
||||
{
|
||||
// echo "SlideCount=".$this->slideCount;
|
||||
if($this->slideCount ==1 ){ return "gallery-jumper must be loaded after Gallery-Slides"; }
|
||||
|
||||
$text = '';
|
||||
for($i=1; $i < ($this->slideCount +1); $i++)
|
||||
{
|
||||
$val = ($parm == 'space') ? " " : $i;
|
||||
$text .= '<a href="#" class="gallery-slide-jumper" rel="gallery-item-'.$i.'">'.$val.'</a>';
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
@@ -32,9 +32,29 @@
|
||||
|
||||
|
||||
/* SLIDESHOW */
|
||||
|
||||
#gallery-slideshow-wrapper { -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; width: 660px; height: 146px; overflow: hidden; background: #000000; margin-left:auto;margin-right:auto }
|
||||
|
||||
#gallery-slideshow-content { width: 3500px; }
|
||||
|
||||
#gallery-slideshow-content .slide { float: left; width: 660px; padding:12px; height: 146px; }
|
||||
|
||||
.gallery-slideshow-controls { clear:both; width: 660px; margin-left:auto; margin-right:auto; padding-bottom:10px; }
|
||||
|
||||
.gallery-slide-item { margin-right:8px; }
|
||||
.gallery-slideshow-thumb { -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; }
|
||||
|
||||
.gallery-slideshow-thumb { -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; }
|
||||
|
||||
.gallery-slideshow-thumb:hover { }
|
||||
|
||||
.gallery-slide-jumper-container { text-align:center; padding-left:250px;}
|
||||
|
||||
.gallery-slide-jumper { padding:3px;}
|
||||
|
||||
.gallery-slide-jumper-selected { font-weight:bold }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -46,16 +46,23 @@ $GALLERY_TEMPLATE['CAT_END'] =
|
||||
|
||||
// {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_JUMPER=space} will remove numbers and just leave spaces.
|
||||
|
||||
$GALLERY_TEMPLATE['SLIDESHOW_WRAPPER'] = '
|
||||
|
||||
<div id="gallery-slideshow-wrapper">
|
||||
<div id="gallery-slideshow-content">
|
||||
{GALLERY_SLIDES}
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-slideshow-controls">
|
||||
<a href="javascript:" class="carousel-control ico-next" rel="next" style="float: right">Next ›</a>
|
||||
|
||||
<div class="gallery-slideshow-controls">
|
||||
<a href="javascript:" class="carousel-control ico-next" rel="next" style="float: right">Next ›</a>
|
||||
<a href="javascript:" class="carousel-control ico-prev" rel="prev">‹ Previous</a>
|
||||
<span class="gallery-slide-jumper-container">{GALLERY_JUMPER}</span>
|
||||
</div>
|
||||
|
||||
|
||||
';
|
||||
|
||||
$GALLERY_TEMPLATE['SLIDESHOW_SLIDE_ITEM'] = '<span class="gallery-slide-item">{GALLERY_THUMB=aw=150&ah=120}</span>';
|
||||
|
Reference in New Issue
Block a user