var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(t){var s=[];return jQuery.each(t,function(t,e){(e=jQuery.trim(e))&&-1==jQuery.inArray(e,s)&&s.push(e)}),s}!function(c){tagBox={clean:function(t){var e=postL10n.comma;return t=(t=","!==e?t.replace(new RegExp(e,"g"),","):t).replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),t=","!==e?t.replace(/,/g,e):t},parseTags:function(t){var e=t.id.split("-check-num-")[1],s=c(t).closest(".tagsdiv"),i=s.find(".the-tags"),n=postL10n.comma,t=i.val().split(n),a=[];return delete t[e],c.each(t,function(t,e){(e=c.trim(e))&&a.push(e)}),i.val(this.clean(a.join(n))),this.quickClicks(s),!1},quickClicks:function(t){var s,e=c(".the-tags",t),i=c(".tagchecklist",t),n=c(t).attr("id");e.length&&(s=e.prop("disabled"),e=e.val().split(postL10n.comma),i.empty(),c.each(e,function(t,e){(e=c.trim(e))&&(e=c("").text(e),s||((t=c('X')).click(function(){tagBox.parseTags(this)}),e.prepend(" ").prepend(t)),i.append(e))}))},flushTags:function(t,e,s){var i,n=c(".the-tags",t),a=c("input.newtag",t),o=postL10n.comma,l=(e=e||!1)?c(e).text():a.val(),l=(i=n.val())?i+o+l:l;return l=array_unique_noempty((l=this.clean(l)).split(o)).join(o),n.val(l),this.quickClicks(t),e||a.val(""),void 0===s&&a.focus(),!1},get:function(s){var i=s.substr(s.indexOf("-")+1);c.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e||(t=wpAjax.broken),t=c('
'+t+"
"),c("a",t).click(function(){return tagBox.flushTags(c(this).closest(".inside").children(".tagsdiv"),this),!1}),c("#"+s).after(t)})},init:function(){var t=this,e=c("div.ajaxtag");c(".tagsdiv").each(function(){tagBox.quickClicks(this)}),c("input.tagadd",e).click(function(){t.flushTags(c(this).closest(".tagsdiv"))}),c("div.taghint",e).click(function(){c(this).css("visibility","hidden").parent().siblings(".newtag").focus()}),c("input.newtag",e).blur(function(){""===this.value&&c(this).parent().siblings(".taghint").css("visibility","")}).focus(function(){c(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(t){if(13==t.which)return tagBox.flushTags(c(this).closest(".tagsdiv")),!1}).keypress(function(t){if(13==t.which)return t.preventDefault(),!1}).each(function(){var t=c(this).closest("div.tagsdiv").attr("id");c(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+t,{delay:500,minchars:2,multiple:!0,multipleSep:postL10n.comma+" "})}),c("#post").submit(function(){c("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),c("a.tagcloud-link").click(function(){return tagBox.get(c(this).attr("id")),c(this).unbind().click(function(){return c(this).siblings(".the-tagcloud").toggle(),!1}),!1})}},commentsBox={st:0,get:function(t,e){var s=this.st;return e=e||20,this.st+=e,this.total=t,c("#commentsdiv .spinner").show(),e={action:"get-comments",mode:"single",_ajax_nonce:c("#add_comment_nonce").val(),p:c("#post_ID").val(),start:s,number:e},c.post(ajaxurl,e,function(t){return t=wpAjax.parseAjaxResponse(t),c("#commentsdiv .widefat").show(),c("#commentsdiv .spinner").hide(),"object"==typeof t&&t.responses[0]?(c("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,c("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?c("#show-comments").hide():c("#show-comments").show().children("a").html(postL10n.showcomm))):void(1!=t?c("#the-comment-list").append('| '+wpAjax.broken+" |
"):c("#show-comments").html(postL10n.endcomm))}),!1}},WPSetThumbnailHTML=function(t){c(".inside","#postimagediv").html(t)},WPSetThumbnailID=function(t){var e=c('input[value="_thumbnail_id"]',"#list-table");0').attr("src",s.lock_error.avatar_src.replace(/&/g,"&")),i.find("div.post-locked-avatar").empty().append(e)),i.show().find(".currently-editing").text(s.lock_error.text),i.find(".wp-tab-first").focus()):s.new_lock&&c("#active_post_lock").val(s.new_lock))})}(jQuery),function(n){var a,t;function s(){a=!1,window.clearTimeout(t),t=window.setTimeout(function(){a=!0},3e5)}n(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var s,i;a&&(i=n("#post_ID").val())&&(s=n("#_wpnonce").val())&&(e["wp-refresh-post-nonces"]={post_id:i,post_nonce:s})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(s(),e.replace&&n.each(e.replace,function(t,e){n("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){s()})}(jQuery),jQuery(document).ready(function(d){var u,t,e,s,i,n,a,o="",l=0,c=d("#content");function r(t){return n.height(Math.max(50,a+t.pageY)+"px"),!1}function p(){var t;n.focus(),d(document).unbind("mousemove",r).unbind("mouseup",p),(t=parseInt(n.css("height"),10))&&50 label input[type="checkbox"]',function(){var t=d(this),e=t.is(":checked"),s=t.val();s&&t.parents("#taxonomy-"+n).length&&d("#in-"+n+"-"+s+", #in-popular-"+n+"-"+s).prop("checked",e)})}),d("#postcustom").length&&d("#the-list").wpList({addAfter:function(){d("table#list-table").show()},addBefore:function(t){return t.data+="&post_id="+d("#post_ID").val(),t}}),d("#submitdiv").length&&(u=d("#timestamp").html(),t=d("#post-visibility-display").html(),e=function(){var t=d("#post-visibility-select");"public"!=d("input:radio:checked",t).val()?(d("#sticky").prop("checked",!1),d("#sticky-span").hide()):d("#sticky-span").show(),"password"!=d("input:radio:checked",t).val()?d("#password-span").hide():d("#password-span").show()},s=function(){if(!d("#timestampdiv").length)return!0;var t,e=d("#post_status"),s=d('option[value="publish"]',e),i=d("#aa").val(),n=d("#mm").val(),a=d("#jj").val(),o=d("#hh").val(),l=d("#mn").val(),c=new Date(i,n-1,a,o,l),r=new Date(d("#hidden_aa").val(),d("#hidden_mm").val()-1,d("#hidden_jj").val(),d("#hidden_hh").val(),d("#hidden_mn").val()),p=new Date(d("#cur_aa").val(),d("#cur_mm").val()-1,d("#cur_jj").val(),d("#cur_hh").val(),d("#cur_mn").val());return c.getFullYear()!=i||1+c.getMonth()!=n||c.getDate()!=a||c.getMinutes()!=l?(d(".timestamp-wrap","#timestampdiv").addClass("form-invalid"),!1):(d(".timestamp-wrap","#timestampdiv").removeClass("form-invalid"),p"+postL10n.dateFormat.replace("%1$s",d('option[value="'+d("#mm").val()+'"]',"#mm").text()).replace("%2$s",a).replace("%3$s",i).replace("%4$s",o).replace("%5$s",l)+" "),"private"==d("input:radio:checked","#post-visibility-select").val()?(d("#publish").val(postL10n.update),0===s.length?e.append('"):s.html(postL10n.privatelyPublished),d('option[value="publish"]',e).prop("selected",!0),d(".edit-post-status","#misc-publishing-actions").hide()):("future"==d("#original_post_status").val()||"draft"==d("#original_post_status").val()?s.length&&(s.remove(),e.val(d("#hidden_post_status").val())):s.html(postL10n.published),e.is(":hidden")&&d(".edit-post-status","#misc-publishing-actions").show()),d("#post-status-display").html(d("option:selected",e).text()),"private"==d("option:selected",e).val()||"publish"==d("option:selected",e).val()?d("#save-post").hide():(d("#save-post").show(),"pending"==d("option:selected",e).val()?d("#save-post").show().val(postL10n.savePending):d("#save-post").show().val(postL10n.saveDraft)),!0)},d(".edit-visibility","#visibility").click(function(){return d("#post-visibility-select").is(":hidden")&&(e(),d("#post-visibility-select").slideDown("fast"),d(this).hide()),!1}),d(".cancel-post-visibility","#post-visibility-select").click(function(){return d("#post-visibility-select").slideUp("fast"),d("#visibility-radio-"+d("#hidden-post-visibility").val()).prop("checked",!0),d("#post_password").val(d("#hidden-post-password").val()),d("#sticky").prop("checked",d("#hidden-post-sticky").prop("checked")),d("#post-visibility-display").html(t),d(".edit-visibility","#visibility").show(),s(),!1}),d(".save-post-visibility","#post-visibility-select").click(function(){var t=d("#post-visibility-select");return t.slideUp("fast"),d(".edit-visibility","#visibility").show(),s(),"public"!=d("input:radio:checked",t).val()&&d("#sticky").prop("checked",!1),o=d("#sticky").prop("checked")?"Sticky":"",d("#post-visibility-display").html(postL10n[d("input:radio:checked",t).val()+o]),!1}),d("input:radio","#post-visibility-select").change(function(){e()}),d("#timestampdiv").siblings("a.edit-timestamp").click(function(){return d("#timestampdiv").is(":hidden")&&(d("#timestampdiv").slideDown("fast"),d("#mm").focus(),d(this).hide()),!1}),d(".cancel-timestamp","#timestampdiv").click(function(){return d("#timestampdiv").slideUp("fast"),d("#mm").val(d("#hidden_mm").val()),d("#jj").val(d("#hidden_jj").val()),d("#aa").val(d("#hidden_aa").val()),d("#hh").val(d("#hidden_hh").val()),d("#mn").val(d("#hidden_mn").val()),d("#timestampdiv").siblings("a.edit-timestamp").show(),s(),!1}),d(".save-timestamp","#timestampdiv").click(function(){return s()&&(d("#timestampdiv").slideUp("fast"),d("#timestampdiv").siblings("a.edit-timestamp").show()),!1}),d("#post").on("submit",function(t){if(!s())return t.preventDefault(),d("#timestampdiv").show(),d("#publishing-action .spinner").hide(),d("#publish").prop("disabled",!1).removeClass("button-primary-disabled"),!1}),d("#post-status-select").siblings("a.edit-post-status").click(function(){return d("#post-status-select").is(":hidden")&&(d("#post-status-select").slideDown("fast"),d(this).hide()),!1}),d(".save-post-status","#post-status-select").click(function(){return d("#post-status-select").slideUp("fast"),d("#post-status-select").siblings("a.edit-post-status").show(),s(),!1}),d(".cancel-post-status","#post-status-select").click(function(){return d("#post-status-select").slideUp("fast"),d("#post_status").val(d("#hidden_post_status").val()),d("#post-status-select").siblings("a.edit-post-status").show(),s(),!1})),d("#edit-slug-box").length&&(editPermalink=function(t){var e,s,i=0,n=d("#editable-post-name"),a=n.html(),o=d("#post_name"),l=o.val(),c=d("#edit-slug-buttons"),r=c.html(),p=d("#editable-post-name-full").html();for(d("#view-post-btn").hide(),c.html(''+postL10n.ok+' '+postL10n.cancel+""),c.children(".save").click(function(){var s=n.children("input").val();return s==d("#editable-post-name-full").text()?d(".cancel","#edit-slug-buttons").click():(d.post(ajaxurl,{action:"sample-permalink",post_id:t,new_slug:s,new_title:d("#title").val(),samplepermalinknonce:d("#samplepermalinknonce").val()},function(t){var e=d("#edit-slug-box");e.html(t),e.hasClass("hidden")&&e.fadeIn("fast",function(){e.removeClass("hidden")}),c.html(r),o.val(s),makeSlugeditClickable(),d("#view-post-btn").show()}),!1)}),d(".cancel","#edit-slug-buttons").click(function(){return d("#view-post-btn").show(),n.html(a),c.html(r),o.val(l),!1}),s=0;sp.length/4?"":p,n.html('').children("input").keypress(function(t){t=t.keyCode||0;return 13==t?(c.children(".save").click(),!1):27==t?(c.children(".cancel").click(),!1):void 0}).keyup(function(){o.val(this.value)}).focus()},(makeSlugeditClickable=function(){d("#editable-post-name").click(function(){d("#edit-slug-buttons").children(".edit-slug").click()})})()),"undefined"!=typeof wpWordCount&&(d(document).triggerHandler("wpcountwords",[c.val()]),c.keyup(function(t){t=t.keyCode||t.charCode;return t==l||(13!=t&&8!=l&&46!=l||d(document).triggerHandler("wpcountwords",[c.val()]),l=t),!0})),(wptitlehint=function(t){var e=d("#"+(t=t||"title")),s=d("#"+t+"-prompt-text");""===e.val()&&s.removeClass("screen-reader-text"),s.click(function(){d(this).addClass("screen-reader-text"),e.focus()}),e.blur(function(){""===this.value&&s.removeClass("screen-reader-text")}).focus(function(){s.addClass("screen-reader-text")}).keydown(function(t){s.addClass("screen-reader-text"),d(this).unbind(t)})})(),n=d("textarea#content"),a=null,!n.length||"ontouchstart"in window||(n.css("resize","none"),i=d('
'),d("#wp-content-wrap").append(i),i.on("mousedown",function(t){return a=n.height()-t.pageY,n.blur(),d(document).mousemove(r).mouseup(p),!1})),"undefined"!=typeof tinymce&&(tinymce.onAddEditor.add(function(t,e){function s(){var t=document.getElementById("content_ifr"),e=t?parseInt(t.style.height,10):0,t=d("#content_tbl tr.mceFirst").height();return!(!e||!t)&&(t=e+t+21,t-=33)}"content"!=e.id||tinymce.isIOS5||(e.onLoadContent.add(function(){var t=document.getElementById("content"),e=t?parseInt(t.style.height,10):0,t=d("#content_tbl tr.mceFirst").height()||33;(!e||e<50||5e3