Changeset 27566 for extensions


Ignore:
Timestamp:
Mar 6, 2014, 12:37:01 PM (10 years ago)
Author:
Miklfe
Message:

Change theme.css
Slideshow fixed
compatibility with MyPiwiShop(futur)

Location:
extensions/Slide
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/Slide/Slide.php

    r26889 r27566  
    55global $conf, $template,$smarty, $repeat, $user, $page;
    66        $params = array_merge(unserialize($conf['Slide']));
    7        
    8        
    9        
    10        
     7               
    118if ($params['color_theme'] == 2 )
    129                {
     
    1714                };
    1815               
     16$plug_act = array();           
    1917               
     18$plug = get_db_plugins('active');
     19  foreach($plug as $plug){
     20   $plug_act[]=$plug['id'];
     21  }             
    2022               
    21 $plug_act = array();           
    2223$withlightbox = get_db_plugins('active' , 'lightbox');
    2324if($withlightbox)
     
    4445$template->assign('lightbox_data', $lightbox_data);
    4546
    46 array_push($plug_act, 'lightbox');
    4747};
    4848       
     
    5555        $template->assign('slideGThumb', $GThumb_data);
    5656        $template->assign('GThumb_derivative_params', ImageStdParams::get_custom(9999, $conf['GThumb']['height']));
    57         array_push($plug_act, 'GThumb');
     57};
     58
     59$withPiwiShop = get_db_plugins('active' , 'MyPiwiShop');
     60if($withPiwiShop)
     61        {
     62        $template->func_combine_css(array('path'=>'plugins/MyPiwiShop/template/style.css'));
     63        $template->func_combine_css(array('path'=>'plugins/MyPiwiShop/template/elem_form_style.css'));
    5864};
    5965
     
    8086        $template->assign('slideEasyCaptcha', $EasyCaptcha_data);
    8187
    82         array_push($plug_act, 'EasyCaptcha');
    8388};
    8489
  • extensions/Slide/js/plugin/SlideEasyCaptcha.js

    r26889 r27566  
    11/*
    2  * SlideGThumb - v1.0 - 01-01-2014
     2 * SlideEasyCaptcha - v1.0 - 01-01-2014
    33 * plugin for Slide and EasyCaptcha
    44 * Original by mistic100 for EasyCaptcha : http://fr.piwigo.org/ext/extension_view.php?eid=591
  • extensions/Slide/js/plugin/SlideGThumb.js

    r26889 r27566  
    11/*
    2  * SlideGThumb - v1.0 - 01-01-2014
     2 * SlideMyPiwiShop - v1.0 - 01-01-2014
    33 * plugin for Slide and GThumb+
    44 * Original by P@t for GThumb+ : http://fr.piwigo.org/ext/extension_view.php?eid=591
     
    77 */
    88 
    9 function _GThumb(){
     9function _MyPiwiShop(){
    1010        var $layerShow  = $('body').data('layerShow');
    1111        if($('#the_page', $layerShow).hasClass('GThumb')) {
    1212                if ($('body').hasClass('GThumb')){
    1313                        $.getScript('./plugins/GThumb/js/jquery.ba-resize.min.js', function(){
    14                                 $.getScript('./plugins/GThumb/js/gthumb.js',function(){
     14                                $.getScript('./plugins/MyPiwiShop/js/gthumb.js',function(){
    1515                                _Gthumb_init();
    1616                                $('body').removeClass('GThumb').addClass('GThumbReady');
  • extensions/Slide/js/plugin/SlideLightbox.js

    r27025 r27566  
    11/*
    2  * SlideGThumb - v1.0 - 01-01-2014
     2 * SlideLightbox - v1.0 - 01-01-2014
    33 * plugin for Slide and Lightbox
    44 * Original by P@t for Lightbox : http://fr.piwigo.org/ext/extension_view.php?eid=591
  • extensions/Slide/js/slide.js

    r27026 r27566  
    313313                                _GThumb()
    314314                        };
     315                        if($('body').hasClass('MyPiwiShop')||$('body').hasClass('MyPiwiShopReady')) {
     316                                _MyPiwiShop()
     317                        };
     318
    315319                };             
    316320               
     
    543547                                        var $next       = $(html).find('.pwg-button-icon-right').attr('href'),
    544548                                                $title  = $(html).find('#imageHeaderBar h2').text(),
    545                                                 $img    = $(html).find('#theImage img').attr('src');
    546                                         _stock_img($img,$title);
     549                                                $img    = $(html).find('#theImage #imgContent').data('src'),
     550                                                $img_h  = $(html).find('#theImage #imgContent').data('height'),
     551                                                $img_w  = $(html).find('#theImage #imgContent').data('width');
     552                                               
     553                                        _stock_img($img,$title,$img_h,$img_w);
    547554                                        if(typeof $next != "undefined"){
    548555                                                _load_slideshow($next,$slideW)
     
    565572                };
    566573
    567                 function _stock_img($href,$title){
    568                         var $img = {src : $href  , title : $title , descr : $title};
     574                function _stock_img($href,$title,$height,$width){
     575                        var $img = {src : $href  , title : $title , descr : $title , height : $height , width : $width};
     576                console.debug($img);
    569577                        $slideshow.push($img);
    570578                };
  • extensions/Slide/js/slideshow.js

    r27402 r27566  
    5959                        $(document).ready(function(){
    6060                                $.each(options.imgs, function(i, img){
    61                                         var imag                = img.src,
    62                                                 alt             = img.alt,
    63                                                 title           = img.title,
    64                                                 url             = img.url,
    65                                                 descr           = img.descr;
     61                                        var $imag               = img.src,
     62                                                $alt            = img.alt,
     63                                                $title          = img.title,
     64                                                $url            = img.url,
     65                                                $descr          = img.descr,
     66                                                $height         = img.height,
     67                                                $width          = img.width;
    6668                                               
    67                                                 if(typeof descr === 'undefined'){       
     69                                                if(typeof $descr === 'undefined'){     
    6870                                                        var divDescr    = ""
    6971                                                }else{
    70                                                         var     divDescr        =[$('<div />').addClass('descr').html(descr)]
     72                                                        var     divDescr        =[$('<div />').addClass('descr').html($descr)]
    7173                                                };
    7274                                               
    73                                                 if(typeof url === 'undefined'){
    74                                                         var blockImg    = [$('<div />').append(divDescr).append($('<img />').attr({'src':imag , 'alt':alt , 'title':title }))]
     75                                                if(typeof $url === 'undefined'){
     76                                                        var blockImg    = [$('<div />').append(divDescr).append($('<img />').attr({'src':$imag , 'alt':$alt , 'title':$title }))]
    7577                                                }else{
    76                                                         var     blockImg        = [$('<a />').attr({'href':url , 'target':options.target}).append(divDescr).append($('<img />').attr({'src':imag , 'alt':alt , 'title':title }))]
     78                                                        var     blockImg        = [$('<a />').attr({'href':$url , 'target':options.target}).append(divDescr).append($('<img />').attr({'src':$imag , 'alt':$alt , 'title':$title }))]
    7779                                                }
    7880                                               
    7981                                        $('ul',ele).append($('<li />').addClass('img-' + i).append($('<div />').addClass('contenerImg').width(options.width).height(cont_h).append(blockImg)));
    80                                
     82
     83                                       
     84                                _resizeSlideshowImag(ele, i, $height,$width);
     85
    8186                                });
    8287                               
    83                                 _resizeSlideshowImag();
    8488       
    8589//slide_____________________________________________________________________________________________
    8690                                if(options.styleSlideshow == 'Slide'){
    87                                         var ul_w = (options.imgs.length + 1) * options.width;
    88                                         $('ul', ele).wrap($('<div />').addClass('slideCont')).width(ul_w);
     91                                        var $ul_w = (options.imgs.length + 1) * options.width;
     92                                        $('ul', ele).wrap($('<div />').addClass('slideCont')).width($ul_w);
    8993                                        $('ul', ele).prepend($('ul li:last-child', ele).clone().css('margin-left','-'+ options.width +'px'));
    9094                                        $('ul', ele).append($('ul li:nth-child(2)', ele).clone());
     
    137141                                                $('.clt_thumb', ele).hide()
    138142                                        };
    139                                         var resize_thumb_w              = ((options.width-(n_thumb * 5))/n_thumb),
    140                                                 r                                       = options.thumb_width/options.thumb_height,
    141                                                 rezise_thumb_h          = resize_thumb_w / r,
    142                                                 navThumb_w                      = options.imgs.length * (resize_thumb_w + 6);
    143                                         $(ele).data('e').navThumb_w     = navThumb_w;
     143                                        var $resize_thumb_w     = ((options.width-(n_thumb * 5))/n_thumb),
     144                                                $r                                      = options.thumb_width/options.thumb_height,
     145                                                $rezise_thumb_h         = $resize_thumb_w / $r,
     146                                                $navThumb_w                     = options.imgs.length * ($resize_thumb_w + 6);
     147                                        $(ele).data('e').$navThumb_w    = $navThumb_w;
    144148                                        $('.link', ele).width(options.width).height(options.thumb_height + 10);
    145                                         $('.link', ele).append($('<div />').addClass('nav-thumb-content').height(rezise_thumb_h + 10).width(navThumb_w));
     149                                        $('.link', ele).append($('<div />').addClass('nav-thumb-content').height($rezise_thumb_h + 10).width($navThumb_w));
    146150                                        $.each(options.imgs, function(i, img){
    147151                                                var imag        = img.src;
    148                                                 $('.nav-thumb-content', ele).append($('<span />').addClass('slideshow-' + i + ' nav-link slideshow-thumb').attr('imag', i).width(resize_thumb_w).height(rezise_thumb_h).append($('<img />').attr({'class':'thumb','src':imag})));
     152                                                $('.nav-thumb-content', ele).append($('<span />').addClass('slideshow-' + i + ' nav-link slideshow-thumb').attr('imag', i).width($resize_thumb_w).height($rezise_thumb_h).append($('<img />').attr({'class':'thumb','src':imag})));
    149153                                        });
    150                                         if(navThumb_w > options.width){
     154                                        if($navThumb_w > options.width){
    151155                                                $('.nav-thumb-content', ele).wrap($('<div />').addClass('nav-thumb-slide').width( options.width));
    152156                                                $('.link', ele).append($('<div />').addClass('thumb_control thumb-left')).append($('<div />').addClass('thumb_control thumb-right'));
     
    191195                                        _pause(ele);
    192196                                }               
    193                                 var new_i_img   = parseInt($(this).attr('imag')),
    194                                         r;
    195                                         r       = new_i_img - ($(ele).data('e').i_img + 1)
    196                                 $(ele).data('e').m_s    = $(ele).data('e').m_s - (r * options.width);
    197                                 $(ele).data('e').i_img  = new_i_img - 1;
     197                                var $new_i_img  = parseInt($(this).attr('imag')),
     198                                        $r;
     199                                        $r      = $new_i_img - ($(ele).data('e').i_img + 1)
     200                                $(ele).data('e').m_s    = $(ele).data('e').m_s - ($r * options.width);
     201                                $(ele).data('e').i_img  = $new_i_img - 1;
    198202                                _rotate(ele);
    199203                                if ($(ele).data('e').playOnT == true){
     
    277281//resize and center image__________________________________________________________________________________________________________________
    278282                               
    279                                 function _resizeSlideshowImag (){
     283                                function _resizeSlideshowImag (ele, i, $img_h,$img_w){
    280284                                       
    281                                         $('ul img',ele).each(function(){
    282                                                 var $img                = $(this),
    283                                                         $descr          = $(this).prev(),
    284                                                         $img_w          = $img.width(),
    285                                                         $img_h          = $img.height(),
     285                                                var $img                = $('ul li.img-' + i +' img ',ele),
     286                                                        $descr          = $img.prev(),
    286287                                                        $img_r          = $img_h/$img_w,
    287288                                                        $box_h          = cont_h,
     
    305306                                                var $left       = ($(ele).data('e').s_w / 2)-($new_w / 2) + 'px',
    306307                                                        $top    = ($box_h / 2)-($new_h / 2) + 'px';
    307                                                        
    308308                                                $img.css({
    309309                                                        width   : $new_w + 'px',
     
    316316                                                        left    : $left,
    317317                                                        width   : $new_w + 'px',
    318                                                         height  : $new_h/4,
    319                                                         bottom  : (($box_h / 2)-($new_h / 2)) + 'px',
     318                                                        height  : $new_h/4 + 'px',
     319                                                        bottom  : (($box_h / 2)-($new_h / 2)) + 'px',                                                   
    320320                                                })
    321                                         })
    322                                 };
     321                                };
     322                               
    323323//animation________________________________________________________________________________________________________________________________                     
    324324                        function _rotate(ele) {
     
    419419                        function _thumbSlide(ele) {
    420420                                if(options.navType == 'thumb'){
    421                                         var a                           = ($(ele).data('e').i_img)/$(ele).data('e').n_thumb,
    422                                                 thumbcontent    = $('.nav-thumb-content', ele);
    423                                         if(a < 0){
    424                                                 a = 0
     421                                        var $a                          = ($(ele).data('e').i_img)/$(ele).data('e').n_thumb,
     422                                                $thumbcontent   = $('.nav-thumb-content', ele);
     423                                        if($a < 0){
     424                                                $a = 0
    425425                                        }
    426                                         $(ele).data('e').thumb_i = Math.floor(a);
     426                                        $(ele).data('e').thumb_i = Math.floor($a);
    427427                                        var m_r = ( $(ele).data('e').thumb_i)* $(ele).data('e').s_w;
    428                                         if ( m_r > thumbcontent.width() - $('.nav-thumb-slide', ele).width()){
    429                                                 m_r = thumbcontent.width() - $('.nav-thumb-slide', ele).width();
    430                                         };
    431                                         var n_p = thumbcontent.position();
     428                                        if ( m_r > $thumbcontent.width() - $('.nav-thumb-slide', ele).width()){
     429                                                m_r = $thumbcontent.width() - $('.nav-thumb-slide', ele).width();
     430                                        };
     431                                        var n_p = $thumbcontent.position();
    432432                                        if($('.link:hover', ele).length == 0){
    433433                                                if ( n_p.left != m_r ){
  • extensions/Slide/local_head.tpl

    r27021 r27566  
    66{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}
    77{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}
     8{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}
    89
    910{combine_script id='slide' load='footer' require='jquery' path='themes/Slide/js/slide.js'}
  • extensions/Slide/template/header.tpl

    r26858 r27566  
    4646
    4747{get_combined_scripts load='header'}
    48 <!--[if lt IE 7]>
    49 <script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script>
    50 <![endif]-->
     48
    5149{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    5250{combine_script id="jquery" load="footer"}
  • extensions/Slide/template/picture_content.tpl

    r26889 r27566  
    1 <div id="imgContent">
     1<div id="imgContent" data-width="{$current.width}" data-height="{$current.height}" data-src="{$current.path}">
    22        <img src="{$current.selected_derivative->get_url()}" {$current.selected_derivative->get_size_htm()} alt="{$ALT_IMG}" id="theMainImage"  title="{if isset($COMMENT_IMG)}{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}{else}{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}{/if}">
    33
  • extensions/Slide/theme.css

    r27402 r27566  
    10721072        height:                                         100px;
    10731073        width:                                          100px;
    1074         background:                                     url("/piwigo26/themes/Slide/images/ajax-loader.gif") no-repeat scroll center center rgba(51, 51, 51, 0.46);
     1074        background:                                     url(images/ajax-loader.gif) no-repeat scroll center center rgba(51, 51, 51, 0.46);
    10751075        z-index:                                        0;
    10761076        border-radius:                          5px;
Note: See TracChangeset for help on using the changeset viewer.