!function(a,b){var c=function(){function c(a){return a&&b.pressThisL10n?b.pressThisL10n[a]||a:a||""}function d(a){return a=a||"",a.replace(/|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"")}function e(a){var b=d(a);try{J.innerHTML=b,b=d(J.value)}catch(c){}return b}function f(b){return b=a.trim(b||""),/^(?:https?:)?\/\//.test(b)?(b=d(b),b.replace(/["\\]+/g,"")):""}function g(){a(".spinner").addClass("is-active"),a(".post-actions button").attr("disabled","disabled")}function h(){a(".spinner").removeClass("is-active"),a(".post-actions button").removeAttr("disabled")}function i(){var b=a("#title-container");return b.find("img.emoji").each(function(){var b=a(this);b.replaceWith(a("").text(b.attr("alt")))}),e(b.text())}function j(){var c=a("#pressthis-form"),d=a('');E&&E.save(),a("#post_title").val(i()),b.tagBox&&a("div.tagsdiv").each(function(){b.tagBox.flushTags(this,!1,1)}),a(".categories-select .category").each(function(b,e){var f=a(e);f.hasClass("selected")&&c.append(d.clone().val(f.attr("data-term-id")||""))})}function k(d){var e,f=a(document.activeElement).hasClass("draft-button");H=!1,g(),"publish"===d&&a("#post_status").val("publish"),j(),e=a("#pressthis-form").serialize(),a.ajax({type:"post",url:b.ajaxurl,data:e}).always(function(){h(),r()}).done(function(c){var d,e;if(c.success)if(c.data.redirect)if(b.opener&&L.redirInParent){try{b.opener.location.href=c.data.redirect}catch(g){}b.self.close()}else b.location.href=c.data.redirect;else c.data.postSaved&&(d=a(".edit-post-link"),e=a(".draft-button"),I=!0,e.fadeOut(200,function(){e.removeClass("is-saving"),d.fadeIn(200,function(){var b=document.activeElement;f&&(b===e[0]||a(b).hasClass("post-actions")||"BODY"===b.nodeName)&&d.focus()})}));else q(c.data.errorMessage)}).fail(function(){q(c("serverError"))})}function l(){I&&(I=!1,a(".edit-post-link").fadeOut(200,function(){a(".draft-button").removeClass("is-saving").fadeIn(200)}))}function m(a){var b,c,d="";E&&(b=f(a.attr("data-wp-src")||""),c=f(M.u),a.hasClass("is-image")?(c||(c=b),d=''):d="[embed]"+b+"[/embed]",O?E.execCommand("mceInsertContent",!1,d):E.setContent("

"+d+"

"+E.getContent()))}function n(){var c,d=a("#new-category").val();d&&(c={action:"press-this-add-category",post_id:a("#post_ID").val()||0,name:d,new_cat_nonce:a("#_ajax_nonce-add-category").val()||"",parent:a("#new-category-parent").val()||0},a.post(b.ajaxurl,c,function(b){if(b.success){var c,d,e=a("ul.categories-select");a.each(b.data,function(b,f){var g=a("
  • ").append(a('