Changeset 27566 for extensions
- Timestamp:
- Mar 6, 2014, 12:37:01 PM (10 years ago)
- Location:
- extensions/Slide
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Slide/Slide.php
r26889 r27566 5 5 global $conf, $template,$smarty, $repeat, $user, $page; 6 6 $params = array_merge(unserialize($conf['Slide'])); 7 8 9 10 7 11 8 if ($params['color_theme'] == 2 ) 12 9 { … … 17 14 }; 18 15 16 $plug_act = array(); 19 17 18 $plug = get_db_plugins('active'); 19 foreach($plug as $plug){ 20 $plug_act[]=$plug['id']; 21 } 20 22 21 $plug_act = array();22 23 $withlightbox = get_db_plugins('active' , 'lightbox'); 23 24 if($withlightbox) … … 44 45 $template->assign('lightbox_data', $lightbox_data); 45 46 46 array_push($plug_act, 'lightbox');47 47 }; 48 48 … … 55 55 $template->assign('slideGThumb', $GThumb_data); 56 56 $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'); 60 if($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')); 58 64 }; 59 65 … … 80 86 $template->assign('slideEasyCaptcha', $EasyCaptcha_data); 81 87 82 array_push($plug_act, 'EasyCaptcha');83 88 }; 84 89 -
extensions/Slide/js/plugin/SlideEasyCaptcha.js
r26889 r27566 1 1 /* 2 * Slide GThumb- v1.0 - 01-01-20142 * SlideEasyCaptcha - v1.0 - 01-01-2014 3 3 * plugin for Slide and EasyCaptcha 4 4 * Original by mistic100 for EasyCaptcha : http://fr.piwigo.org/ext/extension_view.php?eid=591 -
extensions/Slide/js/plugin/SlideGThumb.js
r26889 r27566 1 1 /* 2 * Slide GThumb- v1.0 - 01-01-20142 * SlideMyPiwiShop - v1.0 - 01-01-2014 3 3 * plugin for Slide and GThumb+ 4 4 * Original by P@t for GThumb+ : http://fr.piwigo.org/ext/extension_view.php?eid=591 … … 7 7 */ 8 8 9 function _ GThumb(){9 function _MyPiwiShop(){ 10 10 var $layerShow = $('body').data('layerShow'); 11 11 if($('#the_page', $layerShow).hasClass('GThumb')) { 12 12 if ($('body').hasClass('GThumb')){ 13 13 $.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(){ 15 15 _Gthumb_init(); 16 16 $('body').removeClass('GThumb').addClass('GThumbReady'); -
extensions/Slide/js/plugin/SlideLightbox.js
r27025 r27566 1 1 /* 2 * Slide GThumb- v1.0 - 01-01-20142 * SlideLightbox - v1.0 - 01-01-2014 3 3 * plugin for Slide and Lightbox 4 4 * Original by P@t for Lightbox : http://fr.piwigo.org/ext/extension_view.php?eid=591 -
extensions/Slide/js/slide.js
r27026 r27566 313 313 _GThumb() 314 314 }; 315 if($('body').hasClass('MyPiwiShop')||$('body').hasClass('MyPiwiShopReady')) { 316 _MyPiwiShop() 317 }; 318 315 319 }; 316 320 … … 543 547 var $next = $(html).find('.pwg-button-icon-right').attr('href'), 544 548 $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); 547 554 if(typeof $next != "undefined"){ 548 555 _load_slideshow($next,$slideW) … … 565 572 }; 566 573 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); 569 577 $slideshow.push($img); 570 578 }; -
extensions/Slide/js/slideshow.js
r27402 r27566 59 59 $(document).ready(function(){ 60 60 $.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; 66 68 67 if(typeof descr === 'undefined'){69 if(typeof $descr === 'undefined'){ 68 70 var divDescr = "" 69 71 }else{ 70 var divDescr =[$('<div />').addClass('descr').html( descr)]72 var divDescr =[$('<div />').addClass('descr').html($descr)] 71 73 }; 72 74 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 }))] 75 77 }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 }))] 77 79 } 78 80 79 81 $('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 81 86 }); 82 87 83 _resizeSlideshowImag();84 88 85 89 //slide_____________________________________________________________________________________________ 86 90 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); 89 93 $('ul', ele).prepend($('ul li:last-child', ele).clone().css('margin-left','-'+ options.width +'px')); 90 94 $('ul', ele).append($('ul li:nth-child(2)', ele).clone()); … … 137 141 $('.clt_thumb', ele).hide() 138 142 }; 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; 144 148 $('.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)); 146 150 $.each(options.imgs, function(i, img){ 147 151 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}))); 149 153 }); 150 if( navThumb_w > options.width){154 if($navThumb_w > options.width){ 151 155 $('.nav-thumb-content', ele).wrap($('<div />').addClass('nav-thumb-slide').width( options.width)); 152 156 $('.link', ele).append($('<div />').addClass('thumb_control thumb-left')).append($('<div />').addClass('thumb_control thumb-right')); … … 191 195 _pause(ele); 192 196 } 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; 198 202 _rotate(ele); 199 203 if ($(ele).data('e').playOnT == true){ … … 277 281 //resize and center image__________________________________________________________________________________________________________________ 278 282 279 function _resizeSlideshowImag ( ){283 function _resizeSlideshowImag (ele, i, $img_h,$img_w){ 280 284 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(), 286 287 $img_r = $img_h/$img_w, 287 288 $box_h = cont_h, … … 305 306 var $left = ($(ele).data('e').s_w / 2)-($new_w / 2) + 'px', 306 307 $top = ($box_h / 2)-($new_h / 2) + 'px'; 307 308 308 $img.css({ 309 309 width : $new_w + 'px', … … 316 316 left : $left, 317 317 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', 320 320 }) 321 })322 };321 }; 322 323 323 //animation________________________________________________________________________________________________________________________________ 324 324 function _rotate(ele) { … … 419 419 function _thumbSlide(ele) { 420 420 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 = 0421 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 425 425 } 426 $(ele).data('e').thumb_i = Math.floor( a);426 $(ele).data('e').thumb_i = Math.floor($a); 427 427 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(); 432 432 if($('.link:hover', ele).length == 0){ 433 433 if ( n_p.left != m_r ){ -
extensions/Slide/local_head.tpl
r27021 r27566 6 6 {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} 7 7 {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} 8 9 9 10 {combine_script id='slide' load='footer' require='jquery' path='themes/Slide/js/slide.js'} -
extensions/Slide/template/header.tpl
r26858 r27566 46 46 47 47 {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 51 49 {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} 52 50 {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}"> 2 2 <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}"> 3 3 -
extensions/Slide/theme.css
r27402 r27566 1072 1072 height: 100px; 1073 1073 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); 1075 1075 z-index: 0; 1076 1076 border-radius: 5px;
Note: See TracChangeset
for help on using the changeset viewer.