Editorial Calendar - Version 3.7.5

Version Description

The calendar now support quick edit when a post has either a title or content instead of requiring a title.

Download this release

Release Info

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

Code changes from version 3.7.4 to 3.7.5

Files changed (4) hide show
  1. edcal.js +19 -7
  2. edcal.min.js +61 -61
  3. edcal.php +1 -1
  4. readme.txt +6 -2
edcal.js CHANGED
@@ -424,9 +424,25 @@ var edcal = {
424
  return edcal.savePost(null, false, true);
425
  });
426
 
427
- jQuery('#edcal-title-new-field').bind('keyup', function(evt) {
428
- if (jQuery('#edcal-title-new-field').val().length > 0 &&
429
- (!jQuery('#edcal-time').is(':visible') || jQuery('#edcal-time').val().length > 0)) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  jQuery('#newPostScheduleButton').removeClass('disabled');
431
  } else {
432
  jQuery('#newPostScheduleButton').addClass('disabled');
@@ -1177,10 +1193,6 @@ var edcal = {
1177
  post = edcal.serializePost();
1178
  }
1179
 
1180
- if (!post.title || post.title === '') {
1181
- return false;
1182
- }
1183
-
1184
  //edcal.output('savePost(' + post.date + ', ' + post.title + ')');
1185
 
1186
  jQuery('#edit-slug-buttons').addClass('tiploading');
424
  return edcal.savePost(null, false, true);
425
  });
426
 
