!function(S,q){q.wp=q.wp||{},q.wp.pressThis=new function(){var o,d,l,e,r=!1,n=!1,s=document.createElement("textarea"),c=!1,i=q.wpPressThisConfig||{},p=q.wpPressThisData||{},t=128,u=!1,f=[],h="is-off-screen",m="is-hidden",g=h+" "+m,v=void 0!==(e=document.documentElement.style).transition?"transitionend":void 0!==e.WebkitTransition&&"webkitTransitionEnd";function C(e){return e&&q.pressThisL10n?q.pressThisL10n[e]||e:e||""}function a(e){return(e=e||"").replace(/|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"")}function b(e){return e=S.trim(e||""),/^(?:https?:)?\/\//.test(e)?(e=a(e)).replace(/["\\]+/g,""):""}function x(){var e=S("#title-container");return e.find("img.emoji").each(function(){var e=S(this);e.replaceWith(S("").text(e.attr("alt")))}),function(e){var t=a(e);try{s.innerHTML=t,t=a(s.value)}catch(e){}return t}(e.text())}function y(){var s=S("#pressthis-form"),a=S('');o&&o.save(),S("#post_title").val(x()),q.tagBox&&S("div.tagsdiv").each(function(){q.tagBox.flushTags(this,!1,1)}),S(".categories-select .category").each(function(e,t){t=S(t);t.hasClass("selected")&&s.append(a.clone().val(t.attr("data-term-id")||""))})}function w(e){var a=S(document.activeElement).hasClass("draft-button");r=!1,S(".spinner").addClass("is-active"),S(".post-actions button").attr("disabled","disabled"),"publish"===e&&S("#post_status").val("publish"),y(),e=S("#pressthis-form").serialize(),S.ajax({type:"post",url:q.ajaxurl,data:e}).always(function(){S(".spinner").removeClass("is-active"),S(".post-actions button").removeAttr("disabled"),S("div.alerts").empty()}).done(function(e){var t,s;if(e.success)if(e.data.redirect)if(q.opener&&i.redirInParent){try{q.opener.location.href=e.data.redirect}catch(e){}q.self.close()}else q.location.href=e.data.redirect;else e.data.postSaved&&(t=S(".edit-post-link"),s=S(".draft-button"),n=!0,s.fadeOut(200,function(){s.removeClass("is-saving"),t.fadeIn(200,function(){var e=document.activeElement;a&&(e===s[0]||S(e).hasClass("post-actions")||"BODY"===e.nodeName)&&t.focus()})}));else D(e.data.errorMessage)}).fail(function(){D(C("serverError"))})}function k(){n&&(n=!1,S(".edit-post-link").fadeOut(200,function(){S(".draft-button").removeClass("is-saving").fadeIn(200)}))}function T(){var e=S("#new-category").val();e&&(e={action:"press-this-add-category",post_id:S("#post_ID").val()||0,name:e,new_cat_nonce:S("#_ajax_nonce-add-category").val()||"",parent:S("#new-category-parent").val()||0},S.post(q.ajaxurl,e,function(e){var a,n,i;e.success?(i=S("ul.categories-select"),S.each(e.data,function(e,t){var s=S("
  • ").append(S('