Changeset 2827455
- Timestamp:
- 12/02/2022 03:57:00 AM (3 years ago)
- Location:
- dyggrid/trunk
- Files:
-
- 2 added
- 1 deleted
- 9 edited
-
dyg-post-grid/addons/free/dygpg_go_pro.php (modified) (1 diff)
-
dyg-post-grid/addons/free/dygpg_transitions_free.css (added)
-
dyg-post-grid/addons/free/dygpg_transitions_free.php (added)
-
dyg-post-grid/addons/pro (deleted)
-
dyg-post-grid/css/dyg-post-grid-templates.css (modified) (3 diffs)
-
dyg-post-grid/dyg-post-grid.php (modified) (1 diff)
-
dyg-post-grid/includes/class-dygpg-db.php (modified) (2 diffs)
-
dyg-post-grid/includes/class-dygpg-form.php (modified) (3 diffs)
-
dyg-post-grid/includes/class-dygpg-postgrid.php (modified) (8 diffs)
-
dyg-post-grid/js/dygpg-edit-ajax.js (modified) (2 diffs)
-
dyggrid.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dyggrid/trunk/dyg-post-grid/addons/free/dygpg_go_pro.php
r2818006 r2827455 123 123 ]; 124 124 $f[] = [ 125 'label' => "Transition animations", 126 'free' => '1', 127 'pro' => 'lots of animation styles!!' 128 ]; 129 $f[] = [ 125 130 'label' => "Cell layouts", 126 131 'free' => '2-4 columns', -
dyggrid/trunk/dyg-post-grid/css/dyg-post-grid-templates.css
r2823384 r2827455 12 12 transition: transform .2s, box-shadow .2s; 13 13 position: relative; 14 /* z-index: 1; */15 14 overflow-wrap: anywhere; 16 15 } … … 46 45 47 46 .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 { 53 52 background-color: white; 54 53 } … … 174 173 175 174 .dygpg-blog .dygpg-content { 176 margin: 17px;175 padding: 17px; 177 176 } 178 177 .dygpg-blog .dyg-post-grid-cell { -
dyggrid/trunk/dyg-post-grid/dyg-post-grid.php
r2823384 r2827455 11 11 $dygpg_state = 0; 12 12 13 define('DYGGRID_VERSION', ' 1.3.1');13 define('DYGGRID_VERSION', '2.0.1'); 14 14 15 15 include_once DYG_STYLESHEET_DIRECTORY . '/dyg-post-grid/includes/class-dygpg-db.php'; -
dyggrid/trunk/dyg-post-grid/includes/class-dygpg-db.php
r2818006 r2827455 158 158 global $wpdb; 159 159 $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'"); 161 164 } 162 165 … … 183 186 $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"); 184 187 if ($undo_id == null) { 188 $wpdb->update($this->table_name, ['active' => 0], ['grid_id' => $grid_id]); 185 189 return false; 186 190 } -
dyggrid/trunk/dyg-post-grid/includes/class-dygpg-form.php
r2823384 r2827455 211 211 */ 212 212 public function save($data) { 213 global $dygpg_db; 213 214 $args = []; 214 215 $should_save = TRUE; … … 249 250 $postgrid = new DygPostGrid(); 250 251 $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 256 255 $undo = ''; 257 256 if (($args['undo'] ?? '') !== '') { 257 $undo_count = $dygpg_db->db_count_undo($args['id']); 258 258 $should_save = FALSE; 259 259 $undo = $args['undo'] == 'undo' ? $postgrid::undo_atts($args['id']) : $postgrid::redo_atts($args['id']); 260 260 $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)) { 262 276 $response['message'] = "There was nothing to $undo_field"; 263 277 $response['success'] = false; 264 } else { 278 } 279 280 //otherwise return the undo/redo args 281 else { 265 282 $args = $undo; 266 283 $response['message'] = "$undo_field successful"; 267 284 } 268 285 } 286 287 //handle reset 288 list($args, $existing_args) = $this->handle_reset($args, $existing_args); 269 289 270 290 //convert the class preset checkboxes into classes … … 331 351 unset($changes['id']); 332 352 333 global $dygpg_db;334 353 $redo = $dygpg_db->db_count_redo($args['id']); 335 354 $undo = $dygpg_db->db_count_undo($args['id']); -
dyggrid/trunk/dyg-post-grid/includes/class-dygpg-postgrid.php
r2823384 r2827455 1 <?php1 <?php 2 2 3 3 class DygPostGrid { … … 61 61 // delete_option('dygpg-' . $id); 62 62 $atts = self::retrieve_atts($id); 63 //if empty, it means the atts have not been saved throught the editor yet, so con stinue with the shortcode supplied atts63 //if empty, it means the atts have not been saved throught the editor yet, so continue with the shortcode supplied atts 64 64 if (empty($atts)) { 65 65 $atts = $this->atts ?? []; … … 303 303 'equal-title-heights' => 'N', 304 304 'equal-grid-heights' => 'N', 305 'equal-content-heights' => 'N', 305 306 'tax-field' => 'slug', //this tells the taxonomy search that the 'terms' argument is the 'slug' and not the name 306 307 'tax-terms' => '', … … 1112 1113 return self::get_pattern_field_wrapper_static( 1113 1114 'date', 1114 get_the_date( ),1115 get_the_date('M d, Y'), 1115 1116 $this->args['pattern-direction'], 1116 1117 '' … … 1177 1178 break; 1178 1179 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); 1180 1186 break; 1181 1187 case ">" : 1182 $output[] = "</div>";1188 $output[] = apply_filters('dygpg-content-close', "</div>"); 1183 1189 break; 1184 1190 case "button" : … … 1218 1224 function get_main_loop() { 1219 1225 1226 1227 1220 1228 $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; 1222 1230 $this->qindex = 0; 1223 1231 $grid_content = ''; … … 1233 1241 $href = $this->get_href(); 1234 1242 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>", 1239 1244 [ 1240 1245 '%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)), 1243 1248 '%heights' => $this->args['equal-grid-heights'] === "Y" ? "dyg-equal-height-{$this->args['id']}" : '', 1244 1249 '%filters' => dygpg_toolbox::sanitize_classes($this->get_filter_classes()), … … 1277 1282 1278 1283 $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')\">" 1281 1286 . "%text</button></div>", 1282 1287 [ -
dyggrid/trunk/dyg-post-grid/js/dygpg-edit-ajax.js
r2823384 r2827455 73 73 }); 74 74 }); 75 75 76 76 //clear the separator character after the last consecutive span in content elements 77 77 jQuery('.dygpg-content > div').prev('span').addClass('dygpg-pattern-last'); 78 78 jQuery('.dygpg-content > span:last-child').addClass('dygpg-pattern-last'); 79 79 80 80 //initialise the inline/block pattern arrows based on the value of the hidden input field 81 81 jQuery('[data-link="pattern-direction"]').each(function () { … … 110 110 }); 111 111 jQuery('i.dygpg-undo').off('click').on('click', function () { 112 if (jQuery(this).prev().text() == 0) 113 return; 112 114 jQuery(this).closest('form').find("[name='undo']").val('undo'); 113 115 jQuery(this).closest('form').find("button[name='submit']").trigger('click'); 114 116 }); 115 117 jQuery('i.dygpg-redo').off('click').on('click', function () { 118 if (jQuery(this).prev().text() == 0) 119 return; 116 120 jQuery(this).closest('form').find("[name='undo']").val('redo'); 117 121 jQuery(this).closest('form').find("button[name='submit']").trigger('click'); -
dyggrid/trunk/dyggrid.php
r2823393 r2827455 12 12 * Plugin URI: https://www.dyggrid.com 13 13 * Description: The ultimate grid and list generator for all Wordpress content types 14 * Version: 1.3.114 * Version: 2.0.1 15 15 * License: GPL-2.0+ 16 16 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt -
dyggrid/trunk/readme.txt
r2823384 r2827455 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.1.1 7 Stable tag: 1.3.17 Stable tag: 2.0.1 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html=== … … 55 55 56 56 Get answers to all your questions on [our website](https://dyggrid.com/) 57 58 == Changelog == 59 60 version 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 65 version 2.0.0 66 * Added transition animations 67 * Added content aspect ratio setting 68 * Added content equal height feature 69 * General bug fixes 70 71 version 1.3.1 72 * General bug fixes 73 74 version 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 80 version 1.2.4 81 * Fixed issue of duplicate page more results 82 * CSS improvements 83 * General bug fixes 84 85 version 1.2.3 (public launch)
Note: See TracChangeset
for help on using the changeset viewer.