1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-16 12:36:26 +02:00

Gallery jumper added

This commit is contained in:
CaMer0n
2012-04-25 21:01:05 +00:00
parent 78aadc0e72
commit fcadcef5ff
4 changed files with 66 additions and 9 deletions

View File

@ -19,7 +19,7 @@ e107::getJs()->pluginCSS('gallery', 'gallery_style.css');
$gp = e107::getPlugPref('gallery'); $gp = e107::getPlugPref('gallery');
e107::getJs()->footerInline(" 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).", duration: ".varset($gp['slideshow_duration'],1).",
auto: ".varset($gp['slideshow_auto'],0).", auto: ".varset($gp['slideshow_auto'],0).",
@ -28,11 +28,24 @@ e107::getJs()->footerInline("
wheel: true, wheel: true,
visibleSlides: 1, visibleSlides: 1,
effect: '".varset($gp['slideshow_effect'],'scroll')."', 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); unset($gp);

View File

@ -17,6 +17,7 @@ class gallery_shortcodes extends e_shortcode
public $curCat = null; public $curCat = null;
public $sliderCat = 1; public $sliderCat = 1;
public $slideMode = FALSE; public $slideMode = FALSE;
public $slideCount = 1;
function sc_gallery_caption($parm='') function sc_gallery_caption($parm='')
{ {
@ -85,25 +86,41 @@ class gallery_shortcodes extends e_shortcode
{ {
$this->setParserVars($row); $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 .= "\n\t".$tp->parseTemplate($item_template,TRUE)."\n";
$inner .= ($count == $amount) ? "\n</div>\n\n" : ""; $inner .= ($count == $amount) ? "\n</div>\n\n" : "";
if($count == $amount) if($count == $amount)
{ {
$count = 1; $count = 1;
$this->slideCount++;
} }
else else
{ {
$count++; $count++;
} }
} }
$inner .= ($count != 1) ? "</div><!-- END SLIDES -->" : ""; $inner .= ($count != 1) ? "</div><!-- END SLIDES -->" : "";
return $inner; 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') ? "&nbsp;" : $i;
$text .= '<a href="#" class="gallery-slide-jumper" rel="gallery-item-'.$i.'">'.$val.'</a>';
}
return $text;
}
} }
?> ?>

View File

@ -32,9 +32,29 @@
/* SLIDESHOW */ /* 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-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 { width: 3500px; }
#gallery-slideshow-content .slide { float: left; width: 660px; padding:12px; height: 146px; } #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-slideshow-controls { clear:both; width: 660px; margin-left:auto; margin-right:auto; padding-bottom:10px; }
.gallery-slide-item { margin-right:8px; } .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 }

View File

@ -46,16 +46,23 @@ $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. (Overrides preference in admin.)
// {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}
</div> </div>
</div> </div>
<div class="gallery-slideshow-controls">
<a href="javascript:" class="carousel-control ico-next" rel="next" style="float: right">Next &rsaquo;</a> <div class="gallery-slideshow-controls">
<a href="javascript:" class="carousel-control ico-next" rel="next" style="float: right">Next &rsaquo;</a>
<a href="javascript:" class="carousel-control ico-prev" rel="prev">&lsaquo; Previous</a> <a href="javascript:" class="carousel-control ico-prev" rel="prev">&lsaquo; Previous</a>
<span class="gallery-slide-jumper-container">{GALLERY_JUMPER}</span>
</div> </div>
'; ';
$GALLERY_TEMPLATE['SLIDESHOW_SLIDE_ITEM'] = '<span class="gallery-slide-item">{GALLERY_THUMB=aw=150&ah=120}</span>'; $GALLERY_TEMPLATE['SLIDESHOW_SLIDE_ITEM'] = '<span class="gallery-slide-item">{GALLERY_THUMB=aw=150&ah=120}</span>';