Shortcodes Ultimate - Version 5.3.0

Version Description

What's new

  • New shortcode [su_csv_table] for displaying CSV tables
  • New option indent for the [su_list] shortcode, which allows adjusting of list indentation

Fixes

  • Fixed inaccessible fields in media modal (while inserting Gallery/Slider/Carousel shortcodes)
  • Fixed close icon class name in the presets menu
  • Fixed issue with unwanted content inside single shortcodes
  • Fixed warning when non-numeric value is used for the button size attribute
  • Min-width for responsive tables is set to 100%
Download this release

Release Info

Developer gn_themes
Plugin Icon 128x128 Shortcodes Ultimate
Version 5.3.0
Comparing to
See all releases

Code changes from version 5.2.0 to 5.3.0

assets/js/other-shortcodes.js CHANGED
@@ -79,8 +79,6 @@ jQuery(document).ready(function($) {
79
  }).magnificPopup('open');
80
  }
81
  });
82
- // Tables
83
- $('.su-table tr:even').addClass('su-even');
84
  // Frame
85
  $('.su-frame-align-center, .su-frame-align-none').each(function() {
86
  var frame_width = $(this).find('img').width();
79
  }).magnificPopup('open');
80
  }
81
  });
 
 
82
  // Frame
83
  $('.su-frame-align-center, .su-frame-align-none').each(function() {
84
  var frame_width = $(this).find('img').width();
inc/core/tools.php CHANGED
@@ -1,72 +1,4 @@
1
  <?php
2
- function su_parse_csv( $file ) {
3
- $csv_lines = file( $file );
4
- if ( is_array( $csv_lines ) ) {
5
- $cnt = count( $csv_lines );
6
- for ( $i = 0; $i < $cnt; $i++ ) {
7
- $line = $csv_lines[$i];
8
- $line = trim( $line );
9
- $first_char = true;
10
- $col_num = 0;
11
- $length = strlen( $line );
12
- for ( $b = 0; $b < $length; $b++ ) {
13
- if ( $skip_char != true ) {
14
- $process = true;
15
- if ( $first_char == true ) {
16
- if ( $line[$b] == '"' ) {
17
- $terminator = '";';
18
- $process = false;
19
- }
20
- else
21
- $terminator = ';';
22
- $first_char = false;
23
- }
24
- if ( $line[$b] == '"' ) {
25
- $next_char = $line[$b + 1];
26
- if ( $next_char == '"' ) $skip_char = true;
27
- elseif ( $next_char == ';' ) {
28
- if ( $terminator == '";' ) {
29
- $first_char = true;
30
- $process = false;
31
- $skip_char = true;
32
- }
33
- }
34
- }
35
- if ( $process == true ) {
36
- if ( $line[$b] == ';' ) {
37
- if ( $terminator == ';' ) {
38
- $first_char = true;
39
- $process = false;
40
- }
41
- }
42
- }
43
- if ( $process == true ) $column .= $line[$b];
44
- if ( $b == ( $length - 1 ) ) $first_char = true;
45
- if ( $first_char == true ) {
46
- $values[$i][$col_num] = $column;
47
- $column = '';
48
- $col_num++;
49
- }
50
- }
51
- else
52
- $skip_char = false;
53
- }
54
- }
55
- }
56
- $return = '<table><tr>';
57
- foreach ( $values[0] as $value ) $return .= '<th>' . $value . '</th>';
58
- $return .= '</tr>';
59
- array_shift( $values );
60
- foreach ( $values as $rows ) {
61
- $return .= '<tr>';
62
- foreach ( $rows as $col ) {
63
- $return .= '<td>' . $col . '</td>';
64
- }
65
- $return .= '</tr>';
66
- }
67
- $return .= '</table>';
68
- return $return;
69
- }
70
 
71
  function su_hex2rgb( $colour, $delimiter = '-' ) {
72
  if ( $colour[0] == '#' ) {
@@ -86,12 +18,12 @@ function su_hex2rgb( $colour, $delimiter = '-' ) {
86
  }
87
 
88
  /**
89
- * Resizes an image and returns an array containing the resized URL, width, height and file type. Uses native Wordpress functionality.
90
  *
91
  * @author Matthew Ruddy (http://easinglider.com)
92
  * @return array An array containing the resized image URL, width, height and file type.
93
  */
94
- function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $retina = false ) {
95
  global $wp_version;
96
 
97
  //######################################################################
@@ -99,10 +31,11 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
99
  //######################################################################
100
  if ( isset( $wp_version ) && version_compare( $wp_version, '3.5' ) >= 0 ) {
101
  global $wpdb;
102
- if ( empty( $url ) )
103
  return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url );
 
104
  // Get default size from database
105
- $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' );
106
  $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' );
107
  // Allow for different retina sizes
108
  $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1;
@@ -113,38 +46,48 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
113
  if ( is_multisite() ) {
114
  global $blog_id;
115
  $blog_details = get_blog_details( $blog_id );
116
- $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path );
117
  }
118
  // Destination width and height variables
119
- $dest_width = $width * $retina;
120
  $dest_height = $height * $retina;
121
  // File name suffix (appended to original file name)
122
  $suffix = "{$dest_width}x{$dest_height}";
123
  // Some additional info about the image
124
  $info = pathinfo( $file_path );
125
- $dir = $info['dirname'];
126
- $ext = $info['extension'];
127
  $name = wp_basename( $file_path, ".$ext" );
128
  // Suffix applied to filename
129
  $suffix = "{$dest_width}x{$dest_height}";
130
  // Get the destination file name
131
  $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}";
132
- if ( !file_exists( $dest_file_name ) ) {
133
- $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url );
134
  $get_attachment = $wpdb->get_results( $query );
135
- if ( !$get_attachment )
136
- return array( 'url' => $url, 'width' => $width, 'height' => $height );
137
- // Load Wordpress Image Editor
 
 
 
 
 
138
  $editor = wp_get_image_editor( $file_path );
139
- if ( is_wp_error( $editor ) )
140
- return array( 'url' => $url, 'width' => $width, 'height' => $height );
 
 
 
 
 
141
  // Get the original image size
142
- $size = $editor->get_size();
143
- $orig_width = $size['width'];
144
  $orig_height = $size['height'];
145
- $src_x = $src_y = 0;
146
- $src_w = $orig_width;
147
- $src_h = $orig_height;
148
  if ( $crop ) {
149
 
150
  $cmp_x = $orig_width / $dest_width;
@@ -154,11 +97,10 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
154
  if ( $cmp_x > $cmp_y ) {
155
  $src_w = round( $orig_width / $cmp_x * $cmp_y );
156
  $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 );
157
- }
158
- else if ( $cmp_y > $cmp_x ) {
159
  $src_h = round( $orig_height / $cmp_y * $cmp_x );
160
  $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 );
161
- }
162
  }
163
 
164
  // Time to crop the image!
@@ -166,10 +108,10 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
166
  // Now let's save the image
167
  $saved = $editor->save( $dest_file_name );
168
  // Get resized image information
169
- $resized_url = str_replace( basename( $url ), basename( $saved['path'] ), $url );
170
- $resized_width = $saved['width'];
171
  $resized_height = $saved['height'];
172
- $resized_type = $saved['mime-type'];
173
  // Add the resized dimensions to original image metadata (so we can delete our resized images when the original image is delete from the Media Library)
174
  $metadata = wp_get_attachment_metadata( $get_attachment[0]->ID );
175
  if ( isset( $metadata['image_meta'] ) ) {
@@ -178,18 +120,17 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
178
  }
179
  // Create the image array
180
  $image_array = array(
181
- 'url' => $resized_url,
182
- 'width' => $resized_width,
183
  'height' => $resized_height,
184
- 'type' => $resized_type
185
  );
186
- }
187
- else {
188
  $image_array = array(
189
- 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ),
190
- 'width' => $dest_width,
191
  'height' => $dest_height,
192
- 'type' => $ext
193
  );
194
  }
195
  // Return image array
@@ -202,22 +143,28 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
202
  else {
203
  global $wpdb;
204
 
205
- if ( empty( $url ) )
206
  return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url );
 
207
 
208
  // Bail if GD Library doesn't exist
209
- if ( !extension_loaded( 'gd' ) || !function_exists( 'gd_info' ) )
210
- return array( 'url' => $url, 'width' => $width, 'height' => $height );
 
 
 
 
 
211
 
212
  // Get default size from database
213
- $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' );
214
  $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' );
215
 
216
  // Allow for different retina sizes
217
  $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1;
218
 
219
  // Destination width and height variables
220
- $dest_width = $width * $retina;
221
  $dest_height = $height * $retina;
222
 
223
  // Get image file path
@@ -228,13 +175,13 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
228
  if ( is_multisite() ) {
229
  global $blog_id;
230
  $blog_details = get_blog_details( $blog_id );
231
- $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path );
232
  }
233
 
234
  // Some additional info about the image
235
  $info = pathinfo( $file_path );
236
- $dir = $info['dirname'];
237
- $ext = $info['extension'];
238
  $name = wp_basename( $file_path, ".$ext" );
239
 
240
  // Suffix applied to filename
@@ -244,25 +191,32 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
244
  $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}";
245
 
246
  // No need to resize & create a new image if it already exists!
247
- if ( !file_exists( $dest_file_name ) ) {
248
 
249
  /*
250
  * Bail if this image isn't in the Media Library either.
251
  * We only want to resize Media Library images, so we can be sure they get deleted correctly when appropriate.
252
  */
253
- $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url );
254
  $get_attachment = $wpdb->get_results( $query );
255
- if ( !$get_attachment )
256
- return array( 'url' => $url, 'width' => $width, 'height' => $height );
 
 
 
 
 
257
 
258
  $image = wp_load_image( $file_path );
259
- if ( !is_resource( $image ) )
260
  return new WP_Error( 'error_loading_image_as_resource', $image, $file_path );
 
261
 
262
  // Get the current image dimensions and type
263
  $size = @getimagesize( $file_path );
264
- if ( !$size )
265
  return new WP_Error( 'file_path_getimagesize_failed', 'Failed to get $file_path information using getimagesize.' );
 
266
  list( $orig_width, $orig_height, $orig_type ) = $size;
267
 
268
  // Create new image
@@ -282,55 +236,58 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
282
  if ( $cmp_x > $cmp_y ) {
283
  $src_w = round( $orig_width / $cmp_x * $cmp_y );
284
  $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 );
285
- }
286
- else if ( $cmp_y > $cmp_x ) {
287
  $src_h = round( $orig_height / $cmp_y * $cmp_x );
288
  $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 );
289
- }
290
 
291
  // Create the resampled image
292
  imagecopyresampled( $new_image, $image, 0, 0, $src_x, $src_y, $dest_width, $dest_height, $src_w, $src_h );
293
- }
294
- else
295
  imagecopyresampled( $new_image, $image, 0, 0, 0, 0, $dest_width, $dest_height, $orig_width, $orig_height );
 
296
 
297
  // Convert from full colors to index colors, like original PNG.
298
- if ( IMAGETYPE_PNG == $orig_type && function_exists( 'imageistruecolor' ) && !imageistruecolor( $image ) )
299
  imagetruecolortopalette( $new_image, false, imagecolorstotal( $image ) );
 
300
 
301
  // Remove the original image from memory (no longer needed)
302
  imagedestroy( $image );
303
 
304
  // Check the image is the correct file type
305
  if ( IMAGETYPE_GIF == $orig_type ) {
306
- if ( !imagegif( $new_image, $dest_file_name ) )
307
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (GIF)' );
308
- }
309
- elseif ( IMAGETYPE_PNG == $orig_type ) {
310
- if ( !imagepng( $new_image, $dest_file_name ) )
311
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (PNG).' );
312
- }
313
- else {
314
 
315
  // All other formats are converted to jpg
316
- if ( 'jpg' != $ext && 'jpeg' != $ext )
317
  $dest_file_name = "{$dir}/{$name}-{$suffix}.jpg";
318
- if ( !imagejpeg( $new_image, $dest_file_name, apply_filters( 'resize_jpeg_quality', 90 ) ) )
 
319
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (JPG).' );
 
320
  }
321
 
322
  // Remove new image from memory (no longer needed as well)
323
  imagedestroy( $new_image );
324
 
325
  // Set correct file permissions
326
- $stat = stat( dirname( $dest_file_name ) );
327
  $perms = $stat['mode'] & 0000666;
328
  @chmod( $dest_file_name, $perms );
329
 
330
  // Get some information about the resized image
331
  $new_size = @getimagesize( $dest_file_name );
332
- if ( !$new_size )
333
  return new WP_Error( 'resize_path_getimagesize_failed', 'Failed to get $dest_file_name (resized image) info via @getimagesize', $dest_file_name );
 
334
  list( $resized_width, $resized_height, $resized_type ) = $new_size;
335
 
336
  // Get the new image URL
@@ -345,18 +302,17 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
345
 
