Plugin Directory

Changeset 1738488


Ignore:
Timestamp:
09/29/2017 03:10:43 PM (9 years ago)
Author:
graphicarea
Message:

1.0.2

  • Add Customization Features
Location:
ga-image-carousel/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ga-image-carousel/trunk/ga-image-carousel-basic.css

    r1737747 r1738488  
    1616    padding:10px;
    1717    width: 100%;
     18    cursor:pointer;
    1819}
    1920.basic .ga-roll {
     
    5960    font-size:14px;
    6061    overflow:hidden;
    61     width:90%;
    62     margin-left:5%;
    6362    z-index:2;
    6463}
  • ga-image-carousel/trunk/ga-image-carousel-dark.css

    r1737747 r1738488  
    1616    padding:10px;
    1717    width: 100%;
    18 }
     18    cursor:pointer;
     19    }
    1920.dark .ga-roll {
    2021    position: relative;
     
    5960    font-size:14px;
    6061    overflow:hidden;
    61     width:90%;
    62     margin-left:5%;
    6362    z-index:2;
    6463}
  • ga-image-carousel/trunk/ga-image-carousel.js

    r1738275 r1738488  
    2828        this.proportionY;
    2929        this.easing = "linear";
     30        this.border;
     31        this.borderR;
     32        this.borderC;
     33        this.margin;
     34        this.nav;
    3035        this.customStyle;
    3136        var self = this;
     
    4651            this.an = this.carousel.data("animation");
    4752            this.cp = this.carousel.data("caption");
     53            this.b = this.carousel.data("border");
     54            this.bc = this.carousel.data("border-color");
     55            this.br = this.carousel.data("border-radius");
     56            this.mr = this.carousel.data("margin");
     57            this.nv = this.carousel.data("navigation");
     58           
     59            if(typeof this.b != "undefined"){this.border = this.b;}
     60            if(typeof this.bc != "undefined"){this.borderC = this.bc;}
     61            if(typeof this.br != "undefined"){this.borderR = this.br;}
     62            if(typeof this.mr != "undefined"){this.margin = this.mr;}
     63            if(typeof this.nv != "undefined"){this.nav = this.nv;}
    4864           
    4965            if(typeof this.dl == "undefined"){this.autoplaydelay = 5000;}else{this.autoplaydelay = this.dl*1000;}
     
    6177           
    6278            createCustomCSS.call(this);         
    63 
     79           
    6480            this.carouselWidth = this.carousel.width();
    6581            this.projectWidth = this.project.outerWidth() + parseInt(this.project.css('margin-right').replace('px',''));
     
    97113            }
    98114           
    99             }
     115        }
    100116       
    101117        function createCustomCSS() {
     
    105121            var imgW;
    106122            var addheight = 0;
     123            var addProject ='';
     124            var addP ='';
    107125           
    108126            this.captionH=$(this.id+' .ga-project p').outerHeight(true);
    109127           
     128            if (typeof this.border != "undefined"){
     129
     130                addProject +="border-width:"+this.border+"px;";
     131               
     132                if (typeof this.borderC != "undefined"){
     133               
     134                    addProject +="border-color:"+this.borderC+";";
     135                    addP +="background:"+this.borderC+";";
     136                    }
     137                   
     138                if (typeof this.borderR != "undefined"){
     139               
     140                    if (this.borderR != 0){
     141                   
     142                        if(!this.borderR.indexOf('%'))
     143                        {this.borderR = this.borderR+"px";}                     
     144                       
     145                        }
     146                   
     147                    addProject +="border-radius:"+this.borderR+";-webkit-border-radius:"+this.borderR+";-moz-border-radius:"+this.borderR+";";
     148                   
     149                    }
     150               
     151                }
     152               
     153                if (typeof this.margin != "undefined"){
     154               
     155                    addProject +="margin-right:"+this.margin+"px;";
     156                   
     157                    }
     158                   
     159                if (this.nav == 0){
     160               
     161                    $(this.id).find('.ga-navigation').hide();
     162                   
     163                    }
     164           
    110165            if (this.proportionX == "auto"){
    111166               
    112                     proportion = this.imgWidth/this.imgHeight;
    113                    
     167                proportion = this.imgWidth/this.imgHeight;
     168               
    114169                }else{
    115170               
    116                     proportion = this.proportionX/this.proportionY;
    117                
    118                 }
    119                
     171                proportion = this.proportionX/this.proportionY;
     172               
     173            }
     174           
    120175            if (this.captionH != null){
    121176               
    122177                addheight = this.captionH;
    123                 }
    124                        
     178            }
     179           
    125180            this.customStyle = "<style>";
    126181           
    127182            if (proportion == 1){
    128183               
    129             this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+this.configProjectWidth+"px}";
    130             this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+(Number(this.configProjectWidth)+Number(addheight))+"px}";
     184                this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+this.configProjectWidth+"px}";
     185                this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+(Number(this.configProjectWidth)+Number(addheight))+"px;"+addProject+"}";
    131186                imgH = this.configProjectWidth+"px";
    132187                imgW = "auto";
     
    135190               
    136191                if (proportion > 1){
    137 
     192                   
    138193                    imgH = Number(this.configProjectWidth/proportion)+Number(addheight)+"px";
    139194                    imgW = this.configProjectWidth+"px";
    140195                   
    141196                    this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+imgH+";}";
    142                     this.customStyle += this.id+" .ga-project{width:"+this.configProjectWidth+"px;height:"+imgH+";}";
     197                    this.customStyle += this.id+" .ga-project{width:"+this.configProjectWidth+"px;height:"+imgH+";"+addProject+"}";
    143198                    this.customStyle += this.id+" .ga-project img {min-height:100%;width:"+imgW+";}";
    144199                    }else{
     
    147202                    imgW = "auto";
    148203                    this.customStyle += this.id+" .ga-project div{width:"+this.configProjectWidth+"px;height:"+imgH+";}";
    149                     this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+imgH+";}";
     204                    this.customStyle += this.id+" .ga-project {width:"+this.configProjectWidth+"px;height:"+imgH+";"+addProject+"}";
    150205                    this.customStyle += this.id+" .ga-project img {height:"+imgH+";width:"+imgW+";}";
    151206                }
    152207               
    153             }
    154            
    155            
    156            
     208            }           
     209            this.customStyle += this.id+" .ga-project p{"+addP+"}";
    157210            this.customStyle +="</style>"; 
    158211            $('head').append(this.customStyle);
     
    168221           
    169222            if(typeof $.fancybox != 'function') {
    170            
    171             $links.on('click touchstart', function() {
    172             $.fancybox.open( $links, {
    173             }, $links.index( this ) );
    174 
    175             return false;
    176             });
    177            
    178             }
    179            
    180             this.carousel.on('mousedown touchstart', 'div', function(event){
     223               
     224                $links.on('click touchstart', function() {
     225                    $.fancybox.open( $links, {
     226                    }, $links.index( this ) );
     227                   
     228                    return false;
     229                });
     230               
     231            }
     232           
     233            this.carousel.on('mousedown touchstart', function(event){
    181234                event.preventDefault();
    182235                event.stopPropagation();
    183236                clearInterval(self.autoplayTimer);
    184237                drag = true;           
    185 
     238               
    186239            });
    187240           
     
    218271                   
    219272                }
    220             });     
     273            });
    221274           
    222275        }
  • ga-image-carousel/trunk/ga-image-carousel.php

    r1738231 r1738488  
    44Plugin URI: http://www.graphicarea.pro/en/ga-image-carousel-v1-en
    55Description: Simple and light image carousel with animation and fancybox.
    6 Version: 1.0.1
     6Version: 1.0.2
    77Author: Anatoly Ludischev
    88Author URI: http://www.graphicarea.pro
     
    2020
    2121add_action( 'wp_enqueue_scripts', 'ga_wp_add_basic_scripts' );
     22add_image_size( 'ga-image-size', 500, 500, array( 'center', 'center' ));
    2223
    2324
     
    3738                    'clickable' => '1',
    3839                    'caption' => '1',
     40                    'border' => '10',
     41                    'border-color' => '#ffffff',
     42                    'border-radius' => '0',
     43                    'margin' => '10',
     44                    'navigation' => '1',
    3945    );
    4046   
    4147    $user_config = "";
    4248    $image_caption = "";
     49    $proportion = 0;
    4350
    4451    if(isset ($args['theme'])){$config['theme'] = $args['theme'];}
     
    5360            }           
    5461        }
     62    }
     63    $ga_size = array($config['width-item'], $config['width-item']);
     64    if ($config['proportion'] != 'auto') {
     65            $proportion = explode(":", $config['proportion']);
     66            $proportion = $proportion[0] / $proportion[1];
     67    }
     68    if ($proportion == 1) {
     69        $ga_size = 'ga-image-size' ;
    5570    }
    5671    $ids = explode(',', $args['ids']);
     
    7792
    7893
    79             $html.= wp_get_attachment_image( $id, array($config['width-item'], $config['width-item'])).'</a></div>'.$image_caption.'</div>';   
     94            $html.= wp_get_attachment_image( $id, $ga_size).'</a></div>'.$image_caption.'</div>';   
    8095        } else {
    81                 $html.= '<div class="ga-project"><div>'.wp_get_attachment_image( $id, array($config['width-item'], $config['width-item'])).'</div>'.$image_caption.'</div>';   
     96                $html.= '<div class="ga-project"><div>'.wp_get_attachment_image( $id, $ga_size).'</div>'.$image_caption.'</div>';   
    8297        }
    8398   
  • ga-image-carousel/trunk/readme.txt

    r1738298 r1738488  
    5151
    5252`
    53 ids          => use image ids
    54 direction    => left / right. default: right
    55 duration     => from 0 to ∞ (in sec). default: 0.4
    56 animation    => bysection / linear. default: bysection
    57 delay        => from 0 to ∞ (in sec). default: 5
    58 width        => px / %. default: 100%
    59 width-item   => px / %. default: 150px
    60 proportion   => example: 1:3.5 / auto . default: 1:1
    61 clickable    => 0 / 1. default: 1
    62 fancy        => 0 / 1. default: 1
    63 theme        => basic / dark. default: basic
    64 caption      => 0 / 1. default: 1
     53ids           => use image ids
     54direction     => left / right. default: right
     55duration      => from 0 to ∞ (in sec). default: 0.4
     56animation     => bysection / linear. default: bysection
     57delay         => from 0 to ∞ (in sec). default: 5
     58width         => px / %. default: 100%
     59width-item    => px / %. default: 150px
     60proportion    => example: 1:3.5 / auto . default: 1:1
     61clickable     => 0 / 1. default: 1
     62fancy         => 0 / 1. default: 1
     63theme         => basic / dark. default: basic
     64caption       => 0 / 1. default: 1
     65border        => from 0 to ∞. default: 10
     66border-color  => in rgb, rgba or hex. default: #ffffff
     67border-radius => in px, % or 0 (disable). default: 0
     68margin        => from 0 to ∞. default: 10
     69navigation    => 0 or 1. default: 1
    6570`
    6671
     
    8186== Changelog ==
    8287
     88= 1.0.2 =
     89* Add Customization Features
    8390
    8491= 1.0.1 =
Note: See TracChangeset for help on using the changeset viewer.