var commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint,editPermalink,makeSlugeditClickable=editPermalink=function(){};window.wp=window.wp||{},function(n){var t=!1;commentsBox={st:0,get:function(t,e){var s=this.st;return e=e||20,this.st+=e,this.total=t,n("#commentsdiv .spinner").addClass("is-active"),e={action:"get-comments",mode:"single",_ajax_nonce:n("#add_comment_nonce").val(),p:n("#post_ID").val(),start:s,number:e},n.post(ajaxurl,e,function(t){return t=wpAjax.parseAjaxResponse(t),n("#commentsdiv .widefat").show(),n("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof t&&t.responses[0]?(n("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,n("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?n("#show-comments").hide():n("#show-comments").show().children("a").html(postL10n.showcomm))):void(1!=t?n("#the-comment-list").append('
'+wpAjax.broken+" |
"):n("#show-comments").html(postL10n.endcomm))}),!1}},WPSetThumbnailHTML=function(t){n(".inside","#postimagediv").html(t)},WPSetThumbnailID=function(t){var e=n('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&&n("#active_post_lock").val(s.new_lock))}).on("before-autosave.update-post-slug",function(){t=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){n("#edit-slug-box > *").length||t||n.post(ajaxurl,{action:"sample-permalink",post_id:n("#post_ID").val(),new_title:n("#title").val(),samplepermalinknonce:n("#samplepermalinknonce").val()},function(t){"-1"!=t&&n("#edit-slug-box").html(t)})})}(jQuery),function(a){var n,t;function s(){n=!1,window.clearTimeout(t),t=window.setTimeout(function(){n=!0},3e5)}a(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var s,i;n&&(i=a("#post_ID").val())&&(s=a("#_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&&a.each(e.replace,function(t,e){a("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){s()})}(jQuery),jQuery(document).ready(function(d){var u,e,s,t,i,a,n,o,l,r,p="",c=0,h=d("#content"),v=d(document),f=d("#edit-slug-box"),m=d("#post_ID").val()||0,w=d("#submitpost"),b=!0,g=d("#post-visibility-select"),k=d("#timestampdiv"),_=d("#post-status-select");function y(t){r.hasClass("wp-editor-expand")||(o?a.theme.resizeTo(null,n+t.pageY):l.height(Math.max(50,n+t.pageY)),t.preventDefault())}function x(){var t;r.hasClass("wp-editor-expand")||(t=o?(a.focus(),((t=parseInt(d("#wp-content-editor-container .mce-toolbar-grp").height(),10))<10||200 *").length&&(d("form#post").one("submit",function(){t=!0}),window.setTimeout(function(){!t&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),v.on("autosave-disable-buttons.edit-post",function(){s.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||s.removeClass("disabled")}).on("before-autosave.edit-post",function(){d(".autosave-message").text(postL10n.savingText)}).on("after-autosave.edit-post",function(t,e){d(".autosave-message").text(e.message)}),d(window).on("beforeunload.edit-post",function(){var t="undefined"!=typeof tinymce&&tinymce.get("content");if(t&&!t.isHidden()&&t.isDirty()||wp.autosave&&wp.autosave.server.postChanged())return postL10n.saveAlert}).on("unload.edit-post",function(t){b&&(t.target&&"#document"!=t.target.nodeName||d.ajax({type:"POST",url:ajaxurl,async:!1,data:{action:"wp-remove-post-lock",_wpnonce:d("#_wpnonce").val(),post_ID:d("#post_ID").val(),active_post_lock:d("#active_post_lock").val()}}))}),d("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():d("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),d(".categorydiv").each(function(){var t,a,e,s=d(this).attr("id").split("-");s.shift(),a=s.join("-"),e="category"==a?"cats":a+"_tab",d("a","#"+a+"-tabs").click(function(){var t=d(this).attr("href");return d(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),d("#"+a+"-tabs").siblings(".tabs-panel").hide(),d(t).show(),"#"+a+"-all"==t?deleteUserSetting(e):setUserSetting(e,"pop"),!1}),getUserSetting(e)&&d('a[href="#'+a+'-pop"]',"#"+a+"-tabs").click(),d("#new"+a).one("focus",function(){d(this).val("").removeClass("form-input-tip")}),d("#new"+a).keypress(function(t){13===t.keyCode&&(t.preventDefault(),d("#"+a+"-add-submit").click())}),d("#"+a+"-add-submit").click(function(){d("#new"+a).focus()}),t=function(t){return!!d("#new"+a).val()&&(t.data+="&"+d(":checked","#"+a+"checklist").serialize(),d("#"+a+"-add-submit").prop("disabled",!0),t)},s=function(t,e){var s,i=d("#new"+a+"_parent");d("#"+a+"-add-submit").prop("disabled",!1),"undefined"!=e.parsed.responses[0]&&(s=e.parsed.responses[0].supplemental.newcat_parent)&&(i.before(s),i.remove())},d("#"+a+"checklist").wpList({alt:"",response:a+"-ajax-response",addBefore:t,addAfter:s}),d("#"+a+"-add-toggle").click(function(){return d("#"+a+"-adder").toggleClass("wp-hidden-children"),d('a[href="#'+a+'-all"]',"#"+a+"-tabs").click(),d("#new"+a).focus(),!1}),d("#"+a+"checklist, #"+a+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var t=d(this),e=t.is(":checked"),s=t.val();s&&t.parents("#taxonomy-"+a).length&&d("#in-"+a+"-"+s+", #in-popular-"+a+"-"+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(),e=d("#post-visibility-display").html(),t=function(){"public"!=g.find("input:radio:checked").val()?(d("#sticky").prop("checked",!1),d("#sticky-span").hide()):d("#sticky-span").show(),"password"!=g.find("input:radio:checked").val()?d("#password-span").hide():d("#password-span").show()},i=function(){if(!k.length)return!0;var t,e=d("#post_status"),s=d('option[value="publish"]',e),i=d("#aa").val(),a=d("#mm").val(),n=d("#jj").val(),o=d("#hh").val(),l=d("#mn").val(),r=new Date(i,a-1,n,o,l),p=new Date(d("#hidden_aa").val(),d("#hidden_mm").val()-1,d("#hidden_jj").val(),d("#hidden_hh").val(),d("#hidden_mn").val()),c=new Date(d("#cur_aa").val(),d("#cur_mm").val()-1,d("#cur_jj").val(),d("#cur_hh").val(),d("#cur_mn").val());return r.getFullYear()!=i||1+r.getMonth()!=a||r.getDate()!=n||r.getMinutes()!=l?(k.find(".timestamp-wrap").addClass("form-invalid"),!1):(k.find(".timestamp-wrap").removeClass("form-invalid"),c"+postL10n.dateFormat.replace("%1$s",d('option[value="'+d("#mm").val()+'"]',"#mm").text()).replace("%2$s",n).replace("%3$s",i).replace("%4$s",o).replace("%5$s",l)+" "),"private"==g.find("input:radio:checked").val()?(d("#publish").val(postL10n.update),0===s.length?e.append('"):s.html(postL10n.privatelyPublished),d('option[value="publish"]',e).prop("selected",!0),d("#misc-publishing-actions .edit-post-status").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("#misc-publishing-actions .edit-post-status").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("#visibility .edit-visibility").click(function(){return g.is(":hidden")&&(t(),g.slideDown("fast").find('input[type="radio"]').first().focus(),d(this).hide()),!1}),g.find(".cancel-post-visibility").click(function(t){g.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(e),d("#visibility .edit-visibility").show().focus(),i(),t.preventDefault()}),g.find(".save-post-visibility").click(function(t){g.slideUp("fast"),d("#visibility .edit-visibility").show(),i(),"public"!=g.find("input:radio:checked").val()&&d("#sticky").prop("checked",!1),p=d("#sticky").prop("checked")?"Sticky":"",d("#post-visibility-display").html(postL10n[g.find("input:radio:checked").val()+p]),t.preventDefault()}),g.find("input:radio").change(function(){t()}),k.siblings("a.edit-timestamp").click(function(t){k.is(":hidden")&&(k.slideDown("fast"),d("#mm").focus(),d(this).hide()),t.preventDefault()}),k.find(".cancel-timestamp").click(function(t){k.slideUp("fast").siblings("a.edit-timestamp").show().focus(),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()),i(),t.preventDefault()}),k.find(".save-timestamp").click(function(t){i()&&(k.slideUp("fast"),k.siblings("a.edit-timestamp").show()),t.preventDefault()}),d("#post").on("submit",function(t){i()||(t.preventDefault(),k.show(),wp.autosave&&wp.autosave.enableButtons(),d("#publishing-action .spinner").removeClass("is-active"))}),_.siblings("a.edit-post-status").click(function(t){_.is(":hidden")&&(_.slideDown("fast").find("select").focus(),d(this).hide()),t.preventDefault()}),_.find(".save-post-status").click(function(t){_.slideUp("fast").siblings("a.edit-post-status").show(),i(),t.preventDefault()}),_.find(".cancel-post-status").click(function(t){d("#post-status-select").slideUp("fast").siblings("a.edit-post-status").show().focus(),d("#post_status").val(d("#hidden_post_status").val()),i(),t.preventDefault()})),f.length&&f.on("click",function(t){t=d(t.target);(t.is("#editable-post-name")||t.hasClass("edit-slug"))&&function(){var t,e,s=0,i=d("#editable-post-name"),a=i.html(),n=d("#post_name"),o=n.val(),l=d("#edit-slug-buttons"),r=l.html(),p=d("#editable-post-name-full");for(p.find("img").replaceWith(function(){return this.alt}),p=p.html(),d("#view-post-btn").hide(),l.html(''+postL10n.ok+' '+postL10n.cancel+""),l.children(".save").click(function(){var s=i.children("input").val();return s==d("#editable-post-name-full").text()?l.children(".cancel").click():d.post(ajaxurl,{action:"sample-permalink",post_id:m,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")}),l.html(r),n.val(s),d("#view-post-btn").show()}),!1}),l.children(".cancel").click(function(){return d("#view-post-btn").show(),i.html(a),l.html(r),n.val(o),!1}),t=0;tp.length/4?"":p,i.html('').children("input").keypress(function(t){t=t.keyCode||0;return 13==t?(l.children(".save").click(),!1):27==t?(l.children(".cancel").click(),!1):void 0}).keyup(function(){n.val(this.value)}).focus()}()}),"undefined"!=typeof wpWordCount&&(v.triggerHandler("wpcountwords",[h.val()]),h.keyup(function(t){t=t.keyCode||t.charCode;return t==c||(13!=t&&8!=c&&46!=c||v.triggerHandler("wpcountwords",[h.val()]),c=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)})})(),l=d("textarea#content"),f=d("#post-status-info"),r=d("#postdivrich"),!l.length||"ontouchstart"in window?d("#content-resize-handle").hide():f.on("mousedown.wp-editor-resize",function(t){(a="undefined"!=typeof tinymce?tinymce.get("content"):a)&&!a.isHidden()?(o=!0,n=d("#content_ifr").height()-t.pageY):(o=!1,n=l.height()-t.pageY,l.blur()),v.on("mousemove.wp-editor-resize",y).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",x),t.preventDefault()}).on("mouseup.wp-editor-resize",x),"undefined"!=typeof tinymce&&d("#post-formats-select input.post-format").on("change.set-editor-class",function(){var t,e,s=this.id;s&&d(this).prop("checked")&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpost-format-[^ ]+/,""),t.dom.addClass(e,"post-format-0"==s?"post-format-standard":s),d(document).trigger("editor-classchange"))})});