Plugin Directory

Changeset 2156268


Ignore:
Timestamp:
09/13/2019 05:52:58 PM (6 years ago)
Author:
mfarazaly
Message:

New Version 1.0.1 Added

Location:
swiper-js-slider
Files:
36 added
17 edited

Legend:

Unmodified
Added
Removed
  • swiper-js-slider/trunk/README.txt

    r2149746 r2156268  
    22Contributors: midexigner, mfarazaly
    33Donate link: https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36
    4 Tags: swiper, slider, js slider, image slider, wordpress slider
     4Tags: swiper, slider, js slider, image slider, wordpress slider, carousel, multirow
    55Requires at least: 5.1
    66Requires PHP: 5.2.4
    77Tested up to: 5.2.2
    8 Stable tag: 5.0
     8Stable tag: 1.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Swiper Js Slider Simple to use and very effective. Most Modern Mobile Touch Slider
     12Swiper Js Slider/Carousel with Multirow Simple to use and very effective. Most Modern Mobile Touch Slider
    1313
    1414== Description ==
    1515
    16 Swiper Js Slider Simple to use and very effective. Most Modern Mobile Touch Slider
     16Swiper Js Slider/Carousel with Multirow Simple to use and very effective. Most Modern Mobile Touch Slider
    1717
    1818MOST POWERFUL FEATURES
    1919
     20Parameters
     21* slidesPerView | To Set Slider in to Carousel
     22* spaceBetween | In Carousel space between slides
     23* slidesPerColumn | Muti Row with Carousel
     24* initialSlide | Position of slider with index
     25* direction | Vertial or Horizontal
     26* speed | Sliders speed
     27* autoHeight | Auto Height adjust according to image height
     28* effect | Multiple Effects
     29
    2030Autoplay
    2131* On/Off.
    22 * Speed.
     32* Delay
    2333* Stop On Last Slide.
    2434* Disable On Interection.
     
    95105Of course! Smart Slider use protocol relative urls which works fine on http:// and on https:// too.
    96106
    97 = Can I contribute to the developpement? =
     107= Can I contribute to the developement? =
    98108
    99109Yes, you can make a <a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" rel="nofollow">donation</a> or suggest me code correction, see you in private message or via email : mfarazaly(at)gmail.com
     
    1081186. screenshot-6
    1091197. screenshot-7
     1208. screenshot-8
     1219. screenshot-9
     12210. screenshot-10
    110123
    111124== Changelog ==
     125
     126= 1.0.1 =
     127* New Parameters of slides Added.
     128* Search bar added in slider settings.
     129* User Interface updated like, Delete all slides button added Display Total slides in slider.
     130* Code Clean.
     131* Shortcode Details added.
    112132
    113133= 1.0.0 =
  • swiper-js-slider/trunk/admin/css/admin.css

    r2149740 r2156268  
    1 .swiperjsSection {
    2     margin: 20px 0 0 0;
    3     border: 1px solid #ddd;
     1.post-type-swiper_js_slides .swiperjsSection {
     2    box-sizing: border-box;
     3    position: relative;
     4    margin: 0;
     5    border: 0;
    46    background: #fcfcfc;
    5     box-sizing: border-box;
    6     width: 99%;
    7     position: relative;
    8 }
    9 
    10 .headSec {
    11     display: block;
    12     padding: 20px;
    13     background: #ddd;
    14 }
    15 
    16 .headSec h1 span {
    17     margin: 0;
    18     font-size: 14px;
    19 }
    20 
    21 .swiperjsSection h1 {
     7    width: 100%;
     8    display: table;
     9}
     10
     11.post-type-swiper_js_slides .swiperjsSection h1 {
    2212    font-size: 30px;
    2313    margin: 0;
     
    2515}
    2616
    27 .contentSection {
    28     position: relative;
    29 }
    30 
    31 .nav-tab-side {
    32     width: 250px;
    33     margin: 0;
    34     display: inline-block;
    35     vertical-align: top;
     17.post-type-swiper_js_slides .swiperjsSection .tabSec {
     18    display: none;
     19}
     20
     21.post-type-swiper_js_slides .swiperjsSection .rightSide table {
     22    width: 100%;
     23    border: 0;
     24    border-collapse: collapse;
     25}
     26
     27.post-type-swiper_js_slides .swiperjsSection .rightSide table tr:nth-child(even) td {
    3628    background: #ffffff;
    37     position: absolute;
    38     left: 0;
    39     top: 0;
    40     bottom: 0;
    41     border-right: 1px solid #ddd;
    42 }
    43 
    44 .nav-tab-side li {
    45     margin: 0;
    46     border-top: 1px solid #ddd;
    47     outline: none;
    48 }
    49 
    50 .nav-tab-side li.active a,
    51 .nav-tab-side li:hover a{
    52     background: #fcfcfc;
    53 }
    54 
    55 .nav-tab-side li.active a:after{
    56     display: block;
    57 }
    58 
    59 .nav-tab-side li:first-child {
    60     border-top: 0px;
    61 }
    62 
    63 .nav-tab-side li a {
    64     display: block;
     29}
     30
     31.post-type-swiper_js_slides .swiperjsSection .rightSide table td {
     32    width: 20%;
    6533    padding: 10px 15px;
    66     background: #ffffff;
    67     position: relative;
    68     outline: none;
    69     text-decoration: none;
    70     font-size: 14px;
    71     text-transform: capitalize;
    72     letter-spacing: 0.5px;
    73 }
    74 
    75 .nav-tab-side li a:focus{
    76     box-shadow: none;
    77 }
    78 
    79 .nav-tab-side li a:after{
    80     content: '';
    81     position: absolute;
    82     right: -1px;
    83     top: 0;
    84     bottom: 0;
    85     background: #fcfcfc;
    86     width: 2px;
    87     display: none;
    88 }
    89 
    90 .swiperjsSection .rightSide {
    91     padding: 10px 10px 10px 275px;
    92     overflow: hidden;
    93 }
    94 
    95 .swiperjsSection.wrap div.updated,
    96 .swiperjsSection.wrap .notice {
    97     margin: 5px -20px -19px;
    98 }
    99 
    100 .gallery-form-table {
    101     width: 100%;
    102     margin-bottom: 5px;
    103 }
    104 
    105 .gallery-form-table ul {
    106     margin: 0;
    107     font-size: 0;
    108 }
    109 
    110 .gallery-form-table ul li {
    111     display: inline-block;
    112     vertical-align: top;
    113     border: 1px solid #eeeeee;
    114     padding: 5px;
    115     margin: 3px 4px;
    116     background: #ffffff;
    117 }
    118 
    119 .gallery-form-table ul li.ui-sortable-placeholder {
    120     min-height: 170px;
    121     border-style: dashed;
    122     visibility: visible !important;
    123 }
    124 
    125 .gallery-add span {
    126     margin: 4px 3px 0 -4px;
    127 }
    128 
    129 .actionButtons {
    130     text-align: center;
    131     margin-top: 5px;
    132 }
    133 
    134 .actionButtons .button {
    135     width: calc(50% - 4px);
    136     margin: 0 2px;
    137 }
    138 
    139 .actionButtons .remove-image {
    140     background: rgba(170, 0, 0, 0.65);
    141     border: 0;
    142     color: #ffffff;
    143 }
    144 
    145 .actionButtons .remove-image:hover {
    146     background: rgba(170, 0, 0, 0.75);
    147     color: #ffffff;
    148 }
    149 
    150 .actionButtons .button.change-image {
    151     border-color: #cdcdcd;
    152 }
    153 
    154 #swiper-js-slider-settings .inside {
    155     margin: 0;
    156     padding: 0;
    157 }
    158 
    159 .swiperjsSection.innerOptions {
    160     margin: 0;
    161     border: 0;
    162     background: #fcfcfc;
    163     width: 100%;
    164     display: table;
    165 }
    166 
    167 .swiperjsSection.innerOptions .tabSec{
    168     display: none;
    169 }
    170 
    171 .swiperjsSection.innerOptions .nav-tab-side {
    172     display: table-cell;
    173     vertical-align: top;
    174     position: relative;
    175 }
    176 
    177 .swiperjsSection.innerOptions .rightSide {
    178     display: table-cell;
    179     vertical-align: top;
    180     padding: 0;
    181 }
    182 
    183 .swiperjsSection.innerOptions .rightSide table {
    184     width: 100%;
    185     border: 0;
    186     border-collapse: collapse;
    187 }
    188 
    189 .swiperjsSection.innerOptions .rightSide table td {
    190     width: 20%;
    191     padding: 10px;
    19234    border-bottom: 1px solid #eeeeee;
    19335    min-width: 130px;
    19436}
    19537
    196 .swiperjsSection.innerOptions .rightSide table td ul{
     38.post-type-swiper_js_slides .swiperjsSection .rightSide table td ul {
    19739    margin-bottom: 0;
    19840}
    19941
    200 .swiperjsSection.innerOptions .rightSide table td+td {
     42.post-type-swiper_js_slides .swiperjsSection .rightSide table td+td {
    20143    width: 80%;
    20244    border-left: 1px solid #eeeeee;
    20345}
    20446
    205 .swiperjsSection.innerOptions .rightSide input[type="text"] {
    206     width: 100%;
    207 }
    208 
    209 .swiperjsSection.innerOptions .rightSide td > label {
     47.post-type-swiper_js_slides .swiperjsSection .rightSide input[type="text"] {
     48    width: 100%;
     49}
     50
     51.post-type-swiper_js_slides .swiperjsSection .rightSide td>label {
    21052    display: block;
    21153    font-weight: 500;
    21254}
    21355
    214 .swiperjsSection.innerOptions .rightSide span{
     56.post-type-swiper_js_slides .swiperjsSection .rightSide span {
    21557    font-size: 12px;
    21658    display: block;
     
    21961}
    22062
    221 .swiperjsSection.innerOptions .rightSide td ul li{
    222     display: inline-block;
    223     margin-right: 10px;
    224 }
    225 .swiperjsSection.innerOptions .rightSide td ul li input{
    226     margin-right: 5px;
    227 }
    228 .swiperjsSection.innerOptions .hiddenData{
    229     position: relative;
    230 }
    231 .swiperjsSection.innerOptions .hiddenData:after{
     63.post-type-swiper_js_slides .swiperjsSection .rightSide td ul li {
     64    display: inline-block;
     65    margin-right: 10px;
     66}
     67
     68.post-type-swiper_js_slides .swiperjsSection .rightSide td ul li input {
     69    margin-right: 5px;
     70}
     71
     72.post-type-swiper_js_slides .swiperjsSection .hiddenData {
     73    position: relative;
     74}
     75
     76.post-type-swiper_js_slides .swiperjsSection .hiddenData:after {
    23277    content: '';
    23378    position: absolute;
     
    24085}
    24186
    242 .swiperjsSection.innerOptions .hiddenData ::selection{
     87.post-type-swiper_js_slides .swiperjsSection .hiddenData ::selection {
    24388    background: transparent;
    24489}
    245 .addfooter{
     90
     91.post-type-swiper_js_slides .swiperjsSection .nav-tab-side {
     92    width: 250px;
     93    margin: 0;
     94    background: #ffffff;
     95    border-right: 1px solid #eeeeee;
     96    display: table-cell;
     97    vertical-align: top;
     98    position: relative;
     99}
     100
     101.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li {
     102    margin: 0;
     103    border-bottom: 1px solid #eeeeee;
     104    outline: none;
     105}
     106
     107.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active a,
     108.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:hover a {
     109    background: #eeeeee;
     110}
     111
     112.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active,
     113.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:hover {
     114    border-color: #eeeeee;
     115}
     116
     117.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active a:after {
     118    display: block;
     119}
     120
     121.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:first-child {
     122    border-top: 0px;
     123}
     124
     125.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li a {
     126    display: block;
     127    padding: 10px 15px;
     128    background: #ffffff;
     129    position: relative;
     130    outline: none;
     131    text-decoration: none;
     132    font-size: 13px;
     133    text-transform: capitalize;
     134    letter-spacing: 0px;
     135    font-weight: 500;
     136    color: #1e70cd;
     137}
     138
     139.post-type-swiper_js_slides .swiperjsSection .nav-tab-side li a:focus {
     140    box-shadow: none;
     141}
     142
     143.post-type-swiper_js_slides .swiperjsSection .rightSide {
     144    display: table-cell;
     145    vertical-align: top;
     146    padding: 0;
     147}
     148
     149.post-type-swiper_js_slides .swiperjsSection.wrap div.updated,
     150.post-type-swiper_js_slides .swiperjsSection.wrap .notice {
     151    margin: 5px -20px -19px;
     152}
     153
     154.post-type-swiper_js_slides .gallery-form-table {
     155    width: 100%;
     156    margin-bottom: 5px;
     157    overflow: hidden;
     158}
     159
     160.post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list {
     161    margin: 0;
     162    font-size: 0;
     163}
     164
     165.post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list li {
     166    display: inline-block;
     167    vertical-align: top;
     168    border: 1px solid #eeeeee;
     169    padding: 5px;
     170    margin: 3px 4px;
     171    background: #ffffff;
     172    cursor: move;
     173    width: auto;
     174    float: none;
     175    text-align: center;
     176}
     177
     178.post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list li.ui-sortable-placeholder {
     179    min-height: 170px;
     180    border: 3px dashed #cccccc;
     181    visibility: visible !important;
     182}
     183
     184.post-type-swiper_js_slides .gallery-add span {
     185    margin: 4px 3px 0 -4px;
     186}
     187
     188.post-type-swiper_js_slides .actionButtons {
     189    text-align: center;
     190    margin-top: 5px;
     191}
     192
     193.post-type-swiper_js_slides .actionButtons .button {
     194    width: calc(50% - 4px);
     195    margin: 0 2px;
     196}
     197
     198.post-type-swiper_js_slides .actionButtons .remove-image {
     199    background: rgba(170, 0, 0, 0.65);
     200    border: 0;
     201    color: #ffffff;
     202}
     203
     204.post-type-swiper_js_slides .actionButtons .remove-image:hover {
     205    background: rgba(170, 0, 0, 0.75);
     206    color: #ffffff;
     207}
     208
     209.post-type-swiper_js_slides .actionButtons .remove-image .dashicons {
     210    vertical-align: middle;
     211}
     212
     213.post-type-swiper_js_slides .actionButtons .button.change-image {
     214    border-color: #cdcdcd;
     215}
     216
     217.post-type-swiper_js_slides #swiper-js-slider-settings .inside {
     218    margin: 0;
     219    padding: 0;
     220}
     221
     222.post-type-swiper_js_slides .addfooter {
    246223    position: relative;
    247224    padding: 10px 10px 0;
     
    250227    text-align: right;
    251228}
    252 .gallery-form-table .noDataFound{
     229
     230.post-type-swiper_js_slides .gallery-form-table .noDataFound {
    253231    text-align: center;
    254     display:  none;
    255 }
     232    display: none;
     233}
     234
     235.post-type-swiper_js_slides .addfooter .removeAll {
     236    float: left;
     237    background-color: #c85959;
     238    background: rgba(170, 0, 0, 0.65);
     239    border: 0;
     240    color: #ffffff;
     241    line-height: 30px;
     242}
     243
     244.post-type-swiper_js_slides .addfooter .removeAll:hover,
     245.post-type-swiper_js_slides .addfooter .removeAll:focus {
     246    background: rgba(170, 0, 0, 0.75);
     247    color: #ffffff;
     248}
     249
     250.post-type-swiper_js_slides .addfooter .removeAll .dashicons {
     251    vertical-align: middle;
     252    font-size: 18px;
     253}
     254
     255.post-type-swiper_js_slides .footerRight {
     256    position: relative;
     257    padding: 10px;
     258    border-top: 1px solid #eeeeee;
     259    margin: 0;
     260}
     261
     262.post-type-swiper_js_slides .footerRight ul li {
     263    vertical-align: middle;
     264}
     265
     266.post-type-swiper_js_slides .shortcodeWrap {
     267    padding: 10px;
     268    border: 1px solid #ececec;
     269    margin: 10px 0 0;
     270    background: rgba(238, 238, 238, 0.42)
     271}
     272
     273.post-type-swiper_js_slides .shortcodeWrap h4 {
     274    margin: 0 0 6px 0;
     275    font-size: 12px;
     276    font-weight: 500;
     277}
     278
     279.post-type-swiper_js_slides .shortcodeWrap input {
     280    font-size: 12px;
     281    font-weight: 500;
     282    padding: 5px;
     283}
     284
     285.post-type-swiper_js_slides .shortcodeWrap .copyData {
     286    display: block;
     287    text-align: right;
     288    font-size: 11px;
     289    margin: 5px 0 0 0;
     290}
     291
     292.post-type-swiper_js_slides .saveAll .dashicons {
     293    vertical-align: middle;
     294    font-size: 16px;
     295    margin: 2px 1px 0 0;
     296}
     297
     298.post-type-swiper_js_slides #poststuff .stuffbox>h3,
     299.post-type-swiper_js_slides #poststuff h2,
     300.post-type-swiper_js_slides #poststuff h3.hndle {
     301    background: #1e70cd;
     302    color: #ffffff;
     303}
     304
     305.post-type-swiper_js_slides .accordion-section-title:after,
     306.post-type-swiper_js_slides .handlediv,
     307.item-edit,
     308.post-type-swiper_js_slides .postbox .handlediv.button-link,
     309.post-type-swiper_js_slides .toggle-indicator {
     310    color: #ffffff;
     311}
     312
     313.post-type-swiper_js_slides.wp-core-ui .button-primary {
     314    background: #1e70cd;
     315}
     316
     317.post-type-swiper_js_slides .shortcode.column-shortcode .copyData {
     318    display: block;
     319    text-align: left;
     320    font-size: 11px;
     321    margin: 5px 0 0 0;
     322}
     323
     324.post-type-swiper_js_slides .column-image {
     325    width: 85px !important;
     326}
     327
     328.post-type-swiper_js_slides .column-image .imgCount {
     329    display: block;
     330    text-align: center;
     331    border: 0;
     332    border-bottom: 0;
     333    background: #1f73d2;
     334    font-size: 11px;
     335    font-weight: 600;
     336    color: #ffffff;
     337    padding: 2px 0;
     338}
     339
     340.post-type-swiper_js_slides .column-image img {
     341    width: 100%;
     342    display: inherit;
     343}
     344
     345.post-type-swiper_js_slides .widefat td,
     346.post-type-swiper_js_slides .widefat td ol,
     347.post-type-swiper_js_slides .widefat td p,
     348.post-type-swiper_js_slides .widefat td ul {
     349    vertical-align: middle;
     350}
     351
     352.post-type-swiper_js_slides .searchHead {
     353    position: relative;
     354    padding: 10px;
     355    border-bottom: 1px solid #eeeeee;
     356    margin: 0;
     357}
     358
     359.post-type-swiper_js_slides .dtbl {
     360    display: table;
     361    width: 100%;
     362    margin: 0;
     363}
     364
     365.post-type-swiper_js_slides .dtbl li {
     366    display: table-cell;
     367}
     368
     369.post-type-swiper_js_slides .searchHead .searchFilter {
     370    text-align: right;
     371}
     372
     373.post-type-swiper_js_slides .searchHead .searchFilter input {
     374    padding: 5px 10px;
     375    min-width: 300px;
     376}
     377
     378.post-type-swiper_js_slides .hidden {
     379    display: none;
     380}
     381
     382.post-type-swiper_js_slides .text-right {
     383    text-align: right;
     384}
     385
     386.post-type-swiper_js_slides.wp-core-ui .button.addShortCode {
     387    background: #1e70cd;
     388    color: #ffffff;
     389    border: 0;
     390    line-height: 27px;
     391}
     392
     393.post-type-swiper_js_slides.wp-core-ui .button.addShortCode img {
     394    margin: -2px 2px 0 0;
     395    padding: 0;
     396}
  • swiper-js-slider/trunk/admin/js/func-admin.js

    r2149740 r2156268  
     1
    12jQuery(function($) {
     3
     4    var sjs_tabs_hash = window.location.hash,
     5        sjs_current_tab = window.location.hash.replace('!', '');
     6
     7    if (sjs_tabs_hash && sjs_tabs_hash.indexOf('sjs-tab') >= 0) {
     8        var sjs_post_action = $('#post').attr('action');
     9        $('.nav-tab-side').find('.active').removeClass('active');
     10        $('.nav-tab-side li').find('a[href="' + sjs_current_tab + '"]').parent('li').addClass('active');
     11        $('.swiperjsSection .rightSide .tabSec').hide();
     12        $('.swiperjsSection .rightSide '+ sjs_current_tab).fadeIn();
     13        if (sjs_post_action) {
     14            sjs_post_action = sjs_post_action.split('#')[0];
     15            $('#post').attr('action', sjs_post_action + window.location.hash);
     16        }
     17    }else{
     18        $('.swiperjsSection .rightSide .tabSec').first().fadeIn();
     19    }
     20
    221
    322    var file_frame;
     
    120139            });
    121140        }
    122     });
    123 
     141    }).on('click', 'a.removeAll', function(e){
     142        e.preventDefault();
     143        if (confirm('Are you sure you want to remove all images?')) {
     144            $('#gallery-metabox-list').html('');
     145            resetIndex();
     146            checkData();
     147        }
     148    }).on('click', 'a.saveAll', function(e){
     149        e.preventDefault();
     150        $('#publish').trigger('click');
     151    });
     152   
    124153    makeSortable();
    125154
    126155    $('body').on('click', '.swiperjsSection .nav-tab-side li a', function(e){
    127         //e.preventDefault();
     156        e.preventDefault();
    128157        var t = $(this),
    129             v = t.attr('href');
     158            v = t.attr('href'),
     159            d = t.attr('data-tab-id'),
     160            s = $('.nav-tab-side').attr('data-update-hashbang'),
     161            b = ((typeof t.attr('href') !== 'undefined') ? t.attr('href') : d);
    130162        $('.nav-tab-side li').removeClass('active');
    131163        t.closest('li').addClass('active');
    132164        $('.swiperjsSection .rightSide .tabSec').hide();
    133165        $('.swiperjsSection .rightSide '+v).fadeIn();
    134     });
    135 
    136     var getUrl = window.location.href,
    137         urlSplit = getUrl.split("#");
    138     console.log(urlSplit[1]);
    139     if(urlSplit[1] != undefined){
    140         $('.nav-tab-side li').removeClass('active');
    141         $('.nav-tab-side li a[href="#'+ urlSplit[1] +'"]').closest('li').addClass('active');
    142         $('.swiperjsSection .rightSide .tabSec').hide();
    143         $('.swiperjsSection .rightSide #'+urlSplit[1]).fadeIn();
    144     }else{
    145         $('.swiperjsSection .rightSide .tabSec').first().fadeIn();
    146     }   
     166
     167        if (s === '1') {
     168            window.location.hash = b.split('#').join('#!');
     169            var sjs_post_action = $('#post').attr('action');
     170            if (sjs_post_action) {
     171                sjs_post_action = sjs_post_action.split('#')[0];
     172                $('#post').attr('action', sjs_post_action + window.location.hash);
     173            }
     174        }
     175    });
     176
     177    $('.copyData').click(function(e) {
     178        e.preventDefault();
     179        $(this).prev().focus();
     180        $(this).prev().select();
     181        document.execCommand('copy');
     182    });
     183
     184    $('[data-search]').on('keyup', function() {
     185        var searchVal = $(this).val(),
     186            filterItems = $('[data-filter-item]');
     187
     188        if ( searchVal != '' ) {
     189            filterItems.addClass('hidden');
     190            $('.swiperjsSection .rightSide .tabSec').show();
     191            $('[data-filter-item][data-filter-name*="' + searchVal + '"]').removeClass('hidden');
     192        } else {
     193            $('.swiperjsSection .rightSide .tabSec').hide();
     194            var getActive = $('.swiperjsSection .nav-tab-side li.active a').attr('href');
     195            $(getActive).fadeIn();
     196            filterItems.removeClass('hidden');
     197        }
     198    });
     199
     200    $(".addShortCode").on('click', function(e) {
     201        //send_to_editor(jQuery("#sc_select :selected").val());
     202        e.preventDefault();
     203    });
     204
    147205});
  • swiper-js-slider/trunk/inc/post-types.php

    r2149740 r2156268  
    66    'name'                  => _x( 'Swiper Js Sliders', 'Post Type General Name', $prefix ),
    77    'singular_name'         => _x( 'Swiper Js Slide', 'Post Type Singular Name', $prefix ),
    8     'menu_name'             => __( 'Swiper Js Slides', $prefix ),
     8    'menu_name'             => __( 'Swiper Js Sliders', $prefix ),
    99    'name_admin_bar'        => __( 'Swiper Js Slides', $prefix ),
    1010    'archives'              => __( 'Item Archives', $prefix ),
     
    4141    'show_in_menu'          => true,
    4242    'menu_position'         => 99,
    43     'menu_icon'             => 'dashicons-smiley',
     43    'menu_icon'             => esc_url( plugins_url( 'admin/images/logo.png', dirname(__FILE__) ) ),
    4444    'show_in_admin_bar'     => true,
    4545    'show_in_nav_menus'     => true,
  • swiper-js-slider/trunk/public/js/main.js

    r2149740 r2156268  
    77    $('[data-slider]').each(function(){
    88        var t           = $(this),
    9             config      = {},
     9            config      = {},
     10            general     = t.data('general'),
    1011            autoplay    = t.data('autoplay'),
    1112            pagination  = t.data('pagination'),
    1213            navigation  = t.data('navigation');
     14
     15        if(general){
     16            config = general;
     17        }
    1318
    1419        if(autoplay){
     
    2530       
    2631        //console.log(config);
    27         swiper_slider = new Swiper(t, config);
     32        swiper_slider = new Swiper(t, config);
     33       
     34        t.removeAttr('data-general');
     35        t.removeAttr('data-autoplay');
     36        t.removeAttr('data-pagination');
     37        t.removeAttr('data-navigation');
    2838     });
    2939     
  • swiper-js-slider/trunk/shortcode/slide-js-shortcode.php

    r2149740 r2156268  
    2525    );
    2626
     27    $my_query = null;
     28    $my_query = new WP_Query($args);
     29
    2730    ob_start();
    28     $my_query = null;
    29     $my_query = new WP_Query($args); ?>
     31    if ( $my_query->have_posts() ) {
     32    ?>
    3033
    3134
    3235    <?php
     36        $general    = get_post_meta($atts['id'], $meta_prefix.'setting_general', true);
    3337        $autoplay   = get_post_meta($atts['id'], $meta_prefix.'setting_autoplay', true);
    3438        $pagination = get_post_meta($atts['id'], $meta_prefix.'setting_pagination', true);
    3539        $navigation = get_post_meta($atts['id'], $meta_prefix.'setting_navigation', true);
    36 
    3740
    3841        $auto;
     
    4447        $navi;
    4548        $naviCheck = s_j_s_checkit('navigation', $navigation);
     49
     50        if($general){
     51            $gene = array(
     52                "initialSlide"          => s_j_s_checkit('initialSlide', $general),
     53                "direction"             => s_j_s_checkit('direction', $general),
     54                "speed"                 => s_j_s_checkit('speed', $general),
     55                "autoHeight"            => filter_var(s_j_s_checkit('autoHeight', $general), FILTER_VALIDATE_BOOLEAN),
     56                "effect"                => s_j_s_checkit('effect', $general),
     57                "slidesPerView"         => s_j_s_checkit('slidesPerView', $general),
     58                "slidesPerColumn"       => s_j_s_checkit('slidesPerColumn', $general),
     59                "spaceBetween"          => s_j_s_checkit('spaceBetween', $general),
     60            );
     61        }
    4662
    4763        if($autoCheck == 'false'){
     
    84100        }
    85101
     102       
     103
    86104    ?>
    87105
    88106    <div class="swiper-container"
    89107        data-slider='swiperSlider<?php echo $atts['id']; ?>'
     108        data-general='<?php echo json_encode($gene, JSON_NUMERIC_CHECK); ?>'
    90109        data-autoplay='<?php echo json_encode($auto, JSON_NUMERIC_CHECK); ?>'
    91110        data-pagination='<?php echo json_encode($pagi, JSON_NUMERIC_CHECK); ?>'
     
    93112        <div class="swiper-wrapper">
    94113            <?php
     114             
    95115            while ($my_query->have_posts()) : $my_query->the_post();
    96116                $ids = get_post_meta(get_the_ID(), $meta_prefix.'gallery_id', true);
     
    106126        </div>
    107127
     128       
     129
    108130        <?php if($pagiCheck != 'false'){ ?>
    109             <div class="<?php echo $pagination['el']; ?>"></div>
     131            <div class="<?php echo s_j_s_checkit('el', $pagination); ?>"></div>
    110132        <?php } ?>
    111133
    112134        <?php if($naviCheck != 'false'){ ?>
    113             <div class="<?php echo $navigation['prevEl']; ?>"></div>
    114             <div class="<?php echo $navigation['nextEl']; ?>"></div>
     135            <div class="<?php echo s_j_s_checkit('prevEl', $navigation); ?>"></div>
     136            <div class="<?php echo s_j_s_checkit('nextEl', $navigation); ?>"></div>
    115137        <?php } ?>
    116138    </div>
     139
     140    <?php
     141            }else{
     142                _e( 'Sorry, no slider were found.', 'textdomain' );
     143                //die;
     144            }
     145        ?>
    117146   
    118147 
    119148<?php
     149
     150
    120151    $html = ob_get_clean();
    121152    return $html;
  • swiper-js-slider/trunk/swiper-js-slider.php

    r2149740 r2156268  
    4343            include_once( plugin_dir_path( __FILE__ ) . 'shortcode/slide-js-shortcode.php' );
    4444        }
     45
    4546        function register() {
    4647            add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
     
    4950            add_action( 'init', array( $this, 'custom_post_type' ) );
    5051        }
     52
    5153        public function settings_link( $links ) {
    52             $settings_link = '<a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" target="_blank">Donate Now</a>';
     54            $settings_link = '<a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" target="_blank">Donate Now</a> | ';
     55            $settings_link .= '<a href="edit.php?post_type=swiper_js_slides">Add Slider</a>';
    5356            array_push( $links, $settings_link );
    5457            return $links;
     
    6467            wp_enqueue_script( 'adminjs', plugins_url( '/admin/js/func-admin.js', __FILE__ ), array('jquery'), '1.0.0', true );
    6568        }
     69
    6670        function frontStyling() {
    67             // enqueue all our scripts
    6871            wp_enqueue_style( 'swiper-css-library', plugins_url( '/public/css/library.css', __FILE__ ) );
    6972            wp_enqueue_style( 'swiper-css-main', plugins_url( '/public/css/main.css', __FILE__ ) );
     
    7174            wp_enqueue_script( 'swiper-js-main', plugins_url( '/public/js/main.js', __FILE__ ), array('jquery'), '1.0.0', true );
    7275        }
     76
    7377        function activate() {
    7478            flush_rewrite_rules();
    7579        }
     80
    7681        function deactivate() {
    7782            flush_rewrite_rules();
  • swiper-js-slider/trunk/uninstall.php

    r2149740 r2156268  
    1818}
    1919
    20 // delette post meta
    21 #delete_post_meta_by_key( 'contest-video-points' );
    22 
    23 // delete option
    24 #delete_option( 'video-pcplugin-menu-style' );
    25 
    26 
    27 // Delete All Meta Option
    28 //ref: https://codex.wordpress.org/delete_post_meta
    29 
    3020foreach ( wp_load_alloptions() as $option => $value ) {
    3121    if ( strpos( $option, '_s_s_m_' ) === 0 ) {
     
    3323    }
    3424}
    35 
    36 /* global $wpdb;
    37 $plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_speedy_swiper_meta_%'" );
    38 foreach( $plugin_options as $option ) {
    39     delete_option( $option->option_name );
    40 } */
  • swiper-js-slider/trunk/views/front-columns.php

    r2149740 r2156268  
    1111    $addColumns = array();
    1212    $addColumns['cb'] = '<input type="checkbox" />';
     13    $addColumns['image'] = 'Total Slides';
    1314    $addColumns['title'] = 'Sliders';
    1415    $addColumns['shortcode'] = 'Shortcode';
     
    2021//  Create Custom Columns
    2122function sjs_carousel_custom_column( $column, $post_id ){
     23   
     24    global $post;
     25    $post_id = absint( $post_id );
     26    $meta_prefix = '_s_s_m_';
     27
    2228    switch( $column ){
    23         case 'shortcode' :
    24             // shortcode column
    25             GLOBAL $post;
    26             echo '<input type="text" onfocus="this.select();" readonly="readonly" value="[swiper-js-slider id='. $post->ID .']" class="large-text code">';
    27         break;
     29        case 'shortcode': ?>
     30            <input type="text" readonly="readonly" value='[swiper-js-slider id="<?php echo $post->ID ?>"]' class="large-text code">
     31            <a href="#" class="copyData">Copy to clipboard</a>
     32        <?php
     33        break;
     34       
     35        case 'image':
     36            $ids = get_post_meta( $post_id, $meta_prefix.'gallery_id', true );
     37           
     38            if ( ! empty( $ids ) && is_array( $ids ) ) {
     39                $image = wp_get_attachment_image_src($ids[0]);
     40                $total = count($ids);
     41                echo '<img src="' . esc_url($image[0]) . '" width="75" height="50">';
     42                echo '<span class="imgCount">';
     43                echo ($total == 1) ? $total . " Slide" : $total . " Slides";
     44                echo '</span>';
     45            }
     46        break;
    2847    }
    2948}
  • swiper-js-slider/trunk/views/meta-box-options.php

    r2149740 r2156268  
    5959        $ids = get_post_meta($post->ID, $this->meta_prefix.'gallery_id', true);
    6060
    61 
    62 
    6361        // Display the form, using the current value.
    6462        ?>
     
    7573                            </a>
    7674                            <a class="remove-image button button-small" href="#">
    77                                 <span class="dashicons dashicons-trash"></span>
     75                                <span class="dashicons dashicons-no-alt"></span>
    7876                            </a>
    7977                        </div>
     
    8684       
    8785        <div class="addfooter">
     86            <a href="#" class="removeAll button button-secondary button-large">
     87                <span class="dashicons dashicons-trash"></span>
     88                Empty Slider
     89            </a>
     90            <a href="#" class="saveAll button button-primary button-large">
     91                <span class="dashicons dashicons-admin-tools"></span>
     92                Save
     93            </a>
    8894            <a  class="gallery-add button button-primary button-large"
    8995                href="#"
     
    109115        global $post;
    110116
    111         wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' );
    112 
    113         $autoplay   = get_post_meta($post->ID, $this->meta_prefix.'setting_autoplay', true);
    114         $pagination = get_post_meta($post->ID, $this->meta_prefix.'setting_pagination', true);
    115         $navigation = get_post_meta($post->ID, $this->meta_prefix.'setting_navigation', true);
    116 
    117         $autoplay = array(
    118             "autoplay"             => $this->s_j_s_checkit('autoplay', $autoplay, 'true'),
    119             "delay"                => $this->s_j_s_checkit('delay', $autoplay, '3000'),
    120             "stopOnLastSlide"      => $this->s_j_s_checkit('stopOnLastSlide', $autoplay, 'false'),
    121             "disableOnInteraction" => $this->s_j_s_checkit('disableOnInteraction', $autoplay, 'true'),
    122             "reverseDirection"     => $this->s_j_s_checkit('reverseDirection', $autoplay, 'false'),
    123             "waitForTransition"    => $this->s_j_s_checkit('waitForTransition', $autoplay, 'true')
    124         );
    125 
    126         $pagination = array(
    127             "pagination"            => $this->s_j_s_checkit('pagination', $pagination, 'true'),
    128             "el"                    => $this->s_j_s_checkit('el', $pagination, 'swiper-pagination'),
    129             "type"                  => $this->s_j_s_checkit('type', $pagination, 'bullets'),
    130             "bulletElement"         => $this->s_j_s_checkit('bulletElement', $pagination, 'span'),
    131             "clickable"             => $this->s_j_s_checkit('clickable', $pagination, 'false'),
    132             "bulletClass"           => $this->s_j_s_checkit('bulletClass', $pagination, 'swiper-pagination-bullet'),
    133             "currentClass"          => $this->s_j_s_checkit('currentClass', $pagination, 'swiper-pagination-current'),
    134             "bulletActiveClass"     => $this->s_j_s_checkit('bulletActiveClass', $pagination, 'swiper-pagination-bullet-active'),
    135             "clickableClass"        => $this->s_j_s_checkit('clickableClass', $pagination, 'swiper-pagination-clickable'),
    136             "lockClass"             => $this->s_j_s_checkit('lockClass', $pagination, 'swiper-pagination-lock'),
    137         );
    138 
    139         $navigation = array(
    140             "navigation"            => $this->s_j_s_checkit('navigation', $navigation, 'true'),
    141             "nextEl"                => $this->s_j_s_checkit('nextEl', $navigation, 'swiper-button-next'),
    142             "prevEl"                => $this->s_j_s_checkit('prevEl', $navigation, 'swiper-button-prev'),
    143             "disabledClass"         => $this->s_j_s_checkit('disabledClass', $navigation, 'swiper-button-disabled'),
    144             "hiddenClass"           => $this->s_j_s_checkit('hiddenClass', $navigation, 'swiper-button-hidden'),
    145         );
    146 
    147         ?>
     117        wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' ); ?>
     118
     119        <div class="searchHead">
     120            <ul class="dtbl">
     121                <li class="searchFilter"><input type="text" placeholder="Search in setting..." data-search></li>
     122            </ul>
     123        </div>
    148124       
    149125        <div class="swiperjsSection innerOptions">
    150 
    151             <ul class="nav-tab-side">
    152                 <li class="active"><a href="#autoplay">Autoplay</a></li>
    153                 <li><a href="#pagination">Pagination</a></li>
    154                 <li><a href="#navigation">Navigation</a></li>
     126       
     127            <ul class="nav-tab-side" data-update-hashbang="1">
     128                <li class="active"><a href="#sjs-tab-parameters">Parameters</a></li>
     129                <li><a href="#sjs-tab-autoplay">Autoplay</a></li>
     130                <li><a href="#sjs-tab-pagination">Pagination</a></li>
     131                <li><a href="#sjs-tab-navigation">Navigation</a></li>
     132                <li><a href="#sjs-tab-carousel">Carousel</a></li>
    155133            </ul>
    156134
    157135            <div class="rightSide">
    158                 <div id="autoplay" class="tabSec autoPlay">
    159                     <table>
    160                         <tbody>
    161                             <tr>
    162                                 <td>
    163                                     <label>Autoplay</label>
    164                                 </td>
    165                                 <td>
    166                                     <ul>
    167                                         <li>
    168                                             <label>
    169                                                 <input
    170                                                     type="radio"
    171                                                     name="<?php echo $this->meta_prefix.'setting_autoplay[autoplay]'; ?>"
    172                                                     value="true"
    173                                                     <?php checked( $autoplay['autoplay'], 'true' ); ?>> True
    174                                             </label>
    175                                         </li>
    176                                         <li>
    177                                             <label>
    178                                                 <input
    179                                                     type="radio"
    180                                                     name="<?php echo $this->meta_prefix.'setting_autoplay[autoplay]'; ?>"
    181                                                     value="false"
    182                                                     <?php checked( $autoplay['autoplay'], 'false' ); ?>> False
    183                                             </label>
    184                                         </li>
    185                                     </ul>
    186                                 </td>
    187                             </tr>
    188                         </tbody>
    189                     </table>
    190                    
    191                     <div class="<?php echo ($autoplay['autoplay'] == 'false' ? 'hiddenData' : '' ) ?>">
    192                         <table class="autoPlaySettings">
    193                             <tbody>
    194                                 <tr>
    195                                     <td>
    196                                         <label for="apDelay">Delay</label>
    197                                     </td>
    198                                     <td>
    199                                         <span>Delay between transitions (in ms).</span>
    200                                         <input
    201                                             id="apDelay"
    202                                             name="<?php echo $this->meta_prefix.'setting_autoplay[delay]'; ?>"
    203                                             type="text"
    204                                             value="<?php echo $autoplay['delay']; ?>">
    205                                     </td>
    206                                 </tr>
    207                                 <tr>
    208                                     <td>
    209                                         <label>stopOnLastSlide</label>
    210                                     </td>
    211                                     <td>
    212                                         <span>Enable this parameter and autoplay will be stopped when it reaches last slide (has no effect in loop mode)</span>
    213                                         <ul>
    214                                             <li>
    215                                                 <label>
    216                                                     <input
    217                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[stopOnLastSlide]'; ?>"
    218                                                         type="radio"
    219                                                         <?php checked( $autoplay['stopOnLastSlide'], 'true' ); ?>
    220                                                         value="true">True
    221                                                 </label>
    222                                             </li>
    223                                             <li>
    224                                                 <label>
    225                                                     <input
    226                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[stopOnLastSlide]'; ?>"
    227                                                         type="radio"
    228                                                         <?php checked( $autoplay['stopOnLastSlide'], 'false' ); ?>
    229                                                         value="false">False
    230                                                 </label>
    231                                             </li>
    232                                         </ul>
    233                                     </td>
    234                                 </tr>
    235                                 <tr>
    236                                     <td>
    237                                         <label>disableOnInteraction</label>
    238                                     </td>
    239                                     <td>
    240                                         <span>Set to false and autoplay will not be disabled after user interactions (swipes), it will be restarted every time after interaction</span>
    241                                         <ul>
    242                                             <li>
    243                                                 <label>
    244                                                     <input
    245                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[disableOnInteraction]'; ?>"
    246                                                         type="radio"
    247                                                         <?php checked( $autoplay['disableOnInteraction'], 'true' ); ?>
    248                                                         value="true">True
    249                                                 </label>
    250                                             </li>
    251                                             <li>
    252                                                 <label>
    253                                                     <input
    254                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[disableOnInteraction]'; ?>"
    255                                                         type="radio"
    256                                                         <?php checked( $autoplay['disableOnInteraction'], 'false' ); ?>
    257                                                         value="false">False
    258                                                 </label>
    259                                             </li>
    260                                         </ul>
    261                                     </td>
    262                                 </tr>
    263                                 <tr>
    264                                     <td>
    265                                         <label>reverseDirection</label>
    266                                     </td>
    267                                     <td>
    268                                         <span>Enables autoplay in reverse direction</span>
    269                                         <ul>
    270                                             <li>
    271                                                 <label>
    272                                                     <input
    273                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[reverseDirection]'; ?>"
    274                                                         type="radio"
    275                                                         <?php checked( $autoplay['reverseDirection'], 'true' ); ?>
    276                                                         value="true">True
    277                                                 </label>
    278                                             </li>
    279                                             <li>
    280                                                 <label>
    281                                                     <input
    282                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[reverseDirection]'; ?>"
    283                                                         type="radio"
    284                                                         <?php checked( $autoplay['reverseDirection'], 'false' ); ?>
    285                                                         value="false">False
    286                                                 </label>
    287                                             </li>
    288                                         </ul>
    289                                     </td>
    290                                 </tr>
    291                                 <tr>
    292                                     <td>
    293                                         <label>waitForTransition</label>
    294                                     </td>
    295                                     <td>
    296                                         <span>When enabled autoplay will wait for wrapper transition to continue. Can be disabled in case of using Virtual Translate when your slider may not have transition</span>
    297                                         <ul>
    298                                             <li>
    299                                                 <label>
    300                                                     <input
    301                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[waitForTransition]'; ?>"
    302                                                         type="radio"
    303                                                         <?php checked( $autoplay['waitForTransition'], 'true' ); ?>
    304                                                         value="true">True
    305                                                 </label>
    306                                             </li>
    307                                             <li>
    308                                                 <label>
    309                                                     <input
    310                                                         name="<?php echo $this->meta_prefix.'setting_autoplay[waitForTransition]'; ?>"
    311                                                         type="radio"
    312                                                         <?php checked( $autoplay['waitForTransition'], 'false' ); ?>
    313                                                         value="false">False
    314                                                 </label>
    315                                             </li>
    316                                         </ul>
    317                                     </td>
    318                                 </tr>
    319                             </tbody>
    320                         </table>
    321                     </div>
    322                 </div>
    323 
    324                 <div id="pagination" class="tabSec pagiNation">
    325                     <table>
    326                         <tbody>
    327                             <tr>
    328                                 <td>
    329                                     <label>Pagination</label>
    330                                 </td>
    331                                 <td>
    332                                     <ul>
    333                                         <li>
    334                                             <label>
    335                                                 <input
    336                                                     type="radio"
    337                                                     name="<?php echo $this->meta_prefix.'setting_pagination[pagination]'; ?>"
    338                                                     value="true"
    339                                                     <?php checked( $pagination['pagination'], 'true' ); ?>> True
    340                                             </label>
    341                                         </li>
    342                                         <li>
    343                                             <label>
    344                                                 <input
    345                                                     type="radio"
    346                                                     name="<?php echo $this->meta_prefix.'setting_pagination[pagination]'; ?>"
    347                                                     value="false"
    348                                                     <?php checked( $pagination['pagination'], 'false' ); ?>> False
    349                                             </label>
    350                                         </li>
    351                                     </ul>
    352                                 </td>
    353                             </tr>
    354                         </tbody>
    355                     </table>
    356 
    357                     <div class="<?php echo ($pagination['pagination'] == 'false' ? 'hiddenData' : '' ) ?>">
    358                         <table class="autoPlaySettings">
    359                             <tr>
    360                                 <td>
    361                                     <label for="el">Element Class</label>
    362                                 </td>
    363                                 <td>
    364                                     <span>Class Name for Pagination.</span>
    365                                     <input
    366                                             id="el"
    367                                             name="<?php echo $this->meta_prefix.'setting_pagination[el]'; ?>"
    368                                             type="text"
    369                                             value="<?php echo $pagination['el']; ?>">
    370                                 </td>
    371                             </tr>
    372                             <tr>
    373                                 <td>
    374                                     <label for="">type</label>
    375                                 </td>
    376                                 <td>
    377                                     <span>String with type of pagination.</span>
    378                                     <select name="<?php echo $this->meta_prefix.'setting_pagination[type]'; ?>">
    379                                         <option value="bullets" <?php selected($pagination['type'], 'bullets') ?>>bullets</option>
    380                                         <option value="fraction" <?php selected($pagination['type'], 'fraction') ?>>fraction</option>
    381                                         <option value="progressbar" <?php selected($pagination['type'], 'progressbar') ?>>progressbar</option>
    382                                         <option value="custom" <?php selected($pagination['type'], 'custom') ?>>custom</option>
    383                                     </select>
    384                                 </td>
    385                             </tr>
    386                             <tr>
    387                                 <td>
    388                                     <label for="bulletEle">bulletElement</label>
    389                                 </td>
    390                                 <td>
    391                                     <span>Defines which HTML tag will be use to represent single pagination bullet. Only for bullets pagination type.</span>
    392                                     <input
    393                                             id="bulletEle"
    394                                             name="<?php echo $this->meta_prefix.'setting_pagination[bulletElement]'; ?>"
    395                                             type="text"
    396                                             value="<?php echo $pagination['bulletElement']; ?>">
    397                                 </td>
    398                             </tr>
    399                             <tr>
    400                                     <td>
    401                                         <label>clickable</label>
    402                                     </td>
    403                                     <td>
    404                                         <span>If true then clicking on pagination button will cause transition to appropriate slide. Only for bullets pagination type</span>
    405                                         <ul>
    406                                             <li>
    407                                                 <label>
    408                                                     <input
    409                                                         name="<?php echo $this->meta_prefix.'setting_pagination[clickable]'; ?>"
    410                                                         type="radio"
    411                                                         <?php checked( $pagination['clickable'], 'true' ); ?>
    412                                                         value="true">True
    413                                                 </label>
    414                                             </li>
    415                                             <li>
    416                                                 <label>
    417                                                     <input
    418                                                         name="<?php echo $this->meta_prefix.'setting_pagination[clickable]'; ?>"
    419                                                         type="radio"
    420                                                         <?php checked( $pagination['clickable'], 'false' ); ?>
    421                                                         value="false">False
    422                                                 </label>
    423                                             </li>
    424                                         </ul>
    425                                     </td>
    426                                 </tr>
    427                                 <tr>
    428                                     <td>
    429                                         <label for="bulletClass">bulletClass</label>
    430                                     </td>
    431                                     <td>
    432                                         <span>CSS class name of single pagination bullet</span>
    433                                         <input
    434                                                 id="bulletClass"
    435                                                 name="<?php echo $this->meta_prefix.'setting_pagination[bulletClass]'; ?>"
    436                                                 type="text"
    437                                                 value="<?php echo $pagination['bulletClass']; ?>">
    438                                     </td>
    439                                 </tr>
    440                                 <tr>
    441                                     <td>
    442                                         <label for="currentClass">currentClass</label>
    443                                     </td>
    444                                     <td>
    445                                         <span>CSS class name of the element with currently active index in "fraction" pagination</span>
    446                                         <input
    447                                                 id="currentClass"
    448                                                 name="<?php echo $this->meta_prefix.'setting_pagination[currentClass]'; ?>"
    449                                                 type="text"
    450                                                 value="<?php echo $pagination['currentClass']; ?>">
    451                                     </td>
    452                                 </tr>
    453                                 <tr>
    454                                     <td>
    455                                         <label for="bulletActiveClass">bulletActiveClass</label>
    456                                     </td>
    457                                     <td>
    458                                         <span>CSS class name of currently active pagination bullet</span>
    459                                         <input
    460                                                 id="bulletActiveClass"
    461                                                 name="<?php echo $this->meta_prefix.'setting_pagination[bulletActiveClass]'; ?>"
    462                                                 type="text"
    463                                                 value="<?php echo $pagination['bulletActiveClass']; ?>">
    464                                     </td>
    465                                 </tr>
    466                                 <tr>
    467                                     <td>
    468                                         <label for="clickableClass">clickableClass</label>
    469                                     </td>
    470                                     <td>
    471                                         <span>CSS class name set to pagination when it is clickable</span>
    472                                         <input
    473                                                 id="clickableClass"
    474                                                 name="<?php echo $this->meta_prefix.'setting_pagination[clickableClass]'; ?>"
    475                                                 type="text"
    476                                                 value="<?php echo $pagination['clickableClass']; ?>">
    477                                     </td>
    478                                 </tr>
    479                                 <tr>
    480                                     <td>
    481                                         <label for="lockClass">lockClass</label>
    482                                     </td>
    483                                     <td>
    484                                         <span>CSS class name set to pagination when it is disabled</span>
    485                                         <input
    486                                                 id="lockClass"
    487                                                 name="<?php echo $this->meta_prefix.'setting_pagination[lockClass]'; ?>"
    488                                                 type="text"
    489                                                 value="<?php echo $pagination['lockClass']; ?>">
    490                                     </td>
    491                                 </tr>
    492                         </table>
    493                     </div>
    494                 </div>
    495 
    496                 <div id="navigation" class="tabSec navigation">
    497                     <table>
    498                         <tbody>
    499                             <tr>
    500                                 <td>
    501                                     <label>Navigation</label>
    502                                 </td>
    503                                 <td>
    504                                     <ul>
    505                                         <li>
    506                                             <label>
    507                                                 <input
    508                                                     type="radio"
    509                                                     name="<?php echo $this->meta_prefix.'setting_navigation[navigation]'; ?>"
    510                                                     value="true"
    511                                                     <?php checked( $navigation['navigation'], 'true' ); ?>> True
    512                                             </label>
    513                                         </li>
    514                                         <li>
    515                                             <label>
    516                                                 <input
    517                                                     type="radio"
    518                                                     name="<?php echo $this->meta_prefix.'setting_navigation[navigation]'; ?>"
    519                                                     value="false"
    520                                                     <?php checked( $navigation['navigation'], 'false' ); ?>> False
    521                                             </label>
    522                                         </li>
    523                                     </ul>
    524                                 </td>
    525                             </tr>
    526                         </tbody>
    527                     </table>
    528 
    529                     <div class="<?php echo ($navigation['navigation'] == 'false' ? 'hiddenData' : '' ) ?>">
    530                         <table class="autoPlaySettings">
    531                             <tr>
    532                                 <td>
    533                                     <label for="nextEl">nextEl</label>
    534                                 </td>
    535                                 <td>
    536                                     <span>String with CSS selector or HTML element of the element that will work like "next" button after click on it</span>
    537                                     <input
    538                                             id="nextEl"
    539                                             name="<?php echo $this->meta_prefix.'setting_navigation[nextEl]'; ?>"
    540                                             type="text"
    541                                             value="<?php echo $navigation['nextEl']; ?>">
    542                                 </td>
    543                             </tr>
    544                             <tr>
    545                                 <td>
    546                                     <label for="prevEl">prevEl</label>
    547                                 </td>
    548                                 <td>
    549                                     <span>String with CSS selector or HTML element of the element that will work like "prev" button after click on it</span>
    550                                     <input
    551                                             id="prevEl"
    552                                             name="<?php echo $this->meta_prefix.'setting_navigation[prevEl]'; ?>"
    553                                             type="text"
    554                                             value="<?php echo $navigation['prevEl']; ?>">
    555                                 </td>
    556                             </tr>
    557                             <tr>
    558                                 <td>
    559                                     <label for="disabledClass">disabledClass</label>
    560                                 </td>
    561                                 <td>
    562                                     <span>CSS class name added to navigation button when it becomes disabled</span>
    563                                     <input
    564                                             id="disabledClass"
    565                                             name="<?php echo $this->meta_prefix.'setting_navigation[disabledClass]'; ?>"
    566                                             type="text"
    567                                             value="<?php echo $navigation['disabledClass']; ?>">
    568                                 </td>
    569                             </tr>
    570                             <tr>
    571                                 <td>
    572                                     <label for="hiddenClass">hiddenClass</label>
    573                                 </td>
    574                                 <td>
    575                                     <span>CSS class name added to navigation button when it becomes hidden</span>
    576                                     <input
    577                                             id="hiddenClass"
    578                                             name="<?php echo $this->meta_prefix.'setting_navigation[hiddenClass]'; ?>"
    579                                             type="text"
    580                                             value="<?php echo $navigation['hiddenClass']; ?>">
    581                                 </td>
    582                             </tr>
    583                         </table>
    584                     </div>
    585                 </div>
     136                <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/parameters-meta.php' ); ?>
     137                <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/autoplay-meta.php' ); ?>
     138                <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/pagination-meta.php' ); ?>
     139                <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/navigation-meta.php' ); ?>
     140                <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/carousel-meta.php' ); ?>
    586141            </div>
     142
     143        </div>
     144        <div class="footerRight">
     145            <ul class="dtbl">
     146                <li class="documentation">Documentation: <a href="https://idangero.us/swiper/" target="_blank">https://idangero.us/swiper/</a></li>
     147                <li class="text-right">
     148                    <a href="#" class="saveAll button button-primary button-large">
     149                        <span class="dashicons dashicons-admin-tools"></span>
     150                        Save
     151                    </a>
     152                </li>
     153            </ul>
    587154        </div>
    588155
    589156        <?php
    590157    }
    591 
    592    
    593158
    594159    public function render_metabox_shortcode( $post ) {
     
    596161        wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' ); ?>
    597162           
    598             <input
    599                 type="text"
    600                 onfocus="this.select();"
    601                 readonly="readonly"
    602                 value="[swiper-js-slider id=<?php echo $post->ID ?>]"
    603                 class="large-text code">
    604            
     163            <div class="shortcodeWrap">
     164                <h4>Copy & Paste For Post & Pages.</h4>
     165                <input
     166                    type="text"
     167                    readonly="readonly"
     168                    value="[swiper-js-slider id=<?php echo $post->ID ?>]"
     169                    class="large-text code">
     170                <a href="#" class="copyData">Copy to clipboard</a>
     171            </div>
     172
     173            <div class="shortcodeWrap">
     174                <h4>For Custom Template Php Files.</h4>
     175                <input
     176                    type="text"
     177                    readonly="readonly"
     178                    value='&lt;?php echo do_shortcode("[swiper-js-slider id=<?php echo $post->ID ?>]"); ?&gt;'
     179                    class="large-text code">
     180                <a href="#" class="copyData">Copy to clipboard</a>
     181            </div>
    605182        <?php
    606183    }
     
    638215        }
    639216
    640         /* OK, it's safe for us to save the data now. */
    641 
    642 
    643         // Check if $_POST field(s) are available
    644        
    645         // Sanitize the user input.
    646         function s_j_s_sanitize_text_or_array_field($array_or_string) {
    647             if( is_string($array_or_string) ){
    648                 $array_or_string = sanitize_text_field($array_or_string);
    649             }elseif( is_array($array_or_string) ){
    650                 foreach ( $array_or_string as $key => &$value ) {
    651                     if ( is_array( $value ) ) {
    652                         $value = s_j_s_sanitize_text_or_array_field($value);
    653                     }
    654                     else {
    655                         $value = sanitize_text_field( $value );
    656                     }
    657                 }
    658             }
    659 
    660             return $array_or_string;
    661         }
     217        /* OK, it's safe for us to save the data now. */       
    662218
    663219        // Update the meta field.
    664 
    665         if(isset($_POST[$this->meta_prefix.'setting_autoplay'])) {
    666             $autoplayData = $_POST[$this->meta_prefix.'setting_autoplay'];
    667             update_post_meta($post_id, $this->meta_prefix.'setting_autoplay', s_j_s_sanitize_text_or_array_field($autoplayData));
     220        $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_general');
     221        $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_autoplay');
     222        $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_pagination');
     223        $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_navigation');
     224        $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'gallery_id');
     225    }
     226
     227    function s_j_s_sanitize_text_or_array_field($array_or_string) {
     228        if( is_string($array_or_string) ){
     229            $array_or_string = sanitize_text_field($array_or_string);
     230        }elseif( is_array($array_or_string) ){
     231            foreach ( $array_or_string as $key => &$value ) {
     232                if ( is_array( $value ) ) {
     233                    $value = s_j_s_sanitize_text_or_array_field($value);
     234                }
     235                else {
     236                    $value = sanitize_text_field( $value );
     237                }
     238            }
     239        }
     240
     241        return $array_or_string;
     242    }
     243
     244    function s_j_s_updatePostMeta($id, $prefix, $name){
     245        if(isset($_POST[$prefix.$name])) {
     246            $allData = $_POST[$prefix.$name];
     247            update_post_meta($id, $prefix.$name, $this->s_j_s_sanitize_text_or_array_field($allData));
    668248        } else {
    669             delete_post_meta($post_id, $this->meta_prefix.'setting_autoplay');
    670         }
    671 
    672         if(isset($_POST[$this->meta_prefix.'setting_pagination'])) {
    673             $paginationData = $_POST[$this->meta_prefix.'setting_pagination'];
    674             update_post_meta($post_id, $this->meta_prefix.'setting_pagination', s_j_s_sanitize_text_or_array_field($paginationData));
    675         } else {
    676             delete_post_meta($post_id, $this->meta_prefix.'setting_pagination');
    677         }
    678 
    679         if(isset($_POST[$this->meta_prefix.'setting_navigation'])) {
    680             $navigationData = $_POST[$this->meta_prefix.'setting_navigation'];
    681             update_post_meta($post_id, $this->meta_prefix.'setting_navigation', s_j_s_sanitize_text_or_array_field($navigationData));
    682         } else {
    683             delete_post_meta($post_id, $this->meta_prefix.'setting_navigation');
    684         }
    685        
    686         if(isset($_POST[$this->meta_prefix.'gallery_id'])) {
    687             $galleryData = $_POST[$this->meta_prefix.'gallery_id'];
    688             update_post_meta($post_id, $this->meta_prefix.'gallery_id', s_j_s_sanitize_text_or_array_field($galleryData));
    689         } else {
    690             delete_post_meta($post_id, $this->meta_prefix.'gallery_id');
    691         }
     249            delete_post_meta($id, $prefix.$name);
     250        }   
    692251    }
    693252}
Note: See TracChangeset for help on using the changeset viewer.