Index: /extensions/Slide/Slide.php =================================================================== --- /extensions/Slide/Slide.php (revision 27565) +++ /extensions/Slide/Slide.php (revision 27566) @@ -5,8 +5,5 @@ global $conf, $template,$smarty, $repeat, $user, $page; $params = array_merge(unserialize($conf['Slide'])); - - - - + if ($params['color_theme'] == 2 ) { @@ -17,7 +14,11 @@ }; +$plug_act = array(); +$plug = get_db_plugins('active'); + foreach($plug as $plug){ + $plug_act[]=$plug['id']; + } -$plug_act = array(); $withlightbox = get_db_plugins('active' , 'lightbox'); if($withlightbox) @@ -44,5 +45,4 @@ $template->assign('lightbox_data', $lightbox_data); -array_push($plug_act, 'lightbox'); }; @@ -55,5 +55,11 @@ $template->assign('slideGThumb', $GThumb_data); $template->assign('GThumb_derivative_params', ImageStdParams::get_custom(9999, $conf['GThumb']['height'])); - array_push($plug_act, 'GThumb'); +}; + +$withPiwiShop = get_db_plugins('active' , 'MyPiwiShop'); +if($withPiwiShop) + { + $template->func_combine_css(array('path'=>'plugins/MyPiwiShop/template/style.css')); + $template->func_combine_css(array('path'=>'plugins/MyPiwiShop/template/elem_form_style.css')); }; @@ -80,5 +86,4 @@ $template->assign('slideEasyCaptcha', $EasyCaptcha_data); - array_push($plug_act, 'EasyCaptcha'); }; Index: /extensions/Slide/js/plugin/SlideEasyCaptcha.js =================================================================== --- /extensions/Slide/js/plugin/SlideEasyCaptcha.js (revision 27565) +++ /extensions/Slide/js/plugin/SlideEasyCaptcha.js (revision 27566) @@ -1,4 +1,4 @@ /* - * SlideGThumb - v1.0 - 01-01-2014 + * SlideEasyCaptcha - v1.0 - 01-01-2014 * plugin for Slide and EasyCaptcha * Original by mistic100 for EasyCaptcha : http://fr.piwigo.org/ext/extension_view.php?eid=591 Index: /extensions/Slide/js/plugin/SlideGThumb.js =================================================================== --- /extensions/Slide/js/plugin/SlideGThumb.js (revision 27565) +++ /extensions/Slide/js/plugin/SlideGThumb.js (revision 27566) @@ -1,4 +1,4 @@ /* - * SlideGThumb - v1.0 - 01-01-2014 + * SlideMyPiwiShop - v1.0 - 01-01-2014 * plugin for Slide and GThumb+ * Original by P@t for GThumb+ : http://fr.piwigo.org/ext/extension_view.php?eid=591 @@ -7,10 +7,10 @@ */ -function _GThumb(){ +function _MyPiwiShop(){ var $layerShow = $('body').data('layerShow'); if($('#the_page', $layerShow).hasClass('GThumb')) { if ($('body').hasClass('GThumb')){ $.getScript('./plugins/GThumb/js/jquery.ba-resize.min.js', function(){ - $.getScript('./plugins/GThumb/js/gthumb.js',function(){ + $.getScript('./plugins/MyPiwiShop/js/gthumb.js',function(){ _Gthumb_init(); $('body').removeClass('GThumb').addClass('GThumbReady'); Index: /extensions/Slide/js/plugin/SlideLightbox.js =================================================================== --- /extensions/Slide/js/plugin/SlideLightbox.js (revision 27565) +++ /extensions/Slide/js/plugin/SlideLightbox.js (revision 27566) @@ -1,4 +1,4 @@ /* - * SlideGThumb - v1.0 - 01-01-2014 + * SlideLightbox - v1.0 - 01-01-2014 * plugin for Slide and Lightbox * Original by P@t for Lightbox : http://fr.piwigo.org/ext/extension_view.php?eid=591 Index: /extensions/Slide/js/slide.js =================================================================== --- /extensions/Slide/js/slide.js (revision 27565) +++ /extensions/Slide/js/slide.js (revision 27566) @@ -313,4 +313,8 @@ _GThumb() }; + if($('body').hasClass('MyPiwiShop')||$('body').hasClass('MyPiwiShopReady')) { + _MyPiwiShop() + }; + }; @@ -543,6 +547,9 @@ var $next = $(html).find('.pwg-button-icon-right').attr('href'), $title = $(html).find('#imageHeaderBar h2').text(), - $img = $(html).find('#theImage img').attr('src'); - _stock_img($img,$title); + $img = $(html).find('#theImage #imgContent').data('src'), + $img_h = $(html).find('#theImage #imgContent').data('height'), + $img_w = $(html).find('#theImage #imgContent').data('width'); + + _stock_img($img,$title,$img_h,$img_w); if(typeof $next != "undefined"){ _load_slideshow($next,$slideW) @@ -565,6 +572,7 @@ }; - function _stock_img($href,$title){ - var $img = {src : $href , title : $title , descr : $title}; + function _stock_img($href,$title,$height,$width){ + var $img = {src : $href , title : $title , descr : $title , height : $height , width : $width}; + console.debug($img); $slideshow.push($img); }; Index: /extensions/Slide/js/slideshow.js =================================================================== --- /extensions/Slide/js/slideshow.js (revision 27565) +++ /extensions/Slide/js/slideshow.js (revision 27566) @@ -59,32 +59,36 @@ $(document).ready(function(){ $.each(options.imgs, function(i, img){ - var imag = img.src, - alt = img.alt, - title = img.title, - url = img.url, - descr = img.descr; + var $imag = img.src, + $alt = img.alt, + $title = img.title, + $url = img.url, + $descr = img.descr, + $height = img.height, + $width = img.width; - if(typeof descr === 'undefined'){ + if(typeof $descr === 'undefined'){ var divDescr = "" }else{ - var divDescr =[$('
').addClass('descr').html(descr)] + var divDescr =[$('').addClass('descr').html($descr)] }; - if(typeof url === 'undefined'){ - var blockImg = [$('').append(divDescr).append($('').attr({'src':imag , 'alt':alt , 'title':title }))] + if(typeof $url === 'undefined'){ + var blockImg = [$('').append(divDescr).append($('').attr({'src':$imag , 'alt':$alt , 'title':$title }))] }else{ - var blockImg = [$('').attr({'href':url , 'target':options.target}).append(divDescr).append($('').attr({'src':imag , 'alt':alt , 'title':title }))] + var blockImg = [$('').attr({'href':$url , 'target':options.target}).append(divDescr).append($('').attr({'src':$imag , 'alt':$alt , 'title':$title }))] } $('ul',ele).append($('').addClass('img-' + i).append($('').addClass('contenerImg').width(options.width).height(cont_h).append(blockImg))); - + + + _resizeSlideshowImag(ele, i, $height,$width); + }); - _resizeSlideshowImag(); //slide_____________________________________________________________________________________________ if(options.styleSlideshow == 'Slide'){ - var ul_w = (options.imgs.length + 1) * options.width; - $('ul', ele).wrap($('').addClass('slideCont')).width(ul_w); + var $ul_w = (options.imgs.length + 1) * options.width; + $('ul', ele).wrap($('').addClass('slideCont')).width($ul_w); $('ul', ele).prepend($('ul li:last-child', ele).clone().css('margin-left','-'+ options.width +'px')); $('ul', ele).append($('ul li:nth-child(2)', ele).clone()); @@ -137,16 +141,16 @@ $('.clt_thumb', ele).hide() }; - var resize_thumb_w = ((options.width-(n_thumb * 5))/n_thumb), - r = options.thumb_width/options.thumb_height, - rezise_thumb_h = resize_thumb_w / r, - navThumb_w = options.imgs.length * (resize_thumb_w + 6); - $(ele).data('e').navThumb_w = navThumb_w; + var $resize_thumb_w = ((options.width-(n_thumb * 5))/n_thumb), + $r = options.thumb_width/options.thumb_height, + $rezise_thumb_h = $resize_thumb_w / $r, + $navThumb_w = options.imgs.length * ($resize_thumb_w + 6); + $(ele).data('e').$navThumb_w = $navThumb_w; $('.link', ele).width(options.width).height(options.thumb_height + 10); - $('.link', ele).append($('').addClass('nav-thumb-content').height(rezise_thumb_h + 10).width(navThumb_w)); + $('.link', ele).append($('').addClass('nav-thumb-content').height($rezise_thumb_h + 10).width($navThumb_w)); $.each(options.imgs, function(i, img){ var imag = img.src; - $('.nav-thumb-content', ele).append($('').addClass('slideshow-' + i + ' nav-link slideshow-thumb').attr('imag', i).width(resize_thumb_w).height(rezise_thumb_h).append($('').attr({'class':'thumb','src':imag}))); + $('.nav-thumb-content', ele).append($('').addClass('slideshow-' + i + ' nav-link slideshow-thumb').attr('imag', i).width($resize_thumb_w).height($rezise_thumb_h).append($('').attr({'class':'thumb','src':imag}))); }); - if(navThumb_w > options.width){ + if($navThumb_w > options.width){ $('.nav-thumb-content', ele).wrap($('').addClass('nav-thumb-slide').width( options.width)); $('.link', ele).append($('').addClass('thumb_control thumb-left')).append($('').addClass('thumb_control thumb-right')); @@ -191,9 +195,9 @@ _pause(ele); } - var new_i_img = parseInt($(this).attr('imag')), - r; - r = new_i_img - ($(ele).data('e').i_img + 1) - $(ele).data('e').m_s = $(ele).data('e').m_s - (r * options.width); - $(ele).data('e').i_img = new_i_img - 1; + var $new_i_img = parseInt($(this).attr('imag')), + $r; + $r = $new_i_img - ($(ele).data('e').i_img + 1) + $(ele).data('e').m_s = $(ele).data('e').m_s - ($r * options.width); + $(ele).data('e').i_img = $new_i_img - 1; _rotate(ele); if ($(ele).data('e').playOnT == true){ @@ -277,11 +281,8 @@ //resize and center image__________________________________________________________________________________________________________________ - function _resizeSlideshowImag (){ + function _resizeSlideshowImag (ele, i, $img_h,$img_w){ - $('ul img',ele).each(function(){ - var $img = $(this), - $descr = $(this).prev(), - $img_w = $img.width(), - $img_h = $img.height(), + var $img = $('ul li.img-' + i +' img ',ele), + $descr = $img.prev(), $img_r = $img_h/$img_w, $box_h = cont_h, @@ -305,5 +306,4 @@ var $left = ($(ele).data('e').s_w / 2)-($new_w / 2) + 'px', $top = ($box_h / 2)-($new_h / 2) + 'px'; - $img.css({ width : $new_w + 'px', @@ -316,9 +316,9 @@ left : $left, width : $new_w + 'px', - height : $new_h/4, - bottom : (($box_h / 2)-($new_h / 2)) + 'px', + height : $new_h/4 + 'px', + bottom : (($box_h / 2)-($new_h / 2)) + 'px', }) - }) - }; + }; + //animation________________________________________________________________________________________________________________________________ function _rotate(ele) { @@ -419,15 +419,15 @@ function _thumbSlide(ele) { if(options.navType == 'thumb'){ - var a = ($(ele).data('e').i_img)/$(ele).data('e').n_thumb, - thumbcontent = $('.nav-thumb-content', ele); - if(a < 0){ - a = 0 + var $a = ($(ele).data('e').i_img)/$(ele).data('e').n_thumb, + $thumbcontent = $('.nav-thumb-content', ele); + if($a < 0){ + $a = 0 } - $(ele).data('e').thumb_i = Math.floor(a); + $(ele).data('e').thumb_i = Math.floor($a); var m_r = ( $(ele).data('e').thumb_i)* $(ele).data('e').s_w; - if ( m_r > thumbcontent.width() - $('.nav-thumb-slide', ele).width()){ - m_r = thumbcontent.width() - $('.nav-thumb-slide', ele).width(); - }; - var n_p = thumbcontent.position(); + if ( m_r > $thumbcontent.width() - $('.nav-thumb-slide', ele).width()){ + m_r = $thumbcontent.width() - $('.nav-thumb-slide', ele).width(); + }; + var n_p = $thumbcontent.position(); if($('.link:hover', ele).length == 0){ if ( n_p.left != m_r ){ Index: /extensions/Slide/local_head.tpl =================================================================== --- /extensions/Slide/local_head.tpl (revision 27565) +++ /extensions/Slide/local_head.tpl (revision 27566) @@ -6,4 +6,5 @@ {if not empty($pluginActive)}{foreach from=$pluginActive item=foo}{if $foo == 'lightbox'}{combine_script id='slideLB' load='footer' require='jquery' path='themes/Slide/js/plugin/SlideLightbox.js'}{/if}{/foreach}{/if} {if not empty($pluginActive)}{foreach from=$pluginActive item=foo}{if $foo == 'EasyCaptcha'}{combine_script id='slideEC' load='footer' require='jquery' path='themes/Slide/js/plugin/SlideEasyCaptcha.js'}{/if}{/foreach}{/if} +{if not empty($pluginActive)}{foreach from=$pluginActive item=foo}{if $foo == 'MyPiwiShop'}{combine_script id='slidemps' load='footer' require='jquery' path='themes/Slide/js/plugin/SlideMyPiwiShop.js'}{/if}{/foreach}{/if} {combine_script id='slide' load='footer' require='jquery' path='themes/Slide/js/slide.js'} Index: /extensions/Slide/template/header.tpl =================================================================== --- /extensions/Slide/template/header.tpl (revision 27565) +++ /extensions/Slide/template/header.tpl (revision 27566) @@ -46,7 +46,5 @@ {get_combined_scripts load='header'} - + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} {combine_script id="jquery" load="footer"} Index: /extensions/Slide/template/picture_content.tpl =================================================================== --- /extensions/Slide/template/picture_content.tpl (revision 27565) +++ /extensions/Slide/template/picture_content.tpl (revision 27566) @@ -1,3 +1,3 @@ -