Plugin Directory

Changeset 2832606


Ignore:
Timestamp:
12/12/2022 11:41:51 PM (3 years ago)
Author:
dyggrid
Message:

changes

Location:
dyggrid/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • dyggrid/trunk/dyg-form/css/dygform-public.css

    r2823384 r2832606  
    430430    margin-top: 20px;
    431431}
    432 .full-width {
    433     width: 100%;
    434 }
    435 .half-width {
    436     display:inline-block;
    437     width: calc(calc(100% - 20px) / 2);
    438     margin-right: 20px;
    439 }
    440 .third-width {
    441     display:inline-block;
    442     width: calc(calc(100% - 40px) / 3);
    443     margin-right: 20px;
    444 }
    445 .end {
    446     margin-right: 0px !important;
    447 }
    448 form.dygform .end {
    449     margin-right: 0px !important;
    450 }
     432
    451433
    452434.dygform-container-radio,
     
    568550    /* top: -5px; */
    569551}
     552.dygform .full-width {
     553    width: 100%;
     554}
     555.dygform .half-width {
     556    display:inline-block;
     557    width: calc(calc(100% - 20px) / 2);
     558    margin-right: 20px;
     559}
     560.dygform .third-width {
     561    display:inline-block;
     562    width: calc(calc(100% - 40px) / 3);
     563    margin-right: 20px;
     564}
     565.dygform .end {
     566    margin-right: 0px !important;
     567}
     568form.dygform .end {
     569    margin-right: 0px !important;
     570}
  • dyggrid/trunk/dyg-form/includes/dyg-form-functions.php

    r2823384 r2832606  
    2828}
    2929
     30/**
     31 * ads additional select options to an existing select option group
     32 *
     33 * @param type $element - the select-option-group level element
     34 * @param type $options - an array of options to be included as both label and value
     35 * @param type $selected -  the option to mark as selected
     36 */
     37function dygform_add_options_array($element, $options, $selected) {
     38    $add = (array) $element->options;
     39    foreach ($options as $option) {
     40        $add[] = (object) [
     41                    "type"      => 'option',
     42                    "value"     => $option['value'],
     43                    "parameter" => $option['value'] === $selected ? 'selected' : '',
     44                    "contains"  => $option['contains'] ?? ''
     45        ];
     46    }
     47    $element->options = (object) $add;
     48    return $element;
     49}
    3050
    3151
  • dyggrid/trunk/dyg-post-grid/addons/free/dygpg_go_pro.css

    r2818006 r2832606  
    8080    margin:3px;
    8181}
     82.dyg-post-grid-wrapper.dygpg-gallery .dyg-post-grid-cell .dygpg-pattern,
     83.dyg-post-grid-wrapper.dygpg-gallery .dyg-post-grid-cell .dygpg-pattern > *,
     84.dyg-post-grid-wrapper.dygpg-gallery-tiled .dyg-post-grid-cell .dygpg-pattern,
     85.dyg-post-grid-wrapper.dygpg-gallery-tiled .dyg-post-grid-cell .dygpg-pattern > *,
     86.dyg-post-grid-wrapper.dygpg-gallery-columns .dyg-post-grid-cell .dygpg-pattern,
     87.dyg-post-grid-wrapper.dygpg-gallery-columns .dyg-post-grid-cell .dygpg-pattern > *
     88{
     89    line-height: 0;
     90    padding: 0px;
     91}
  • dyggrid/trunk/dyg-post-grid/addons/free/dygpg_styles_free.php

    r2823384 r2832606  
    1111
    1212    public function __construct() {
     13        add_filter('dygpg-after-process-atts', [$this, 'store_args'], 10, 2);
    1314        add_filter('dygpg-style-selected', [$this, 'style_selected'], 1, 2);
    1415        add_filter("dygform-filter-data-dygpg-form", [$this, 'add_form_elements'], 5, 1);
     16        add_filter('dygpg-shortcode-array', [$this, 'shortcode_array']);
     17        add_filter('dygpg-class', [$this, 'filter_class'], 10, 2);
    1518
    1619        $this->elements  = [
     
    2326                'container-style' => 'width: 100%;',
    2427                'contains'        => [
     28                    'style-reset'                 => [
     29                        'type'            => 'checkbox',
     30                        'label'           => 'Reset',
     31                        'checked'         => '',
     32                        'value'           => '',
     33                        'container-class' => 'dygpg-play-button',
     34                        'data-link'       => 'style-reset',
     35                        'data-link-val'   => 'Y',
     36                        'style'           => 'font-size: 200%;',
     37                        'hide'            => '',
     38                    ],
    2539                    'style-preset-options-header' => [
    2640                        'type'     => 'div',
     
    4054                        'parameters'       => '',
    4155                        'readonly'         => '',
    42                         'class'            => 'dygpg-play-button',
     56                        'class'            => 'dygpg-play-',
    4357                        'container-class'  => '',
    4458                        'container-style'  => '',
     
    4660                        'contains'         => '',
    4761                        'options'          => [
    48                             'style-reset' => [
    49                                 'type'          => 'checkbox',
    50                                 'label'         => 'Reset',
    51                                 'checked'       => '',
    52                                 'value'         => '',
    53                                 'contains'      => '',
    54                                 'data-link'     => 'style-reset',
    55                                 'data-link-val' => 'Y',
    56                                 'show'          => '',
    57                                 'hide'          => '',
    58                             ],
    59                             'fonts'       => [
    60                                 'type'          => 'checkbox',
    61                                 'label'         => 'Font Styles',
    62                                 'checked'       => '',
    63                                 'value'         => '',
    64                                 'contains'      => '',
    65                                 'data-link'     => 'class-fonts',
    66                                 'data-link-val' => 'Y',
    67                                 'show'          => '',
    68                                 'hide'          => '',
    69                             ],
    70                             0             => [
    71                                 'type'          => 'checkbox',
    72                                 'label'         => 'Shadow',
    73                                 'checked'       => '',
    74                                 'value'         => '',
    75                                 'contains'      => '',
    76                                 'data-link'     => 'class-shadow',
    77                                 'data-link-val' => 'Y',
    78                                 'show'          => '',
    79                                 'hide'          => '',
    80                             ],
    81                             1             => [
    82                                 'type'          => 'checkbox',
    83                                 'label'         => 'Image shadow',
    84                                 'checked'       => '',
    85                                 'value'         => '',
    86                                 'contains'      => '',
    87                                 'data-link'     => 'class-image-shadow',
    88                                 'data-link-val' => 'Y',
    89                                 'show'          => '',
    90                                 'hide'          => '',
    91                             ],
    92                             2             => [
    93                                 'type'          => 'checkbox',
    94                                 'label'         => 'Hover enlarge',
    95                                 'checked'       => '',
    96                                 'value'         => '',
    97                                 'contains'      => '',
    98                                 'data-link'     => 'class-hover-enlarge',
    99                                 'data-link-val' => 'Y',
    100                                 'show'          => '',
    101                                 'hide'          => '',
     62                            'fonts' => [
     63                                'type'          => 'checkbox',
     64                                'label'         => 'Override theme fonts',
     65                                'data-link'     => 'style-fonts',
     66                                'data-link-val' => 'Y',
     67                                'default'       => 'Y',
     68                            ],
     69                            0       => [
     70                                'type'          => 'checkbox',
     71                                'label'         => 'Cell Shadow',
     72                                'data-link'     => 'style-shadow',
     73                                'data-link-val' => 'Y',
     74                                'default'       => '',
     75                            ],
     76                            1       => [
     77                                'type'          => 'checkbox',
     78                                'label'         => 'Image Shadow',
     79                                'data-link'     => 'style-image-shadow',
     80                                'data-link-val' => 'Y',
     81                                'default'       => '',
     82                            ],
     83                            2       => [
     84                                'type'          => 'checkbox',
     85                                'label'         => 'Hover Enlarge',
     86                                'data-link'     => 'style-hover-enlarge',
     87                                'data-link-val' => 'Y',
     88                                'default'       => '',
     89                            ],
     90                            3       => [
     91                                'type'          => 'checkbox',
     92                                'label'         => 'Center All Text',
     93                                'data-link'     => 'style-center-text',
     94                                'data-link-val' => 'Y',
     95                                'default'       => '',
     96                            ],
     97                            4       => [
     98                                'type'          => 'checkbox',
     99                                'label'         => 'Center Content (Vertical)',
     100                                'data-link'     => 'style-center-content-vertical',
     101                                'data-link-val' => 'Y',
     102                                'default'       => '',
     103                            ],
     104                            5       => [
     105                                'type'          => 'checkbox',
     106                                'label'         => 'Center Content (Horizontal)',
     107                                'data-link'     => 'style-center-content-horizontal',
     108                                'data-link-val' => 'Y',
     109                                'default'       => '',
    102110                            ],
    103111                        ],
     
    105113                    'theme-preset-options-header' => [
    106114                        'type'     => 'div',
    107                         'label'    => 'Theme presets',
     115                        'label'    => 'Theme preset',
     116                        'container-class'    => 'half-width',
    108117                        'help'     => 'theme-presets',
    109                         'contains' => '',
    110                     ],
    111                     'theme-preset-options'        => [
    112                         'type'    => 'select_group',
    113                         'class'   => 'dygpg-play-button',
    114                         'style'   => 'column-count: 4;',
    115                         'options' => [
     118                        'contains' => [
     119                            'theme-preset-options' => [
     120                                'container-style' => '',
     121                                'data-link'       => 'preset',
     122                                'type'            => 'dropdown_group',
     123                                'default'         => '',
     124                                'placeholder'     => 'Preset',
     125                                'options'         => [
     126                                ],
     127                            ],
    116128                        ],
    117129                    ],
     
    152164
    153165
     166    public function store_args($args, $atts) {
     167        $this->args = $args;
     168        return $args;
     169    }
     170
     171
     172
     173    public function filter_class($class, $obj) {
     174        if ($obj->args['style-center-text'] === 'Y') {
     175            $class .= ' dygpg-center-text';
     176        }
     177        if ($obj->args['style-center-content-horizontal'] === 'Y') {
     178            $class .= ' dygpg-center-content-horizontal';
     179        }
     180        if ($obj->args['style-center-content-vertical'] === 'Y') {
     181            $class .= ' dygpg-center-content-vertical';
     182        }
     183        if ($obj->args['style-shadow'] === 'Y') {
     184            $class .= ' dygpg-shadow';
     185        }
     186        if ($obj->args['style-image-shadow'] === 'Y') {
     187            $class .= ' dygpg-image-shadow';
     188        }
     189        if ($obj->args['style-hover-enlarge'] === 'Y') {
     190            $class .= ' dygpg-hover-enlarge';
     191        }
     192        if ($obj->args['style-fonts'] === 'Y') {
     193            $class .= ' dygpg-fonts';
     194        }
     195        return $class;
     196    }
     197
     198
     199
     200    /**
     201     * adds an additional parameter to the shortcode array
     202     * @param array $shortcode - array of shortcode elements
     203     * @return string - modified shortcode array
     204     */
     205    public function shortcode_array($shortcode) {
     206        foreach ($this->elements['style-presets-wrapper']['contains']['style-preset-options']['options'] as $element) {
     207            $shortcode[$element['data-link']] = $element['default'] ?? '';
     208        }
     209
     210        return $shortcode;
     211    }
     212
     213
     214
    154215    /**
    155216     * adds additional post grid form editor elements to provide and interface for the new shortcode values
     
    159220        $styles   = [];
    160221        $styles[] = [
    161             'type'            => 'checkbox',
    162             'label'           => 'Blog',
    163             'container-style' => 'display:block;',
    164             'data-link'       => 'class-blog',
    165             'data-link-val'   => 'Y',
     222            'contains' => 'Blog',
     223            'value'    => 'dygpg-blog',
    166224        ];
    167225        $styles[] = [
    168             'type'            => 'checkbox',
    169             'label'           => 'List (bullets)',
    170             'data-link'       => 'class-list',
    171             'data-link-val'   => 'Y',
    172             'container-style' => 'display:block;',
     226            'contains' => 'Blog (Fade)',
     227            'value'    => 'dygpg-blog-fade',
    173228        ];
    174229        $styles[] = [
    175             'type'            => 'checkbox',
    176             'label'           => 'Gallery',
    177             'data-link'       => 'class-gallery',
    178             'data-link-val'   => 'Y',
    179             'container-style' => 'display:block;',
     230            'contains' => 'List (bullets)',
     231            'value'    => 'dygpg-list',
     232        ];
     233        $styles[] = [
     234            'contains' => 'Gallery',
     235            'value'    => 'dygpg-gallery',
     236        ];
     237        $none     = [];
     238        $none []  = [
     239            'contains' => 'None',
     240            'value'    => 'none',
    180241        ];
    181242
     
    183244        $styles = apply_filters('dygpg-get-more-styles', $styles);
    184245        usort($styles, function ($item1, $item2) {
    185             return $item1['label'] <=> $item2['label'];
     246            return $item1['contains'] <=> $item2['contains'];
    186247        });
    187         $this->elements['style-presets-wrapper']['contains']['theme-preset-options']['options'] = $styles;
    188 
     248        $styles = array_merge($none, $styles);
    189249        dygform_insert_element($data, 'show_wrapper', $this->elements);
     250        $e      = dygform_find_element($data, 'theme-preset-options');
     251        $e      = dygform_add_options_array($e, $styles, $this->args['preset'] ?? 'none');
     252
    190253        if (is_dyggrid_free()) {
    191254            dygform_insert_element($data, 'pattern_wrapper', $this->elements2);
     
    207270
    208271    public function style_selected($args, $class) {
    209         if ($class === 'class-blog') {
     272        if ($class === 'dygpg-blog') {
    210273            $args['button']              = 'More';
    211274            $args['columns']             = '3,3,2,1';
    212             $args['equal-grid-heights']  = is_dyggrid_pro() ? 'Y': '';
    213             $args['equal-title-heights'] = is_dyggrid_pro() ? 'Y': '';
     275            $args['equal-grid-heights']  = 'Y';
     276            $args['equal-title-heights'] = is_dyggrid_pro() ? 'Y' : '';
    214277            $args['link-titles']         = 'Y';
    215278            $args['meta_tag']            = 'h6';
    216279            $args['pattern']             = '%image%,%<,%title%,%category%,%excerpt%,%button%,%>';
    217280        }
    218         if ($class === 'class-list') {
     281        if ($class === 'dygpg-blog-fade') {
     282            $args['columns']              = '3,3,2,1';
     283            $args['content-aspect-ratio'] = '4:3';
     284            $args['equal-grid-heights']   = 'Y';
     285            $args['equal-title-heights']  = '';
     286            $args['pattern']              = '%<,%excerpt%,%>,%date%,%category%,%author%,%title%';
     287            $args['pattern-direction']    = '%date%,%category%,%author%';
     288            $args['transition']           = 'fade';
     289        }
     290        if ($class === 'dygpg-list') {
    219291            $args['column-gap']         = '0px,0px,0px,0px';
    220292            $args['columns']            = '1,1,1,1';
     
    225297            $args['title-tag']          = 'li';
    226298        }
    227         if ($class === 'class-gallery') {
     299        if ($class === 'dygpg-gallery') {
    228300            $args['equal-grid-heights']  = '';
    229301            $args['equal-title-heights'] = '';
    230302            $args['iclass-aspect-ratio'] = '1-1';
    231303            $args['link']                = 'L';
     304            $args['columns']             = '6,4,3,1';
    232305            $args['resolutions']         = '100px, 100px, 100px, 100px';
    233306            $args['show-content']        = '';
     
    237310            $args['width']               = '100px';
    238311        }
    239         if ($class === 'class-fonts') {
     312        if ($class === 'dygpg-fonts') {
    240313            $pattern = [
    241314                'title'   => 18,
  • dyggrid/trunk/dyg-post-grid/addons/free/dygpg_transitions_free.php

    r2827455 r2832606  
    1212    public function __construct() {
    1313        $this->obj = NULL;
     14        add_filter('dygpg-after-process-atts', [$this, 'store_args'], 10, 2);
    1415        add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
    1516        add_filter('dygpg-content-open', [$this, 'open_wrapper'], 10, 2); //filter the cell content open tag
     
    1819        add_filter('dygpg-shortcode-array', [$this, 'shortcode_array']); //adds additional shortcode arguements
    1920        add_filter('dygpg-aclass', [$this, 'aclass'], 10, 2); //filters the aclass arguement at output;
     21    }
     22
     23
     24
     25    public function store_args($args, $atts) {
     26        $this->args = $args;
     27        return $args;
    2028    }
    2129
     
    3442     */
    3543    public function aclass($class, $obj) {
    36         if (empty($obj->args['transition'])) {
     44        if (empty($obj->args['transition']) OR $obj->args['transition'] === 'none') {
    3745            $this->obj = NULL;
    3846            return $class;
     
    105113        $none   = [];
    106114        $none[] = [
    107             'type'            => 'radio',
    108             'label'           => 'None',
    109             'container-style' => 'display:block;',
    110             'data-link'       => 'transition',
    111             'data-link-val'   => '',
     115            'contains' => 'None',
     116            'value'    => 'none',
    112117        ];
    113118
    114119        $styles   = [];
    115120        $styles[] = [
    116             'type'            => 'radio',
    117             'label'           => 'Fade',
    118             'container-style' => 'display:block;',
    119             'data-link'       => 'transition',
    120             'data-link-val'   => 'fade',
     121            'contains' => 'Fade',
     122            'value'    => 'fade',
    121123        ];
    122124
     
    124126        $styles = apply_filters('dygpg-get-more-transitions', $styles);
    125127        usort($styles, function ($item1, $item2) {
    126             return $item1['label'] <=> $item2['label'];
     128            return $item1['contains'] <=> $item2['contains'];
    127129        });
    128130
    129         $styles   = $elements = [
    130             'transition-animations-label'   => [
    131                 'type'     => 'div',
    132                 'label'    => 'Transition animations',
     131        $elements = [
     132            'transition-animations-label' => [
     133                'type'            => 'div',
     134                'container-class' => 'half-width end',
     135                'label'           => 'Transition animation',
    133136//                'help'     => 'transition-animations',
    134                 'contains' => '',
    135             ],
    136             'transition-animations-wrapper' => [
    137                 'type'    => 'select_group',
    138                 'style'   => 'column-count:4',
    139                 'options' => array_merge($none, $styles),
     137                'contains'        => [
     138                    'transition-animations-wrapper' => [
     139                        'data-link'       => 'transition',
     140                        'type'            => 'dropdown_group',
     141                        'default'         => '',
     142                        'placeholder'     => 'Animation',
     143                        'options'         => [
     144                        ],
     145                    ],
     146                ],
    140147            ],
    141148        ];
    142         dygform_insert_element($data, 'theme-preset-options', $elements);
     149        dygform_insert_element($data, 'theme-preset-options-header', $elements);
     150        $e        = dygform_find_element($data, 'transition-animations-wrapper');
     151        dygform_add_options_array($e, array_merge($none, $styles), $this->args['transition'] ?? 'none');
    143152        return $data;
    144153    }
  • dyggrid/trunk/dyg-post-grid/css/dyg-post-grid-templates.css

    r2827455 r2832606  
    1515}
    1616
    17 .dyg-post-grid-wrapper img {max-width: 100%;height: auto;}
    18 .dyg-post-grid-wrapper h3 {
    19 }
    20 
    21 .dyg-post-grid-wrapper p {
    22 }
    23 .dyg-post-grid-wrapper li,
    24 .dyg-post-grid-wrapper  p,
    25 .dyg-post-grid-wrapper  p:not(.has-background):last-of-type,
    26 .dyg-post-grid-wrapper  h1,
    27 .dyg-post-grid-wrapper  h2,
    28 .dyg-post-grid-wrapper  h3,
    29 .dyg-post-grid-wrapper  h4,
    30 .dyg-post-grid-wrapper  h5,
    31 .dyg-post-grid-wrapper  h6
    32 {
    33     /* padding: 0px 0px 5px 0px; */
    34     /* margin:0px; */
    35     /* line-height: 1.3em; */
     17.dyg-post-grid-wrapper img {/* max-width: 100%; */
     18    height: auto;
    3619}
    3720
     
    170153    cursor:pointer;
    171154}
    172 /*end dygpg-button*/
    173 
     155/*blog-hover*/
     156.dygpg-blog-fade .dyg-post-grid-cell {
     157    padding: 20px;
     158}
     159.dygpg-blog-fade .dygpg-transition-wrapper {
     160    margin: -20px -20px 20px -20px;
     161}
     162.dygpg-blog-fade .dyg-post-grid-cell {
     163    border: 1px solid var(--dygiphy-theme-color-extra-light);
     164}
     165.dygpg-blog-fade .dygpg-content {
     166    padding: 20px;
     167    display: flex;
     168    align-items: center;
     169    justify-items: center;
     170}
     171
     172/*end dygpg-blog-fade*/
    174173.dygpg-blog .dygpg-content {
    175174    padding: 17px;
     
    188187.dygpg-overlay .dygpg-content {
    189188    background-color: #ffffffa0;
    190     display: flex;
    191189    width: 100%;
    192190    height: 100%;
    193     justify-content: center;
    194     align-items: center;
    195191    text-align: center;
    196192    padding: 20px;
    197     flex-direction: column;
    198193    margin:  0px;
    199194}
    200195
    201 .dygpg-content {box-sizing: border-box;}
     196.dygpg-content {
     197    box-sizing: border-box;
     198}
    202199
    203200.dygpg-meta li:not(:last-child):after {
    204     content:" , ";
     201    content:",";
     202    padding: 0px 0.2em 0px 0.2em;
    205203}
    206204ul.dygpg-meta {
     
    248246}
    249247/*end dygpg-list*/
     248
     249.dygpg-center-text .dygpg-content,
     250.dygpg-center-text .dygpg-text {
     251    text-align: center;
     252    align-items: center;
     253}
     254
     255.dygpg-center-content-horizontal .dygpg-content  {
     256    text-align: center;
     257    justify-content: center;
     258}
     259.dygpg-center-content-vertical .dygpg-content  {
     260    display:flex;
     261    flex-flow: row wrap;
     262    align-content: center;
     263    align-items: center;
     264}
     265.dygpg-center-content-vertical .dygpg-content *  {
     266    flex-basis: 100%;
     267}
     268.dygpg-center-content-vertical .dygpg-content span  {
     269    flex: 0 1 auto;
     270}
  • dyggrid/trunk/dyg-post-grid/css/dyg-post-grid.css

    r2823384 r2832606  
     1@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Rokkitt:wght@700&display=swap');
     2
    13.dygpg-filter-hide {
    24    display:none !important;
     
    1214}
    1315.dyg-post-grid-wrapper div.dygpg-filter {
    14     text-align: left;
     16    text-align: center;
    1517    margin-bottom: 30px;
    1618    width: 100%;
     
    2628}
    2729
    28 .dygpg-content > span:not(.dygpg-pattern-last):after {
    29     content: ' | ';
     30span.dygpg-pattern:not(.dygpg-pattern-last):after {
     31    content: '|';
     32    padding: 0px 0.2em 0px 0.2em;
    3033}
    3134.dyg-post-grid-wrapper .dygpg-filter table,
     
    9699.dyg-post-grid-wrapper-outer {
    97100    position: relative;
     101    z-index: 0;
    98102}
    99103div.dygpg-edit-wrapper .dygpg-keep-together textarea:not(:last-child) {
     
    148152    background-size: cover;
    149153    background-position: 50% 50%;
    150 }
    151 
    152 
     154    line-height: 0;
     155}
    153156
    154157
     
    264267    position: relative;
    265268}
     269.dyg-post-grid-cell > .dygpg-pattern:not(.dygpg-pattern-image) {
     270    padding-top: 10px;
     271}
     272.dyg-post-grid-wrapper .dygpg-meta,
     273.dyg-post-grid-wrapper .dygpg-text {
     274    line-height: 1.3;
     275}
     276.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern,
     277.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern-title a > * ,
     278.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern > *:not(a) {
     279    font-family: 'Open Sans', sans-serif;
     280    font-weight: 700;
     281    font-size: 15px;
     282    margin: 0px;
     283    padding: 0px 0px 5px 0px;
     284}
     285.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern div {
     286    font-weight: 400;
     287}
     288div.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern-title a > * ,
     289div.dyg-post-grid-wrapper.dygpg-fonts .dygpg-pattern-title * {
     290    font-weight: 700;
     291    font-size: 20px;
     292    padding: 0px;
     293    font-family: 'Rokkitt', serif;
     294    text-decoration: none;
     295    text-transform: uppercase;
     296}
  • dyggrid/trunk/dyg-post-grid/dyg-post-grid.php

    r2827455 r2832606  
    1111$dygpg_state = 0;
    1212
    13 define('DYGGRID_VERSION', '2.0.1');
     13define('DYGGRID_VERSION', '2.3.0');
    1414
    1515include_once DYG_STYLESHEET_DIRECTORY . '/dyg-post-grid/includes/class-dygpg-db.php';
  • dyggrid/trunk/dyg-post-grid/includes/class-dygpg-form.php

    r2827455 r2832606  
    184184     * @return type
    185185     */
    186     function handle_reset($args, $existing_args) {
     186    function handle_reset($args) {
    187187        if (apply_filters('dygpg-reset-arg-test', $args['style-reset'], $args) !== 'Y')
    188             return [$args, $existing_args];
    189 
    190         $id                  = $args['id'];
    191         $args                = apply_filters('dygpg-reset-get-defaults', DygPostGrid::get_shortcode_defaults($id), $args);
     188            return $args;
     189
     190        $existing_args = $args;
     191
     192        $args                = apply_filters('dygpg-reset-get-defaults', DygPostGrid::get_shortcode_defaults($args['id']), $args['id']);
    192193        $args['style-reset'] = '';
    193194
    194195        //don't reset the query source
    195196        $keeps = ['id', 'demo-id', 'content', 'posttype', 'taxonomy', 'tax-operator', 'tax-terms', 'numposts', 'pagesize', 'orderby', 'order', 'meta-key', 'term',
    196             'attached-taxonomies', 'use-ajax', 'load-more-button-label'];
     197            'attached-taxonomies', 'use-ajax', 'load-more-button-label', 'preset'];
    197198        $keeps = apply_filters('dygpg-reset-keeps', $keeps, $args);
    198199
     
    200201            $args[$key] = $existing_args[$key] ?? '';
    201202        }
    202         $existing_args['style-reset'] = 'Y';
    203 
    204         return [$args, $existing_args];
     203
     204        return $args;
    205205    }
    206206
     
    262262            //if this is a demo grid and we are at position 1, return the current state of the parent grid
    263263            if ($undo_count == 1 AND $undo_field === 'undo' AND $args['id'] !== $parent_id) {
    264                 $args = $postgrid::retrieve_atts($parent_id);
     264                $args                = $postgrid::retrieve_atts($parent_id);
    265265                $response['message'] = "$undo_field successful";
    266266            }
    267            
     267
    268268            //if this is an undo with an undo count of 1, perform a reset as no record is saved at 0
    269269            else if ($undo_count == 1 AND $undo_field === 'undo') {
     
    286286
    287287        //handle reset
    288         list($args, $existing_args) = $this->handle_reset($args, $existing_args);
    289 
    290         //convert the class preset checkboxes into classes
    291         $args['class'] = $args['class'] ?? '';
    292         foreach ($args_copy as $key => $value) {  //use the args copy in case the style checkboxes were reset above
    293             preg_match_all('/^class-(.*)/m', $key, $matches, PREG_SET_ORDER, 0);
    294             if (count($matches) === 0) { // we are looking for args with a key that starts with 'class-'
    295                 continue;
    296             }
    297             $class = "dygpg-{$matches[0][1]}";
    298             if (!empty($args_copy[$key]) && !str_contains($args['class'], $class)) {
    299                 $args['class'] .= " $class";
    300             }
    301 
    302             //for each checked style, call the filter so that other args can be modified by addons etc
    303             if ($args_copy[$key] === 'Y') {
    304                 $args = apply_filters("dygpg-style-selected", $args, $key);
    305             }
    306 
    307             //clear the play checkbox on the edit form
    308             $existing_args[$key] = 'Y';
    309             $args[$key]          = '';
    310         }
     288        $args = $this->handle_reset($args);
     289        $existing_args['style-reset'] = 'Y';
     290        $args['style-reset'] = '';
     291
     292        //handle presets
     293        if ($args['preset'] !== $existing_args['preset'])
     294            $args = apply_filters("dygpg-style-selected", $args, $args['preset']);
    311295
    312296        //perform a final filter of the args prior to saving
  • dyggrid/trunk/dyg-post-grid/includes/class-dygpg-postgrid.php

    r2827455 r2832606  
    1     <?php
     1<?php
    22
    33class DygPostGrid {
     
    135135            unset($atts['show_woo_price']);
    136136        }
     137        if (version_compare($atts['version'] ?? '0.0.0', '2.0.1', '<')) {
     138           
     139        }
     140        if (version_compare($atts['version'] ?? '0.0.0', '2.0.1', '<')) {
     141            $atts['style-fonts'] = '';
     142        }
    137143        $atts['version'] = DYGGRID_VERSION;
    138144        return $atts;
     
    185191            '%grid'    => $this->get_main_loop(),
    186192            '%widgets' => apply_filters('dygpg-top-widgets', '', $this),
    187             '%class'   => dygpg_toolbox::sanitize_classes($this->args['class'])
     193            '%class'   => dygpg_toolbox::sanitize_classes(apply_filters('dygpg-class', $this->args['class'], $this)) . " {$this->args['preset']}",
    188194        ]);
    189195    }
     
    264270            'pattern'                  => "%image%,%<,%title%,%>", // should the description be populated with the_content or the_excerpt;         
    265271            'pattern-direction'        => "", // list of pattern elements that should be inline-block     
     272            'preset'                   => "", // currectly selected style preset class 
    266273            'meta_pattern'             => "", // pattern for taxonomy etc meta fields   
    267274            'meta_tag'                 => "h5", // element for meta wrapper
     
    290297            'iclass-aspect-ratio'      => '4-3', //used by form editor to flag that aspect ratio classes should be added to the image
    291298            'aclass-aspect-ratio'      => '', //used by form editor to flag that aspect ratio classes should be added to the cell
     299            'content-aspect-ratio'     => '', //used by form editor to flag that aspect ratio classes should be added to the cell
    292300            'image'                    => 'Y', // 'Y' for separate <img> object.  'B' for background of the <a> object - only implemented for term so far
    293301            'show-post-content'        => '', //show the_content
     
    642650            return '';
    643651        }
    644         $aspect_ratio = round($image_meta['width'] / $image_meta['height'], 2);
    645         $dirname      = _wp_get_attachment_relative_path($image_meta['file']);
     652        $this->qaspect_ratio = round($image_meta['width'] / $image_meta['height'], 2);
     653        $dirname             = _wp_get_attachment_relative_path($image_meta['file']);
    646654        if ($dirname) {
    647655            $dirname = trailingslashit($dirname);
     
    654662            if (!($image['height'] ?? 0 > 0))
    655663                continue;
    656             if ($aspect_ratio === round($image['width'] / $image['height'], 2)) {
     664            if ($this->qaspect_ratio === round($image['width'] / $image['height'], 2)) {
    657665                $srcset .= "$image_baseurl{$image['file']} {$image['width']}w,";
    658666            }
     
    921929            return '';
    922930        }
    923         $aspect_ratio = str_replace(':', '-', $aspect_ratio);
    924         $aspect_ratio = explode('-', $aspect_ratio);
     931        if ($aspect_ratio === 'match_image') {
     932            $aspect_ratio = [];
     933            $aspect_ratio[0] = $this->qaspect_ratio ?? '';
     934            $aspect_ratio[1] = 1;
     935        } else {
     936            $aspect_ratio = str_replace(':', '-', $aspect_ratio);
     937            $aspect_ratio = explode('-', $aspect_ratio);
     938        }
    925939
    926940        if (!is_numeric($aspect_ratio[0] ?? '') || !is_numeric($aspect_ratio[1] ?? '')) {
     
    962976     */
    963977    function get_excerpt() {
    964         $excerpt = strtr("<div class='dygpg-excerpt'>%data%</div>", [
     978        $excerpt = strtr("<div class='dygpg-text dygpg-excerpt'>%data%</div>", [
    965979            '%data%' => $this->qexcerpt ?? '',
    966980        ]);
     
    979993     */
    980994    function get_rich_excerpt() {
    981         $excerpt = strtr("<div class='dygpg-rich-excerpt'>%data%</div>", [
     995        $excerpt = strtr("<div class='dygpg-text dygpg-rich-excerpt'>%data%</div>", [
    982996            '%data%' => $this->qpgexcerpt ?? '',
    983997        ]);
     
    9961010     */
    9971011    function get_the_content() {
    998         $content = strtr("<div class='dygpg-the-content'>%data%</div>", [
     1012        $content = strtr("<div class='dygpg-text dygpg-the-content'>%data%</div>", [
    9991013            '%data%' => $this->qcontent ?? '',
    10001014        ]);
     
    10151029     */
    10161030    public function get_titles($href) {
    1017         $title = strtr("<%tag href='%href' class='dygpg-title %equal'>%qtitle</%tag>", [
     1031        $title = strtr("<%tag href='%href' class='dygpg-text dygpg-title %equal'>%qtitle</%tag>", [
    10181032            '%tag'    => esc_attr($this->args['title-tag']),
    10191033            '%href'   => esc_url($href),
     
    11151129                        get_the_date('M d, Y'),
    11161130                        $this->args['pattern-direction'],
    1117                         ''
     1131                        'dygpg-text'
    11181132        );
    11191133    }
     
    11301144                        get_the_author(),
    11311145                        $this->args['pattern-direction'],
    1132                         ''
     1146                        'dygpg-text'
    11331147        );
    11341148    }
     
    11801194                    $output[] = apply_filters('dygpg-content-open',
    11811195                            strtr("<div %aspect class='dygpg-content%equalise'>", [
    1182                                 '%equalise' => $this->args['equal-content-heights'] === 'Y' ? " dyg-equal-height-content-{$this->args['id']}" : '',
    1183                                 '%aspect'  => $this->get_aspect_parameters($this->args['content-aspect-ratio'] ?? ''),
     1196                        '%equalise' => $this->args['equal-content-heights'] === 'Y' ? " dyg-equal-height-content-{$this->args['id']}" : '',
     1197                        '%aspect'   => $this->get_aspect_parameters($this->args['content-aspect-ratio'] ?? ''),
    11841198                            ]),
    11851199                            $this);
  • dyggrid/trunk/dyg-post-grid/js/dygpg-edit-ajax.js

    r2827455 r2832606  
    1515        var el = '#' + data.fields[field].id;
    1616        var parent = jQuery(el).closest('form');
    17         if (data.fields[field].type === 'input' || data.fields[field].type === 'textarea' || data.fields[field].type === 'select_list') {
     17        if (data.fields[field].type === 'input' || data.fields[field].type === 'textarea' || data.fields[field].type === 'select_list'  || data.fields[field].type === 'dropdown_group') {
    1818            jQuery(el).val(data.fields[field].val);
    1919        } else
     
    6262function dygpgAdminAjaxReadyFunctions() {
    6363    //auto select reset when a preset button is clicked
    64     jQuery('input[name="theme-preset-options"]').each(function () {
    65         jQuery(this).off('click').on('click', function () {
    66             var resetButton = jQuery(this).closest('form').find('[data-link="style-reset"]');
    67             jQuery(resetButton).prop("checked", false);
    68             jQuery(this).closest('form').find('input[name="theme-preset-options"]').each(function () {
    69                 if (jQuery(this).prop('checked') === true) {
    70                     jQuery(resetButton).prop("checked", true);
    71                 }
    72             });
    73         });
     64    jQuery('select[name="theme-preset-options"]').off('change').on('change', function () {
     65        var resetButton = jQuery(this).closest('form').find('[data-link="style-reset"]');
     66        jQuery(resetButton).prop("checked", true);
    7467    });
    7568
    7669    //clear the separator character after the last consecutive span in content elements
    77     jQuery('.dygpg-content > div').prev('span').addClass('dygpg-pattern-last');
     70    jQuery('div.dygpg-pattern').prev('span').addClass('dygpg-pattern-last');
    7871    jQuery('.dygpg-content > span:last-child').addClass('dygpg-pattern-last');
     72    jQuery('.dyg-post-grid-cell > span:last-child').addClass('dygpg-pattern-last');
    7973
    8074    //initialise the inline/block pattern arrows based on the value of the hidden input field
     
    116110    });
    117111    jQuery('i.dygpg-redo').off('click').on('click', function () {
    118         if (jQuery(this).prev().text() == 0) 
     112        if (jQuery(this).prev().text() == 0)
    119113            return;
    120114        jQuery(this).closest('form').find("[name='undo']").val('redo');
  • dyggrid/trunk/dyggrid.php

    r2827455 r2832606  
    1212 * Plugin URI:        https://www.dyggrid.com
    1313 * Description:       The ultimate grid and list generator for all Wordpress content types
    14  * Version:           2.0.1
     14 * Version:           2.0.3
    1515 * License:           GPL-2.0+
    1616 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
  • dyggrid/trunk/readme.txt

    r2827455 r2832606  
    55Requires PHP: 7.4
    66Tested up to: 6.1.1
    7 Stable tag: 2.0.1
     7Stable tag: 2.3.0
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html===
Note: See TracChangeset for help on using the changeset viewer.