Shortcodes by Angie Makes - Version 1.44

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 1.44
Comparing to
See all releases

Code changes from version 1.43 to 1.44

README.md CHANGED
@@ -66,6 +66,10 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
69
  ### Version 1.43
70
 
71
  * Added theme support for developers
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 1.44
70
+
71
+ * Changed gutter width to fixed pixel value instead of percentage.
72
+
73
  ### Version 1.43
74
 
75
  * Added theme support for developers
includes/js/posts.js CHANGED
@@ -3,14 +3,14 @@
3
 
4
  var calculateGrid = function($container) {
5
  var columns = parseInt( $container.data('columns') );
6
- var gutterSpace = $container.data('gutterSpace');
7
  var containerWidth = $container.width();
8
 
9
- if ( isNaN( gutterSpace ) ) {
10
- gutterSpace = .020;
11
  }
12
- else if ( gutterSpace > 0.05 || gutterSpace < 0 ) {
13
- gutterSpace = .020;
14
  }
15
 
16
  if ( containerWidth < 568 ) {
@@ -33,7 +33,7 @@
33
  columns = 1;
34
  }
35
 
36
- var gutterWidth = Math.floor( containerWidth * gutterSpace );
37
 
38
  var allGutters = gutterWidth * ( columns - 1 );
39
  var contentWidth = containerWidth - allGutters;
@@ -49,9 +49,9 @@
49
  var o = calculateGrid($container);
50
 
51
  var marginBottom = o.gutterWidth;
52
- if ( 1 == o.columns ) {
53
  marginBottom = 20;
54
- }
55
 
56
  $postBox.css({'width':o.columnWidth+'px', 'margin-bottom':marginBottom+'px', 'padding':'0'});
57
 
3
 
4
  var calculateGrid = function($container) {
5
  var columns = parseInt( $container.data('columns') );
6
+ var gutterWidth = $container.data('gutterSpace');
7
  var containerWidth = $container.width();
8
 
9
+ if ( isNaN( gutterWidth ) ) {
10
+ gutterWidth = 20;
11
  }
12
+ else if ( gutterWidth > 50 || gutterWidth < 0 ) {
13
+ gutterWidth = 20;
14
  }
15
 
16
  if ( containerWidth < 568 ) {
33
  columns = 1;
34
  }
35
 
36
+ gutterWidth = parseInt( gutterWidth );
37
 
38
  var allGutters = gutterWidth * ( columns - 1 );
39
  var contentWidth = containerWidth - allGutters;
49
  var o = calculateGrid($container);
50
 
51
  var marginBottom = o.gutterWidth;
52
+ /* if ( 1 == o.columns ) {
53
  marginBottom = 20;
54
+ } */
55
 
56
  $postBox.css({'width':o.columnWidth+'px', 'margin-bottom':marginBottom+'px', 'padding':'0'});
57
 
includes/mce/js/shortcodes-tinymce-4.js CHANGED
@@ -85,7 +85,7 @@
85
  {
86
  text: "Posts",
87
  onclick: function(){
88
- editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="0.020" heading_type="h2" layout="masonry"][/wc_posts]');
89
  }
90
  },
91
  {
85
  {
86
  text: "Posts",
87
  onclick: function(){
88
+ editor.insertContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="masonry"][/wc_posts]');
89
  }
90
  },
91
  {
includes/mce/js/shortcodes_tinymce.js CHANGED
@@ -186,7 +186,7 @@
186
 
187
  // Posts
188
  if(id === "posts") {
189
- tinyMCE.activeEditor.selection.setContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="0.020" heading_type="h2" layout="isotope"][/wc_posts]');
190
  }
191
 
192
 
186
 
187
  // Posts
188
  if(id === "posts") {
189
+ tinyMCE.activeEditor.selection.setContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="20" heading_type="h2" layout="isotope"][/wc_posts]');
190
  }
191
 
192
 
includes/shortcode-functions.php CHANGED
@@ -1090,7 +1090,7 @@ if( ! function_exists( 'wc_shortcodes_posts' ) ) {
1090
 
1091
  'filtering' => true, // insert isotope filter navigation
1092
  'columns' => '3', // default number of isotope columns
1093
- 'gutter_space' => '0.020', // gutter width percentage relative to parent element width
1094
  'heading_type' => 'h2', // heading tag for title
1095
  'layout' => 'masonry', // blog layout
1096
  ), $atts );
@@ -1103,13 +1103,16 @@ if( ! function_exists( 'wc_shortcodes_posts' ) ) {
1103
  $atts['heading_type'] = strtolower( $atts['heading_type'] );
1104
 
1105
  if ( ! is_numeric( $atts['gutter_space'] ) ) {
1106
- $atts['gutter_space'] = 0.020;
1107
  }
1108
- $atts['gutter_space'] = number_format( $atts['gutter_space'], 3 );
1109
- if ( $atts['gutter_space'] > 0.05 || $atts['gutter_space'] < 0.000 ) {
1110
- $atts['gutter_space'] = 0.020;
1111
  }
1112
-
 
 
 
 
1113
  if (isset($atts['posts_per_page']) && $atts['posts_per_page']) {
1114
  $atts['posts_per_page'] = (int) $atts['posts_per_page'];
1115
  }
1090
 
1091
  'filtering' => true, // insert isotope filter navigation
1092
  'columns' => '3', // default number of isotope columns
1093
+ 'gutter_space' => '20', // gutter width percentage relative to parent element width
1094
  'heading_type' => 'h2', // heading tag for title
1095
  'layout' => 'masonry', // blog layout
1096
  ), $atts );
1103
  $atts['heading_type'] = strtolower( $atts['heading_type'] );
1104
 
1105
  if ( ! is_numeric( $atts['gutter_space'] ) ) {
1106
+ $atts['gutter_space'] = 20;
1107
  }
1108
+ if ( $atts['gutter_space'] > 0 && $atts['gutter_space'] < 1 ) {
1109
+ $atts['gutter_space'] = (int) ( $atts['gutter_space'] * 1000 );
 
1110
  }
1111
+ $atts['gutter_space'] = (int) $atts['gutter_space'];
1112
+ if ( $atts['gutter_space'] > 50 || $atts['gutter_space'] < 0 ) {
1113
+ $atts['gutter_space'] = 20;
1114
+ }
1115
+
1116
  if (isset($atts['posts_per_page']) && $atts['posts_per_page']) {
1117
  $atts['posts_per_page'] = (int) $atts['posts_per_page'];
1118
  }
readme.txt CHANGED
@@ -88,6 +88,10 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  ### Version 1.43
92
 
93
  * Added theme support for developers
88
 
89
  == Changelog ==
90
 
91
+ ### Version 1.44
92
+
93
+ * Changed gutter width to fixed pixel value instead of percentage.
94
+
95
  ### Version 1.43
96
 
97
  * Added theme support for developers
wc-shortcodes.php CHANGED
@@ -5,11 +5,11 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.43
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.43' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.44
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.44' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );