From fcadcef5ffbde06193fd1c1034c0cbb68eba38d9 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 25 Apr 2012 21:01:05 +0000 Subject: [PATCH] Gallery jumper added --- e107_plugins/gallery/e_header.php | 17 +++++++++++-- e107_plugins/gallery/e_shortcode.php | 25 ++++++++++++++++--- e107_plugins/gallery/gallery_style.css | 22 +++++++++++++++- .../gallery/templates/gallery_template.php | 11 ++++++-- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/e107_plugins/gallery/e_header.php b/e107_plugins/gallery/e_header.php index b7b9a3843..1fdc6563f 100644 --- a/e107_plugins/gallery/e_header.php +++ b/e107_plugins/gallery/e_header.php @@ -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); diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index 59728c9cc..c9d476748 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -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\n
\n" : ""; + $inner .= ($count == 1) ? "\n\n\n\n\n" : ""; if($count == $amount) { $count = 1; + $this->slideCount++; } else { $count++; - } - + } } - + $inner .= ($count != 1) ? "
" : ""; 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 .= ''.$val.''; + } + + return $text; + + } + } ?> \ No newline at end of file diff --git a/e107_plugins/gallery/gallery_style.css b/e107_plugins/gallery/gallery_style.css index e9d49c3d7..d77debabc 100644 --- a/e107_plugins/gallery/gallery_style.css +++ b/e107_plugins/gallery/gallery_style.css @@ -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 } + + + + + + diff --git a/e107_plugins/gallery/templates/gallery_template.php b/e107_plugins/gallery/templates/gallery_template.php index ff8470812..931a87831 100644 --- a/e107_plugins/gallery/templates/gallery_template.php +++ b/e107_plugins/gallery/templates/gallery_template.php @@ -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'] = ' + -