346
  // Return array with resized image information
347
  $image_array = array(
348
- 'url' => $resized_url,
349
- 'width' => $resized_width,
350
  'height' => $resized_height,
351
- 'type' => $resized_type
352
  );
353
- }
354
- else {
355
  $image_array = array(
356
- 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ),
357
- 'width' => $dest_width,
358
  'height' => $dest_height,
359
- 'type' => $ext
360
  );
361
  }
362
 
@@ -365,7 +321,7 @@ function su_image_resize( $url, $width = NULL, $height = NULL, $crop = true, $re
365
  }
366
 
367
  /**
368
- * Deletes the resized images when the original image is deleted from the Wordpress Media Library.
369
  *
370
  * @author Matthew Ruddy
371
  */
@@ -373,20 +329,23 @@ function su_delete_resized_images( $post_id ) {
373
 
374
  // Get attachment image metadata
375
  $metadata = wp_get_attachment_metadata( $post_id );
376
- if ( !$metadata )
377
  return;
 
378
 
379
  // Do some bailing if we cannot continue
380
- if ( !isset( $metadata['file'] ) || !isset( $metadata['image_meta']['resized_images'] ) )
381
  return;
382
- $pathinfo = pathinfo( $metadata['file'] );
 
383
  $resized_images = $metadata['image_meta']['resized_images'];
384
 
385
- // Get Wordpress uploads directory (and bail if it doesn't exist)
386
  $wp_upload_dir = wp_upload_dir();
387
- $upload_dir = $wp_upload_dir['basedir'];
388
- if ( !is_dir( $upload_dir ) )
389
  return;
 
390
 
391
  // Delete the resized images
392
  foreach ( $resized_images as $dims ) {
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  function su_hex2rgb( $colour, $delimiter = '-' ) {
4
  if ( $colour[0] == '#' ) {
18
  }
19
 
20
  /**
21
+ * Resizes an image and returns an array containing the resized URL, width, height and file type. Uses native WordPress functionality.
22
  *
23
  * @author Matthew Ruddy (http://easinglider.com)
24
  * @return array An array containing the resized image URL, width, height and file type.
25
  */
26
+ function su_image_resize( $url, $width = null, $height = null, $crop = true, $retina = false ) {
27
  global $wp_version;
28
 
29
  //######################################################################
31
  //######################################################################
32
  if ( isset( $wp_version ) && version_compare( $wp_version, '3.5' ) >= 0 ) {
33
  global $wpdb;
34
+ if ( empty( $url ) ) {
35
  return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url );
36
+ }
37
  // Get default size from database
38
+ $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' );
39
  $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' );
40
  // Allow for different retina sizes
41
  $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1;
46
  if ( is_multisite() ) {
47
  global $blog_id;
48
  $blog_details = get_blog_details( $blog_id );
49
+ $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path );
50
  }
51
  // Destination width and height variables
52
+ $dest_width = $width * $retina;
53
  $dest_height = $height * $retina;
54
  // File name suffix (appended to original file name)
55
  $suffix = "{$dest_width}x{$dest_height}";
56
  // Some additional info about the image
57
  $info = pathinfo( $file_path );
58
+ $dir = $info['dirname'];
59
+ $ext = $info['extension'];
60
  $name = wp_basename( $file_path, ".$ext" );
61
  // Suffix applied to filename
62
  $suffix = "{$dest_width}x{$dest_height}";
63
  // Get the destination file name
64
  $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}";
65
+ if ( ! file_exists( $dest_file_name ) ) {
66
+ $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url );
67
  $get_attachment = $wpdb->get_results( $query );
68
+ if ( ! $get_attachment ) {
69
+ return array(
70
+ 'url' => $url,
71
+ 'width' => $width,
72
+ 'height' => $height,
73
+ );
74
+ }
75
+ // Load WordPress Image Editor
76
  $editor = wp_get_image_editor( $file_path );
77
+ if ( is_wp_error( $editor ) ) {
78
+ return array(
79
+ 'url' => $url,
80
+ 'width' => $width,
81
+ 'height' => $height,
82
+ );
83
+ }
84
  // Get the original image size
85
+ $size = $editor->get_size();
86
+ $orig_width = $size['width'];
87
  $orig_height = $size['height'];
88
+ $src_x = $src_y = 0;
89
+ $src_w = $orig_width;
90
+ $src_h = $orig_height;
91
  if ( $crop ) {
92
 
93
  $cmp_x = $orig_width / $dest_width;
97
  if ( $cmp_x > $cmp_y ) {
98
  $src_w = round( $orig_width / $cmp_x * $cmp_y );
99
  $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 );
100
+ } elseif ( $cmp_y > $cmp_x ) {
 
101
  $src_h = round( $orig_height / $cmp_y * $cmp_x );
102
  $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 );
103
+ }
104
  }
105
 
106
  // Time to crop the image!
108
  // Now let's save the image
109
  $saved = $editor->save( $dest_file_name );
110
  // Get resized image information
111
+ $resized_url = str_replace( basename( $url ), basename( $saved['path'] ), $url );
112
+ $resized_width = $saved['width'];
113
  $resized_height = $saved['height'];
114
+ $resized_type = $saved['mime-type'];
115
  // Add the resized dimensions to original image metadata (so we can delete our resized images when the original image is delete from the Media Library)
116
  $metadata = wp_get_attachment_metadata( $get_attachment[0]->ID );
117
  if ( isset( $metadata['image_meta'] ) ) {
120
  }
121
  // Create the image array
122
  $image_array = array(
123
+ 'url' => $resized_url,
124
+ 'width' => $resized_width,
125
  'height' => $resized_height,
126
+ 'type' => $resized_type,
127
  );
128
+ } else {
 
129
  $image_array = array(
130
+ 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ),
131
+ 'width' => $dest_width,
132
  'height' => $dest_height,
133
+ 'type' => $ext,
134
  );
135
  }
136
  // Return image array
143
  else {
144
  global $wpdb;
145
 
146
+ if ( empty( $url ) ) {
147
  return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url );
148
+ }
149
 
150
  // Bail if GD Library doesn't exist
151
+ if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) {
152
+ return array(
153
+ 'url' => $url,
154
+ 'width' => $width,
155
+ 'height' => $height,
156
+ );
157
+ }
158
 
159
  // Get default size from database
160
+ $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' );
161
  $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' );
162
 
163
  // Allow for different retina sizes
164
  $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1;
165
 
166
  // Destination width and height variables
167
+ $dest_width = $width * $retina;
168
  $dest_height = $height * $retina;
169
 
170
  // Get image file path
175
  if ( is_multisite() ) {
176
  global $blog_id;
177
  $blog_details = get_blog_details( $blog_id );
178
+ $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path );
179
  }
180
 
181
  // Some additional info about the image
182
  $info = pathinfo( $file_path );
183
+ $dir = $info['dirname'];
184
+ $ext = $info['extension'];
185
  $name = wp_basename( $file_path, ".$ext" );
186
 
187
  // Suffix applied to filename
191
  $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}";
192
 
193
  // No need to resize & create a new image if it already exists!
194
+ if ( ! file_exists( $dest_file_name ) ) {
195
 
196
  /*
197
  * Bail if this image isn't in the Media Library either.
198
  * We only want to resize Media Library images, so we can be sure they get deleted correctly when appropriate.
199
  */
200
+ $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url );
201
  $get_attachment = $wpdb->get_results( $query );
202
+ if ( ! $get_attachment ) {
203
+ return array(
204
+ 'url' => $url,
205
+ 'width' => $width,
206
+ 'height' => $height,
207
+ );
208
+ }
209
 
210
  $image = wp_load_image( $file_path );
211
+ if ( ! is_resource( $image ) ) {
212
  return new WP_Error( 'error_loading_image_as_resource', $image, $file_path );
213
+ }
214
 
215
  // Get the current image dimensions and type
216
  $size = @getimagesize( $file_path );
217
+ if ( ! $size ) {
218
  return new WP_Error( 'file_path_getimagesize_failed', 'Failed to get $file_path information using getimagesize.' );
219
+ }
220
  list( $orig_width, $orig_height, $orig_type ) = $size;
221
 
222
  // Create new image
236
  if ( $cmp_x > $cmp_y ) {
237
  $src_w = round( $orig_width / $cmp_x * $cmp_y );
238
  $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 );
239
+ } elseif ( $cmp_y > $cmp_x ) {
 
240
  $src_h = round( $orig_height / $cmp_y * $cmp_x );
241
  $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 );
242
+ }
243
 
244
  // Create the resampled image
245
  imagecopyresampled( $new_image, $image, 0, 0, $src_x, $src_y, $dest_width, $dest_height, $src_w, $src_h );
246
+ } else {
 
247
  imagecopyresampled( $new_image, $image, 0, 0, 0, 0, $dest_width, $dest_height, $orig_width, $orig_height );
248
+ }
249
 
250
  // Convert from full colors to index colors, like original PNG.
251
+ if ( IMAGETYPE_PNG == $orig_type && function_exists( 'imageistruecolor' ) && ! imageistruecolor( $image ) ) {
252
  imagetruecolortopalette( $new_image, false, imagecolorstotal( $image ) );
253
+ }
254
 
255
  // Remove the original image from memory (no longer needed)
256
  imagedestroy( $image );
257
 
258
  // Check the image is the correct file type
259
  if ( IMAGETYPE_GIF == $orig_type ) {
260
+ if ( ! imagegif( $new_image, $dest_file_name ) ) {
261
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (GIF)' );
262
+ }
263
+ } elseif ( IMAGETYPE_PNG == $orig_type ) {
264
+ if ( ! imagepng( $new_image, $dest_file_name ) ) {
265
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (PNG).' );
266
+ }
267
+ } else {
268
 
269
  // All other formats are converted to jpg
270
+ if ( 'jpg' != $ext && 'jpeg' != $ext ) {
271
  $dest_file_name = "{$dir}/{$name}-{$suffix}.jpg";
272
+ }
273
+ if ( ! imagejpeg( $new_image, $dest_file_name, apply_filters( 'resize_jpeg_quality', 90 ) ) ) {
274
  return new WP_Error( 'resize_path_invalid', 'Resize path invalid (JPG).' );
275
+ }
276
  }
277
 
278
  // Remove new image from memory (no longer needed as well)
279
  imagedestroy( $new_image );
280
 
281
  // Set correct file permissions
282
+ $stat = stat( dirname( $dest_file_name ) );
283
  $perms = $stat['mode'] & 0000666;
284
  @chmod( $dest_file_name, $perms );
285
 
286
  // Get some information about the resized image
287
  $new_size = @getimagesize( $dest_file_name );
288
+ if ( ! $new_size ) {
289
  return new WP_Error( 'resize_path_getimagesize_failed', 'Failed to get $dest_file_name (resized image) info via @getimagesize', $dest_file_name );
290
+ }
291
  list( $resized_width, $resized_height, $resized_type ) = $new_size;
292
 
293
  // Get the new image URL
302
 
303
  // Return array with resized image information
304
  $image_array = array(
305
+ 'url' => $resized_url,
306
+ 'width' => $resized_width,
307
  'height' => $resized_height,
308
+ 'type' => $resized_type,
309
  );
310
+ } else {
 
311
  $image_array = array(
312
+ 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ),
313
+ 'width' => $dest_width,
314
  'height' => $dest_height,
315
+ 'type' => $ext,
316
  );
317
  }
318
 
321
  }
322
 
323
  /**
324
+ * Deletes the resized images when the original image is deleted from the WordPress Media Library.
325
  *
326
  * @author Matthew Ruddy
327
  */
329
 
330
  // Get attachment image metadata
331
  $metadata = wp_get_attachment_metadata( $post_id );
332
+ if ( ! $metadata ) {
333
  return;
334
+ }
335
 
336
  // Do some bailing if we cannot continue
337
+ if ( ! isset( $metadata['file'] ) || ! isset( $metadata['image_meta']['resized_images'] ) ) {
338
  return;
339
+ }
340
+ $pathinfo = pathinfo( $metadata['file'] );
341
  $resized_images = $metadata['image_meta']['resized_images'];
342
 
343
+ // Get WordPress uploads directory (and bail if it doesn't exist)
344
  $wp_upload_dir = wp_upload_dir();
345
+ $upload_dir = $wp_upload_dir['basedir'];
346
+ if ( ! is_dir( $upload_dir ) ) {
347
  return;
348
+ }
349
 
350
  // Delete the resized images
