Plugin Directory

Changeset 2827455


Ignore:
Timestamp:
12/02/2022 03:57:00 AM (3 years ago)
Author:
dyggrid
Message:

changes

Location:
dyggrid/trunk
Files:
2 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • dyggrid/trunk/dyg-post-grid/addons/free/dygpg_go_pro.php

    r2818006 r2827455  
    123123        ];
    124124        $f[] = [
     125            'label' => "Transition animations",
     126            'free'  => '1',
     127            'pro'   => 'lots of animation styles!!'
     128        ];
     129        $f[] = [
    125130            'label' => "Cell layouts",
    126131            'free'  => '2-4 columns',
  • dyggrid/trunk/dyg-post-grid/css/dyg-post-grid-templates.css

    r2823384 r2827455  
    1212    transition: transform .2s, box-shadow .2s;
    1313    position: relative;
    14     /* z-index: 1; */
    1514    overflow-wrap: anywhere;
    1615}
     
    4645
    4746.dygpg-shadow .dygpg-content {
    48     margin: 12px;
    49 }
    50 
    51 
    52 .dyg-post-grid-wrapper.dygpg-shadow .dyg-post-grid-cell {
     47    padding: 12px;
     48}
     49
     50
     51.dygpg-shadow .dyg-post-grid-cell {
    5352    background-color: white;
    5453}
     
    174173
    175174.dygpg-blog .dygpg-content {
    176     margin: 17px;
     175    padding: 17px;
    177176}
    178177.dygpg-blog .dyg-post-grid-cell {
  • dyggrid/trunk/dyg-post-grid/dyg-post-grid.php

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

    r2818006 r2827455  
    158158        global $wpdb;
    159159        $active_id = $this->db_get_active_id($grid_id);
    160         return $wpdb->get_var("select count(id) as total from $this->table_name where id < $active_id and grid_id = '$grid_id'");
     160        if ( 0 == $wpdb->get_var("select count(id) as total from $this->table_name where active = 1 and grid_id = '$grid_id'"))
     161            return 0;
     162       
     163        return 1 + $wpdb->get_var("select count(id) as total from $this->table_name where id < $active_id and grid_id = '$grid_id'");
    161164    }
    162165
     
    183186        $undo_id   = $wpdb->get_var("select id from $this->table_name where id < $active_id and grid_id = '$grid_id' ORDER BY id DESC limit 1");
    184187        if ($undo_id == null) {
     188            $wpdb->update($this->table_name, ['active' => 0], ['grid_id' => $grid_id]);
    185189            return false;
    186190        }
  • dyggrid/trunk/dyg-post-grid/includes/class-dygpg-form.php

    r2823384 r2827455  
    211211     */
    212212    public function save($data) {
     213        global $dygpg_db;
    213214        $args                = [];
    214215        $should_save         = TRUE;
     
    249250        $postgrid      = new DygPostGrid();
    250251        $existing_args = DygPostGrid::retrieve_atts($args['id']);
    251 
    252         //handle reset
    253         list($args, $existing_args) = $this->handle_reset($args, $existing_args);
    254 
    255         //see if this is an undo / redo
     252        $existing_args = empty($existing_args) ? $args : $existing_args;
     253
     254        //see if this is an undo / redo
    256255        $undo = '';
    257256        if (($args['undo'] ?? '') !== '') {
     257            $undo_count  = $dygpg_db->db_count_undo($args['id']);
    258258            $should_save = FALSE;
    259259            $undo        = $args['undo'] == 'undo' ? $postgrid::undo_atts($args['id']) : $postgrid::redo_atts($args['id']);
    260260            $undo_field  = $args['undo'];
    261             if ($undo === false) {
     261
     262            //if this is a demo grid and we are at position 1, return the current state of the parent grid
     263            if ($undo_count == 1 AND $undo_field === 'undo' AND $args['id'] !== $parent_id) {
     264                $args = $postgrid::retrieve_atts($parent_id);
     265                $response['message'] = "$undo_field successful";
     266            }
     267           
     268            //if this is an undo with an undo count of 1, perform a reset as no record is saved at 0
     269            else if ($undo_count == 1 AND $undo_field === 'undo') {
     270                $args['style-reset'] == 'Y';
     271                $response['message'] = "$undo_field successful";
     272            }
     273
     274            //if there are no undo/redos, return a message
     275            else if (empty($undo)) {
    262276                $response['message'] = "There was nothing to $undo_field";
    263277                $response['success'] = false;
    264             } else {
     278            }
     279
     280            //otherwise return the undo/redo args
     281            else {
    265282                $args                = $undo;
    266283                $response['message'] = "$undo_field successful";
    267284            }
    268285        }
     286
     287        //handle reset
     288        list($args, $existing_args) = $this->handle_reset($args, $existing_args);
    269289
    270290        //convert the class preset checkboxes into classes
     
    331351        unset($changes['id']);
    332352
    333         global $dygpg_db;
    334353        $redo = $dygpg_db->db_count_redo($args['id']);
    335354        $undo = $dygpg_db->db_count_undo($args['id']);
  • dyggrid/trunk/dyg-post-grid/includes/class-dygpg-postgrid.php

    r2823384 r2827455  
    1 <?php
     1    <?php
    22
    33class DygPostGrid {
     
    6161//        delete_option('dygpg-' . $id);
    6262        $atts = self::retrieve_atts($id);
    63         //if empty, it means the atts have not been saved throught the editor yet, so constinue with the shortcode supplied atts
     63        //if empty, it means the atts have not been saved throught the editor yet, so continue with the shortcode supplied atts
    6464        if (empty($atts)) {
    6565            $atts       = $this->atts ?? [];
     
    303303            'equal-title-heights'      => 'N',
    304304            'equal-grid-heights'       => 'N',
     305            'equal-content-heights'    => 'N',
    305306            'tax-field'                => 'slug', //this tells the taxonomy search that the 'terms' argument is the 'slug' and not the name
    306307            'tax-terms'                => '',
     
    11121113        return self::get_pattern_field_wrapper_static(
    11131114                        'date',
    1114                         get_the_date(),
     1115                        get_the_date('M d, Y'),
    11151116                        $this->args['pattern-direction'],
    11161117                        ''
     
    11771178                    break;
    11781179                case "<" :
    1179                     $output[] = "<div class='dygpg-content'>";
     1180                    $output[] = apply_filters('dygpg-content-open',
     1181                            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'] ?? ''),
     1184                            ]),
     1185                            $this);
    11801186                    break;
    11811187                case ">" :
    1182                     $output[] = "</div>";
     1188                    $output[] = apply_filters('dygpg-content-close', "</div>");
    11831189                    break;
    11841190                case "button" :
     
    12181224    function get_main_loop() {
    12191225
     1226
     1227
    12201228        $this->qstart_index = $this->args['start-index'];
    1221         $this->end_index    = $this->qstart_index + min($this->args['pagesize'], $this->args['numposts']) - 1;
     1229        $this->end_index    = $this->qstart_index + min($this->args ['pagesize'], $this->args['numposts']) - 1;
    12221230        $this->qindex       = 0;
    12231231        $grid_content       = '';
     
    12331241            $href = $this->get_href();
    12341242
    1235             //main html output for the grid element
    1236             $aspect_params = $this->get_aspect_parameters($this->args['aclass-aspect-ratio']);
    1237 
    1238             $grid_content .= strtr("<%el %aspect %lightbox class='dyg-post-grid-cell %aclass %heights %filters' style='%style' href='%href'>%insert</%el>",
     1243            $grid_content .= strtr("<%el %aspect %lightbox class = 'dyg-post-grid-cell %aclass %heights %filters' style = '%style' href = '%href'>%insert</%el>",
    12391244                    [
    12401245                        '%el'       => $this->args['cell-element'],
    1241                         '%aspect'   => $aspect_params,
    1242                         '%aclass'   => dygpg_toolbox::sanitize_classes($this->args['aclass']),
     1246                        '%aspect'   => $this->get_aspect_parameters($this->args['aclass-aspect-ratio']),
     1247                        '%aclass'   => dygpg_toolbox::sanitize_classes(apply_filters('dygpg-aclass', $this->args['aclass'], $this)),
    12431248                        '%heights'  => $this->args['equal-grid-heights'] === "Y" ? "dyg-equal-height-{$this->args['id']}" : '',
    12441249                        '%filters'  => dygpg_toolbox::sanitize_classes($this->get_filter_classes()),
     
    12771282
    12781283        $this->args['start-index'] += $this->args['pagesize'];
    1279         return strtr("<div class='dyg-load-more-wrapper'>"
    1280                 . "<button id='dyg-post-grid-%id' class='dyg-load-more %ajax' onclick=\"dygLoadMore('%id','%start','%param')\">"
     1284        return strtr("<div class = 'dyg-load-more-wrapper'>"
     1285                . "<button id = 'dyg-post-grid-%id' class = 'dyg-load-more %ajax' onclick = \"dygLoadMore('%id','%start','%param')\">"
    12811286                . "%text</button></div>",
    12821287                [
  • dyggrid/trunk/dyg-post-grid/js/dygpg-edit-ajax.js

    r2823384 r2827455  
    7373        });
    7474    });
    75    
     75
    7676    //clear the separator character after the last consecutive span in content elements
    7777    jQuery('.dygpg-content > div').prev('span').addClass('dygpg-pattern-last');
    7878    jQuery('.dygpg-content > span:last-child').addClass('dygpg-pattern-last');
    79    
     79
    8080    //initialise the inline/block pattern arrows based on the value of the hidden input field
    8181    jQuery('[data-link="pattern-direction"]').each(function () {
     
    110110    });
    111111    jQuery('i.dygpg-undo').off('click').on('click', function () {
     112        if (jQuery(this).prev().text() == 0)
     113            return;
    112114        jQuery(this).closest('form').find("[name='undo']").val('undo');
    113115        jQuery(this).closest('form').find("button[name='submit']").trigger('click');
    114116    });
    115117    jQuery('i.dygpg-redo').off('click').on('click', function () {
     118        if (jQuery(this).prev().text() == 0)
     119            return;
    116120        jQuery(this).closest('form').find("[name='undo']").val('redo');
    117121        jQuery(this).closest('form').find("button[name='submit']").trigger('click');
  • dyggrid/trunk/dyggrid.php

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

    r2823384 r2827455  
    55Requires PHP: 7.4
    66Tested up to: 6.1.1
    7 Stable tag: 1.3.1
     7Stable tag: 2.0.1
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html===
     
    5555
    5656Get answers to all your questions on [our website](https://dyggrid.com/)
     57
     58== Changelog ==
     59
     60version 2.0.1
     61* Added additional transition animations
     62* Fixed issue with undo/redo not working in certain situations
     63* Fixed issue with unsaved IDs conflicting with reset
     64
     65version 2.0.0
     66* Added transition animations
     67* Added content aspect ratio setting
     68* Added content equal height feature
     69* General bug fixes
     70
     71version 1.3.1
     72* General bug fixes
     73
     74version 1.3.0
     75* Added inline/block toggle for meta pattern fields and taxonomies
     76* Added consolidated meta/pattern fields
     77* Changed reset behaviour to exclude content source settings
     78* Fixed cursor not changing to zoom icon on slideshow grids
     79
     80version 1.2.4
     81* Fixed issue of duplicate page more results
     82* CSS  improvements
     83* General bug fixes
     84
     85version 1.2.3 (public launch)
Note: See TracChangeset for help on using the changeset viewer.