Editorial Calendar - Version 3.3

Version Description

This version fixes an error handling apostrophes and ampersands in post titles in WordPress 4.0.

Download this release

Release Info

Developer zgrossbart
Plugin Icon wp plugin Editorial Calendar
Version 3.3
Comparing to
See all releases

Code changes from version 3.2 to 3.3

Files changed (4) hide show
  1. .jshintrc +25 -0
  2. edcal.js +7 -4
  3. edcal.php +3 -2
  4. readme.txt +6 -2
.jshintrc ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "curly": true,
3
+ "bitwise": true,
4
+ "eqeqeq": true,
5
+ "es3": true,
6
+ "forin": true,
7
+ "freeze": true,
8
+ "immed": true,
9
+ "indent": 4,
10
+ "latedef": true,
11
+ "newcap": true,
12
+ "noarg": true,
13
+ "noempty": true,
14
+ "nonbsp": true,
15
+ "nonew": true,
16
+ "quotmark": true,
17
+ "undef": true,
18
+ "browser": true,
19
+ "jquery": true,
20
+ "devel": true,
21
+ "predef": [ "sprintf", "ajaxurl", "humanMsg", "edcal_test" ],
22
+ "maxparams": 7,
23
+ "maxdepth": 7,
24
+ "maxcomplexity": 14
25
+ }
edcal.js CHANGED
@@ -1343,7 +1343,7 @@ var edcal = {
1343
  jQuery('#edcal-status').val(post.status);
1344
  edcal.updatePublishButton();
1345
  } else {
1346
- if (0 != jQuery('#edcal-status option[value=' + edcal.defaultStatus + ']').length) {
1347
  /*
1348
  * We want to use the default status if it exists in the list and we'll
1349
  * default to the draft status if the default one is in the list.
@@ -1847,6 +1847,7 @@ var edcal = {
1847
  * This is the full list of start of the week days from unicode.org
1848
  * http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml
1849
  */
 
1850
  nextStartOfWeek: function(/*date*/ date) {
1851
  date = date.clone();
1852
  if (edcal.startOfWeek === null) {
@@ -1944,6 +1945,8 @@ var edcal = {
1944
  return date.next().sunday().add(edcal.startOfWeek).days();
1945
  },
1946
 
 
 
1947
  /*
1948
  * Just a little helper function to tell if a given string (str)
1949
  * ends with the given expression (expr). I could adding this
@@ -2652,9 +2655,9 @@ var edcal = {
2652
  },
2653
 
2654
  chineseAposWorkaround: function(/*String*/ dateString) {
2655
- if (Date.CultureInfo.name.indexOf("zh") === 0 ||
2656
- Date.CultureInfo.name.indexOf("ja") === 0) {
2657
- return dateString.replace(/'/g, "");
2658
  }
2659
  return dateString;
2660
  }
1343
  jQuery('#edcal-status').val(post.status);
1344
  edcal.updatePublishButton();
1345
  } else {
1346
+ if (0 !== jQuery('#edcal-status option[value=' + edcal.defaultStatus + ']').length) {
1347
  /*
1348
  * We want to use the default status if it exists in the list and we'll
1349
  * default to the draft status if the default one is in the list.
1847
  * This is the full list of start of the week days from unicode.org
1848
  * http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml
1849
  */
1850
+ /* jshint maxcomplexity: 80 */
1851
  nextStartOfWeek: function(/*date*/ date) {
1852
  date = date.clone();
1853
  if (edcal.startOfWeek === null) {
1945
  return date.next().sunday().add(edcal.startOfWeek).days();
1946
  },
1947
 
1948
+ /* jshint maxcomplexity: 14 */
1949
+
1950
  /*
1951
  * Just a little helper function to tell if a given string (str)
1952
  * ends with the given expression (expr). I could adding this
2655
  },
2656
 
2657
  chineseAposWorkaround: function(/*String*/ dateString) {
2658
+ if (Date.CultureInfo.name.indexOf('zh') === 0 ||
2659
+ Date.CultureInfo.name.indexOf('ja') === 0) {
2660
+ return dateString.replace(/'/g, '');
2661
  }
2662
  return dateString;
2663
  }
edcal.php CHANGED
@@ -18,7 +18,7 @@
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
21
- Version: 3.2
22
  Author: Colin Vernon, Justin Evans, Joachim Kudish, Mary Vogt, and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  Plugin URI: http://stresslimitdesign.com/editorial-calendar-plugin
@@ -722,6 +722,7 @@ class EdCal {
722
  * with Firefox, but IE complains with a very unhelpful error message. We
723
  * can replace them with a right curly apostrophe since that works in IE
724
  * and Firefox. It is also a little nicer typographically.
 
725
  */
726
  return json_encode(str_replace("'", "’", $string));
727
  }
@@ -827,7 +828,7 @@ class EdCal {
827
  "url" : "<?php $this->edcal_json_encode(the_permalink()) ?>",
828
  "status" : "<?php echo get_post_status() ?>",
829
  "orig_status" : "<?php echo get_post_status() ?>",
830
- "title" : <?php echo $this->edcal_json_encode(get_the_title()) ?>,
831
  "author" : <?php echo $this->edcal_json_encode(get_the_author()) ?>,
832
  "type" : "<?php echo get_post_type( $post ) ?>",
833
  "typeTitle" : "<?php echo $postTypeTitle ?>",
18
  /*
19
  Plugin Name: WordPress Editorial Calendar
20
  Description: The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
21
+ Version: 3.3
22
  Author: Colin Vernon, Justin Evans, Joachim Kudish, Mary Vogt, and Zack Grossbart
23
  Author URI: http://www.zackgrossbart.com
24
  Plugin URI: http://stresslimitdesign.com/editorial-calendar-plugin
722
  * with Firefox, but IE complains with a very unhelpful error message. We
723
  * can replace them with a right curly apostrophe since that works in IE
724
  * and Firefox. It is also a little nicer typographically.
725
+ *
726
  */
727
  return json_encode(str_replace("&#039;", "&#146;", $string));
728
  }
828
  "url" : "<?php $this->edcal_json_encode(the_permalink()) ?>",
829
  "status" : "<?php echo get_post_status() ?>",
830
  "orig_status" : "<?php echo get_post_status() ?>",
831
+ "title" : <?php echo $this->edcal_json_encode(isset( $post->post_title ) ? $post->post_title : '') ?>,
832
  "author" : <?php echo $this->edcal_json_encode(get_the_author()) ?>,
833
  "type" : "<?php echo get_post_type( $post ) ?>",
834
  "typeTitle" : "<?php echo $postTypeTitle ?>",
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: cvernon, justinstresslimit, jkudish, MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 3.0
5
- Tested up to: 3.9.2
6
- Stable tag: 3.2
7
 
8
  The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
@@ -195,6 +195,10 @@ The `edcal_default_status` property controls the default status for new posts in
195
 
196
  == Changelog ==
197
 
 
 
 
 
198
  = 3.2 =
199
 
200
  We now have a new option for specifying the default status of a new post and documented the option for specifying the default time of a post.
2
  Contributors: cvernon, justinstresslimit, jkudish, MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 3.0
5
+ Tested up to: 4.0
6
+ Stable tag: 3.3
7
 
8
  The Editorial Calendar makes it possible to see all your posts and drag and drop them to manage your blog.
9
 
195
 
196
  == Changelog ==
197
 
198
+ = 3.3 =
199
+
200
+ This version fixes an error handling apostrophes and ampersands in post titles in WordPress 4.0.
201
+
202
  = 3.2 =
203
 
204
  We now have a new option for specifying the default status of a new post and documented the option for specifying the default time of a post.