351
  foreach ( $resized_images as $dims ) {
includes/css/icons.css CHANGED
@@ -1,6 +1,6 @@
1
  /*!
2
  Fork Awesome 1.1.5
3
- License - http://forkawesome.github.io/Fork-Awesome/license
4
 
5
  Copyright 2018 Dave Gandy & Fork Awesome
6
 
1
  /*!
2
  Fork Awesome 1.1.5
3
+ License - https://forkaweso.me/Fork-Awesome/license
4
 
5
  Copyright 2018 Dave Gandy & Fork Awesome
6
 
includes/css/shortcodes.css CHANGED
@@ -1022,19 +1022,23 @@
1022
 
1023
  /* List
1024
  ---------------------------------------------------------------*/
 
 
 
 
1025
  .su-list ul {
1026
- list-style: none !important;
1027
- margin: 0 0 1.5em !important;
1028
  padding: 0 !important;
 
1029
  }
1030
 
1031
  .su-list ul li {
1032
  position: relative;
1033
- list-style-type: none !important;
1034
  display: block !important;
1035
- line-height: 1.3em;
1036
  margin: 0 !important;
1037
  padding: 4px 0 4px 2em !important;
 
 
1038
  }
1039
 
1040
  .su-list ul li > img {
@@ -1048,7 +1052,7 @@
1048
  border: none;
1049
  }
1050
 
1051
- .su-list ul li i {
1052
  position: absolute;
1053
  left: 0;
1054
  top: 4px;
@@ -1240,39 +1244,44 @@
1240
  }
1241
 
1242
  .su-table table {
1243
- width: 100% !important;
1244
  margin: 0 !important;
1245
  border-collapse: collapse !important;
1246
  font-size: 1em !important;
1247
  border: 1px solid #ccc !important;
1248
  }
1249
 
1250
- .su-table.su-table-responsive {
1251
- overflow-x: auto;
1252
- }
1253
-
1254
- .su-table.su-table-responsive table {
1255
- width: auto !important;
1256
- }
1257
-
1258
- .su-table th {
1259
  text-align: center !important;
1260
  padding: 1em !important;
1261
  font-size: 1em !important;
1262
- font-weight: normal !important;
1263
  color: #333 !important;
1264
  border: 1px solid #ccc !important;
1265
  background: #f0f0f0 !important;
1266
  }
1267
 
1268
- .su-table td {
1269
  padding: .5em 1em !important;
1270
  border: 1px solid #ccc !important;
1271
  background: #fff !important;
1272
  }
1273
 
1274
- .su-table .su-even td {
1275
- background: #f7f7f7 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
1276
  }
1277
 
1278
  /* QR code
1022
 
1023
  /* List
1024
  ---------------------------------------------------------------*/
1025
+ .su-list {
1026
+ margin-bottom: 1.5em;
1027
+ }
1028
+
1029
  .su-list ul {
1030
+ margin: 0 !important;
 
1031
  padding: 0 !important;
1032
+ list-style: none !important;
1033
  }
1034
 
1035
  .su-list ul li {
1036
  position: relative;
 
1037
  display: block !important;
 
1038
  margin: 0 !important;
1039
  padding: 4px 0 4px 2em !important;
1040
+ list-style-type: none !important;
1041
+ line-height: 1.3em;
1042
  }
1043
 
1044
  .su-list ul li > img {
1052
  border: none;
1053
  }
1054
 
1055
+ .su-list ul li > i {
1056
  position: absolute;
1057
  left: 0;
1058
  top: 4px;
1244
  }
1245
 
1246
  .su-table table {
1247
+ min-width: 100% !important;
1248
  margin: 0 !important;
1249
  border-collapse: collapse !important;
1250
  font-size: 1em !important;
1251
  border: 1px solid #ccc !important;
1252
  }
1253
 
1254
+ .su-table table th {
 
 
 
 
 
 
 
 
1255
  text-align: center !important;
1256
  padding: 1em !important;
1257
  font-size: 1em !important;
1258
+ font-weight: bold !important;
1259
  color: #333 !important;
1260
  border: 1px solid #ccc !important;
1261
  background: #f0f0f0 !important;
1262
  }
1263
 
1264
+ .su-table table td {
1265
  padding: .5em 1em !important;
1266
  border: 1px solid #ccc !important;
1267
  background: #fff !important;
1268
  }
1269
 
1270
+ .su-table-responsive {
1271
+ overflow-x: auto;
1272
+ }
1273
+
1274
+ .su-table-responsive table th,
1275
+ .su-table-responsive table td {
1276
+ word-break: initial !important;
1277
+ }
1278
+
1279
+ .su-table-alternate table tr:nth-child(even) td {
1280
+ background-color: #f7f7f7 !important;
1281
+ }
1282
+
1283
+ .su-table-fixed table {
1284
+ table-layout: fixed !important;
1285
  }
1286
 
1287
  /* QR code
includes/deprecated/functions.php CHANGED
@@ -146,3 +146,81 @@ function su_hex_shift( $supplied_hex, $shift_method, $percentage = 50 ) {
146
  }
147
  return '#' . $shifted_hex_value;
148
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
  return '#' . $shifted_hex_value;
148
  }
149
+
150
+ function su_parse_csv( $file ) {
151
+ // phpcs:disable
152
+ $csv_lines = file( $file );
153
+ if ( is_array( $csv_lines ) ) {
154
+ $cnt = count( $csv_lines );
155
+ for ( $i = 0; $i < $cnt; $i++ ) {
156
+ $line = $csv_lines[ $i ];
157
+ $line = trim( $line );
158
+ $first_char = true;
159
+ $col_num = 0;
160
+ $length = strlen( $line );
161
+ for ( $b = 0; $b < $length; $b++ ) {
162
+ if ( $skip_char != true ) {
163
+ $process = true;
164
+ if ( $first_char == true ) {
165
+ if ( $line[ $b ] == '"' ) {
166
+ $terminator = '";';
167
+ $process = false;
168
+ } else {
169
+ $terminator = ';';
170
+ }
171
+ $first_char = false;
172
+ }
173
+ if ( $line[ $b ] == '"' ) {
174
+ $next_char = $line[ $b + 1 ];
175
+ if ( $next_char == '"' ) {
176
+ $skip_char = true;
177
+ } elseif ( $next_char == ';' ) {
178
+ if ( $terminator == '";' ) {
179
+ $first_char = true;
180
+ $process = false;
181
+ $skip_char = true;
182
+ }
183
+ }
184
+ }
185
+ if ( $process == true ) {
186
+ if ( $line[ $b ] == ';' ) {
187
+ if ( $terminator == ';' ) {
188
+ $first_char = true;
189
+ $process = false;
190
+ }
191
+ }
192
+ }
193
+ if ( $process == true ) {
194
+ $column .= $line[ $b ];
195
+ }
196
+ if ( $b == ( $length - 1 ) ) {
197
+ $first_char = true;
198
+ }
199
+ if ( $first_char == true ) {
200
+ $values[ $i ][ $col_num ] = $column;
201
+ $column = '';
202
+ $col_num++;
203
+ }
204
+ } else {
205
+ $skip_char = false;
206
+ }
207
+ }
208
+ }
209
+ }
210
+ $return = '<table><tr>';
211
+ foreach ( $values[0] as $value ) {
212
+ $return .= '<th>' . $value . '</th>';
213
+ }
214
+ $return .= '</tr>';
215
+ array_shift( $values );
216
+ foreach ( $values as $rows ) {
217
+ $return .= '<tr>';
218
+ foreach ( $rows as $col ) {
219
+ $return .= '<td>' . $col . '</td>';
220
+ }
221
+ $return .= '</tr>';
222
+ }
223
+ $return .= '</table>';
224
+ return $return;
225
+ // phpcs:enable
226
+ }
includes/functions-html.php CHANGED
@@ -139,3 +139,48 @@ function su_html_dropdown( $args ) {
139
  '<select' . $args['id'] . $args['name'] . $args['class'] . $args['multiple'] . $args['size'] . $args['disabled'] . $args['style'] . '>' . $options . '</select>';
140
 
141
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  '<select' . $args['id'] . $args['name'] . $args['class'] . $args['multiple'] . $args['size'] . $args['disabled'] . $args['style'] . '>' . $options . '</select>';
140
 
141
  }
142
+
143
+ /**
144
+ * Create a HTML table from a CSV string.
145
+ *
146
+ * @since 5.3.0
147
+ * @param string $csv CSV input.
148
+ * @param string $delimiter Column delimiter.
149
+ * @return string HTML output.
150
+ */
151
+ function su_csv_to_html( $csv, $delimiter = ',', $header = false ) {
152
+
153
+ if ( ! is_string( $csv ) ) {
154
+ return '';
155
+ }
156
+
157
+ if ( ! function_exists( 'str_getcsv' ) ) {
158
+ return $csv;
159
+ }
160
+
161
+ $html = '';
162
+ $rows = explode( PHP_EOL, $csv );
163
+
164
+ foreach ( $rows as $row ) {
165
+
166
+ $html .= '<tr>';
167
+
168
+ foreach ( str_getcsv( $row, $delimiter ) as $cell ) {
169
+
170
+ $cell = trim( $cell );
171
+
172
+ $html .= $header
173
+ ? '<th>' . $cell . '</th>'
174
+ : '<td>' . $cell . '</td>';
175
+
176
+ }
177
+
178
+ $html .= '</tr>';
179
+
180
+ $header = false;
181
+
182
+ }
183
+
184
+ return '<table>' . $html . '</table>';
185
+
186
+ }
includes/js/generator/index.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function e(t){return typeof t}:function e(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var SUG={};SUG.App=function(f){var s=f("#su-generator"),o=f("#su-generator-search"),i=f("#su-generator-filter"),e=i.children("a"),u=f("#su-generator-choices"),c=u.find("span"),l=f("#su-generator-settings"),g=f("#su-compatibility-mode-prefix"),n=f("#su-generator-result"),p=f("#su-generator-selected"),d={state:{mceSelection:"",target:"",wpActiveEditor:null,context:"",insertArgs:"",preview:{timer:null,request:null}}};return d.el={body:f("body")},d.init=function(){var n;e.click(function(e){var t=f(this).data("filter");if("all"===t)c.css({opacity:1}).removeClass("su-generator-choice-first");else{var r=new RegExp(t,"gi");c.css({opacity:.2}),c.each(function(){var e;null!==f(this).data("group").match(r)&&f(this).css({opacity:1}).removeClass("su-generator-choice-first")})}e.preventDefault()}),f("#su-generator").on("click",".su-generator-home",function(e){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),d.state.mceSelection="",o.focus(),e.preventDefault()}),f("#su-generator").on("click",".su-generator-close",function(e){f.magnificPopup.close(),e.preventDefault()}),o.on({focus:function e(){f(this).val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),u.show(),c.css({opacity:1}).removeClass("su-generator-choice-first"),i.show()},blur:function e(){},keyup:function e(t){var r=f(".su-generator-choice-first:first"),o=f(this).val(),i=new RegExp(o,"gi"),u=0;13===t.keyCode&&0<r.length&&(t.preventDefault(),f(this).val("").blur(),r.trigger("click")),c.css({opacity:.2}).removeClass("su-generator-choice-first"),c.each(function(){var e=f(this).data(),t=e.shortcode,r,a,n,s=[t,e.name,e.desc,e.group].join(" ").match(i);null!==s&&(f(this).css({opacity:1}),o===t?(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=999):s.length>u&&(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=s.length))}),""===o&&c.removeClass("su-generator-choice-first")}}),c.on("click",function(e){var a=f(this).data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_settings",shortcode:a},beforeSend:function e(){f("#su-generator-preview").hide(),u.hide(),l.addClass("su-generator-loading").show(),s.addClass("su-generator-narrow"),i.hide()},success:function e(t){l.removeClass("su-generator-loading"),l.html(t);var r=f("#su-generator-content");void 0!==d.state.mceSelection&&""!==d.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(d.state.mceSelection),f(".su-generator-range-picker").each(function(e){var t,r=f(this).find("input"),a=r.attr("min"),n=r.attr("max"),s=r.attr("step");r.simpleSlider({snap:!0,step:s,range:[a,n]}),r.show(),r.on("keyup blur",function(e){r.simpleSlider("setValue",r.val())})}),f(".su-generator-select-color").each(function(e){f(this).find(".su-generator-select-color-wheel").filter(":first").farbtastic(".su-generator-select-color-value:eq("+e+")"),f(this).find(".su-generator-select-color-value").focus(function(){f(".su-generator-select-color-wheel:eq("+e+")").show()}),f(this).find(".su-generator-select-color-value").blur(function(){f(".su-generator-select-color-wheel:eq("+e+")").hide()})}),f(".su-generator-isp").each(function(){var r=f(this),u=r.find(".su-generator-isp-sources"),a=r.find(".su-generator-isp-source"),e=r.find(".su-generator-isp-add-media"),c=r.find(".su-generator-isp-images"),l=r.find(".su-generator-isp-categories"),g=r.find(".su-generator-isp-taxonomies"),p=f(".su-generator-isp-terms"),d=r.find(".su-generator-attr"),t,n=function e(){var t="none",r="",a=u.val();if("media"===a){var n=[];c.find("span").each(function(e){n[e]=f(this).data("id")}),0<n.length&&(r=n.join(","))}else if("category"===a){var s=l.val()||[];0<s.length&&(r=s.join(","))}else if("taxonomy"===a){var o=g.val()||"",i=p.val()||[];"0"!==o&&0<i.length&&(t="taxonomy: "+o+"/"+i.join(","))}else t="0"===a?"none":a;""!==r&&(t=a+": "+r),d.val(t).trigger("change")};u.on("change",function(e){var t=f(this).val();e.preventDefault(),a.removeClass("su-generator-isp-source-open"),-1===t.indexOf(":")&&r.find(".su-generator-isp-source-"+t).addClass("su-generator-isp-source-open"),n()}),c.on("click","span i",function(){f(this).parent("span").css("border-color","#f03").fadeOut(300,function(){f(this).remove(),n()})}),e.click(function(e){e.preventDefault(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_1=wp.media({title:SUGL10n.isp_media_title,library:{type:"image"},button:{text:SUGL10n.isp_media_insert},multiple:!0})).on("select",function(){var e=t.state().get("selection").toJSON();c.find("em").remove(),f.each(e,function(e){c.append('<span data-id="'+this.id+'" title="'+this.title+'"><img src="'+this.url+'" alt="" /><i class="sui sui-times"></i></span>')}),n()}).open()}),c.sortable({revert:200,containment:r,tolerance:"pointer",stop:function e(){n()}}),l.on("change",n),p.on("change",n),g.on("change",function(){var r=f(this).parents(".su-generator-isp-source"),e=f(this).val();if(p.hide().find("option").remove(),n(),"0"!==e)var t=f.ajax({url:ajaxurl,type:"post",dataType:"html",data:{action:"su_generator_get_terms",tax:e,class:"su-generator-isp-terms",multiple:!0,size:10},beforeSend:function e(){"object"===_typeof(t)&&t.abort(),p.html("").attr("disabled",!0).hide(),r.addClass("su-generator-loading")},success:function e(t){p.html(t).attr("disabled",!1).show(),r.removeClass("su-generator-loading")}})})}),f(".su-generator-upload-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container").find("input:text"),r;e.on("click",function(e){e.preventDefault(),e.stopPropagation(),void 0!==r&&r.close(),(r=wp.media.frames.su_media_frame_2=wp.media({title:SUGL10n.upload_title,button:{text:SUGL10n.upload_insert},multiple:!1})).on("select",function(){var e=r.state().get("selection").first().toJSON();t.val(e.url).trigger("change")}),r.open()})}),f(".su-generator-icon-picker-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container"),r=t.find(".su-generator-attr"),n=t.find(".su-generator-icon-picker"),s=n.find("input:text");e.click(function(e){n.toggleClass("su-generator-icon-picker-visible"),s.val("").trigger("keyup"),n.hasClass("su-generator-icon-picker-loaded")||(f.ajax({type:"post",url:ajaxurl,data:{action:"su_generator_get_icons"},dataType:"html",beforeSend:function e(){n.addClass("su-generator-loading"),n.addClass("su-generator-icon-picker-loaded")},success:function e(t){n.append(t);var a=n.children("i");a.click(function(e){r.val("icon: "+f(this).attr("title")),n.removeClass("su-generator-icon-picker-visible"),r.trigger("change"),e.preventDefault()}),s.on({keyup:function e(){var t=f(this).val(),r=new RegExp(t,"gi");a.hide(),a.each(function(){var e;null!==f(this).attr("title").match(r)&&f(this).show()})},focus:function e(){f(this).val(""),a.show()}}),n.removeClass("su-generator-loading")}}),e.preventDefault())})}),f(".su-generator-switch").click(function(e){var t,r=f(this).parent().children("input"),a;"yes"===r.val()?r.val("no").trigger("change"):r.val("yes").trigger("change"),e.preventDefault()}),f(".su-generator-switch-value").on("change",function(){var e=f(this),t=e.parent().children(".su-generator-switch"),r=e.val();"yes"===r?t.removeClass("su-generator-switch-no").addClass("su-generator-switch-yes"):"no"===r&&t.removeClass("su-generator-switch-yes").addClass("su-generator-switch-no")}),f("select#su-generator-attr-taxonomy").on("change",function(){var e,t=f(this).val(),r=f("select#su-generator-attr-tax_term");window.su_generator_get_terms=f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_get_terms",tax:t,noselect:!0},dataType:"html",beforeSend:function e(){"object"===_typeof(window.su_generator_get_terms)&&window.su_generator_get_terms.abort(),r.parent().addClass("su-generator-loading")},success:function e(t){r.find("option").remove(),r.append(t),r.parent().removeClass("su-generator-loading")}})}),f(".su-generator-shadow-picker").each(function(e){var t=f(this),r=t.find(".su-generator-shadow-picker-field input"),a=t.find(".su-generator-sp-hoff"),n=t.find(".su-generator-sp-voff"),s=t.find(".su-generator-sp-blur"),o={cnt:t.find(".su-generator-shadow-picker-color"),value:t.find(".su-generator-shadow-picker-color-value"),wheel:t.find(".su-generator-shadow-picker-color-wheel")},i=t.find(".su-generator-attr");o.wheel.farbtastic(o.value),o.value.focus(function(){o.wheel.show()}),o.value.blur(function(){o.wheel.hide()}),r.on("change blur keyup",function(){i.val(a.val()+"px "+n.val()+"px "+s.val()+"px "+o.value.val()).trigger("change")}),i.on("keyup",function(){var e=f(this).val().split(" ");4===e.length&&(a.val(e[0].replace("px","")),n.val(e[1].replace("px","")),s.val(e[2].replace("px","")),o.value.val(e[3]),r.trigger("keyup"))})}),f(".su-generator-border-picker").each(function(e){var t=f(this),r=t.find(".su-generator-border-picker-field input, .su-generator-border-picker-field select"),a=t.find(".su-generator-bp-width"),n=t.find(".su-generator-bp-style"),s={cnt:t.find(".su-generator-border-picker-color"),value:t.find(".su-generator-border-picker-color-value"),wheel:t.find(".su-generator-border-picker-color-wheel")},o=t.find(".su-generator-attr");s.wheel.farbtastic(s.value),s.value.focus(function(){s.wheel.show()}),s.value.blur(function(){s.wheel.hide()}),r.on("change blur keyup",function(){o.val(a.val()+"px "+n.val()+" "+s.value.val()).trigger("change")}),o.on("keyup",function(){var e=f(this).val().split(" ");3===e.length&&(a.val(e[0].replace("px","")),n.val(e[1]),s.value.val(e[2]),r.trigger("keyup"))})}),l.find(".su-generator-attr").on("change keyup blur",function(){var e=f(this).parents(".su-generator-attr-container"),t=e.data("default"),r;f(this).val()!=t?e.removeClass("su-generator-skip"):e.addClass("su-generator-skip")}),f(".su-generator-set-value").click(function(e){f(this).parents(".su-generator-attr-container").find("input").val(f(this).text()).trigger("change")}),p.val(a),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:"last_used",shortcode:a},beforeSend:function e(){},success:function e(t){d.setSettings(t);var r=f("#su-generator-content");void 0!==d.state.mceSelection&&""!==d.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(d.state.mceSelection)},dataType:"json"})},dataType:"html"})}),f("#su-generator").on("click",".su-generator-insert",d.insertShortcode),f("#su-generator").on("click",".su-generator-toggle-preview",function(e){var t=f("#su-generator-preview"),r;f(this).hide(),t.addClass("su-generator-loading").show(),l.find("input, textarea, select").on("change keyup blur",function(){d.updatePreview()}),d.updatePreview(!0),e.preventDefault()}),f("#su-generator").on("mouseenter click",".su-generator-presets",function(){clearTimeout(n),f(".su-gp-popup").show()}),f("#su-generator").on("mouseleave",".su-generator-presets",function(){n=window.setTimeout(function(){f(".su-gp-popup").fadeOut(200)},600)}),f("#su-generator").on("click",".su-gp-new",function(e){var t=f(this).parents(".su-generator-presets"),r=f(".su-gp-list"),a=(new Date).getTime(),n=prompt(SUGL10n.presets_prompt_msg,SUGL10n.presets_prompt_value);""!==n&&null!==n&&(r.find("b").hide(),r.append('<span data-id="'+a+'"><em>'+n+'</em><i class="fa fa-times"></i></span>'),d.addPreset(a,n))}),f("#su-generator").on("click",".su-gp-list span",function(e){var t=f(".su-generator-presets").data("shortcode"),r=f(this).data("id"),a=f(".su-generator-insert");f(".su-gp-popup").hide(),clearTimeout(n),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:r,shortcode:t},beforeSend:function e(){a.addClass("button-primary-disabled").attr("disabled",!0)},success:function e(t){a.removeClass("button-primary-disabled").attr("disabled",!1),d.setSettings(t)},dataType:"json"}),e.preventDefault(),e.stopPropagation()}),f("#su-generator").on("click",".su-gp-list i",function(e){var t=f(this).parents(".su-gp-list"),r=f(this).parent("span"),a=r.data("id");r.remove(),t.find("span").length<1&&t.find("b").show(),d.removePreset(a),e.stopPropagation(),e.preventDefault()})},d.addPreset=function(e,t){var r=f(".su-generator-presets").data("shortcode"),a=d.getSettings();f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_add_preset",id:e,name:t,shortcode:r,settings:a}})},d.removePreset=function(e){var t=f(".su-generator-presets").data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_remove_preset",id:e,shortcode:t}})},d.parseSettings=function(){var e=p.val(),t=g.val(),r=f("#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr"),a=f("#su-generator-content").val(),n=new String("");return n+="["+t+e,r.each(function(){var e=f(this),t="";null==(t=e.is("select")?e.find("option:selected").val():e.val())?t="":"array"==typeof t&&(t=t.join(",")),""!==t&&(n+=" "+f(this).attr("name")+'="'+f(this).val().toString().replace(/"/gi,"'")+'"')}),n+="]","false"!=a&&(n+=a+"[/"+t+e+"]"),n},d.getSettings=function(){var e=p.val(),t=f("#su-generator-settings .su-generator-attr"),r=f("#su-generator-content").val(),n={};return t.each(function(e){var t=f(this),r="",a=t.attr("name");null==(r=t.is("select")?t.find("option:selected").val():t.val())&&(r=""),n[a]=r}),n.content=r.toString(),n},d.setSettings=function(r){var e=f("#su-generator-settings .su-generator-attr"),t=f("#su-generator-content");e.each(function(){var e=f(this),t=e.attr("name");r.hasOwnProperty(t)&&(e.val(r[t]),e.trigger("keyup").trigger("change").trigger("blur"))}),r.hasOwnProperty("content")&&t.val(r.content).trigger("keyup").trigger("change").trigger("blur"),d.updatePreview()},d.updatePreview=function(e){var r=f("#su-generator-preview"),t=d.parseSettings(),a=n.text();e=e||!1,r.is(":visible")&&(t!==a||e)&&(window.clearTimeout(d.state.preview.timer),d.state.preview.timer=window.setTimeout(function(){d.state.preview.request=f.ajax({type:"POST",url:ajaxurl,cache:!1,data:{action:"su_generator_preview",shortcode:t},beforeSend:function e(){d.state.preview.request&&d.state.preview.request.abort(),r.addClass("su-generator-loading").html("")},success:function e(t){r.html(t).removeClass("su-generator-loading")},dataType:"html"})},300),n.text(t))},d.insert=function(e,t){if("string"==typeof e&&"object"===_typeof(t)){d.state.context=e;var r=(d.state.insertArgs=t).shortcode||"",a={type:"inline",alignTop:!0,items:{src:"#su-generator"},callbacks:{}};a.callbacks.open=function(){r?c.filter('[data-shortcode="'.concat(r,'"]')).trigger("click"):window.setTimeout(function(){return o.focus()},200),d.el.body.addClass("su-mfp-shown"),"undefined"!=typeof tinyMCE&&null!=tinyMCE.activeEditor&&tinyMCE.activeEditor.hasOwnProperty("selection")&&(d.state.mceSelection=tinyMCE.activeEditor.selection.getContent({format:"text"}))},a.callbacks.close=function(){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),d.state.mceSelection="",d.el.body.removeClass("su-mfp-shown")},f.magnificPopup.open(a)}},d.insertShortcode=function(){var e=d.parseSettings();if(d.addPreset("last_used",SUGL10n.last_used),f.magnificPopup.close(),n.text(e),"classic"===d.state.context)d.state.wpActiveEditor=window.wpActiveEditor,window.wpActiveEditor=d.state.insertArgs.editorID,window.wp.media.editor.insert(e),window.wpActiveEditor=d.state.wpActiveEditor;else if("block"===d.state.context){var t=d.state.insertArgs.props;if(t.attributes.hasOwnProperty("content"))t.setAttributes({content:t.attributes.content+e});else if("core/shortcode"===t.name){var r=t.attributes.hasOwnProperty("text")?t.attributes.text:"";t.setAttributes({text:r+e})}}},d.insertAtCaret=function(e,t){var r=e.selectionStart,a=e.selectionEnd;e.value=e.value.substring(0,r)+t+e.value.substring(r),e.focus(),e.selectionStart=r+t.length},{init:d.init,insert:d.insert}}(jQuery),jQuery(document).ready(SUG.App.init);
2
  //# sourceMappingURL=index.js.map
3
  //# sourceMappingURL=index.js.map
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function e(t){return typeof t}:function e(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var SUG={};SUG.App=function(f){var s=f("#su-generator"),o=f("#su-generator-search"),i=f("#su-generator-filter"),e=i.children("a"),u=f("#su-generator-choices"),c=u.find("span"),l=f("#su-generator-settings"),g=f("#su-compatibility-mode-prefix"),a=f("#su-generator-result"),d=f("#su-generator-selected"),p={state:{mceSelection:"",target:"",wpActiveEditor:null,context:"",insertArgs:"",preview:{timer:null,request:null}}};return p.el={body:f("body")},p.init=function(){var a;e.click(function(e){var t=f(this).data("filter");if("all"===t)c.css({opacity:1}).removeClass("su-generator-choice-first");else{var r=new RegExp(t,"gi");c.css({opacity:.2}),c.each(function(){var e;null!==f(this).data("group").match(r)&&f(this).css({opacity:1}).removeClass("su-generator-choice-first")})}e.preventDefault()}),f("#su-generator").on("click",".su-generator-home",function(e){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),p.state.mceSelection="",o.focus(),e.preventDefault()}),f("#su-generator").on("click",".su-generator-close",function(e){f.magnificPopup.close(),e.preventDefault()}),o.on({focus:function e(){f(this).val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),u.show(),c.css({opacity:1}).removeClass("su-generator-choice-first"),i.show()},blur:function e(){},keyup:function e(t){var r=f(".su-generator-choice-first:first"),o=f(this).val(),i=new RegExp(o,"gi"),u=0;13===t.keyCode&&0<r.length&&(t.preventDefault(),f(this).val("").blur(),r.trigger("click")),c.css({opacity:.2}).removeClass("su-generator-choice-first"),c.each(function(){var e=f(this).data(),t=e.shortcode,r,n,a,s=[t,e.name,e.desc,e.group].join(" ").match(i);null!==s&&(f(this).css({opacity:1}),o===t?(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=999):s.length>u&&(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=s.length))}),""===o&&c.removeClass("su-generator-choice-first")}}),c.on("click",function(e){var n=f(this).data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_settings",shortcode:n},beforeSend:function e(){f("#su-generator-preview").hide(),u.hide(),l.addClass("su-generator-loading").show(),s.addClass("su-generator-narrow"),i.hide()},success:function e(t){l.removeClass("su-generator-loading"),l.html(t);var r=f("#su-generator-content");void 0!==p.state.mceSelection&&""!==p.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(p.state.mceSelection),f(".su-generator-range-picker").each(function(e){var t,r=f(this).find("input"),n=r.attr("min"),a=r.attr("max"),s=r.attr("step");r.simpleSlider({snap:!0,step:s,range:[n,a]}),r.show(),r.on("keyup blur",function(e){r.simpleSlider("setValue",r.val())})}),f(".su-generator-select-color").each(function(e){f(this).find(".su-generator-select-color-wheel").filter(":first").farbtastic(".su-generator-select-color-value:eq("+e+")"),f(this).find(".su-generator-select-color-value").focus(function(){f(".su-generator-select-color-wheel:eq("+e+")").show()}),f(this).find(".su-generator-select-color-value").blur(function(){f(".su-generator-select-color-wheel:eq("+e+")").hide()})}),f(".su-generator-isp").each(function(){var r=f(this),u=r.find(".su-generator-isp-sources"),n=r.find(".su-generator-isp-source"),e=r.find(".su-generator-isp-add-media"),c=r.find(".su-generator-isp-images"),l=r.find(".su-generator-isp-categories"),g=r.find(".su-generator-isp-taxonomies"),d=f(".su-generator-isp-terms"),p=r.find(".su-generator-attr"),t,a=function e(){var t="none",r="",n=u.val();if("media"===n){var a=[];c.find("span").each(function(e){a[e]=f(this).data("id")}),0<a.length&&(r=a.join(","))}else if("category"===n){var s=l.val()||[];0<s.length&&(r=s.join(","))}else if("taxonomy"===n){var o=g.val()||"",i=d.val()||[];"0"!==o&&0<i.length&&(t="taxonomy: "+o+"/"+i.join(","))}else t="0"===n?"none":n;""!==r&&(t=n+": "+r),p.val(t).trigger("change")};u.on("change",function(e){var t=f(this).val();e.preventDefault(),n.removeClass("su-generator-isp-source-open"),-1===t.indexOf(":")&&r.find(".su-generator-isp-source-"+t).addClass("su-generator-isp-source-open"),a()}),c.on("click","span i",function(){f(this).parent("span").css("border-color","#f03").fadeOut(300,function(){f(this).remove(),a()})}),e.click(function(e){e.preventDefault(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_1=wp.media({title:SUGL10n.isp_media_title,library:{type:"image"},button:{text:SUGL10n.isp_media_insert},multiple:!0})).on("open",function(){f(".mfp-wrap").addClass("hidden")}),t.on("close",function(){f(".mfp-wrap").removeClass("hidden")}),t.on("select",function(){var e=t.state().get("selection").toJSON();c.find("em").remove(),f.each(e,function(e){c.append('<span data-id="'+this.id+'" title="'+this.title+'"><img src="'+this.url+'" alt="" /><i class="sui sui-times"></i></span>')}),a()}).open()}),c.sortable({revert:200,containment:r,tolerance:"pointer",stop:function e(){a()}}),l.on("change",a),d.on("change",a),g.on("change",function(){var r=f(this).parents(".su-generator-isp-source"),e=f(this).val();if(d.hide().find("option").remove(),a(),"0"!==e)var t=f.ajax({url:ajaxurl,type:"post",dataType:"html",data:{action:"su_generator_get_terms",tax:e,class:"su-generator-isp-terms",multiple:!0,size:10},beforeSend:function e(){"object"===_typeof(t)&&t.abort(),d.html("").attr("disabled",!0).hide(),r.addClass("su-generator-loading")},success:function e(t){d.html(t).attr("disabled",!1).show(),r.removeClass("su-generator-loading")}})})}),f(".su-generator-upload-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container").find("input:text"),r;e.on("click",function(e){e.preventDefault(),e.stopPropagation(),void 0!==r&&r.close(),(r=wp.media.frames.su_media_frame_2=wp.media({title:SUGL10n.upload_title,button:{text:SUGL10n.upload_insert},multiple:!1})).on("select",function(){var e=r.state().get("selection").first().toJSON();t.val(e.url).trigger("change")}),r.on("open",function(){f(".mfp-wrap").addClass("hidden")}),r.on("close",function(){f(".mfp-wrap").removeClass("hidden")}),r.open()})}),f(".su-generator-icon-picker-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container"),r=t.find(".su-generator-attr"),a=t.find(".su-generator-icon-picker"),s=a.find("input:text");e.click(function(e){a.toggleClass("su-generator-icon-picker-visible"),s.val("").trigger("keyup"),a.hasClass("su-generator-icon-picker-loaded")||(f.ajax({type:"post",url:ajaxurl,data:{action:"su_generator_get_icons"},dataType:"html",beforeSend:function e(){a.addClass("su-generator-loading"),a.addClass("su-generator-icon-picker-loaded")},success:function e(t){a.append(t);var n=a.children("i");n.click(function(e){r.val("icon: "+f(this).attr("title")),a.removeClass("su-generator-icon-picker-visible"),r.trigger("change"),e.preventDefault()}),s.on({keyup:function e(){var t=f(this).val(),r=new RegExp(t,"gi");n.hide(),n.each(function(){var e;null!==f(this).attr("title").match(r)&&f(this).show()})},focus:function e(){f(this).val(""),n.show()}}),a.removeClass("su-generator-loading")}}),e.preventDefault())})}),f(".su-generator-switch").click(function(e){var t,r=f(this).parent().children("input"),n;"yes"===r.val()?r.val("no").trigger("change"):r.val("yes").trigger("change"),e.preventDefault()}),f(".su-generator-switch-value").on("change",function(){var e=f(this),t=e.parent().children(".su-generator-switch"),r=e.val();"yes"===r?t.removeClass("su-generator-switch-no").addClass("su-generator-switch-yes"):"no"===r&&t.removeClass("su-generator-switch-yes").addClass("su-generator-switch-no")}),f("select#su-generator-attr-taxonomy").on("change",function(){var e,t=f(this).val(),r=f("select#su-generator-attr-tax_term");window.su_generator_get_terms=f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_get_terms",tax:t,noselect:!0},dataType:"html",beforeSend:function e(){"object"===_typeof(window.su_generator_get_terms)&&window.su_generator_get_terms.abort(),r.parent().addClass("su-generator-loading")},success:function e(t){r.find("option").remove(),r.append(t),r.parent().removeClass("su-generator-loading")}})}),f(".su-generator-shadow-picker").each(function(e){var t=f(this),r=t.find(".su-generator-shadow-picker-field input"),n=t.find(".su-generator-sp-hoff"),a=t.find(".su-generator-sp-voff"),s=t.find(".su-generator-sp-blur"),o={cnt:t.find(".su-generator-shadow-picker-color"),value:t.find(".su-generator-shadow-picker-color-value"),wheel:t.find(".su-generator-shadow-picker-color-wheel")},i=t.find(".su-generator-attr");o.wheel.farbtastic(o.value),o.value.focus(function(){o.wheel.show()}),o.value.blur(function(){o.wheel.hide()}),r.on("change blur keyup",function(){i.val(n.val()+"px "+a.val()+"px "+s.val()+"px "+o.value.val()).trigger("change")}),i.on("keyup",function(){var e=f(this).val().split(" ");4===e.length&&(n.val(e[0].replace("px","")),a.val(e[1].replace("px","")),s.val(e[2].replace("px","")),o.value.val(e[3]),r.trigger("keyup"))})}),f(".su-generator-border-picker").each(function(e){var t=f(this),r=t.find(".su-generator-border-picker-field input, .su-generator-border-picker-field select"),n=t.find(".su-generator-bp-width"),a=t.find(".su-generator-bp-style"),s={cnt:t.find(".su-generator-border-picker-color"),value:t.find(".su-generator-border-picker-color-value"),wheel:t.find(".su-generator-border-picker-color-wheel")},o=t.find(".su-generator-attr");s.wheel.farbtastic(s.value),s.value.focus(function(){s.wheel.show()}),s.value.blur(function(){s.wheel.hide()}),r.on("change blur keyup",function(){o.val(n.val()+"px "+a.val()+" "+s.value.val()).trigger("change")}),o.on("keyup",function(){var e=f(this).val().split(" ");3===e.length&&(n.val(e[0].replace("px","")),a.val(e[1]),s.value.val(e[2]),r.trigger("keyup"))})}),l.find(".su-generator-attr").on("change keyup blur",function(){var e=f(this).parents(".su-generator-attr-container"),t=e.data("default"),r;f(this).val()!=t?e.removeClass("su-generator-skip"):e.addClass("su-generator-skip")}),f(".su-generator-set-value").click(function(e){f(this).parents(".su-generator-attr-container").find("input").val(f(this).text()).trigger("change")}),d.val(n),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:"last_used",shortcode:n},beforeSend:function e(){},success:function e(t){p.setSettings(t);var r=f("#su-generator-content");void 0!==p.state.mceSelection&&""!==p.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(p.state.mceSelection)},dataType:"json"})},dataType:"html"})}),f("#su-generator").on("click",".su-generator-insert",p.insertShortcode),f("#su-generator").on("click",".su-generator-toggle-preview",function(e){var t=f("#su-generator-preview"),r;f(this).hide(),t.addClass("su-generator-loading").show(),l.find("input, textarea, select").on("change keyup blur",function(){p.updatePreview()}),p.updatePreview(!0),e.preventDefault()}),f("#su-generator").on("mouseenter click",".su-generator-presets",function(){clearTimeout(a),f(".su-gp-popup").show()}),f("#su-generator").on("mouseleave",".su-generator-presets",function(){a=window.setTimeout(function(){f(".su-gp-popup").fadeOut(200)},600)}),f("#su-generator").on("click",".su-gp-new",function(e){var t=f(this).parents(".su-generator-presets"),r=f(".su-gp-list"),n=(new Date).getTime(),a=prompt(SUGL10n.presets_prompt_msg,SUGL10n.presets_prompt_value);""!==a&&null!==a&&(r.find("b").hide(),r.append('<span data-id="'+n+'"><em>'+a+'</em><i class="sui sui-times"></i></span>'),p.addPreset(n,a))}),f("#su-generator").on("click",".su-gp-list span",function(e){var t=f(".su-generator-presets").data("shortcode"),r=f(this).data("id"),n=f(".su-generator-insert");f(".su-gp-popup").hide(),clearTimeout(a),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:r,shortcode:t},beforeSend:function e(){n.addClass("button-primary-disabled").attr("disabled",!0)},success:function e(t){n.removeClass("button-primary-disabled").attr("disabled",!1),p.setSettings(t)},dataType:"json"}),e.preventDefault(),e.stopPropagation()}),f("#su-generator").on("click",".su-gp-list i",function(e){var t=f(this).parents(".su-gp-list"),r=f(this).parent("span"),n=r.data("id");r.remove(),t.find("span").length<1&&t.find("b").show(),p.removePreset(n),e.stopPropagation(),e.preventDefault()})},p.addPreset=function(e,t){var r=f(".su-generator-presets").data("shortcode"),n=p.getSettings();f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_add_preset",id:e,name:t,shortcode:r,settings:n}})},p.removePreset=function(e){var t=f(".su-generator-presets").data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_remove_preset",id:e,shortcode:t}})},p.parseSettings=function(){var e=d.val(),t=g.val(),r=f("#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr"),n=f("textarea#su-generator-content"),a=n.length?n.val():"false",s=new String("");return s+="["+t+e,r.each(function(){var e=f(this),t="";null==(t=e.is("select")?e.find("option:selected").val():e.val())?t="":"array"==typeof t&&(t=t.join(",")),""!==t&&(s+=" "+f(this).attr("name")+'="'+f(this).val().toString().replace(/"/gi,"'")+'"')}),s+="]","false"!=a&&(s+=a+"[/"+t+e+"]"),s},p.getSettings=function(){var e=d.val(),t=f("#su-generator-settings .su-generator-attr"),r=f("textarea#su-generator-content"),n=r.length?r.val():"false",a={};return t.each(function(e){var t=f(this),r="",n=t.attr("name");null==(r=t.is("select")?t.find("option:selected").val():t.val())&&(r=""),a[n]=r}),a.content=n.toString(),a},p.setSettings=function(r){var e=f("#su-generator-settings .su-generator-attr"),t=f("#su-generator-content");e.each(function(){var e=f(this),t=e.attr("name");r.hasOwnProperty(t)&&(e.val(r[t]),e.trigger("keyup").trigger("change").trigger("blur"))}),r.hasOwnProperty("content")&&t.val(r.content).trigger("keyup").trigger("change").trigger("blur"),p.updatePreview()},p.updatePreview=function(e){var r=f("#su-generator-preview"),t=p.parseSettings(),n=a.text();e=e||!1,r.is(":visible")&&(t!==n||e)&&(window.clearTimeout(p.state.preview.timer),p.state.preview.timer=window.setTimeout(function(){p.state.preview.request=f.ajax({type:"POST",url:ajaxurl,cache:!1,data:{action:"su_generator_preview",shortcode:t},beforeSend:function e(){p.state.preview.request&&p.state.preview.request.abort(),r.addClass("su-generator-loading").html("")},success:function e(t){r.html(t).removeClass("su-generator-loading")},dataType:"html"})},300),a.text(t))},p.insert=function(e,t){if("string"==typeof e&&"object"===_typeof(t)){p.state.context=e;var r=(p.state.insertArgs=t).shortcode||"",n={type:"inline",alignTop:!0,items:{src:"#su-generator"},callbacks:{}};n.callbacks.open=function(){r?c.filter('[data-shortcode="'.concat(r,'"]')).trigger("click"):window.setTimeout(function(){return o.focus()},200),p.el.body.addClass("su-mfp-shown"),"undefined"!=typeof tinyMCE&&null!=tinyMCE.activeEditor&&tinyMCE.activeEditor.hasOwnProperty("selection")&&(p.state.mceSelection=tinyMCE.activeEditor.selection.getContent({format:"text"}))},n.callbacks.close=function(){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),p.state.mceSelection="",p.el.body.removeClass("su-mfp-shown")},f.magnificPopup.open(n)}},p.insertShortcode=function(){var e=p.parseSettings();if(p.addPreset("last_used",SUGL10n.last_used),f.magnificPopup.close(),a.text(e),"classic"===p.state.context)p.state.wpActiveEditor=window.wpActiveEditor,window.wpActiveEditor=p.state.insertArgs.editorID,window.wp.media.editor.insert(e),window.wpActiveEditor=p.state.wpActiveEditor;else if("block"===p.state.context){var t=p.state.insertArgs.props;if(t.attributes.hasOwnProperty("content"))t.setAttributes({content:t.attributes.content+e});else if("core/shortcode"===t.name){var r=t.attributes.hasOwnProperty("text")?t.attributes.text:"";t.setAttributes({text:r+e})}}},p.insertAtCaret=function(e,t){var r=e.selectionStart,n=e.selectionEnd;e.value=e.value.substring(0,r)+t+e.value.substring(r),e.focus(),e.selectionStart=r+t.length},{init:p.init,insert:p.insert}}(jQuery),jQuery(document).ready(SUG.App.init);
2
  //# sourceMappingURL=index.js.map
3
  //# sourceMappingURL=index.js.map
includes/js/generator/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["src/index.js"],"names":["SUG","App","$","$generator","$search","$filter","$filters","children","$choices","$choice","find","$settings","$prefix","$result","$selected","self","state","mceSelection","target","wpActiveEditor","context","insertArgs","preview","timer","request","el","body","init","gp_hover_timer","click","e","filter","this","data","css","opacity","removeClass","regex","RegExp","each","group","match","preventDefault","on","val","html","hide","show","focus","magnificPopup","close","blur","keyup","$first","best","keyCode","length","trigger","id","shortcode","name","desc","matches","join","addClass","ajax","type","url","ajaxurl","action","beforeSend","success","$content","attr","index","$picker","$val","min","max","step","simpleSlider","snap","range","farbtastic","$sources","$source","$add_media","$images","$cats","$taxes","$terms","frame","update","ids","source","images","i","categories","tax","terms","indexOf","parent","fadeOut","remove","wp","media","frames","su_media_frame_1","title","SUGL10n","isp_media_title","library","button","text","isp_media_insert","multiple","files","get","toJSON","append","open","sortable","revert","containment","tolerance","stop","$cont","parents","ajax_term_select","dataType","class","size","_typeof","abort","$button","file","stopPropagation","su_media_frame_2","upload_title","upload_insert","attachment","first","$field","toggleClass","hasClass","$icons","$switch","$value","is_on","value","$taxonomy","window","su_generator_get_terms","noselect","$fields","$hoff","$voff","$blur","$color","cnt","wheel","split","replace","$width","$style","$cnt","_default","setSettings","insertShortcode","$preview","updatePreview","clearTimeout","setTimeout","$container","$list","Date","getTime","prompt","presets_prompt_msg","presets_prompt_value","addPreset","$insert","$preset","removePreset","settings","getSettings","parseSettings","query","prefix","content","result","String","$this","is","toString","hasOwnProperty","forced","previous","cache","insert","args","preSelectedShortcode","mfpOptions","alignTop","items","src","callbacks","concat","tinyMCE","activeEditor","selection","getContent","format","last_used","editorID","editor","props","attributes","setAttributes","originalText","insertAtCaret","field","start","selectionStart","end","selectionEnd","substring","jQuery","document","ready"],"mappings":"kQAAA,IAAIA,IAAM,GAEVA,IAAIC,IAAQ,SAAEC,GAEb,IAAIC,EAAaD,EAAG,iBAChBE,EAAaF,EAAG,wBAChBG,EAAaH,EAAG,wBAChBI,EAAaD,EAAQE,SAAU,KAC/BC,EAAaN,EAAG,yBAChBO,EAAaD,EAASE,KAAM,QAC5BC,EAAaT,EAAG,0BAChBU,EAAaV,EAAG,iCAChBW,EAAaX,EAAG,wBAChBY,EAAaZ,EAAG,0BAEhBa,EAAO,CAEXC,MAAa,CACZC,aAAiB,GACjBC,OAAiB,GACjBC,eAAiB,KACjBC,QAAiB,GACjBC,WAAiB,GACjBC,QAAiB,CAChBC,MAAS,KACTC,QAAS,QAgsCX,OA5rCAT,EAAKU,GAAK,CACTC,KAAMxB,EAAG,SAGVa,EAAKY,KAAO,WAgxBX,IAAIC,EA9wBJtB,EAASuB,MACR,SAASC,GAER,IAAIC,EAAS7B,EAAG8B,MAAOC,KAAM,UAE7B,GAAe,QAAXF,EACHtB,EAAQyB,IACP,CACCC,QAAS,IAETC,YAAa,iCAGX,CACJ,IAAIC,EAAQ,IAAIC,OAAQP,EAAQ,MAEhCtB,EAAQyB,IAAK,CAAEC,QAAS,KAExB1B,EAAQ8B,KACP,WAEC,IAAIC,EAEyB,OAFjBtC,EAAG8B,MAAOC,KAAM,SAElBQ,MAAOJ,IAChBnC,EAAG8B,MACDE,IAAK,CAAEC,QAAS,IAChBC,YAAa,+BAKnBN,EAAEY,mBAIJxC,EAAG,iBAAkByC,GACpB,QACA,qBACA,SAASb,GAER1B,EAAQwC,IAAK,IAEbjC,EAAUkC,KAAM,IAAKC,OAErB3C,EAAWiC,YAAa,uBAExB/B,EAAQ0C,OAERvC,EAASuC,OACTtC,EA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":3,"sources":["src/index.js"],"names":["SUG","App","$","$generator","$search","$filter","$filters","children","$choices","$choice","find","$settings","$prefix","$result","$selected","self","state","mceSelection","target","wpActiveEditor","context","insertArgs","preview","timer","request","el","body","init","gp_hover_timer","click","e","filter","this","data","css","opacity","removeClass","regex","RegExp","each","group","match","preventDefault","on","val","html","hide","show","focus","magnificPopup","close","blur","keyup","$first","best","keyCode","length","trigger","id","shortcode","name","desc","matches","join","addClass","ajax","type","url","ajaxurl","action","beforeSend","success","$content","attr","index","$picker","$val","min","max","step","simpleSlider","snap","range","farbtastic","$sources","$source","$add_media","$images","$cats","$taxes","$terms","frame","update","ids","source","images","i","categories","tax","terms","indexOf","parent","fadeOut","remove","wp","media","frames","su_media_frame_1","title","SUGL10n","isp_media_title","library","button","text","isp_media_insert","multiple","files","get","toJSON","append","open","sortable","revert","containment","tolerance","stop","$cont","parents","ajax_term_select","dataType","class","size","_typeof","abort","$button","file","stopPropagation","su_media_frame_2","upload_title","upload_insert","attachment","first","$field","toggleClass","hasClass","$icons","$switch","$value","is_on","value","$taxonomy","window","su_generator_get_terms","noselect","$fields","$hoff","$voff","$blur","$color","cnt","wheel","split","replace","$width","$style","$cnt","_default","setSettings","insertShortcode","$preview","updatePreview","clearTimeout","setTimeout","$container","$list","Date","getTime","prompt","presets_prompt_msg","presets_prompt_value","addPreset","$insert","$preset","removePreset","settings","getSettings","parseSettings","query","prefix","content","result","String","$this","is","toString","hasOwnProperty","forced","previous","cache","insert","args","preSelectedShortcode","mfpOptions","alignTop","items","src","callbacks","concat","tinyMCE","activeEditor","selection","getContent","format","last_used","editorID","editor","props","attributes","setAttributes","originalText","insertAtCaret","field","start","selectionStart","end","selectionEnd","substring","jQuery","document","ready"],"mappings":"kQAAA,IAAIA,IAAM,GAEVA,IAAIC,IAAQ,SAAEC,GAEb,IAAIC,EAAaD,EAAG,iBAChBE,EAAaF,EAAG,wBAChBG,EAAaH,EAAG,wBAChBI,EAAaD,EAAQE,SAAU,KAC/BC,EAA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@@ -32,6 +32,7 @@ require_once $this->plugin_path . 'includes/shortcodes/dailymotion.php';
32
  require_once $this->plugin_path . 'includes/shortcodes/audio.php';
33
  require_once $this->plugin_path . 'includes/shortcodes/video.php';
34
  require_once $this->plugin_path . 'includes/shortcodes/table.php';
 
35
  require_once $this->plugin_path . 'includes/shortcodes/permalink.php';
36
  require_once $this->plugin_path . 'includes/shortcodes/members.php';
37
  require_once $this->plugin_path . 'includes/shortcodes/guests.php';
32
  require_once $this->plugin_path . 'includes/shortcodes/audio.php';
33
  require_once $this->plugin_path . 'includes/shortcodes/video.php';
34
  require_once $this->plugin_path . 'includes/shortcodes/table.php';
35
+ require_once $this->plugin_path . 'includes/shortcodes/csv-table.php';
36
  require_once $this->plugin_path . 'includes/shortcodes/permalink.php';
37
  require_once $this->plugin_path . 'includes/shortcodes/members.php';
38
  require_once $this->plugin_path . 'includes/shortcodes/guests.php';
includes/shortcodes/button.php CHANGED
@@ -204,6 +204,9 @@ function su_shortcode_button( $atts = null, $content = null ) {
204
  'bottom-left' => '-1px 1px'
205
  );
206
 
 
 
 
207
  // Common styles for button
208
  $styles = array(
209
  'size' => round( ( $atts['size'] + 7 ) * 1.3 ),
204
  'bottom-left' => '-1px 1px'
205
  );
206
 
207
+ // Sanitize the size value
208
+ $atts['size'] = intval( $atts['size'] );
209
+
210
  // Common styles for button
211
  $styles = array(
212
  'size' => round( ( $atts['size'] + 7 ) * 1.3 ),
includes/shortcodes/csv-table.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ su_add_shortcode(
4
+ array(
5
+ 'id' => 'csv_table',
6
+ 'callback' => 'su_shortcode_csv_table',
7
+ 'type' => 'single',
8
+ 'name' => __( 'CSV Table', 'shortcodes-ultimate' ),
9
+ 'desc' => __( 'Styled table from CSV file', 'shortcodes-ultimate' ),
10
+ 'group' => 'content',
11
+ 'image' => su_get_plugin_url() . 'admin/images/shortcodes/table.svg',
12
+ 'icon' => 'table',
13
+ 'atts' => array(
14
+ 'url' => array(
15
+ 'type' => 'upload',
16
+ 'default' => '',
17
+ 'name' => __( 'CSV file URL', 'shortcodes-ultimate' ),
18
+ 'desc' => __( 'The URL of a CSV file that will be displayed', 'shortcodes-ultimate' ),
19
+ ),
20
+ 'delimiter' => array(
21
+ 'type' => 'text',
22
+ 'default' => ',',
23
+ 'name' => __( 'Delimiter', 'shortcodes-ultimate' ),
24
+ 'desc' => __( 'Set the field delimiter (one character only)', 'shortcodes-ultimate' ),
25
+ ),
26
+ 'header' => array(
27
+ 'type' => 'bool',
28
+ 'default' => 'no',
29
+ 'name' => __( 'Display header', 'shortcodes-ultimate' ),
30
+ 'desc' => __( 'Display first row as table header', 'shortcodes-ultimate' ),
31
+ ),
32
+ 'responsive' => array(
33
+ 'type' => 'bool',
34
+ 'default' => 'no',
35
+ 'name' => __( 'Responsive', 'shortcodes-ultimate' ),
36
+ 'desc' => __( 'Add horizontal scrollbar if table width larger than page width', 'shortcodes-ultimate' ),
37
+ ),
38
+ 'alternate' => array(
39
+ 'type' => 'bool',
40
+ 'default' => 'yes',
41
+ 'name' => __( 'Alternate row color', 'shortcodes-ultimate' ),
42
+ 'desc' => __( 'Enable to use alternative background color for even rows', 'shortcodes-ultimate' ),
43
+ ),
44
+ 'fixed' => array(
45
+ 'type' => 'bool',
46
+ 'default' => 'no',
47
+ 'name' => __( 'Fixed layout', 'shortcodes-ultimate' ),
48
+ 'desc' => __( 'Fixed width table cells', 'shortcodes-ultimate' ),
49
+ ),
50
+ 'class' => array(
51
+ 'type' => 'extra_css_class',
52
+ 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
53
+ 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
54
+ 'default' => '',
55
+ ),
56
+ ),
57
+ )
58
+ );
59
+
60
+ function su_shortcode_csv_table( $atts = null, $content = null ) {
61
+
62
+ $atts = shortcode_atts(
63
+ array(
64
+ 'url' => '',
65
+ 'delimiter' => ',',
66
+ 'header' => 'no',
67
+ 'responsive' => 'no',
68
+ 'alternate' => 'yes',
69
+ 'fixed' => 'no',
70
+ 'class' => '',
71
+ ),
72
+ $atts,
73
+ 'table'
74
+ );
75
+
76
+ if ( filter_var( $atts['url'], FILTER_VALIDATE_URL ) === false ) {
77
+ return su_error_message( 'CSV Table', __( 'invalid URL', 'shortcodes-ultimate' ) );
78
+ }
79
+
80
+ $response = wp_remote_get( $atts['url'] );
81
+
82
+ if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
83
+ return su_error_message( 'CSV Table', __( 'invalid URL', 'shortcodes-ultimate' ) );
84
+ }
85
+
86
+ if ( ! is_string( $atts['delimiter'] ) || 1 !== strlen( $atts['delimiter'] ) ) {
87
+ return su_error_message( 'CSV Table', __( 'invalid delimiter', 'shortcodes-ultimate' ) );
88
+ }
89
+
90
+ $csv = wp_remote_retrieve_body( $response );
91
+ $html = su_csv_to_html(
92
+ $csv,
93
+ $atts['delimiter'],
94
+ 'yes' === $atts['header']
95
+ );
96
+
97
+ foreach ( array( 'responsive', 'alternate', 'fixed' ) as $feature ) {
98
+
99
+ if ( 'yes' === $atts[ $feature ] ) {
100
+ $atts['class'] .= ' su-table-' . $feature;
101
+ }
102
+
103
+ }
104
+
105
+ su_query_asset( 'css', 'su-shortcodes' );
106
+
107
+ return '<div class="su-table su-csv-table' . su_get_css_class( $atts ) . '">' . $html . '</div>';
108
+
109
+ }
includes/shortcodes/list.php CHANGED
@@ -1,123 +1,139 @@
1
  <?php
2
 
3
- su_add_shortcode( array(
4
- 'id' => 'list',
 
5
  'callback' => 'su_shortcode_list',
6
- 'image' => su_get_plugin_url() . 'admin/images/shortcodes/list.svg',
7
- 'name' => __( 'List', 'shortcodes-ultimate' ),
8
- 'type' => 'wrap',
9
- 'group' => 'content',
10
- 'atts' => array(
11
- 'icon' => array(
12
- 'type' => 'icon',
13
  'default' => '',
14
- 'name' => __( 'Icon', 'shortcodes-ultimate' ),
15
- 'desc' => __( 'You can upload custom icon for this list or pick a built-in icon', 'shortcodes-ultimate' )
16
  ),
17
  'icon_color' => array(
18
- 'type' => 'color',
19
  'default' => '#333333',
20
- 'name' => __( 'Icon color', 'shortcodes-ultimate' ),
21
- 'desc' => __( 'This color will be applied to the selected icon. Does not works with uploaded icons', 'shortcodes-ultimate' )
22
  ),
23
- 'class' => array(
24
- 'type' => 'extra_css_class',
25
- 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
26
- 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
 
 
 
 
 
 
 
 
 
27
  'default' => '',
28
  ),
29
  ),
30
- 'content' => __( "<ul>\n<li>List item</li>\n<li>List item</li>\n<li>List item</li>\n</ul>", 'shortcodes-ultimate' ),
31
- 'desc' => __( 'Styled unordered list', 'shortcodes-ultimate' ),
32
- 'icon' => 'list-ol',
33
- ) );
 
34
 
35
  function su_shortcode_list( $atts = null, $content = null ) {
36
 
37
- $atts = shortcode_atts( array(
38
- 'icon' => 'icon: star',
 
39
  'icon_color' => '#333',
40
- 'style' => null,
41
- 'class' => ''
42
- ), $atts, 'list' );
 
 
 
 
43
 
44
  // Backward compatibility // 4.2.3+
45
- if ( $atts['style'] !== null ) {
46
  switch ( $atts['style'] ) {
47
- case 'star':
48
- $atts['icon'] = 'icon: star';
49
- $atts['icon_color'] = '#ffd647';
50
- break;
51
- case 'arrow':
52
- $atts['icon'] = 'icon: arrow-right';
53
- $atts['icon_color'] = '#00d1ce';
54
- break;
55
- case 'check':
56
- $atts['icon'] = 'icon: check';
57
- $atts['icon_color'] = '#17bf20';
58
- break;
59
- case 'cross':
60
- $atts['icon'] = 'icon: remove';
61
- $atts['icon_color'] = '#ff142b';
62
- break;
63
- case 'thumbs':
64
- $atts['icon'] = 'icon: thumbs-o-up';
65
- $atts['icon_color'] = '#8a8a8a';
66
- break;
67
- case 'link':
68
- $atts['icon'] = 'icon: external-link';
69
- $atts['icon_color'] = '#5c5c5c';
70
- break;
71
- case 'gear':
72
- $atts['icon'] = 'icon: cog';
73
- $atts['icon_color'] = '#ccc';
74
- break;
75
- case 'time':
76
- $atts['icon'] = 'icon: time';
77
- $atts['icon_color'] = '#a8a8a8';
78
- break;
79
- case 'note':
80
- $atts['icon'] = 'icon: edit';
81
- $atts['icon_color'] = '#f7d02c';
82
- break;
83
- case 'plus':
84
- $atts['icon'] = 'icon: plus-sign';
85
- $atts['icon_color'] = '#61dc3c';
86
- break;
87
- case 'guard':
88
- $atts['icon'] = 'icon: shield';
89
- $atts['icon_color'] = '#1bbe08';
90
- break;
91
- case 'event':
92
- $atts['icon'] = 'icon: bullhorn';
93
- $atts['icon_color'] = '#ff4c42';
94
- break;
95
- case 'idea':
96
- $atts['icon'] = 'icon: sun';
97
- $atts['icon_color'] = '#ffd880';
98
- break;
99
- case 'settings':
100
- $atts['icon'] = 'icon: cogs';
101
- $atts['icon_color'] = '#8a8a8a';
102
- break;
103
- case 'twitter':
104
- $atts['icon'] = 'icon: twitter-sign';
105
- $atts['icon_color'] = '#00ced6';
106
- break;
107
  }
108
  }
109
 
110
  if ( strpos( $atts['icon'], 'icon:' ) !== false ) {
111
  $atts['icon'] = '<i class="sui sui-' . trim( str_replace( 'icon:', '', $atts['icon'] ) ) . '" style="color:' . $atts['icon_color'] . '"></i>';
112
  su_query_asset( 'css', 'su-icons' );
113
- }
114
-
115
- else {
116
  $atts['icon'] = '<img src="' . $atts['icon'] . '" alt="" />';
117
  }
118
 
119
  su_query_asset( 'css', 'su-shortcodes' );
120
 
121
- return '<div class="su-list su-list-style-' . $atts['style'] . su_get_css_class( $atts ) . '">' . str_replace( '<li>', '<li>' . $atts['icon'] . ' ', su_do_nested_shortcodes( $content, 'list' ) ) . '</div>';
 
 
122
 
123
  }
1
  <?php
2
 
3
+ su_add_shortcode(
4
+ array(
5
+ 'id' => 'list',
6
  'callback' => 'su_shortcode_list',
7
+ 'image' => su_get_plugin_url() . 'admin/images/shortcodes/list.svg',
8
+ 'name' => __( 'List', 'shortcodes-ultimate' ),
9
+ 'type' => 'wrap',
10
+ 'group' => 'content',
11
+ 'atts' => array(
12
+ 'icon' => array(
13
+ 'type' => 'icon',
14
  'default' => '',
15
+ 'name' => __( 'Icon', 'shortcodes-ultimate' ),
16
+ 'desc' => __( 'You can upload custom icon for this list or pick a built-in icon', 'shortcodes-ultimate' ),
17
  ),
18
  'icon_color' => array(
19
+ 'type' => 'color',
20
  'default' => '#333333',
21
+ 'name' => __( 'Icon color', 'shortcodes-ultimate' ),
22
+ 'desc' => __( 'This color will be applied to the selected icon. Does not works with uploaded icons', 'shortcodes-ultimate' ),
23
  ),
24
+ 'indent' => array(
25
+ 'type' => 'slider',
26
+ 'default' => 0,
27
+ 'step' => 1,
28
+ 'min' => -100,
29
+ 'max' => 100,
30
+ 'name' => __( 'Indent', 'shortcodes-ultimate' ),
31
+ 'desc' => __( 'Defines list indent size (in pixels). Negative numbers are also allowed', 'shortcodes-ultimate' ),
32
+ ),
33
+ 'class' => array(
34
+ 'type' => 'extra_css_class',
35
+ 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
36
+ 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
37
  'default' => '',
38
  ),
39
  ),
40
+ 'content' => __( "<ul>\n<li>List item</li>\n<li>List item</li>\n<li>List item</li>\n</ul>", 'shortcodes-ultimate' ),
41
+ 'desc' => __( 'Styled unordered list', 'shortcodes-ultimate' ),
42
+ 'icon' => 'list-ol',
43
+ )
44
+ );
45
 
46
  function su_shortcode_list( $atts = null, $content = null ) {
47
 
48
+ $atts = shortcode_atts(
49
+ array(
50
+ 'icon' => 'icon: star',
51
  'icon_color' => '#333',
52
+ 'indent' => 0,
53
+ 'style' => null,
54
+ 'class' => '',
55
+ ),
56
+ $atts,
57
+ 'list'
58
+ );
59
 
60
  // Backward compatibility // 4.2.3+
61
+ if ( null !== $atts['style'] ) {
62
  switch ( $atts['style'] ) {
63
+ case 'star':
64
+ $atts['icon'] = 'icon: star';
65
+ $atts['icon_color'] = '#ffd647';
66
+ break;
67
+ case 'arrow':
68
+ $atts['icon'] = 'icon: arrow-right';
69
+ $atts['icon_color'] = '#00d1ce';
70
+ break;
71
+ case 'check':
72
+ $atts['icon'] = 'icon: check';
73
+ $atts['icon_color'] = '#17bf20';
74
+ break;
75
+ case 'cross':
76
+ $atts['icon'] = 'icon: remove';
77
+ $atts['icon_color'] = '#ff142b';
78
+ break;
79
+ case 'thumbs':
80
+ $atts['icon'] = 'icon: thumbs-o-up';
81
+ $atts['icon_color'] = '#8a8a8a';
82
+ break;
83
+ case 'link':
84
+ $atts['icon'] = 'icon: external-link';
85
+ $atts['icon_color'] = '#5c5c5c';
86
+ break;
87
+ case 'gear':
88
+ $atts['icon'] = 'icon: cog';
89
+ $atts['icon_color'] = '#ccc';
90
+ break;
91
+ case 'time':
92
+ $atts['icon'] = 'icon: time';
93
+ $atts['icon_color'] = '#a8a8a8';
94
+ break;
95
+ case 'note':
96
+ $atts['icon'] = 'icon: edit';
97
+ $atts['icon_color'] = '#f7d02c';
98
+ break;
99
+ case 'plus':
100
+ $atts['icon'] = 'icon: plus-sign';
101
+ $atts['icon_color'] = '#61dc3c';
102
+ break;
103
+ case 'guard':
104
+ $atts['icon'] = 'icon: shield';
105
+ $atts['icon_color'] = '#1bbe08';
106
+ break;
107
+ case 'event':
108
+ $atts['icon'] = 'icon: bullhorn';
109
+ $atts['icon_color'] = '#ff4c42';
110
+ break;
111
+ case 'idea':
112
+ $atts['icon'] = 'icon: sun';
113
+ $atts['icon_color'] = '#ffd880';
114
+ break;
115
+ case 'settings':
116
+ $atts['icon'] = 'icon: cogs';
117
+ $atts['icon_color'] = '#8a8a8a';
118
+ break;
119
+ case 'twitter':
120
+ $atts['icon'] = 'icon: twitter-sign';
121
+ $atts['icon_color'] = '#00ced6';
122
+ break;
123
  }
124
  }
125
 
126
  if ( strpos( $atts['icon'], 'icon:' ) !== false ) {
127
  $atts['icon'] = '<i class="sui sui-' . trim( str_replace( 'icon:', '', $atts['icon'] ) ) . '" style="color:' . $atts['icon_color'] . '"></i>';
128
  su_query_asset( 'css', 'su-icons' );
129
+ } else {
 
 
130
  $atts['icon'] = '<img src="' . $atts['icon'] . '" alt="" />';
131
  }
132
 
133
  su_query_asset( 'css', 'su-shortcodes' );
134
 
135
+ $indent_pos = is_rtl() ? 'right' : 'left';
136
+
137
+ return '<div class="su-list' . su_get_css_class( $atts ) . '" style="margin-' . $indent_pos . ':' . intval( $atts['indent'] ) . 'px">' . str_replace( '<li>', '<li>' . $atts['icon'] . ' ', su_do_nested_shortcodes( $content, 'list' ) ) . '</div>';
138
 
139
  }
includes/shortcodes/table.php CHANGED
@@ -1,57 +1,73 @@
1
  <?php
2
 
3
- su_add_shortcode( array(
4
- 'id' => 'table',
 
5
  'callback' => 'su_shortcode_table',
6
- 'image' => su_get_plugin_url() . 'admin/images/shortcodes/table.svg',
7
- 'name' => __( 'Table', 'shortcodes-ultimate' ),
8
- 'type' => 'wrap',
9
- 'group' => 'content',
10
- 'atts' => array(
11
- 'url' => array(
12
- 'type' => 'upload',
13
- 'default' => '',
14
- 'name' => __( 'CSV file', 'shortcodes-ultimate' ),
15
- 'desc' => __( 'Upload CSV file if you want to create HTML-table from file', 'shortcodes-ultimate' )
16
- ),
17
  'responsive' => array(
18
- 'type' => 'bool',
 
 
 
 
 
 
 
 
 
 
 
 
19
  'default' => 'no',
20
- 'name' => __( 'Responsive', 'shortcodes-ultimate' ),
21
- 'desc' => __( 'Add horizontal scrollbar if table width larger than page width', 'shortcodes-ultimate' )
22
  ),
23
- 'class' => array(
24
- 'type' => 'extra_css_class',
25
- 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
26
- 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
27
  'default' => '',
28
  ),
29
  ),
30
- 'content' => __( "<table>\n<tr>\n\t<td>Table</td>\n\t<td>Table</td>\n</tr>\n<tr>\n\t<td>Table</td>\n\t<td>Table</td>\n</tr>\n</table>", 'shortcodes-ultimate' ),
31
- 'desc' => __( 'Styled table from HTML or CSV file', 'shortcodes-ultimate' ),
32
- 'icon' => 'table',
33
- ) );
34
 
35
  function su_shortcode_table( $atts = null, $content = null ) {
36
 
37
- $atts = shortcode_atts( array(
38
- 'url' => false,
39
- 'responsive' => false,
40
- 'class' => ''
41
- ), $atts, 'table' );
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
- if ( $atts['responsive'] ) {
44
- $atts['class'] .= ' su-table-responsive';
45
  }
46
 
47
  su_query_asset( 'css', 'su-shortcodes' );
48
- su_query_asset( 'js', 'jquery' );
49
- su_query_asset( 'js', 'su-other-shortcodes' );
50
 
51
- $table_data = $atts['url']
52
- ? su_parse_csv( $atts['url'] ) :
53
- do_shortcode( $content );
54
 
55
- return '<div class="su-table' . su_get_css_class( $atts ) . '">' . $table_data . '</div>';
56
 
57
  }
1
  <?php
2
 
3
+ su_add_shortcode(
4
+ array(
5
+ 'id' => 'table',
6
  'callback' => 'su_shortcode_table',
7
+ 'type' => 'wrap',
8
+ 'name' => __( 'Table', 'shortcodes-ultimate' ),
9
+ 'desc' => __( 'Styled table', 'shortcodes-ultimate' ),
10
+ 'group' => 'content',
11
+ 'image' => su_get_plugin_url() . 'admin/images/shortcodes/table.svg',
12
+ 'icon' => 'table',
13
+ 'atts' => array(
 
 
 
 
14
  'responsive' => array(
15
+ 'type' => 'bool',
16
+ 'default' => 'no',
17
+ 'name' => __( 'Responsive', 'shortcodes-ultimate' ),
18
+ 'desc' => __( 'Add horizontal scrollbar if table width larger than page width', 'shortcodes-ultimate' ),
19
+ ),
20
+ 'alternate' => array(
21
+ 'type' => 'bool',
22
+ 'default' => 'yes',
23
+ 'name' => __( 'Alternate row color', 'shortcodes-ultimate' ),
24
+ 'desc' => __( 'Enable to use alternative background color for even rows', 'shortcodes-ultimate' ),
25
+ ),
26
+ 'fixed' => array(
27
+ 'type' => 'bool',
28
  'default' => 'no',
29
+ 'name' => __( 'Fixed layout', 'shortcodes-ultimate' ),
30
+ 'desc' => __( 'Fixed width table cells', 'shortcodes-ultimate' ),
31
  ),
32
+ 'class' => array(
33
+ 'type' => 'extra_css_class',
34
+ 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
35
+ 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
36
  'default' => '',
37
  ),
38
  ),
39
+ 'content' => __( "<table>\n<tr>\n\t<td>Table</td>\n\t<td>Table</td>\n</tr>\n<tr>\n\t<td>Table</td>\n\t<td>Table</td>\n</tr>\n</table>", 'shortcodes-ultimate' ),
40
+ )
41
+ );
 
42
 
43
  function su_shortcode_table( $atts = null, $content = null ) {
44
 
45
+ $atts = shortcode_atts(
46
+ array(
47
+ 'url' => '', // deprecated since 5.3.0
48
+ 'responsive' => 'no',
49
+ 'alternate' => 'yes',
50
+ 'fixed' => 'no',
51
+ 'class' => '',
52
+ ),
53
+ $atts,
54
+ 'table'
55
+ );
56
+
57
+ foreach ( array( 'responsive', 'alternate', 'fixed' ) as $feature ) {
58
+
59
+ if ( 'yes' === $atts[ $feature ] ) {
60
+ $atts['class'] .= ' su-table-' . $feature;
61
+ }
62
 
 
 
63
  }
64
 
65
  su_query_asset( 'css', 'su-shortcodes' );
 
 
66
 
67
+ $table = $atts['url']
68
+ ? su_parse_csv( $atts['url'] )
69
+ : do_shortcode( $content );
70
 
71
+ return '<div class="su-table' . su_get_css_class( $atts ) . '">' . $table . '</div>';
72
 
73
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://paypal.me/anovladimir
5
  Tags: shortcode, toggle, columns, button, slider, video, map, visual, responsive, shortcodes, youtube, vimeo, audio, mp3, tabs, jquery, box, accordion, toggle, pullquote, list, image, gallery, navigation, permalink, feed, rss, members, membership, guests, carousel, icons, rtl, multilingual
6
  Requires at least: 3.5
7
  Requires PHP: 5.2.4
8
- Tested up to: 5.0
9
  Stable tag: trunk
10
 
11
  A comprehensive collection of visual components for your site
@@ -150,6 +150,22 @@ For help with premium add-ons, please [open new support ticket](https://getshort
150
 
151
  == Changelog ==
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  = 5.2.0 =
154
 
155
  **Improvements**
5
  Tags: shortcode, toggle, columns, button, slider, video, map, visual, responsive, shortcodes, youtube, vimeo, audio, mp3, tabs, jquery, box, accordion, toggle, pullquote, list, image, gallery, navigation, permalink, feed, rss, members, membership, guests, carousel, icons, rtl, multilingual
6
  Requires at least: 3.5
7
  Requires PHP: 5.2.4
8
+ Tested up to: 5.1
9
  Stable tag: trunk
10
 
11
  A comprehensive collection of visual components for your site
150
 
151
  == Changelog ==
152
 
153
+ = 5.3.0 =
154
+
155
+ **What's new**
156
+
157
+ - New shortcode `[su_csv_table]` for displaying CSV tables
158
+ - New option `indent` for the `[su_list]` shortcode, which allows adjusting of list indentation
159
+
160
+ **Fixes**
161
+
162
+ - Fixed inaccessible fields in media modal (while inserting Gallery/Slider/Carousel shortcodes)
163
+ - Fixed close icon class name in the presets menu
164
+ - Fixed issue with unwanted content inside single shortcodes
165
+ - Fixed warning when non-numeric value is used for the button size attribute
166
+ - Min-width for responsive tables is set to 100%
167
+
168
+
169
  = 5.2.0 =
170
 
171
  **Improvements**
shortcodes-ultimate.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Shortcodes Ultimate
4
  * Plugin URI: https://getshortcodes.com/
5
- * Version: 5.2.0
6
  * Author: Vladimir Anokhin
7
  * Author URI: https://vanokhin.com/
8
  * Description: A comprehensive collection of visual components for WordPress
@@ -15,7 +15,7 @@
15
  * Define plugin constants.
16
  */
17
  define( 'SU_PLUGIN_FILE', __FILE__ );
18
- define( 'SU_PLUGIN_VERSION', '5.2.0' );
19
 
20
  /**
21
  * Load dependencies.
2
  /**
3
  * Plugin Name: Shortcodes Ultimate
4
  * Plugin URI: https://getshortcodes.com/
5
+ * Version: 5.3.0
6
  * Author: Vladimir Anokhin
7
  * Author URI: https://vanokhin.com/
8
  * Description: A comprehensive collection of visual components for WordPress
15
  * Define plugin constants.
16
  */
17
  define( 'SU_PLUGIN_FILE', __FILE__ );
18
+ define( 'SU_PLUGIN_VERSION', '5.3.0' );
19
 
20
  /**
21
  * Load dependencies.