427
+ jQuery('#edcal-title-new-field').bind('input', function(evt) {
428
+ if ((jQuery('#edcal-title-new-field').val().length > 0 || jQuery('#content').val().length > 0) &&
429
+ (!jQuery('#edcal-time').is(':visible') || jQuery('#edcal-time').val().length > 0)) {
430
+ jQuery('#newPostScheduleButton').removeClass('disabled');
431
+ } else {
432
+ jQuery('#newPostScheduleButton').addClass('disabled');
433
+ }
434
+
435
+ if (evt.keyCode === 13) { // enter key
436
+ /*
437
+ * If the user presses enter we want to save the draft.
438
+ */
439
+ return edcal.savePost(null, true);
440
+ }
441
+ });
442
+
443
+ jQuery('#content').bind('input', function(evt) {
444
+ if ((jQuery('#edcal-title-new-field').val().length > 0 || jQuery('#content').val().length > 0) &&
445
+ (!jQuery('#edcal-time').is(':visible') || jQuery('#edcal-time').val().length > 0)) {
446
  jQuery('#newPostScheduleButton').removeClass('disabled');
447
  } else {
448
  jQuery('#newPostScheduleButton').addClass('disabled');
1193
  post = edcal.serializePost();
1194
  }
1195
 
 
 
 
 
1196
  //edcal.output('savePost(' + post.date + ', ' + post.title + ')');
1197
 
1198
  jQuery('#edit-slug-buttons').addClass('tiploading');
edcal.min.js CHANGED
@@ -7,65 +7,65 @@ jQuery("#edcal_scrollable").bind("mousewheel",function(a,b){a=Math.abs(b);!edcal
7
  edcal.createDaysHeader();jQuery("#edcal_scrollable").scrollable({vertical:!0,size:edcal.weeksPref,keyboard:!1,keyboardSteps:1,speed:100,easing:"linear"});var a=jQuery("#edcal_scrollable").scrollable();a.getConf().keyboard=!1;var b=jQuery.cookie("edcal_date");b?(b=Date.parseExact(b,"yyyy-dd-MM"),edcal.output("Resetting to date from the edcal_Date cookie: "+b)):b=Date.today();edcal.moveTo(b.clone());a.onBeforeSeek(function(a,b){return!1});edcal.enableMouseWheel();jQuery(document).bind("keydown",function(a){if(27===
8
  a.keyCode)return!1;if(!jQuery("#edcal_quickedit").is(":visible"))if(40!==a.keyCode||a.altKey||a.ctrlKey)if(38!==a.keyCode||a.altKey||a.ctrlKey){if(34===a.keyCode&&!a.altKey&&!a.ctrlKey||40===a.keyCode&&a.ctrlKey)return edcal.move(edcal.weeksPref,!0),!1;if(33===a.keyCode&&!a.altKey&&!a.ctrlKey||38===a.keyCode&&a.ctrlKey)return edcal.move(edcal.weeksPref,!1),!1}else return edcal.move(1,!1),!1;else return edcal.move(1,!0),!1});edcal.getPosts(edcal.nextStartOfWeek(b).add(-3).weeks(),edcal.nextStartOfWeek(b).add(edcal.weeksPref+
9
  3).weeks());jQuery("#moveToToday").click(function(){edcal.moveTo(Date.today());edcal.getPosts(edcal.nextStartOfWeek(Date.today()).add(-3).weeks(),edcal.nextStartOfWeek(Date.today()).add(edcal.weeksPref+3).weeks());return!1});jQuery("#moveToLast").click(function(){if("-1"!==edcal.lastPostDate){var a=Date.parseExact(edcal.lastPostDate,"ddMMyyyy");edcal.moveTo(a);edcal.getPosts(edcal.nextStartOfWeek(a).add(-3).weeks(),edcal.nextStartOfWeek(a).add(edcal.weeksPref+3).weeks());return!1}});jQuery("#prevmonth").click(function(){edcal.move(edcal.weeksPref,
10
- !1);return!1});jQuery("#nextmonth").click(function(){edcal.move(edcal.weeksPref,!0);return!1});jQuery("#newPostScheduleButton").on("click",function(a){if(jQuery(this).hasClass("disabled"))return!1;jQuery(this).addClass("disabled");return edcal.savePost(null,!1,!0)});jQuery("#edcal-title-new-field").bind("keyup",function(a){0<jQuery("#edcal-title-new-field").val().length&&(!jQuery("#edcal-time").is(":visible")||0<jQuery("#edcal-time").val().length)?jQuery("#newPostScheduleButton").removeClass("disabled"):
11
- jQuery("#newPostScheduleButton").addClass("disabled");if(13===a.keyCode)return edcal.savePost(null,!0)});jQuery("#edcal-status").bind("change",function(a){edcal.updatePublishButton()});jQuery("#edcal_weeks_pref").on("keyup",function(a){0<jQuery("#edcal_weeks_pref").val().length?jQuery("#edcal_applyoptions").removeClass("disabled"):jQuery("#edcal_applyoptions").addClass("disabled");13===a.keyCode&&edcal.saveOptions()});edcal.savePosition();edcal.addOptionsSection();jQuery("#edcal-time").timePicker({show24Hours:"H:i"===
12
- edcal.timeFormat,separator:":",step:30});jQuery("#showdraftsdrawer").click(function(){edcal.setDraftsDrawerVisible(!edcal.isDraftsDrawerVisible)})}},setDraftsDrawerVisible:function(a,b){var c=jQuery("#showdraftsdrawer");c.hasClass("isLoaded")?b&&b():(c.addClass("isLoaded"),edcal.setupDraftsdrawer(b));a?(jQuery("#cal_cont").css({"margin-right":"13.5%"}),jQuery("#draftsdrawer_cont").css({display:"block",width:"13%"}),c.html(edcal.str_hidedrafts)):(jQuery("#cal_cont").css({"margin-right":"0"}),jQuery("#draftsdrawer_cont").css({display:"none",
13
- width:"0"}),c.html(edcal.str_showdrafts));edcal.isDraftsDrawerVisible=a;jQuery.cookie("edcal_drafts_drawer",a,{expires:2060})},setupDraftsdrawer:function(a){jQuery("#draftsdrawer_loading").css({display:"block"});edcal.getPosts(edcal.NO_DATE,null,function(){edcal.initDraftsdrawer();a&&a()})},initDraftsdrawer:function(){var a=""+('<a href="#" adddate="'+edcal.NO_DATE+'" class="daynewlink" style="margin-top: 5px;"title="'+edcal.str_newdraft+'" id="unscheduledNewLink" onclick="edcal.addDraft(); return false;">'+
14
- edcal.str_addDraftLink+"</a>");a=a+'<ul class="postlist">'+edcal.getPostItems(edcal.NO_DATE);a+="</ul>";edcal.draggablePost("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" li.post");edcal.makeDroppable(jQuery("#draftsdrawer div.day"));jQuery("#unscheduled").append(a);jQuery("#draftsdrawer_loading").css({display:"none"});a=jQuery("#cal_cont");jQuery("#unscheduled ul.postlist").css("min-height",a.height()-10-jQuery("#draftsdrawer .draftsdrawerheadcont").height()-jQuery("#unscheduledNewLink").outerHeight());
15
- jQuery("#unscheduled").mouseout(function(){jQuery("#unscheduledNewLink").hide()}).mouseover(function(){jQuery("#unscheduledNewLink").show()})},alignGrid:function(a,b,c,d,e){if("draftsdrawer"!==jQuery(a).parent().attr("id")){var f=0,h=0,g=1;jQuery(a).each(function(){jQuery(this).css("position","relative");var a=jQuery(this).children("div");if(1===b||"rtl"!==edcal.ltr)for(var k=0;k<a.length;k++)a.eq(k).css({width:c+"%",height:d+"%",position:"absolute",left:f+"%",top:h+"%"}),0===g%b?(f=0,h+=d+e):f+=
16
- c+e,g++;else for(k=a.length-1;-1<k;k--)a.eq(k).css({width:c+"%",height:d+"%",position:"absolute",left:f+"%",top:h+"%"}),0===g%b?(f=0,h+=d+e):f+=c+e,g++})}},alignCal:function(){edcal.alignGrid("#cal",1,100,100/edcal.weeksPref-1,1)},createDaysHeader:function(){var a=Date.today().next().sunday();edcal.nextStartOfWeek(a);var b='<div class="dayheadcont"><div class="dayhead firstday">'+a.add(edcal.startOfWeek).days().toString("dddd")+"</div>",b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+
17
- "</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead lastday">'+a.add(1).days().toString("dddd")+"</div>");jQuery("#cal_cont").prepend(b);edcal.alignGrid(".dayheadcont",7,13.8,100,.5)},getDateClass:function(a){var b;var c=-1===a.compareTo(Date.today())?
18
- "beforeToday":"todayAndAfter";edcal.firstDayOfMonth||(edcal.firstDayOfMonth=Date.today().moveToFirstDayOfMonth().clearTime(),edcal.firstDayOfNextMonth=Date.today().moveToLastDayOfMonth().clearTime());a.between(edcal.firstDayOfMonth,edcal.firstDayOfNextMonth)?b="month-present":1===a.compareTo(edcal.firstDayOfMonth)?b="month-future":-1===a.compareTo(edcal.firstDayOfNextMonth)&&(b="month-past");"01"===a.toString("dd")&&(c+=" firstOfMonth");return b+" "+c},showAddPostLink:function(a){edcal.inDrag||(a=
19
- jQuery("#"+a+" a.daynewlink"),a.css("display","block"),a.bind("click",edcal.addPost))},hideAddPostLink:function(a){jQuery("#"+a+" a.daynewlink").hide().unbind("click",edcal.addPost)},createRow:function(a,b){for(var c=edcal._wDate.clone(),d='<div class="rowcont" id="row'+edcal._wDate.toString(edcal.internalDateFormat)+'"><div id="row'+edcal._wDate.toString(edcal.internalDateFormat)+'row" class="edcal_row">',e=0;7>e;e++)d+="<div onmouseover=\"edcal.showAddPostLink('"+c.toString(edcal.internalDateFormat)+
20
- "');\" onmouseout=\"edcal.hideAddPostLink('"+c.toString(edcal.internalDateFormat)+'\');" id="'+c.toString(edcal.internalDateFormat)+'" class="day '+edcal.getDateClass(c)+" "+c.toString("dddd").toLowerCase()+" month-"+c.toString("MM").toLowerCase()+'">',d+='<div class="dayobj">',d+='<a href="#" adddate="'+c.toString("MMMM d")+'" class="daynewlink" title="'+sprintf(edcal.str_newpost,edcal.chineseAposWorkaround(c.toString(Date.CultureInfo.formatPatterns.monthDay)))+'" onclick="return false;">'+edcal.str_addPostLink+
21
- "</a>",d="01"===c.toString("dd")?d+('<div class="daylabel">'+c.toString("MMM d")):d+('<div class="daylabel">'+c.toString("d")),d+="</div>",d+='<ul class="postlist">',d+=edcal.getPostItems(c.toString(edcal.internalDateFormat)),d+="</ul>",d+="</div>",d+="</div>",c.add(1).days();d+="</div></div>";b?a.append(d):a.prepend(d);edcal.alignGrid("#row"+edcal._wDate.toString(edcal.internalDateFormat)+"row",7,13.9,100,.5);edcal.draggablePost("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" li.post");
22
- edcal.makeDroppable(jQuery("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" > div > div.day"));return jQuery("row"+edcal._wDate.toString(edcal.internalDateFormat))},makeDroppable:function(a){a.droppable({hoverClass:"day-active",accept:function(a){return jQuery(this).hasClass("beforeToday")?a.hasClass("draft")?!0:!1:!0},greedy:!0,tolerance:"pointer",drop:function(a,c){a=c.draggable.parent().parent().parent().attr("id");edcal.doDrop(a,c.draggable.attr("id"),jQuery(this).attr("id"))}})},doDrop:function(a,
23
- b,c,d){var e=edcal.findPostForId(a,b);edcal.removePostFromMap(a,b);var f=jQuery("#"+b);f.detach();setTimeout(function(){f.remove()},500);jQuery("#"+c+" .postlist").append(edcal.createPostItem(e,c));a===c?edcal.draggablePost("#"+c+" .post"):edcal.changeDate(c,e,d)},draggablePost:function(a){jQuery(a).each(function(){var a=edcal.findPostForId(jQuery(this).parent().parent().parent().attr("id"),jQuery(this).attr("id"));edcal.isPostMovable(a)&&(jQuery(this).draggable({revert:"invalid",appendTo:"body",
24
- helper:"clone",distance:1,addClasses:!1,start:function(){edcal.inDrag=!0},stop:function(){edcal.inDrag=!1},drag:function(a,b){edcal.handleDrag(a,b)},scroll:!1,refreshPositions:!0}),jQuery(this).addClass("draggable"))})},handleDrag:function(a,b){edcal.isMoving||edcal.isDragScrolling||(edcal.isDragScrolling=!0,a.pageY<edcal.position.top+10?edcal.move(1,!1):a.pageY>edcal.position.bottom-10&&edcal.move(1,!0),setTimeout(function(){edcal.isDragScrolling=!1},300))},removePostFromMap:function(a,b){if(edcal.posts[a])for(var c=
25
- 0;c<edcal.posts[a].length;c++)if(edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b)return edcal.posts[a][c]=null,!0;return!1},addPostItem:function(a,b){jQuery("#"+b+" > div > ul").append(edcal.createPostItem(a,b))},addPostItemDragAndToolltip:function(a){edcal.draggablePost("#"+a+" > div > ul > li")},deletePost:function(a,b){a=edcal.ajax_url()+"&action=edcal_deletepost&postid="+a;jQuery.ajax({url:a,type:"POST",processData:!1,timeout:1E5,dataType:"json",success:function(a){a.post.date_gmt===edcal.NO_DATE?
26
- edcal.removePostItem(a.post.date_gmt,"post-"+a.post.id):edcal.removePostItem(a.post.date,"post-"+a.post.id);a.error?a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error):edcal.output('Finished deleting the post: "'+a.post.title+'" with id:'+a.post.id);b&&b(a)},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("deletePost xhr.responseText: "+a.responseText)}})},confirmDelete:function(a){return confirm(edcal.str_del_msg1+a+edcal.str_del_msg2)?!0:!1},ajax_url:function(){return ajaxurl+
27
- "?_wpnonce="+edcal.wp_nonce},getMediaBar:function(){return jQuery("#cal_mediabar").html()},addPost:function(){jQuery("#newPostScheduleButton").addClass("disabled");var a=jQuery(this).parent().parent().attr("id"),b=edcal.defaultTime;"H:i"!==edcal.timeFormat&&"G:i"!==edcal.timeFormat&&(b+=" AM");a={id:0,date:a,formatteddate:edcal.getDayFromDayId(a).toString(edcal.previewDateFormat),time:b};edcal.showForm(a);return!1},addDraft:function(){jQuery("#newPostScheduleButton").addClass("disabled");var a={id:0,
28
- date:Date.today(),formatteddate:edcal.NO_DATE,time:edcal.NO_DATE,status:"draft"};edcal.showForm(a);return!1},editPost:function(a){jQuery("#newPostScheduleButton").removeClass("disabled");edcal.getPost(a,edcal.showForm);return!1},savePost:function(a,b,c,d){if("undefined"===typeof a||null===a)a=edcal.serializePost();if(!a.title||""===a.title)return!1;jQuery("#edit-slug-buttons").addClass("tiploading");var e=a.time.toUpperCase();"12"===e.slice(0,2)&&"PM"===e.slice(e.length-2,e.length)?a.time="12:"+e.slice(3,
29
- 5):"12"===e.slice(0,2)&&"AM"===e.slice(a.time.length-2,a.time.length)&&(a.time="00:"+e.slice(3,5));var e=""!==a.time?Date.parse(a.time):Date.parse(edcal.defaultTime);if(null!==e&&e!==edcal.NO_DATE){var f=e.format("H:i:s");var h=encodeURIComponent(edcal.getDayFromDayId(a.date).toString(edcal.wp_dateFormat)+" "+f)}else h=encodeURIComponent(a.date.toString(edcal.wp_dateFormat+" H:i:s"));f=edcal.ajax_url()+"&action=edcal_savepost";a="date="+h+"&title="+encodeURIComponent(a.title)+"&content="+encodeURIComponent(a.content)+
30
- "&id="+encodeURIComponent(a.id)+"&status="+encodeURIComponent(a.status)+"&orig_status="+encodeURIComponent(a.orig_status);if(null===e||e===edcal.NO_DATE)a+="&date_gmt="+encodeURIComponent("0000-00-00 00:00:00");edcal.getUrlVars().post_type&&(a+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type));c&&(a+="&dopublish="+encodeURIComponent("future"));jQuery.ajax({url:f,type:"POST",processData:!1,data:a,timeout:1E5,dataType:"json",success:function(a){jQuery("#edit-slug-buttons").removeClass("tiploading");
31
- jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;if(a.error)return a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error),!1;if(a.post)if(b)window.location=a.post.editlink.replace("&amp;","&");else{var c=a.post.date;a.post.date_gmt===edcal.NO_DATE&&(c=a.post.date_gmt);a.post.id&&edcal.removePostItem(c,"post-"+a.post.id);edcal.addPostItem(a.post,c);edcal.addPostItemDragAndToolltip(c)}else edcal.showError("There was an error creating a new post for your blog.");
32
- d&&d(a);return!0},error:function(a){jQuery("#edit-slug-buttons").removeClass("tiploading");jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;edcal.showError(edcal.general_error);a.responseText&&edcal.output("savePost xhr.responseText: "+a.responseText)}});return!1},serializePost:function(){var a={};jQuery("#edcal_quickedit").find("input, textarea, select").each(function(){a[this.name]=this.value});return a},showForm:function(a){edcal.resetForm();
33
- a.formatteddate===edcal.NO_DATE||a.date_gmt===edcal.NO_DATE?jQuery("#timeEditControls").hide():jQuery("#timeEditControls").show();jQuery("#edcal_quickedit").center().show();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!1;a.id?(jQuery("#tooltiptitle").text(sprintf(edcal.str_edit_post_title,a.typeTitle,edcal.getDayFromDayId(a.date).toString(edcal.previewDateFormat))),jQuery("#edcal-title-new-field").val(a.title),jQuery("#content").val(a.content)):a.formatteddate===edcal.NO_DATE?
34
- jQuery("#tooltiptitle").text(edcal.str_newdraft_title):jQuery("#tooltiptitle").text(edcal.str_newpost_title+a.formatteddate);"future"===a.status&&jQuery("#newPostScheduleButton").text(edcal.str_update);a.status?(jQuery("#edcal-status").val(a.status),edcal.updatePublishButton()):(0!==jQuery("#edcal-status option[value="+edcal.defaultStatus+"]").length?jQuery("#edcal-status").val(edcal.defaultStatus):jQuery("#edcal-status").val("draft"),jQuery("#newPostScheduleButton").text(edcal.str_save));a.status&&
35
- "draft"!==a.status&&"future"!==a.status&&"pending"!==a.status&&(jQuery("#edcal-status").attr("disabled","true"),jQuery("#edcal-status").append('<option class="temp" value="'+a.status+'">'+a.status+"</option>"),jQuery("#edcal-status").val(a.status));a.formatteddate!==edcal.NO_DATE&&-1===edcal.getDayFromDayId(a.date).compareTo(Date.today())&&jQuery("#edcal-status").attr("disabled","true");var b=a.time;jQuery("#edcal-time").val(b);jQuery("#edcal-date").val(a.date);jQuery("#edcal-id").val(a.id);jQuery("#edcal-title-new-field").focus();
36
- jQuery("#edcal-title-new-field").select()},hideForm:function(){jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;edcal.resetForm()},resetForm:function(){jQuery("#edcal_quickedit").find("input, textarea, select").each(function(){this.value=""});jQuery("#edcal-status").removeAttr("disabled");jQuery("#newPostScheduleButton").text(edcal.str_publish);jQuery("#tooltiptitle").text("");jQuery("#edcal-status").removeAttr("disabled");jQuery("#edcal-status .temp").remove()},
37
- createPostItem:function(a,b){edcal.posts[b]||(edcal.posts[b]=[]);edcal.posts[b][edcal.posts[b].length]=a;return edcal.getPostItemString(a)},findPostForId:function(a,b){if(edcal.posts[a])for(var c=0;c<edcal.posts[a].length;c++)if(edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b)return edcal.posts[a][c];return null},removePostItem:function(a,b){if(edcal.findPostForId(a,b))for(var c=0;c<edcal.posts[a].length;c++)edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b&&(edcal.posts[a][c]=null);jQuery("#"+
38
- b).remove()},getPostItems:function(a){var b="";if(edcal.posts[a]){var c=edcal.posts[a];if(50>c.length)for(a=0;a<c.length;a++)c[a]&&(b+=edcal.getPostItemString(c[a]));else edcal.addPostItems(a,0,50)}return b},addPostItems:function(a,b,c){var d=edcal.posts[a],e="";setTimeout(function(){for(var f=b;f<b+c&&f<d.length;f++)d[f]&&(e+=edcal.getPostItemString(d[f]));jQuery("#"+a+" ul").append(e);b+c<d.length&&edcal.addPostItems(a,b+c,50)},100)},showActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);
39
- var b=edcal.findPostForId(jQuery("#"+a).parent().parent().parent().attr("id"),a);if(!edcal.inDrag&&edcal.isPostEditable(b)){var c=jQuery("#"+a+" > div.postactions");edcal.actionLinksElem&&edcal.actionLinksElem.get(0)!==c.get(0)&&edcal.actionLinksElem.slideUp();edcal.actionLinksElem=c;edcal.actionTimer=setTimeout(function(){c.slideDown();if(c.parent().position().top+c.parent().height()>c.parent().parent().height()){var b=jQuery("#"+a+" > div.postactions").parent().parent();b.scrollTop(b.scrollTop()+
40
- 45)}},250)}},hideActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);edcal.actionTimer=setTimeout(function(){jQuery("#"+a+" > div.postactions").slideUp();edcal.actionLinksElem=null},1E3)},isPostMovable:function(a){return a.editlink&&"publish"!==a.status},isPostEditable:function(a){return a.editlink},getPostEditableClass:function(a){return a.editlink?"":"readonly"},getPostItemString:function(a){var b=a.title;""===b&&(b="[No Title]");edcal.statusPref&&("draft"===a.status&&"1"===
41
- a.sticky?b+=edcal.str_draft_sticky:"pending"===a.status&&"1"===a.sticky?b+=edcal.str_pending_sticky:"1"===a.sticky?b+=edcal.str_sticky:"pending"===a.status?b+=edcal.str_pending:"draft"===a.status?b+=edcal.str_draft:"publish"!==a.status&&"future"!==a.status&&"pending"!==a.status&&(b+=" ["+a.status+"]"));edcal.timePref&&(b='<span class="posttime">'+a.formattedtime+"</span> "+b);edcal.authorPref&&(b=sprintf(edcal.str_by,b,'<span class="postauthor">'+a.author+"</span>"));return edcal.isPostMovable(a)?
42
- "<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+a.slugs+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_edit+'</a> | <a href="#" onclick="edcal.editPost('+a.id+'); return false;">'+edcal.str_quick_edit+'</a> | <a href="'+a.dellink+'" onclick="return edcal.confirmDelete(\''+a.title+"');\">"+edcal.str_del+
43
- '</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>":"<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_republish+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>"},setClassforToday:function(){jQuery("#"+Date.today().toString(edcal.internalDateFormat)).addClass("today")},
44
- getCalHeight:function(){var a=jQuery(window).height()-jQuery("#footer").height()-jQuery("#wphead").height()-150;return Math.max(a,500)},move:function(a,b,c){if(!jQuery("#edcal_quickedit").is(":visible")){edcal.currentDirection!==b&&(edcal._wDate=b?edcal._wDate.add(7*(edcal.weeksPref+7)).days():edcal._wDate.add(-(7*(edcal.weeksPref+7))).days(),edcal.steps=0,edcal.moveDate=edcal._wDate);edcal.currentDirection=b;var d;if(b)for(d=0;d<a;d++)jQuery("#cal > div:first").remove(),edcal.createRow(jQuery("#cal"),
45
- !0),edcal._wDate.add(7).days();else for(d=0;d<a;d++)jQuery("#cal > div:last").remove(),edcal.createRow(jQuery("#cal"),!1),edcal._wDate.add(-7).days();edcal.alignCal();edcal.setClassforToday();edcal.setDateLabel();edcal.steps+=a;edcal.tID?clearTimeout(edcal.tID):edcal.moveDate=edcal._wDate;edcal.tID=setTimeout(function(){b?edcal.getPosts(edcal._wDate.clone().add(-7*(edcal.steps+1)).days(),edcal._wDate.clone(),c):edcal.getPosts(edcal._wDate.clone(),edcal._wDate.clone().add(7*(edcal.steps+1)).days(),
46
- c);edcal.steps=0;edcal.tID=null;edcal.moveDate=edcal._wDate},1E3);b?jQuery.cookie("edcal_date",edcal._wDate.clone().add(-(edcal.weeksPref+4)).weeks().toString("yyyy-dd-MM")):jQuery.cookie("edcal_date",edcal._wDate.clone().add(3).weeks().toString("yyyy-dd-MM"))}},getDayFromDayId:function(a){return Date.parseExact(a.substring(2,4)+"/"+a.substring(0,2)+"/"+a.substring(4),"MM/dd/yyyy")},setDateLabel:function(a){var b=jQuery("#edcal_scrollable").scrollable().getVisibleItems();a=edcal.getDayFromDayId(b.eq(0).children(".edcal_row").children(".day:first").attr("id"));
47
- b=edcal.getDayFromDayId(b.eq(edcal.weeksPref-1).children(".edcal_row").children(".day:last").attr("id"));jQuery("#currentRange").text(edcal.chineseAposWorkaround(a.toString(Date.CultureInfo.formatPatterns.yearMonth))+" - "+edcal.chineseAposWorkaround(b.toString(Date.CultureInfo.formatPatterns.yearMonth)))},nextStartOfWeek:function(a){a=a.clone();if(null===edcal.startOfWeek)if(edcal.locale){var b=edcal.locale.toUpperCase();edcal.endsWith(b,"AS")||edcal.endsWith(b,"AZ")||edcal.endsWith(b,"BW")||edcal.endsWith(b,
48
- "CA")||edcal.endsWith(b,"CN")||edcal.endsWith(b,"FO")||edcal.endsWith(b,"GB")||edcal.endsWith(b,"GE")||edcal.endsWith(b,"GL")||edcal.endsWith(b,"GU")||edcal.endsWith(b,"HK")||edcal.endsWith(b,"IE")||edcal.endsWith(b,"IL")||edcal.endsWith(b,"IN")||edcal.endsWith(b,"IS")||edcal.endsWith(b,"JM")||edcal.endsWith(b,"JP")||edcal.endsWith(b,"KG")||edcal.endsWith(b,"KR")||edcal.endsWith(b,"LA")||edcal.endsWith(b,"MH")||edcal.endsWith(b,"MN")||edcal.endsWith(b,"MO")||edcal.endsWith(b,"MP")||edcal.endsWith(b,
49
- "MT")||edcal.endsWith(b,"NZ")||edcal.endsWith(b,"PH")||edcal.endsWith(b,"PK")||edcal.endsWith(b,"SG")||edcal.endsWith(b,"SY")||edcal.endsWith(b,"TH")||edcal.endsWith(b,"TT")||edcal.endsWith(b,"TW")||edcal.endsWith(b,"UM")||edcal.endsWith(b,"US")||edcal.endsWith(b,"UZ")||edcal.endsWith(b,"VI")||edcal.endsWith(b,"ZW")?edcal.startOfWeek=0:edcal.endsWith(b,"MV")?edcal.startOfWeek=5:edcal.endsWith(b,"AF")||edcal.endsWith(b,"BH")||edcal.endsWith(b,"DJ")||edcal.endsWith(b,"DZ")||edcal.endsWith(b,"EG")||
50
- edcal.endsWith(b,"ER")||edcal.endsWith(b,"ET")||edcal.endsWith(b,"IQ")||edcal.endsWith(b,"IR")||edcal.endsWith(b,"JO")||edcal.endsWith(b,"KE")||edcal.endsWith(b,"KW")||edcal.endsWith(b,"LY")||edcal.endsWith(b,"MA")||edcal.endsWith(b,"OM")||edcal.endsWith(b,"QA")||edcal.endsWith(b,"SA")||edcal.endsWith(b,"SD")||edcal.endsWith(b,"SO")||edcal.endsWith(b,"TN")||edcal.endsWith(b,"YE")?edcal.startOfWeek=6:edcal.startOfWeek=1}else edcal.startOfWeek=0;return a.next().sunday().add(edcal.startOfWeek).days()},
51
- endsWith:function(a,b){return a.match(b+"$")===b},moveTo:function(a){edcal.isMoving=!0;jQuery("#cal").empty();jQuery.cookie("edcal_date",a.toString("yyyy-dd-MM"));edcal._wDate=edcal.nextStartOfWeek(a).add(-21).days();edcal.currentDirection=!0;a=edcal.weeksPref+6;for(var b=0;b<a;b++)edcal.createRow(jQuery("#cal"),!0),edcal._wDate.add(7).days();edcal.alignCal();jQuery("#edcal_scrollable").scrollable().move(2);edcal.setDateLabel();edcal.setClassforToday();edcal.isMoving=!1},savePosition:function(){var a=
52
- jQuery("#edcal_scrollable"),b=jQuery("#cal_cont");edcal.position={top:a.offset().top,bottom:a.offset().top+a.height()};jQuery("#edcal_poststyle").remove();a=jQuery(".rowcont:eq(2) .dayobj:first").height()-jQuery(".rowcont:eq(2) .daylabel:first").height()-6;jQuery("head").append('<style id="edcal_poststyle" type="text/css">.ui-draggable-dragging {width: '+(jQuery(".rowcont:eq(2) .day:first").width()-5)+"px;}.postlist {height: "+a+"px;}</style>");jQuery("#draftsdrawer").css("height",b.height());jQuery("#draftsdrawer .day").css("min-height",
53
- b.height()-10-jQuery("#draftsdrawer .draftsdrawerheadcont").height())},addFeedbackSection:function(){3<edcal.visitCount&&edcal.doFeedbackPref&&jQuery("#edcal_main_title").after(edcal.str_feedbackmsg)},doFeedback:function(){jQuery.getScript("http://www.zackgrossbart.com/edcal/mint/?js",function(){edcal.saveFeedbackPref()})},noFeedback:function(){jQuery("#feedbacksection").hide("fast");edcal.saveFeedbackPref()},saveFeedbackPref:function(){var a=edcal.ajax_url()+"&action=edcal_saveoptions&dofeedback="+
54
- encodeURIComponent("done");jQuery.ajax({url:a,type:"POST",processData:!1,timeout:1E5,dataType:"text",success:function(a){jQuery("#feedbacksection").html(edcal.str_feedbackdone);setTimeout(function(){jQuery("#feedbacksection").hide("slow")},5E3)},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("saveOptions xhr.responseText: "+a.responseText)}})},updatePublishButton:function(){"future"===jQuery("#edcal-status").val()&&jQuery("#newPostScheduleButton").text(edcal.str_publish);
55
- "pending"===jQuery("#edcal-status").val()?jQuery("#newPostScheduleButton").text(edcal.str_review):jQuery("#newPostScheduleButton").text(edcal.str_save)},changeDate:function(a,b,c){var d=a===edcal.NO_DATE,e=b.date_gmt===edcal.NO_DATE,f=d?"0000-00-00":edcal.getDayFromDayId(a).toString(edcal.wp_dateFormat),h=e?b.date_gmt:edcal.getDayFromDayId(b.date).toString(edcal.wp_dateFormat);d&&(b.status="draft");f=edcal.ajax_url()+"&action=edcal_changedate&postid="+b.id+"&postStatus="+b.status+"&newdate="+f+"&olddate="+
56
- h;jQuery("#post-"+b.id).addClass("loadingclass");jQuery.ajax({url:f,type:"POST",processData:!1,timeout:1E5,dataType:"json",success:function(b){b.error&&(edcal.removePostItem(a,"post-"+b.post.id),b.error===edcal.CONCURRENCY_ERROR?edcal.displayMessage(edcal.concurrency_error+"<br />"+b.post.title):b.error===edcal.PERMISSION_ERROR?edcal.displayMessage(edcal.permission_error):b.error===edcal.NONCE_ERROR&&edcal.displayMessage(edcal.checksum_error));var f=d?"00000000":b.post.date,g=e?a:f;edcal.removePostItem(f,
57
- "post-"+b.post.id);edcal.addPostItem(b.post,g);edcal.addPostItemDragAndToolltip(g);c&&c(b)},error:function(a,b,c){edcal.showError(edcal.general_error);edcal.output("textStatus: "+b);edcal.output("error: "+c);a.responseText&&edcal.output("changeDate xhr.responseText: "+a.responseText)}})},getPosts:function(a,b,c){b||(b="");edcal.cacheDates[a]?c&&c():(edcal.cacheDates[a]=!0,b=edcal.ajax_url()+"&action=edcal_posts&from="+a.toString("yyyy-MM-dd")+"&to="+b.toString("yyyy-MM-dd"),edcal.getUrlVars().post_type&&
58
- (b+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type)),jQuery("#loading").show(),jQuery.ajax({url:b,type:"GET",processData:!1,timeout:1E5,dataType:"text",success:function(b){jQuery("#loading").hide();var d=null;try{d=JSON.parseIt(b)}catch(l){edcal.showFatalError(edcal.str_fatal_parse_error+l.message);window.console&&console.error(l);return}if(d.error)d.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error);else{for(var f=[],h=d.length;0<=h;h--){var g=d[h];g&&"trash"!==g.status&&
59
- (g.date=g.date.replace(g.date.substring(2,3),g.date.substring(2,3).toUpperCase()),"00000000"===a&&(g.date=a),edcal.removePostItem(g.date,"post-"+g.id),edcal.addPostItem(g,g.date),f[f.length]=g.date)}setTimeout(function(){jQuery.each(f,function(a,b){edcal.addPostItemDragAndToolltip(b)})},300);c&&c(b)}},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("getPosts xhr.responseText: "+a.responseText)}}))},getPost:function(a,b){if(0===a)return!1;jQuery("#loading").show();
60
- a=edcal.ajax_url()+"&action=edcal_getpost&postid="+a;edcal.getUrlVars().post_type&&(a+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type));jQuery.ajax({url:a,type:"GET",processData:!1,timeout:1E5,dataType:"json",success:function(a){jQuery("#loading").hide();edcal.output("xhr for getPost returned: "+a);if(a.error)return a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error),!1;"function"===typeof b&&b(a.post);return a.post},error:function(a){jQuery("#loading").hide();edcal.showError(edcal.general_error);
61
- a.responseText&&edcal.output("getPost xhr.responseText: "+a.responseText);return!1}});return!0},addOptionsSection:function(){var a='<div class="hide-if-no-js screen-meta-toggle" id="screen-options-link-wrap"><a class="show-settings" id="show-edcal-settings-link" onclick="edcal.toggleOptions(); return false;" href="#" >'+edcal.str_screenoptions+"</a></div>";0===jQuery("#screen-meta-links").length&&jQuery("#screen-meta").after('<div id="screen-meta-links"></div>');jQuery("#screen-meta-links").append(a)},
62
- toggleOptions:function(){if(edcal.helpMeta)jQuery("#contextual-help-wrap").slideUp("fast"),jQuery("#contextual-help-wrap").html(edcal.helpMeta),edcal.helpMeta=null,jQuery("#show-edcal-settings-link").removeClass("screen-meta-active"),jQuery("#contextual-help-link-wrap").css("visibility","");else{edcal.helpMeta=jQuery("#contextual-help-wrap").html();for(var a='<div class="metabox-prefs calendar-fields-prefs"><h5>'+edcal.str_show_opts+'</h5><label for="author-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.authorPref)+
63
- 'value="true" id="author-hide" name="author-hide" class="hide-column-tog" />'+edcal.str_opt_author+'</label><label for="status-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.statusPref)+'value="true" id="status-hide" name="status-hide" class="hide-column-tog" />'+edcal.str_opt_status+'</label><label for="time-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.timePref)+'value="true" id="time-hide" name="time-hide" class="hide-column-tog" />'+edcal.str_opt_time+'</label></div><div class="metabox-prefs calendar-fields-prefs"><h5>'+
64
- edcal.str_show_wheel_opts+'</h5><label for="wheel-support"><input type="checkbox" '+edcal.isPrefChecked(edcal.wheelScrollPref)+'value="true" id="wheel-support" name="wheel-support" class="hide-column-tog" />'+edcal.str_opt_wheel+"</label></div>",a=a+('<div class="metabox-prefs"><h5>'+edcal.str_show_title+'</h5><select id="edcal_weeks_pref" class="screen-per-page" title="'+edcal.str_weekstt+'"> '),b=parseInt(edcal.weeksPref,10),c=1;9>c;c++)a=c===b?a+('<option selected="true">'+c+"</option>"):a+("<option>"+
65
- c+"</option>");a+="</select>"+edcal.str_opt_weeks+"</div>";a+='<br /><button id="edcal_applyoptions" onclick="edcal.saveOptions(); return false;" class="save button">'+edcal.str_apply+"</button>";jQuery("#contextual-help-wrap").html(a);jQuery("#contextual-help-link-wrap").css("visibility","hidden");jQuery("#contextual-help-wrap").slideDown("normal");jQuery("#screen-meta").show();jQuery("#show-edcal-settings-link").addClass("screen-meta-active")}},generateColorPicker:function(a,b,c){a='<div id="'+
66
- b+'" class="optionscolorrow">'+('<span style="background-color: '+c+';" class="colorlabel"> '+a+"</span> ");var d="lightred orange yellow lightgreen lightblue purple lightgray".split(" ");edcal.output("colors.length: "+d.length);for(var e=0;e<d.length;e++)a+='<a href="#" class="optionscolor ',d[e]===c&&(a+="colorselected"),a+='" class='+b+d[e]+'" style="background-color: '+d[e]+"; left: "+(20*e+50)+'px" onclick="edcal.selectColor(\''+b+"', '"+d[e]+"'); return false;\"></a>";return a+"</div>"},selectColor:function(a,
67
- b){edcal.output("selectColor("+a+", "+b+")");jQuery("#"+a+" .colorlabel").css("background-color",b);jQuery("#"+a+" .colorselected").removeClass("colorselected");jQuery("#"+a+"value").addClass("colorselected")},isPrefChecked:function(a){return a?' checked="checked" ':""},saveOptions:function(){var a=parseInt(jQuery("#edcal_weeks_pref").val(),10);if(1>a||8<a)humanMsg.displayMsg(edcal.str_weekserror);else{edcal.enableMouseWheel();var b=edcal.ajax_url()+"&action=edcal_saveoptions&weeks="+encodeURIComponent(jQuery("#edcal_weeks_pref").val());
68
- jQuery("div.calendar-fields-prefs").find("input, textarea, select").each(function(){b+="&"+encodeURIComponent(this.name)+"="+encodeURIComponent(this.checked)});jQuery.ajax({url:b,type:"POST",processData:!1,timeout:1E5,dataType:"text",success:function(a){window.location.href=window.location.href},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("saveOptions xhr.responseText: "+a.responseText)}})}},output:function(a){window.console&&console.log(a)},showError:function(a){window.console&&
69
- console.error(a);edcal.displayMessage(a)},displayMessage:function(a){humanMsg.displayMsg(a)},getUrlVars:function(){for(var a=[],b,c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),d=0;d<c.length;d++)b=c[d].split("="),a.push(b[0]),a[b[0]]=b[1];return a},showFatalError:function(a){jQuery("#edcal_main_title").after('<div class="error below-h2" id="message"><p>'+edcal.str_fatal_error+a+"<br></p></div>");window.console&&console.error(a)},chineseAposWorkaround:function(a){return 0===
70
- Date.CultureInfo.name.indexOf("zh")||0===Date.CultureInfo.name.indexOf("ja")?a.replace(/'/g,""):a}};jQuery.fn.center=function(){this.css("position","absolute");this.css("top",(jQuery(window).height()-this.outerHeight())/2+jQuery(window).scrollTop()+"px");this.css("left",(jQuery(window).width()-this.outerWidth())/2+jQuery(window).scrollLeft()+"px");return this};
71
  jQuery(document).ready(function(){try{edcal.init()}catch(a){edcal.output("Error loading calendar: "+a),edcal.showFatalError(a.description)}edcal.getUrlVars().qunit&&edcal_test.runTests()});
7
  edcal.createDaysHeader();jQuery("#edcal_scrollable").scrollable({vertical:!0,size:edcal.weeksPref,keyboard:!1,keyboardSteps:1,speed:100,easing:"linear"});var a=jQuery("#edcal_scrollable").scrollable();a.getConf().keyboard=!1;var b=jQuery.cookie("edcal_date");b?(b=Date.parseExact(b,"yyyy-dd-MM"),edcal.output("Resetting to date from the edcal_Date cookie: "+b)):b=Date.today();edcal.moveTo(b.clone());a.onBeforeSeek(function(a,b){return!1});edcal.enableMouseWheel();jQuery(document).bind("keydown",function(a){if(27===
8
  a.keyCode)return!1;if(!jQuery("#edcal_quickedit").is(":visible"))if(40!==a.keyCode||a.altKey||a.ctrlKey)if(38!==a.keyCode||a.altKey||a.ctrlKey){if(34===a.keyCode&&!a.altKey&&!a.ctrlKey||40===a.keyCode&&a.ctrlKey)return edcal.move(edcal.weeksPref,!0),!1;if(33===a.keyCode&&!a.altKey&&!a.ctrlKey||38===a.keyCode&&a.ctrlKey)return edcal.move(edcal.weeksPref,!1),!1}else return edcal.move(1,!1),!1;else return edcal.move(1,!0),!1});edcal.getPosts(edcal.nextStartOfWeek(b).add(-3).weeks(),edcal.nextStartOfWeek(b).add(edcal.weeksPref+
9
  3).weeks());jQuery("#moveToToday").click(function(){edcal.moveTo(Date.today());edcal.getPosts(edcal.nextStartOfWeek(Date.today()).add(-3).weeks(),edcal.nextStartOfWeek(Date.today()).add(edcal.weeksPref+3).weeks());return!1});jQuery("#moveToLast").click(function(){if("-1"!==edcal.lastPostDate){var a=Date.parseExact(edcal.lastPostDate,"ddMMyyyy");edcal.moveTo(a);edcal.getPosts(edcal.nextStartOfWeek(a).add(-3).weeks(),edcal.nextStartOfWeek(a).add(edcal.weeksPref+3).weeks());return!1}});jQuery("#prevmonth").click(function(){edcal.move(edcal.weeksPref,
10
+ !1);return!1});jQuery("#nextmonth").click(function(){edcal.move(edcal.weeksPref,!0);return!1});jQuery("#newPostScheduleButton").on("click",function(a){if(jQuery(this).hasClass("disabled"))return!1;jQuery(this).addClass("disabled");return edcal.savePost(null,!1,!0)});jQuery("#edcal-title-new-field").bind("input",function(a){(0<jQuery("#edcal-title-new-field").val().length||0<jQuery("#content").val().length)&&(!jQuery("#edcal-time").is(":visible")||0<jQuery("#edcal-time").val().length)?jQuery("#newPostScheduleButton").removeClass("disabled"):
11
+ jQuery("#newPostScheduleButton").addClass("disabled");if(13===a.keyCode)return edcal.savePost(null,!0)});jQuery("#content").bind("input",function(a){(0<jQuery("#edcal-title-new-field").val().length||0<jQuery("#content").val().length)&&(!jQuery("#edcal-time").is(":visible")||0<jQuery("#edcal-time").val().length)?jQuery("#newPostScheduleButton").removeClass("disabled"):jQuery("#newPostScheduleButton").addClass("disabled");if(13===a.keyCode)return edcal.savePost(null,!0)});jQuery("#edcal-status").bind("change",
12
+ function(a){edcal.updatePublishButton()});jQuery("#edcal_weeks_pref").on("keyup",function(a){0<jQuery("#edcal_weeks_pref").val().length?jQuery("#edcal_applyoptions").removeClass("disabled"):jQuery("#edcal_applyoptions").addClass("disabled");13===a.keyCode&&edcal.saveOptions()});edcal.savePosition();edcal.addOptionsSection();jQuery("#edcal-time").timePicker({show24Hours:"H:i"===edcal.timeFormat,separator:":",step:30});jQuery("#showdraftsdrawer").click(function(){edcal.setDraftsDrawerVisible(!edcal.isDraftsDrawerVisible)})}},
13
+ setDraftsDrawerVisible:function(a,b){var c=jQuery("#showdraftsdrawer");c.hasClass("isLoaded")?b&&b():(c.addClass("isLoaded"),edcal.setupDraftsdrawer(b));a?(jQuery("#cal_cont").css({"margin-right":"13.5%"}),jQuery("#draftsdrawer_cont").css({display:"block",width:"13%"}),c.html(edcal.str_hidedrafts)):(jQuery("#cal_cont").css({"margin-right":"0"}),jQuery("#draftsdrawer_cont").css({display:"none",width:"0"}),c.html(edcal.str_showdrafts));edcal.isDraftsDrawerVisible=a;jQuery.cookie("edcal_drafts_drawer",
14
+ a,{expires:2060})},setupDraftsdrawer:function(a){jQuery("#draftsdrawer_loading").css({display:"block"});edcal.getPosts(edcal.NO_DATE,null,function(){edcal.initDraftsdrawer();a&&a()})},initDraftsdrawer:function(){var a=""+('<a href="#" adddate="'+edcal.NO_DATE+'" class="daynewlink" style="margin-top: 5px;"title="'+edcal.str_newdraft+'" id="unscheduledNewLink" onclick="edcal.addDraft(); return false;">'+edcal.str_addDraftLink+"</a>");a=a+'<ul class="postlist">'+edcal.getPostItems(edcal.NO_DATE);a+=
15
+ "</ul>";edcal.draggablePost("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" li.post");edcal.makeDroppable(jQuery("#draftsdrawer div.day"));jQuery("#unscheduled").append(a);jQuery("#draftsdrawer_loading").css({display:"none"});a=jQuery("#cal_cont");jQuery("#unscheduled ul.postlist").css("min-height",a.height()-10-jQuery("#draftsdrawer .draftsdrawerheadcont").height()-jQuery("#unscheduledNewLink").outerHeight());jQuery("#unscheduled").mouseout(function(){jQuery("#unscheduledNewLink").hide()}).mouseover(function(){jQuery("#unscheduledNewLink").show()})},
16
+ alignGrid:function(a,b,c,d,e){if("draftsdrawer"!==jQuery(a).parent().attr("id")){var f=0,h=0,g=1;jQuery(a).each(function(){jQuery(this).css("position","relative");var a=jQuery(this).children("div");if(1===b||"rtl"!==edcal.ltr)for(var k=0;k<a.length;k++)a.eq(k).css({width:c+"%",height:d+"%",position:"absolute",left:f+"%",top:h+"%"}),0===g%b?(f=0,h+=d+e):f+=c+e,g++;else for(k=a.length-1;-1<k;k--)a.eq(k).css({width:c+"%",height:d+"%",position:"absolute",left:f+"%",top:h+"%"}),0===g%b?(f=0,h+=d+e):f+=
17
+ c+e,g++})}},alignCal:function(){edcal.alignGrid("#cal",1,100,100/edcal.weeksPref-1,1)},createDaysHeader:function(){var a=Date.today().next().sunday();edcal.nextStartOfWeek(a);var b='<div class="dayheadcont"><div class="dayhead firstday">'+a.add(edcal.startOfWeek).days().toString("dddd")+"</div>",b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+
18
+ "</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead">'+a.add(1).days().toString("dddd")+"</div>"),b=b+('<div class="dayhead lastday">'+a.add(1).days().toString("dddd")+"</div>");jQuery("#cal_cont").prepend(b);edcal.alignGrid(".dayheadcont",7,13.8,100,.5)},getDateClass:function(a){var b;var c=-1===a.compareTo(Date.today())?"beforeToday":"todayAndAfter";edcal.firstDayOfMonth||(edcal.firstDayOfMonth=Date.today().moveToFirstDayOfMonth().clearTime(),
19
+ edcal.firstDayOfNextMonth=Date.today().moveToLastDayOfMonth().clearTime());a.between(edcal.firstDayOfMonth,edcal.firstDayOfNextMonth)?b="month-present":1===a.compareTo(edcal.firstDayOfMonth)?b="month-future":-1===a.compareTo(edcal.firstDayOfNextMonth)&&(b="month-past");"01"===a.toString("dd")&&(c+=" firstOfMonth");return b+" "+c},showAddPostLink:function(a){edcal.inDrag||(a=jQuery("#"+a+" a.daynewlink"),a.css("display","block"),a.bind("click",edcal.addPost))},hideAddPostLink:function(a){jQuery("#"+
20
+ a+" a.daynewlink").hide().unbind("click",edcal.addPost)},createRow:function(a,b){for(var c=edcal._wDate.clone(),d='<div class="rowcont" id="row'+edcal._wDate.toString(edcal.internalDateFormat)+'"><div id="row'+edcal._wDate.toString(edcal.internalDateFormat)+'row" class="edcal_row">',e=0;7>e;e++)d+="<div onmouseover=\"edcal.showAddPostLink('"+c.toString(edcal.internalDateFormat)+"');\" onmouseout=\"edcal.hideAddPostLink('"+c.toString(edcal.internalDateFormat)+'\');" id="'+c.toString(edcal.internalDateFormat)+
21
+ '" class="day '+edcal.getDateClass(c)+" "+c.toString("dddd").toLowerCase()+" month-"+c.toString("MM").toLowerCase()+'">',d+='<div class="dayobj">',d+='<a href="#" adddate="'+c.toString("MMMM d")+'" class="daynewlink" title="'+sprintf(edcal.str_newpost,edcal.chineseAposWorkaround(c.toString(Date.CultureInfo.formatPatterns.monthDay)))+'" onclick="return false;">'+edcal.str_addPostLink+"</a>",d="01"===c.toString("dd")?d+('<div class="daylabel">'+c.toString("MMM d")):d+('<div class="daylabel">'+c.toString("d")),
22
+ d+="</div>",d+='<ul class="postlist">',d+=edcal.getPostItems(c.toString(edcal.internalDateFormat)),d+="</ul>",d+="</div>",d+="</div>",c.add(1).days();d+="</div></div>";b?a.append(d):a.prepend(d);edcal.alignGrid("#row"+edcal._wDate.toString(edcal.internalDateFormat)+"row",7,13.9,100,.5);edcal.draggablePost("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" li.post");edcal.makeDroppable(jQuery("#row"+edcal._wDate.toString(edcal.internalDateFormat)+" > div > div.day"));return jQuery("row"+edcal._wDate.toString(edcal.internalDateFormat))},
23
+ makeDroppable:function(a){a.droppable({hoverClass:"day-active",accept:function(a){return jQuery(this).hasClass("beforeToday")?a.hasClass("draft")?!0:!1:!0},greedy:!0,tolerance:"pointer",drop:function(a,c){a=c.draggable.parent().parent().parent().attr("id");edcal.doDrop(a,c.draggable.attr("id"),jQuery(this).attr("id"))}})},doDrop:function(a,b,c,d){var e=edcal.findPostForId(a,b);edcal.removePostFromMap(a,b);var f=jQuery("#"+b);f.detach();setTimeout(function(){f.remove()},500);jQuery("#"+c+" .postlist").append(edcal.createPostItem(e,
24
+ c));a===c?edcal.draggablePost("#"+c+" .post"):edcal.changeDate(c,e,d)},draggablePost:function(a){jQuery(a).each(function(){var a=edcal.findPostForId(jQuery(this).parent().parent().parent().attr("id"),jQuery(this).attr("id"));edcal.isPostMovable(a)&&(jQuery(this).draggable({revert:"invalid",appendTo:"body",helper:"clone",distance:1,addClasses:!1,start:function(){edcal.inDrag=!0},stop:function(){edcal.inDrag=!1},drag:function(a,b){edcal.handleDrag(a,b)},scroll:!1,refreshPositions:!0}),jQuery(this).addClass("draggable"))})},
25
+ handleDrag:function(a,b){edcal.isMoving||edcal.isDragScrolling||(edcal.isDragScrolling=!0,a.pageY<edcal.position.top+10?edcal.move(1,!1):a.pageY>edcal.position.bottom-10&&edcal.move(1,!0),setTimeout(function(){edcal.isDragScrolling=!1},300))},removePostFromMap:function(a,b){if(edcal.posts[a])for(var c=0;c<edcal.posts[a].length;c++)if(edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b)return edcal.posts[a][c]=null,!0;return!1},addPostItem:function(a,b){jQuery("#"+b+" > div > ul").append(edcal.createPostItem(a,
26
+ b))},addPostItemDragAndToolltip:function(a){edcal.draggablePost("#"+a+" > div > ul > li")},deletePost:function(a,b){a=edcal.ajax_url()+"&action=edcal_deletepost&postid="+a;jQuery.ajax({url:a,type:"POST",processData:!1,timeout:1E5,dataType:"json",success:function(a){a.post.date_gmt===edcal.NO_DATE?edcal.removePostItem(a.post.date_gmt,"post-"+a.post.id):edcal.removePostItem(a.post.date,"post-"+a.post.id);a.error?a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error):edcal.output('Finished deleting the post: "'+
27
+ a.post.title+'" with id:'+a.post.id);b&&b(a)},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("deletePost xhr.responseText: "+a.responseText)}})},confirmDelete:function(a){return confirm(edcal.str_del_msg1+a+edcal.str_del_msg2)?!0:!1},ajax_url:function(){return ajaxurl+"?_wpnonce="+edcal.wp_nonce},getMediaBar:function(){return jQuery("#cal_mediabar").html()},addPost:function(){jQuery("#newPostScheduleButton").addClass("disabled");var a=jQuery(this).parent().parent().attr("id"),
28
+ b=edcal.defaultTime;"H:i"!==edcal.timeFormat&&"G:i"!==edcal.timeFormat&&(b+=" AM");a={id:0,date:a,formatteddate:edcal.getDayFromDayId(a).toString(edcal.previewDateFormat),time:b};edcal.showForm(a);return!1},addDraft:function(){jQuery("#newPostScheduleButton").addClass("disabled");var a={id:0,date:Date.today(),formatteddate:edcal.NO_DATE,time:edcal.NO_DATE,status:"draft"};edcal.showForm(a);return!1},editPost:function(a){jQuery("#newPostScheduleButton").removeClass("disabled");edcal.getPost(a,edcal.showForm);
29
+ return!1},savePost:function(a,b,c,d){if("undefined"===typeof a||null===a)a=edcal.serializePost();jQuery("#edit-slug-buttons").addClass("tiploading");var e=a.time.toUpperCase();"12"===e.slice(0,2)&&"PM"===e.slice(e.length-2,e.length)?a.time="12:"+e.slice(3,5):"12"===e.slice(0,2)&&"AM"===e.slice(a.time.length-2,a.time.length)&&(a.time="00:"+e.slice(3,5));var e=""!==a.time?Date.parse(a.time):Date.parse(edcal.defaultTime);if(null!==e&&e!==edcal.NO_DATE){var f=e.format("H:i:s");var h=encodeURIComponent(edcal.getDayFromDayId(a.date).toString(edcal.wp_dateFormat)+
30
+ " "+f)}else h=encodeURIComponent(a.date.toString(edcal.wp_dateFormat+" H:i:s"));f=edcal.ajax_url()+"&action=edcal_savepost";a="date="+h+"&title="+encodeURIComponent(a.title)+"&content="+encodeURIComponent(a.content)+"&id="+encodeURIComponent(a.id)+"&status="+encodeURIComponent(a.status)+"&orig_status="+encodeURIComponent(a.orig_status);if(null===e||e===edcal.NO_DATE)a+="&date_gmt="+encodeURIComponent("0000-00-00 00:00:00");edcal.getUrlVars().post_type&&(a+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type));
31
+ c&&(a+="&dopublish="+encodeURIComponent("future"));jQuery.ajax({url:f,type:"POST",processData:!1,data:a,timeout:1E5,dataType:"json",success:function(a){jQuery("#edit-slug-buttons").removeClass("tiploading");jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;if(a.error)return a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error),!1;if(a.post)if(b)window.location=a.post.editlink.replace("&amp;","&");else{var c=a.post.date;a.post.date_gmt===
32
+ edcal.NO_DATE&&(c=a.post.date_gmt);a.post.id&&edcal.removePostItem(c,"post-"+a.post.id);edcal.addPostItem(a.post,c);edcal.addPostItemDragAndToolltip(c)}else edcal.showError("There was an error creating a new post for your blog.");d&&d(a);return!0},error:function(a){jQuery("#edit-slug-buttons").removeClass("tiploading");jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;edcal.showError(edcal.general_error);a.responseText&&edcal.output("savePost xhr.responseText: "+
33
+ a.responseText)}});return!1},serializePost:function(){var a={};jQuery("#edcal_quickedit").find("input, textarea, select").each(function(){a[this.name]=this.value});return a},showForm:function(a){edcal.resetForm();a.formatteddate===edcal.NO_DATE||a.date_gmt===edcal.NO_DATE?jQuery("#timeEditControls").hide():jQuery("#timeEditControls").show();jQuery("#edcal_quickedit").center().show();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!1;a.id?(jQuery("#tooltiptitle").text(sprintf(edcal.str_edit_post_title,
34
+ a.typeTitle,edcal.getDayFromDayId(a.date).toString(edcal.previewDateFormat))),jQuery("#edcal-title-new-field").val(a.title),jQuery("#content").val(a.content)):a.formatteddate===edcal.NO_DATE?jQuery("#tooltiptitle").text(edcal.str_newdraft_title):jQuery("#tooltiptitle").text(edcal.str_newpost_title+a.formatteddate);"future"===a.status&&jQuery("#newPostScheduleButton").text(edcal.str_update);a.status?(jQuery("#edcal-status").val(a.status),edcal.updatePublishButton()):(0!==jQuery("#edcal-status option[value="+
35
+ edcal.defaultStatus+"]").length?jQuery("#edcal-status").val(edcal.defaultStatus):jQuery("#edcal-status").val("draft"),jQuery("#newPostScheduleButton").text(edcal.str_save));a.status&&"draft"!==a.status&&"future"!==a.status&&"pending"!==a.status&&(jQuery("#edcal-status").attr("disabled","true"),jQuery("#edcal-status").append('<option class="temp" value="'+a.status+'">'+a.status+"</option>"),jQuery("#edcal-status").val(a.status));a.formatteddate!==edcal.NO_DATE&&-1===edcal.getDayFromDayId(a.date).compareTo(Date.today())&&
36
+ jQuery("#edcal-status").attr("disabled","true");var b=a.time;jQuery("#edcal-time").val(b);jQuery("#edcal-date").val(a.date);jQuery("#edcal-id").val(a.id);jQuery("#edcal-title-new-field").focus();jQuery("#edcal-title-new-field").select()},hideForm:function(){jQuery("#edcal_quickedit").hide();jQuery("#edcal_scrollable").data("scrollable").getConf().keyboard=!0;edcal.resetForm()},resetForm:function(){jQuery("#edcal_quickedit").find("input, textarea, select").each(function(){this.value=""});jQuery("#edcal-status").removeAttr("disabled");
37
+ jQuery("#newPostScheduleButton").text(edcal.str_publish);jQuery("#tooltiptitle").text("");jQuery("#edcal-status").removeAttr("disabled");jQuery("#edcal-status .temp").remove()},createPostItem:function(a,b){edcal.posts[b]||(edcal.posts[b]=[]);edcal.posts[b][edcal.posts[b].length]=a;return edcal.getPostItemString(a)},findPostForId:function(a,b){if(edcal.posts[a])for(var c=0;c<edcal.posts[a].length;c++)if(edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b)return edcal.posts[a][c];return null},removePostItem:function(a,
38
+ b){if(edcal.findPostForId(a,b))for(var c=0;c<edcal.posts[a].length;c++)edcal.posts[a][c]&&"post-"+edcal.posts[a][c].id===b&&(edcal.posts[a][c]=null);jQuery("#"+b).remove()},getPostItems:function(a){var b="";if(edcal.posts[a]){var c=edcal.posts[a];if(50>c.length)for(a=0;a<c.length;a++)c[a]&&(b+=edcal.getPostItemString(c[a]));else edcal.addPostItems(a,0,50)}return b},addPostItems:function(a,b,c){var d=edcal.posts[a],e="";setTimeout(function(){for(var f=b;f<b+c&&f<d.length;f++)d[f]&&(e+=edcal.getPostItemString(d[f]));
39
+ jQuery("#"+a+" ul").append(e);b+c<d.length&&edcal.addPostItems(a,b+c,50)},100)},showActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);var b=edcal.findPostForId(jQuery("#"+a).parent().parent().parent().attr("id"),a);if(!edcal.inDrag&&edcal.isPostEditable(b)){var c=jQuery("#"+a+" > div.postactions");edcal.actionLinksElem&&edcal.actionLinksElem.get(0)!==c.get(0)&&edcal.actionLinksElem.slideUp();edcal.actionLinksElem=c;edcal.actionTimer=setTimeout(function(){c.slideDown();if(c.parent().position().top+
40
+ c.parent().height()>c.parent().parent().height()){var b=jQuery("#"+a+" > div.postactions").parent().parent();b.scrollTop(b.scrollTop()+45)}},250)}},hideActionLinks:function(a){edcal.actionTimer&&clearTimeout(edcal.actionTimer);edcal.actionTimer=setTimeout(function(){jQuery("#"+a+" > div.postactions").slideUp();edcal.actionLinksElem=null},1E3)},isPostMovable:function(a){return a.editlink&&"publish"!==a.status},isPostEditable:function(a){return a.editlink},getPostEditableClass:function(a){return a.editlink?
41
+ "":"readonly"},getPostItemString:function(a){var b=a.title;""===b&&(b="[No Title]");edcal.statusPref&&("draft"===a.status&&"1"===a.sticky?b+=edcal.str_draft_sticky:"pending"===a.status&&"1"===a.sticky?b+=edcal.str_pending_sticky:"1"===a.sticky?b+=edcal.str_sticky:"pending"===a.status?b+=edcal.str_pending:"draft"===a.status?b+=edcal.str_draft:"publish"!==a.status&&"future"!==a.status&&"pending"!==a.status&&(b+=" ["+a.status+"]"));edcal.timePref&&(b='<span class="posttime">'+a.formattedtime+"</span> "+
42
+ b);edcal.authorPref&&(b=sprintf(edcal.str_by,b,'<span class="postauthor">'+a.author+"</span>"));return edcal.isPostMovable(a)?"<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+a.slugs+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_edit+'</a> | <a href="#" onclick="edcal.editPost('+a.id+'); return false;">'+
43
+ edcal.str_quick_edit+'</a> | <a href="'+a.dellink+'" onclick="return edcal.confirmDelete(\''+a.title+"');\">"+edcal.str_del+'</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>":"<li onmouseover=\"edcal.showActionLinks('post-"+a.id+"');\" onmouseout=\"edcal.hideActionLinks('post-"+a.id+'\');" id="post-'+a.id+'" class="post '+a.status+" "+edcal.getPostEditableClass(a)+'"><div class="postlink "><span>'+b+'</span></div><div class="postactions"><a href="'+a.editlink+'">'+edcal.str_republish+
44
+ '</a> | <a href="'+a.permalink+'">'+edcal.str_view+"</a></div></li>"},setClassforToday:function(){jQuery("#"+Date.today().toString(edcal.internalDateFormat)).addClass("today")},getCalHeight:function(){var a=jQuery(window).height()-jQuery("#footer").height()-jQuery("#wphead").height()-150;return Math.max(a,500)},move:function(a,b,c){if(!jQuery("#edcal_quickedit").is(":visible")){edcal.currentDirection!==b&&(edcal._wDate=b?edcal._wDate.add(7*(edcal.weeksPref+7)).days():edcal._wDate.add(-(7*(edcal.weeksPref+
45
+ 7))).days(),edcal.steps=0,edcal.moveDate=edcal._wDate);edcal.currentDirection=b;var d;if(b)for(d=0;d<a;d++)jQuery("#cal > div:first").remove(),edcal.createRow(jQuery("#cal"),!0),edcal._wDate.add(7).days();else for(d=0;d<a;d++)jQuery("#cal > div:last").remove(),edcal.createRow(jQuery("#cal"),!1),edcal._wDate.add(-7).days();edcal.alignCal();edcal.setClassforToday();edcal.setDateLabel();edcal.steps+=a;edcal.tID?clearTimeout(edcal.tID):edcal.moveDate=edcal._wDate;edcal.tID=setTimeout(function(){b?edcal.getPosts(edcal._wDate.clone().add(-7*
46
+ (edcal.steps+1)).days(),edcal._wDate.clone(),c):edcal.getPosts(edcal._wDate.clone(),edcal._wDate.clone().add(7*(edcal.steps+1)).days(),c);edcal.steps=0;edcal.tID=null;edcal.moveDate=edcal._wDate},1E3);b?jQuery.cookie("edcal_date",edcal._wDate.clone().add(-(edcal.weeksPref+4)).weeks().toString("yyyy-dd-MM")):jQuery.cookie("edcal_date",edcal._wDate.clone().add(3).weeks().toString("yyyy-dd-MM"))}},getDayFromDayId:function(a){return Date.parseExact(a.substring(2,4)+"/"+a.substring(0,2)+"/"+a.substring(4),
47
+ "MM/dd/yyyy")},setDateLabel:function(a){var b=jQuery("#edcal_scrollable").scrollable().getVisibleItems();a=edcal.getDayFromDayId(b.eq(0).children(".edcal_row").children(".day:first").attr("id"));b=edcal.getDayFromDayId(b.eq(edcal.weeksPref-1).children(".edcal_row").children(".day:last").attr("id"));jQuery("#currentRange").text(edcal.chineseAposWorkaround(a.toString(Date.CultureInfo.formatPatterns.yearMonth))+" - "+edcal.chineseAposWorkaround(b.toString(Date.CultureInfo.formatPatterns.yearMonth)))},
48
+ nextStartOfWeek:function(a){a=a.clone();if(null===edcal.startOfWeek)if(edcal.locale){var b=edcal.locale.toUpperCase();edcal.endsWith(b,"AS")||edcal.endsWith(b,"AZ")||edcal.endsWith(b,"BW")||edcal.endsWith(b,"CA")||edcal.endsWith(b,"CN")||edcal.endsWith(b,"FO")||edcal.endsWith(b,"GB")||edcal.endsWith(b,"GE")||edcal.endsWith(b,"GL")||edcal.endsWith(b,"GU")||edcal.endsWith(b,"HK")||edcal.endsWith(b,"IE")||edcal.endsWith(b,"IL")||edcal.endsWith(b,"IN")||edcal.endsWith(b,"IS")||edcal.endsWith(b,"JM")||
49
+ edcal.endsWith(b,"JP")||edcal.endsWith(b,"KG")||edcal.endsWith(b,"KR")||edcal.endsWith(b,"LA")||edcal.endsWith(b,"MH")||edcal.endsWith(b,"MN")||edcal.endsWith(b,"MO")||edcal.endsWith(b,"MP")||edcal.endsWith(b,"MT")||edcal.endsWith(b,"NZ")||edcal.endsWith(b,"PH")||edcal.endsWith(b,"PK")||edcal.endsWith(b,"SG")||edcal.endsWith(b,"SY")||edcal.endsWith(b,"TH")||edcal.endsWith(b,"TT")||edcal.endsWith(b,"TW")||edcal.endsWith(b,"UM")||edcal.endsWith(b,"US")||edcal.endsWith(b,"UZ")||edcal.endsWith(b,"VI")||
50
+ edcal.endsWith(b,"ZW")?edcal.startOfWeek=0:edcal.endsWith(b,"MV")?edcal.startOfWeek=5:edcal.endsWith(b,"AF")||edcal.endsWith(b,"BH")||edcal.endsWith(b,"DJ")||edcal.endsWith(b,"DZ")||edcal.endsWith(b,"EG")||edcal.endsWith(b,"ER")||edcal.endsWith(b,"ET")||edcal.endsWith(b,"IQ")||edcal.endsWith(b,"IR")||edcal.endsWith(b,"JO")||edcal.endsWith(b,"KE")||edcal.endsWith(b,"KW")||edcal.endsWith(b,"LY")||edcal.endsWith(b,"MA")||edcal.endsWith(b,"OM")||edcal.endsWith(b,"QA")||edcal.endsWith(b,"SA")||edcal.endsWith(b,
51
+ "SD")||edcal.endsWith(b,"SO")||edcal.endsWith(b,"TN")||edcal.endsWith(b,"YE")?edcal.startOfWeek=6:edcal.startOfWeek=1}else edcal.startOfWeek=0;return a.next().sunday().add(edcal.startOfWeek).days()},endsWith:function(a,b){return a.match(b+"$")===b},moveTo:function(a){edcal.isMoving=!0;jQuery("#cal").empty();jQuery.cookie("edcal_date",a.toString("yyyy-dd-MM"));edcal._wDate=edcal.nextStartOfWeek(a).add(-21).days();edcal.currentDirection=!0;a=edcal.weeksPref+6;for(var b=0;b<a;b++)edcal.createRow(jQuery("#cal"),
52
+ !0),edcal._wDate.add(7).days();edcal.alignCal();jQuery("#edcal_scrollable").scrollable().move(2);edcal.setDateLabel();edcal.setClassforToday();edcal.isMoving=!1},savePosition:function(){var a=jQuery("#edcal_scrollable"),b=jQuery("#cal_cont");edcal.position={top:a.offset().top,bottom:a.offset().top+a.height()};jQuery("#edcal_poststyle").remove();a=jQuery(".rowcont:eq(2) .dayobj:first").height()-jQuery(".rowcont:eq(2) .daylabel:first").height()-6;jQuery("head").append('<style id="edcal_poststyle" type="text/css">.ui-draggable-dragging {width: '+
53
+ (jQuery(".rowcont:eq(2) .day:first").width()-5)+"px;}.postlist {height: "+a+"px;}</style>");jQuery("#draftsdrawer").css("height",b.height());jQuery("#draftsdrawer .day").css("min-height",b.height()-10-jQuery("#draftsdrawer .draftsdrawerheadcont").height())},addFeedbackSection:function(){3<edcal.visitCount&&edcal.doFeedbackPref&&jQuery("#edcal_main_title").after(edcal.str_feedbackmsg)},doFeedback:function(){jQuery.getScript("http://www.zackgrossbart.com/edcal/mint/?js",function(){edcal.saveFeedbackPref()})},
54
+ noFeedback:function(){jQuery("#feedbacksection").hide("fast");edcal.saveFeedbackPref()},saveFeedbackPref:function(){var a=edcal.ajax_url()+"&action=edcal_saveoptions&dofeedback="+encodeURIComponent("done");jQuery.ajax({url:a,type:"POST",processData:!1,timeout:1E5,dataType:"text",success:function(a){jQuery("#feedbacksection").html(edcal.str_feedbackdone);setTimeout(function(){jQuery("#feedbacksection").hide("slow")},5E3)},error:function(a){edcal.showError(edcal.general_error);a.responseText&&edcal.output("saveOptions xhr.responseText: "+
55
+ a.responseText)}})},updatePublishButton:function(){"future"===jQuery("#edcal-status").val()&&jQuery("#newPostScheduleButton").text(edcal.str_publish);"pending"===jQuery("#edcal-status").val()?jQuery("#newPostScheduleButton").text(edcal.str_review):jQuery("#newPostScheduleButton").text(edcal.str_save)},changeDate:function(a,b,c){var d=a===edcal.NO_DATE,e=b.date_gmt===edcal.NO_DATE,f=d?"0000-00-00":edcal.getDayFromDayId(a).toString(edcal.wp_dateFormat),h=e?b.date_gmt:edcal.getDayFromDayId(b.date).toString(edcal.wp_dateFormat);
56
+ d&&(b.status="draft");f=edcal.ajax_url()+"&action=edcal_changedate&postid="+b.id+"&postStatus="+b.status+"&newdate="+f+"&olddate="+h;jQuery("#post-"+b.id).addClass("loadingclass");jQuery.ajax({url:f,type:"POST",processData:!1,timeout:1E5,dataType:"json",success:function(b){b.error&&(edcal.removePostItem(a,"post-"+b.post.id),b.error===edcal.CONCURRENCY_ERROR?edcal.displayMessage(edcal.concurrency_error+"<br />"+b.post.title):b.error===edcal.PERMISSION_ERROR?edcal.displayMessage(edcal.permission_error):
57
+ b.error===edcal.NONCE_ERROR&&edcal.displayMessage(edcal.checksum_error));var f=d?"00000000":b.post.date,g=e?a:f;edcal.removePostItem(f,"post-"+b.post.id);edcal.addPostItem(b.post,g);edcal.addPostItemDragAndToolltip(g);c&&c(b)},error:function(a,b,c){edcal.showError(edcal.general_error);edcal.output("textStatus: "+b);edcal.output("error: "+c);a.responseText&&edcal.output("changeDate xhr.responseText: "+a.responseText)}})},getPosts:function(a,b,c){b||(b="");edcal.cacheDates[a]?c&&c():(edcal.cacheDates[a]=
58
+ !0,b=edcal.ajax_url()+"&action=edcal_posts&from="+a.toString("yyyy-MM-dd")+"&to="+b.toString("yyyy-MM-dd"),edcal.getUrlVars().post_type&&(b+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type)),jQuery("#loading").show(),jQuery.ajax({url:b,type:"GET",processData:!1,timeout:1E5,dataType:"text",success:function(b){jQuery("#loading").hide();var d=null;try{d=JSON.parseIt(b)}catch(l){edcal.showFatalError(edcal.str_fatal_parse_error+l.message);window.console&&console.error(l);return}if(d.error)d.error===
59
+ edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error);else{for(var f=[],h=d.length;0<=h;h--){var g=d[h];g&&"trash"!==g.status&&(g.date=g.date.replace(g.date.substring(2,3),g.date.substring(2,3).toUpperCase()),"00000000"===a&&(g.date=a),edcal.removePostItem(g.date,"post-"+g.id),edcal.addPostItem(g,g.date),f[f.length]=g.date)}setTimeout(function(){jQuery.each(f,function(a,b){edcal.addPostItemDragAndToolltip(b)})},300);c&&c(b)}},error:function(a){edcal.showError(edcal.general_error);a.responseText&&
60
+ edcal.output("getPosts xhr.responseText: "+a.responseText)}}))},getPost:function(a,b){if(0===a)return!1;jQuery("#loading").show();a=edcal.ajax_url()+"&action=edcal_getpost&postid="+a;edcal.getUrlVars().post_type&&(a+="&post_type="+encodeURIComponent(edcal.getUrlVars().post_type));jQuery.ajax({url:a,type:"GET",processData:!1,timeout:1E5,dataType:"json",success:function(a){jQuery("#loading").hide();edcal.output("xhr for getPost returned: "+a);if(a.error)return a.error===edcal.NONCE_ERROR&&edcal.showError(edcal.checksum_error),
61
+ !1;"function"===typeof b&&b(a.post);return a.post},error:function(a){jQuery("#loading").hide();edcal.showError(edcal.general_error);a.responseText&&edcal.output("getPost xhr.responseText: "+a.responseText);return!1}});return!0},addOptionsSection:function(){var a='<div class="hide-if-no-js screen-meta-toggle" id="screen-options-link-wrap"><a class="show-settings" id="show-edcal-settings-link" onclick="edcal.toggleOptions(); return false;" href="#" >'+edcal.str_screenoptions+"</a></div>";0===jQuery("#screen-meta-links").length&&
62
+ jQuery("#screen-meta").after('<div id="screen-meta-links"></div>');jQuery("#screen-meta-links").append(a)},toggleOptions:function(){if(edcal.helpMeta)jQuery("#contextual-help-wrap").slideUp("fast"),jQuery("#contextual-help-wrap").html(edcal.helpMeta),edcal.helpMeta=null,jQuery("#show-edcal-settings-link").removeClass("screen-meta-active"),jQuery("#contextual-help-link-wrap").css("visibility","");else{edcal.helpMeta=jQuery("#contextual-help-wrap").html();for(var a='<div class="metabox-prefs calendar-fields-prefs"><h5>'+
63
+ edcal.str_show_opts+'</h5><label for="author-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.authorPref)+'value="true" id="author-hide" name="author-hide" class="hide-column-tog" />'+edcal.str_opt_author+'</label><label for="status-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.statusPref)+'value="true" id="status-hide" name="status-hide" class="hide-column-tog" />'+edcal.str_opt_status+'</label><label for="time-hide"><input type="checkbox" '+edcal.isPrefChecked(edcal.timePref)+
64
+ 'value="true" id="time-hide" name="time-hide" class="hide-column-tog" />'+edcal.str_opt_time+'</label></div><div class="metabox-prefs calendar-fields-prefs"><h5>'+edcal.str_show_wheel_opts+'</h5><label for="wheel-support"><input type="checkbox" '+edcal.isPrefChecked(edcal.wheelScrollPref)+'value="true" id="wheel-support" name="wheel-support" class="hide-column-tog" />'+edcal.str_opt_wheel+"</label></div>",a=a+('<div class="metabox-prefs"><h5>'+edcal.str_show_title+'</h5><select id="edcal_weeks_pref" class="screen-per-page" title="'+
65
+ edcal.str_weekstt+'"> '),b=parseInt(edcal.weeksPref,10),c=1;9>c;c++)a=c===b?a+('<option selected="true">'+c+"</option>"):a+("<option>"+c+"</option>");a+="</select>"+edcal.str_opt_weeks+"</div>";a+='<br /><button id="edcal_applyoptions" onclick="edcal.saveOptions(); return false;" class="save button">'+edcal.str_apply+"</button>";jQuery("#contextual-help-wrap").html(a);jQuery("#contextual-help-link-wrap").css("visibility","hidden");jQuery("#contextual-help-wrap").slideDown("normal");jQuery("#screen-meta").show();
66
+ jQuery("#show-edcal-settings-link").addClass("screen-meta-active")}},generateColorPicker:function(a,b,c){a='<div id="'+b+'" class="optionscolorrow">'+('<span style="background-color: '+c+';" class="colorlabel"> '+a+"</span> ");var d="lightred orange yellow lightgreen lightblue purple lightgray".split(" ");edcal.output("colors.length: "+d.length);for(var e=0;e<d.length;e++)a+='<a href="#" class="optionscolor ',d[e]===c&&(a+="colorselected"),a+='" class='+b+d[e]+'" style="background-color: '+d[e]+"; left: "+
67
+ (20*e+50)+'px" onclick="edcal.selectColor(\''+b+"', '"+d[e]+"'); return false;\"></a>";return a+"</div>"},selectColor:function(a,b){edcal.output("selectColor("+a+", "+b+")");jQuery("#"+a+" .colorlabel").css("background-color",b);jQuery("#"+a+" .colorselected").removeClass("colorselected");jQuery("#"+a+"value").addClass("colorselected")},isPrefChecked:function(a){return a?' checked="checked" ':""},saveOptions:function(){var a=parseInt(jQuery("#edcal_weeks_pref").val(),10);if(1>a||8<a)humanMsg.displayMsg(edcal.str_weekserror);
68
+ else{edcal.enableMouseWheel();var b=edcal.ajax_url()+"&action=edcal_saveoptions&weeks="+encodeURIComponent(jQuery("#edcal_weeks_pref").val());jQuery("div.calendar-fields-prefs").find("input, textarea, select").each(function(){b+="&"+encodeURIComponent(this.name)+"="+encodeURIComponent(this.checked)});jQuery.ajax({url:b,type:"POST",processData:!1,timeout:1E5,dataType:"text",success:function(a){window.location.href=window.location.href},error:function(a){edcal.showError(edcal.general_error);a.responseText&&
69
+ edcal.output("saveOptions xhr.responseText: "+a.responseText)}})}},output:function(a){window.console&&console.log(a)},showError:function(a){window.console&&console.error(a);edcal.displayMessage(a)},displayMessage:function(a){humanMsg.displayMsg(a)},getUrlVars:function(){for(var a=[],b,c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),d=0;d<c.length;d++)b=c[d].split("="),a.push(b[0]),a[b[0]]=b[1];return a},showFatalError:function(a){jQuery("#edcal_main_title").after('<div class="error below-h2" id="message"><p>'+
70
+ edcal.str_fatal_error+a+"<br></p></div>");window.console&&console.error(a)},chineseAposWorkaround:function(a){return 0===Date.CultureInfo.name.indexOf("zh")||0===Date.CultureInfo.name.indexOf("ja")?a.replace(/'/g,""):a}};jQuery.fn.center=function(){this.css("position","absolute");this.css("top",(jQuery(window).height()-this.outerHeight())/2+jQuery(window).scrollTop()+"px");this.css("left",(jQuery(window).width()-this.outerWidth())/2+jQuery(window).scrollLeft()+"px");return this};
71
  jQuery(document).ready(function(){try{edcal.init()}catch(a){edcal.output("Error loading calendar: "+a),edcal.showFatalError(a.description)}edcal.getUrlVars().qunit&&edcal_test.runTests()});
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.7.4
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
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.7.5
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
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: 4.0
5
- Tested up to: 5.2.2
6
- Stable tag: 3.7.4
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.7.4 =
199
 
200
  Fixed a specific issue which made the calendar show up as right to left instead of left to right in Dutch.
2
  Contributors: cvernon, justinstresslimit, jkudish, MaryVogt, zgrossbart
3
  Tags: posts, post, calendar, AJAX, admin, administration
4
  Requires at least: 4.0
5
+ Tested up to: 5.2.3
6
+ Stable tag: 3.7.5
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.7.5 =
199
+
200
+ The calendar now support quick edit when a post has either a title or content instead of requiring a title.
201
+
202
  = 3.7.4 =
203
 
204
  Fixed a specific issue which made the calendar show up as right to left instead of left to right in Dutch.