]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/post.min.js
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-admin / js / post.min.js
index 921278a192c4ab6dbf52efa9052e409580808017..379015a267863ce09f1ca39093aca2b21db0b718 100644 (file)
@@ -1 +1 @@
-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(c){var b=postL10n.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(f){var i=f.id,c=i.split("-check-num-")[1],e=a(f).closest(".tagsdiv"),h=e.find(".the-tags"),b=postL10n.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.clean(g.join(b)));this.quickClicks(e);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(postL10n.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(g,c,h){c=c||false;var d=a(".the-tags",g),j=a("input.newtag",g),b=postL10n.comma,e,i;i=c?a(c).text():j.val();tagsval=d.val();e=tagsval?tagsval+b+i:i;e=this.clean(e);e=array_unique_noempty(e.split(b)).join(b);d.val(e);this.quickClicks(g);if(!c){j.val("")}if("undefined"==typeof(h)){j.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:postL10n.comma+" "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv .spinner").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:b,number:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv .spinner").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").show().children("a").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a('input[value="_thumbnail_id"]',"#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})};a(document).on("heartbeat-send.refresh-lock",function(g,d){var c=a("#active_post_lock").val(),b=a("#post_ID").val(),f={};if(!b||!a("#post-lock-dialog").length){return}f.post_id=b;if(c){f.lock=c}d["wp-refresh-post-lock"]=f});a(document).on("heartbeat-tick.refresh-lock",function(f,d){var g,c,b;if(d["wp-refresh-post-lock"]){g=d["wp-refresh-post-lock"];if(g.lock_error){c=a("#post-lock-dialog");if(c.length&&!c.is(":visible")){if(typeof autosave=="function"){a(document).on("autosave-disable-buttons.post-lock",function(){c.addClass("saving")}).on("autosave-enable-buttons.post-lock",function(){c.removeClass("saving").addClass("saved");window.onbeforeunload=null});if(!autosave()){window.onbeforeunload=null}autosave=function(){}}if(g.lock_error.avatar_src){b=a('<img class="avatar avatar-64 photo" width="64" height="64" />').attr("src",g.lock_error.avatar_src.replace(/&amp;/g,"&"));c.find("div.post-locked-avatar").empty().append(b)}c.show().find(".currently-editing").text(g.lock_error.text);c.find(".wp-tab-first").focus()}}else{if(g.new_lock){a("#active_post_lock").val(g.new_lock)}}}})}(jQuery));(function(c){var a,b;function d(){a=false;window.clearTimeout(b);b=window.setTimeout(function(){a=true},300000)}c(document).on("heartbeat-send.wp-refresh-nonces",function(i,h){var g,f;if(a){if((f=c("#post_ID").val())&&(g=c("#_wpnonce").val())){h["wp-refresh-post-nonces"]={post_id:f,post_nonce:g}}}}).on("heartbeat-tick.wp-refresh-nonces",function(h,g){var f=g["wp-refresh-post-nonces"];if(f){d();if(f.replace){c.each(f.replace,function(e,i){c("#"+e).val(i)})}if(f.heartbeatNonce){window.heartbeatSettings.nonce=f.heartbeatNonce}}}).ready(function(){d()})}(jQuery));jQuery(document).ready(function(f){var b,a,g="",e=0,h=f("#content");postboxes.add_postbox_toggles(pagenow);f("#post-lock-dialog .notification-dialog").on("keydown",function(j){if(j.which!=9){return}var i=f(j.target);if(i.hasClass("wp-tab-first")&&j.shiftKey){f(this).find(".wp-tab-last").focus();j.preventDefault()}else{if(i.hasClass("wp-tab-last")&&!j.shiftKey){f(this).find(".wp-tab-first").focus();j.preventDefault()}}}).filter(":visible").find(".wp-tab-first").focus();if(f("#tagsdiv-post_tag").length){tagBox.init()}else{f("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}f(".categorydiv").each(function(){var m=f(this).attr("id"),l,n,k,i,j;k=m.split("-");k.shift();i=k.join("-");j=i+"_tab";if(i=="category"){j="cats"}f("a","#"+i+"-tabs").click(function(){var o=f(this).attr("href");f(this).parent().addClass("tabs").siblings("li").removeClass("tabs");f("#"+i+"-tabs").siblings(".tabs-panel").hide();f(o).show();if("#"+i+"-all"==o){deleteUserSetting(j)}else{setUserSetting(j,"pop")}return false});if(getUserSetting(j)){f('a[href="#'+i+'-pop"]',"#"+i+"-tabs").click()}f("#new"+i).one("focus",function(){f(this).val("").removeClass("form-input-tip")});f("#new"+i).keypress(function(o){if(13===o.keyCode){o.preventDefault();f("#"+i+"-add-submit").click()}});f("#"+i+"-add-submit").click(function(){f("#new"+i).focus()});l=function(o){if(!f("#new"+i).val()){return false}o.data+="&"+f(":checked","#"+i+"checklist").serialize();f("#"+i+"-add-submit").prop("disabled",true);return o};n=function(t,q){var p,o=f("#new"+i+"_parent");f("#"+i+"-add-submit").prop("disabled",false);if("undefined"!=q.parsed.responses[0]&&(p=q.parsed.responses[0].supplemental.newcat_parent)){o.before(p);o.remove()}};f("#"+i+"checklist").wpList({alt:"",response:i+"-ajax-response",addBefore:l,addAfter:n});f("#"+i+"-add-toggle").click(function(){f("#"+i+"-adder").toggleClass("wp-hidden-children");f('a[href="#'+i+'-all"]',"#"+i+"-tabs").click();f("#new"+i).focus();return false});f("#"+i+"checklist, #"+i+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var o=f(this),q=o.is(":checked"),p=o.val();if(p&&o.parents("#taxonomy-"+i).length){f("#in-"+i+"-"+p+", #in-popular-"+i+"-"+p).prop("checked",q)}})});if(f("#postcustom").length){f("#the-list").wpList({addAfter:function(i,j){f("table#list-table").show()},addBefore:function(i){i.data+="&post_id="+f("#post_ID").val();return i}})}if(f("#submitdiv").length){b=f("#timestamp").html();a=f("#post-visibility-display").html();function d(){var i=f("#post-visibility-select");if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false);f("#sticky-span").hide()}else{f("#sticky-span").show()}if(f("input:radio:checked",i).val()!="password"){f("#password-span").hide()}else{f("#password-span").show()}}function c(){if(!f("#timestampdiv").length){return true}var p,q,j,s,r=f("#post_status"),k=f('option[value="publish"]',r),i=f("#aa").val(),n=f("#mm").val(),o=f("#jj").val(),m=f("#hh").val(),l=f("#mn").val();p=new Date(i,n-1,o,m,l);q=new Date(f("#hidden_aa").val(),f("#hidden_mm").val()-1,f("#hidden_jj").val(),f("#hidden_hh").val(),f("#hidden_mn").val());j=new Date(f("#cur_aa").val(),f("#cur_mm").val()-1,f("#cur_jj").val(),f("#cur_hh").val(),f("#cur_mn").val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){f(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{f(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(p>j&&f("#original_post_status").val()!="future"){s=postL10n.publishOnFuture;f("#publish").val(postL10n.schedule)}else{if(p<=j&&f("#original_post_status").val()!="publish"){s=postL10n.publishOn;f("#publish").val(postL10n.publish)}else{s=postL10n.publishOnPast;f("#publish").val(postL10n.update)}}if(q.toUTCString()==p.toUTCString()){f("#timestamp").html(b)}else{f("#timestamp").html(s+" <b>"+postL10n.dateFormat.replace("%1$s",f('option[value="'+f("#mm").val()+'"]',"#mm").text()).replace("%2$s",o).replace("%3$s",i).replace("%4$s",m).replace("%5$s",l)+"</b> ")}if(f("input:radio:checked","#post-visibility-select").val()=="private"){f("#publish").val(postL10n.update);if(k.length==0){r.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{k.html(postL10n.privatelyPublished)}f('option[value="publish"]',r).prop("selected",true);f(".edit-post-status","#misc-publishing-actions").hide()}else{if(f("#original_post_status").val()=="future"||f("#original_post_status").val()=="draft"){if(k.length){k.remove();r.val(f("#hidden_post_status").val())}}else{k.html(postL10n.published)}if(r.is(":hidden")){f(".edit-post-status","#misc-publishing-actions").show()}}f("#post-status-display").html(f("option:selected",r).text());if(f("option:selected",r).val()=="private"||f("option:selected",r).val()=="publish"){f("#save-post").hide()}else{f("#save-post").show();if(f("option:selected",r).val()=="pending"){f("#save-post").show().val(postL10n.savePending)}else{f("#save-post").show().val(postL10n.saveDraft)}}return true}f(".edit-visibility","#visibility").click(function(){if(f("#post-visibility-select").is(":hidden")){d();f("#post-visibility-select").slideDown("fast");f(this).hide()}return false});f(".cancel-post-visibility","#post-visibility-select").click(function(){f("#post-visibility-select").slideUp("fast");f("#visibility-radio-"+f("#hidden-post-visibility").val()).prop("checked",true);f("#post_password").val(f("#hidden-post-password").val());f("#sticky").prop("checked",f("#hidden-post-sticky").prop("checked"));f("#post-visibility-display").html(a);f(".edit-visibility","#visibility").show();c();return false});f(".save-post-visibility","#post-visibility-select").click(function(){var i=f("#post-visibility-select");i.slideUp("fast");f(".edit-visibility","#visibility").show();c();if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false)}if(true==f("#sticky").prop("checked")){g="Sticky"}else{g=""}f("#post-visibility-display").html(postL10n[f("input:radio:checked",i).val()+g]);return false});f("input:radio","#post-visibility-select").change(function(){d()});f("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(f("#timestampdiv").is(":hidden")){f("#timestampdiv").slideDown("fast");f("#mm").focus();f(this).hide()}return false});f(".cancel-timestamp","#timestampdiv").click(function(){f("#timestampdiv").slideUp("fast");f("#mm").val(f("#hidden_mm").val());f("#jj").val(f("#hidden_jj").val());f("#aa").val(f("#hidden_aa").val());f("#hh").val(f("#hidden_hh").val());f("#mn").val(f("#hidden_mn").val());f("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});f(".save-timestamp","#timestampdiv").click(function(){if(c()){f("#timestampdiv").slideUp("fast");f("#timestampdiv").siblings("a.edit-timestamp").show()}return false});f("#post").on("submit",function(i){if(!c()){i.preventDefault();f("#timestampdiv").show();f("#publishing-action .spinner").hide();f("#publish").prop("disabled",false).removeClass("button-primary-disabled");return false}});f("#post-status-select").siblings("a.edit-post-status").click(function(){if(f("#post-status-select").is(":hidden")){f("#post-status-select").slideDown("fast");f(this).hide()}return false});f(".save-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post-status-select").siblings("a.edit-post-status").show();c();return false});f(".cancel-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post_status").val(f("#hidden_post_status").val());f("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(f("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=f("#editable-post-name"),o=m.html(),r=f("#post_name"),s=r.val(),p=f("#edit-slug-buttons"),q=p.html(),l=f("#editable-post-name-full").html();f("#view-post-btn").hide();p.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var i=m.children("input").val();if(i==f("#editable-post-name-full").text()){return f(".cancel","#edit-slug-buttons").click()}f.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:i,new_title:f("#title").val(),samplepermalinknonce:f("#samplepermalinknonce").val()},function(u){var t=f("#edit-slug-box");t.html(u);if(t.hasClass("hidden")){t.fadeIn("fast",function(){t.removeClass("hidden")})}p.html(q);r.val(i);makeSlugeditClickable();f("#view-post-btn").show()});return false});f(".cancel","#edit-slug-buttons").click(function(){f("#view-post-btn").show();m.html(o);p.html(q);r.val(s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(".save").click();return false}if(27==i){p.children(".cancel").click();return false}}).keyup(function(i){r.val(this.value)}).focus()};makeSlugeditClickable=function(){f("#editable-post-name").click(function(){f("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(typeof(wpWordCount)!="undefined"){f(document).triggerHandler("wpcountwords",[h.val()]);h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==e){return true}if(13==i||8==e||46==e){f(document).triggerHandler("wpcountwords",[h.val()])}e=i;return true})}wptitlehint=function(k){k=k||"title";var i=f("#"+k),j=f("#"+k+"-prompt-text");if(i.val()==""){j.removeClass("screen-reader-text")}j.click(function(){f(this).addClass("screen-reader-text");i.focus()});i.blur(function(){if(this.value==""){j.removeClass("screen-reader-text")}}).focus(function(){j.addClass("screen-reader-text")}).keydown(function(l){j.addClass("screen-reader-text");f(this).unbind(l)})};wptitlehint();(function(){var i=f("textarea#content"),l=null,j;if(!i.length||"ontouchstart" in window){return}function k(n){i.height(Math.max(50,l+n.pageY)+"px");return false}function m(o){var n;i.focus();f(document).unbind("mousemove",k).unbind("mouseup",m);n=parseInt(i.css("height"),10);if(n&&n>50&&n<5000){setUserSetting("ed_size",n)}}i.css("resize","none");j=f('<div id="content-resize-handle"><br></div>');f("#wp-content-wrap").append(j);j.on("mousedown",function(n){l=i.height()-n.pageY;i.blur();f(document).mousemove(k).mouseup(m);return false})})();if(typeof(tinymce)!="undefined"){tinymce.onAddEditor.add(function(i,j){if(j.id!="content"||tinymce.isIOS5){return}function k(){var l,m=document.getElementById("content_ifr"),o=m?parseInt(m.style.height,10):0,n=f("#content_tbl tr.mceFirst").height();if(!o||!n){return false}l=o+n+21;l-=33;return l}j.onLoadContent.add(function(m,q){var r,n=document.getElementById("content"),l=n?parseInt(n.style.height,10):0,p=f("#content_tbl tr.mceFirst").height()||33;if(!l||l<50||l>5000){l=360}if(getUserSetting("ed_size")>5000){setUserSetting("ed_size",360)}r=(l-p)+12;if(r>50&&r<5000){f("#content_tbl").css("height","");f("#content_ifr").css("height",r+"px")}});j.onSaveContent.add(function(m,n){var l=k();if(!l||l<50||l>5000){return}f("textarea#content").css("height",l+"px")});j.onPostRender.add(function(){f("#content_resize").on("mousedown.wp-mce-resize",function(l){f(document).on("mouseup.wp-mce-resize",function(n){var m;f(document).off("mouseup.wp-mce-resize");m=k();if(m&&m>50&&m<5000){setUserSetting("ed_size",m)}})})})});f("#post-formats-select input.post-format").on("change.set-editor-class",function(k){var j,i,l=this.id;if(l&&f(this).prop("checked")){j=tinymce.get("content");if(j){i=j.getBody();i.className=i.className.replace(/\bpost-format-[^ ]+/,"");j.dom.addClass(i,l=="post-format-0"?"post-format-standard":l)}}})}});
\ No newline at end of file
+function array_unique_noempty(a){var b=[];return jQuery.each(a,function(a,c){c=jQuery.trim(c),c&&-1==jQuery.inArray(c,b)&&b.push(c)}),b}var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;!function(a){tagBox={clean:function(a){var b=postL10n.comma;return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(b){var c=b.id,d=c.split("-check-num-")[1],e=a(b).closest(".tagsdiv"),f=e.find(".the-tags"),g=postL10n.comma,h=f.val().split(g),i=[];return delete h[d],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),f.val(this.clean(i.join(g))),this.quickClicks(e),!1},quickClicks:function(b){var c,d,e=a(".the-tags",b),f=a(".tagchecklist",b),g=a(b).attr("id");e.length&&(d=e.prop("disabled"),c=e.val().split(postL10n.comma),f.empty(),a.each(c,function(b,c){var e,h;c=a.trim(c),c&&(e=a("<span />").text(c),d||(h=a('<a id="'+g+"-check-num-"+b+'" class="ntdelbutton">X</a>'),h.click(function(){tagBox.parseTags(this)}),e.prepend("&nbsp;").prepend(h)),f.append(e))}))},flushTags:function(b,c,d){c=c||!1;var e,f,g=a(".the-tags",b),h=a("input.newtag",b),i=postL10n.comma;return f=c?a(c).text():h.val(),tagsval=g.val(),e=tagsval?tagsval+i+f:f,e=this.clean(e),e=array_unique_noempty(e.split(i)).join(i),g.val(e),this.quickClicks(b),c||h.val(""),"undefined"==typeof d&&h.focus(),!1},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){(0==d||"success"!=e)&&(d=wpAjax.broken),d=a('<p id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</p>"),a("a",d).click(function(){return tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this),!1}),a("#"+b).after(d)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))}),a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()}),a("input.newtag",c).blur(function(){""==this.value&&a(this).parent().siblings(".taghint").css("visibility","")}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(b){return 13==b.which?(tagBox.flushTags(a(this).closest(".tagsdiv")),!1):void 0}).keypress(function(a){return 13==a.which?(a.preventDefault(),!1):void 0}).each(function(){var b=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:postL10n.comma+" "})}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a("a.tagcloud-link").click(function(){return tagBox.get(a(this).attr("id")),a(this).unbind().click(function(){return a(this).siblings(".the-tagcloud").toggle(),!1}),!1})}},commentsBox={st:0,get:function(b,c){var d,e=this.st;return c||(c=20),this.st+=c,this.total=b,a("#commentsdiv .spinner").show(),d={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:e,number:c},a.post(ajaxurl,d,function(b){return b=wpAjax.parseAjaxResponse(b),a("#commentsdiv .widefat").show(),a("#commentsdiv .spinner").hide(),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm),void 0):1==b?(a("#show-comments").html(postL10n.endcomm),void 0):(a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>"),void 0)}),!1}},WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)},WPSetThumbnailID=function(b){var c=a('input[value="_thumbnail_id"]',"#list-table");c.size()>0&&a("#meta\\["+c.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(b)},WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(a){"0"==a?alert(setPostThumbnailL10n.error):WPSetThumbnailHTML(a)})},a(document).on("heartbeat-send.refresh-lock",function(b,c){var d=a("#active_post_lock").val(),e=a("#post_ID").val(),f={};e&&a("#post-lock-dialog").length&&(f.post_id=e,d&&(f.lock=d),c["wp-refresh-post-lock"]=f)}),a(document).on("heartbeat-tick.refresh-lock",function(b,c){var d,e,f;c["wp-refresh-post-lock"]&&(d=c["wp-refresh-post-lock"],d.lock_error?(e=a("#post-lock-dialog"),e.length&&!e.is(":visible")&&("function"==typeof autosave&&(a(document).on("autosave-disable-buttons.post-lock",function(){e.addClass("saving")}).on("autosave-enable-buttons.post-lock",function(){e.removeClass("saving").addClass("saved"),window.onbeforeunload=null}),autosave()||(window.onbeforeunload=null),autosave=function(){}),d.lock_error.avatar_src&&(f=a('<img class="avatar avatar-64 photo" width="64" height="64" />').attr("src",d.lock_error.avatar_src.replace(/&amp;/g,"&")),e.find("div.post-locked-avatar").empty().append(f)),e.show().find(".currently-editing").text(d.lock_error.text),e.find(".wp-tab-first").focus())):d.new_lock&&a("#active_post_lock").val(d.new_lock))})}(jQuery),function(a){function b(){c=!1,window.clearTimeout(d),d=window.setTimeout(function(){c=!0},3e5)}var c,d;a(document).on("heartbeat-send.wp-refresh-nonces",function(b,d){var e,f;c&&(f=a("#post_ID").val())&&(e=a("#_wpnonce").val())&&(d["wp-refresh-post-nonces"]={post_id:f,post_nonce:e})}).on("heartbeat-tick.wp-refresh-nonces",function(c,d){var e=d["wp-refresh-post-nonces"];e&&(b(),e.replace&&a.each(e.replace,function(b,c){a("#"+b).val(c)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){b()})}(jQuery),jQuery(document).ready(function(a){function b(){var b=a("#post-visibility-select");"public"!=a("input:radio:checked",b).val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=a("input:radio:checked",b).val()?a("#password-span").hide():a("#password-span").show()}function c(){if(!a("#timestampdiv").length)return!0;var b,c,e,f,g=a("#post_status"),h=a('option[value="publish"]',g),i=a("#aa").val(),j=a("#mm").val(),k=a("#jj").val(),l=a("#hh").val(),m=a("#mn").val();return b=new Date(i,j-1,k,l,m),c=new Date(a("#hidden_aa").val(),a("#hidden_mm").val()-1,a("#hidden_jj").val(),a("#hidden_hh").val(),a("#hidden_mn").val()),e=new Date(a("#cur_aa").val(),a("#cur_mm").val()-1,a("#cur_jj").val(),a("#cur_hh").val(),a("#cur_mn").val()),b.getFullYear()!=i||1+b.getMonth()!=j||b.getDate()!=k||b.getMinutes()!=m?(a(".timestamp-wrap","#timestampdiv").addClass("form-invalid"),!1):(a(".timestamp-wrap","#timestampdiv").removeClass("form-invalid"),b>e&&"future"!=a("#original_post_status").val()?(f=postL10n.publishOnFuture,a("#publish").val(postL10n.schedule)):e>=b&&"publish"!=a("#original_post_status").val()?(f=postL10n.publishOn,a("#publish").val(postL10n.publish)):(f=postL10n.publishOnPast,a("#publish").val(postL10n.update)),c.toUTCString()==b.toUTCString()?a("#timestamp").html(d):a("#timestamp").html(f+" <b>"+postL10n.dateFormat.replace("%1$s",a('option[value="'+a("#mm").val()+'"]',"#mm").text()).replace("%2$s",k).replace("%3$s",i).replace("%4$s",l).replace("%5$s",m)+"</b> "),"private"==a("input:radio:checked","#post-visibility-select").val()?(a("#publish").val(postL10n.update),0==h.length?g.append('<option value="publish">'+postL10n.privatelyPublished+"</option>"):h.html(postL10n.privatelyPublished),a('option[value="publish"]',g).prop("selected",!0),a(".edit-post-status","#misc-publishing-actions").hide()):("future"==a("#original_post_status").val()||"draft"==a("#original_post_status").val()?h.length&&(h.remove(),g.val(a("#hidden_post_status").val())):h.html(postL10n.published),g.is(":hidden")&&a(".edit-post-status","#misc-publishing-actions").show()),a("#post-status-display").html(a("option:selected",g).text()),"private"==a("option:selected",g).val()||"publish"==a("option:selected",g).val()?a("#save-post").hide():(a("#save-post").show(),"pending"==a("option:selected",g).val()?a("#save-post").show().val(postL10n.savePending):a("#save-post").show().val(postL10n.saveDraft)),!0)}var d,e,f="",g=0,h=a("#content");postboxes.add_postbox_toggles(pagenow),a("#post-lock-dialog .notification-dialog").on("keydown",function(b){if(9==b.which){var c=a(b.target);c.hasClass("wp-tab-first")&&b.shiftKey?(a(this).find(".wp-tab-last").focus(),b.preventDefault()):c.hasClass("wp-tab-last")&&!b.shiftKey&&(a(this).find(".wp-tab-first").focus(),b.preventDefault())}}).filter(":visible").find(".wp-tab-first").focus(),a("#tagsdiv-post_tag").length?tagBox.init():a("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){return 0===this.id.indexOf("tagsdiv-")?(tagBox.init(),!1):void 0}),a(".categorydiv").each(function(){var b,c,d,e,f,g=a(this).attr("id");d=g.split("-"),d.shift(),e=d.join("-"),f=e+"_tab","category"==e&&(f="cats"),a("a","#"+e+"-tabs").click(function(){var b=a(this).attr("href");return a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a("#"+e+"-tabs").siblings(".tabs-panel").hide(),a(b).show(),"#"+e+"-all"==b?deleteUserSetting(f):setUserSetting(f,"pop"),!1}),getUserSetting(f)&&a('a[href="#'+e+'-pop"]',"#"+e+"-tabs").click(),a("#new"+e).one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#new"+e).keypress(function(b){13===b.keyCode&&(b.preventDefault(),a("#"+e+"-add-submit").click())}),a("#"+e+"-add-submit").click(function(){a("#new"+e).focus()}),b=function(b){return a("#new"+e).val()?(b.data+="&"+a(":checked","#"+e+"checklist").serialize(),a("#"+e+"-add-submit").prop("disabled",!0),b):!1},c=function(b,c){var d,f=a("#new"+e+"_parent");a("#"+e+"-add-submit").prop("disabled",!1),"undefined"!=c.parsed.responses[0]&&(d=c.parsed.responses[0].supplemental.newcat_parent)&&(f.before(d),f.remove())},a("#"+e+"checklist").wpList({alt:"",response:e+"-ajax-response",addBefore:b,addAfter:c}),a("#"+e+"-add-toggle").click(function(){return a("#"+e+"-adder").toggleClass("wp-hidden-children"),a('a[href="#'+e+'-all"]',"#"+e+"-tabs").click(),a("#new"+e).focus(),!1}),a("#"+e+"checklist, #"+e+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var b=a(this),c=b.is(":checked"),d=b.val();d&&b.parents("#taxonomy-"+e).length&&a("#in-"+e+"-"+d+", #in-popular-"+e+"-"+d).prop("checked",c)})}),a("#postcustom").length&&a("#the-list").wpList({addAfter:function(){a("table#list-table").show()},addBefore:function(b){return b.data+="&post_id="+a("#post_ID").val(),b}}),a("#submitdiv").length&&(d=a("#timestamp").html(),e=a("#post-visibility-display").html(),a(".edit-visibility","#visibility").click(function(){return a("#post-visibility-select").is(":hidden")&&(b(),a("#post-visibility-select").slideDown("fast"),a(this).hide()),!1}),a(".cancel-post-visibility","#post-visibility-select").click(function(){return a("#post-visibility-select").slideUp("fast"),a("#visibility-radio-"+a("#hidden-post-visibility").val()).prop("checked",!0),a("#post_password").val(a("#hidden-post-password").val()),a("#sticky").prop("checked",a("#hidden-post-sticky").prop("checked")),a("#post-visibility-display").html(e),a(".edit-visibility","#visibility").show(),c(),!1}),a(".save-post-visibility","#post-visibility-select").click(function(){var b=a("#post-visibility-select");return b.slideUp("fast"),a(".edit-visibility","#visibility").show(),c(),"public"!=a("input:radio:checked",b).val()&&a("#sticky").prop("checked",!1),f=1==a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[a("input:radio:checked",b).val()+f]),!1}),a("input:radio","#post-visibility-select").change(function(){b()}),a("#timestampdiv").siblings("a.edit-timestamp").click(function(){return a("#timestampdiv").is(":hidden")&&(a("#timestampdiv").slideDown("fast"),a("#mm").focus(),a(this).hide()),!1}),a(".cancel-timestamp","#timestampdiv").click(function(){return a("#timestampdiv").slideUp("fast"),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),a("#timestampdiv").siblings("a.edit-timestamp").show(),c(),!1}),a(".save-timestamp","#timestampdiv").click(function(){return c()&&(a("#timestampdiv").slideUp("fast"),a("#timestampdiv").siblings("a.edit-timestamp").show()),!1}),a("#post").on("submit",function(b){return c()?void 0:(b.preventDefault(),a("#timestampdiv").show(),a("#publishing-action .spinner").hide(),a("#publish").prop("disabled",!1).removeClass("button-primary-disabled"),!1)}),a("#post-status-select").siblings("a.edit-post-status").click(function(){return a("#post-status-select").is(":hidden")&&(a("#post-status-select").slideDown("fast"),a(this).hide()),!1}),a(".save-post-status","#post-status-select").click(function(){return a("#post-status-select").slideUp("fast"),a("#post-status-select").siblings("a.edit-post-status").show(),c(),!1}),a(".cancel-post-status","#post-status-select").click(function(){return a("#post-status-select").slideUp("fast"),a("#post_status").val(a("#hidden_post_status").val()),a("#post-status-select").siblings("a.edit-post-status").show(),c(),!1})),a("#edit-slug-box").length&&(editPermalink=function(b){var c,d=0,e=a("#editable-post-name"),f=e.html(),g=a("#post_name"),h=g.val(),i=a("#edit-slug-buttons"),j=i.html(),k=a("#editable-post-name-full").html();for(a("#view-post-btn").hide(),i.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>"),i.children(".save").click(function(){var c=e.children("input").val();return c==a("#editable-post-name-full").text()?a(".cancel","#edit-slug-buttons").click():(a.post(ajaxurl,{action:"sample-permalink",post_id:b,new_slug:c,new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(b){var d=a("#edit-slug-box");d.html(b),d.hasClass("hidden")&&d.fadeIn("fast",function(){d.removeClass("hidden")}),i.html(j),g.val(c),makeSlugeditClickable(),a("#view-post-btn").show()}),!1)}),a(".cancel","#edit-slug-buttons").click(function(){return a("#view-post-btn").show(),e.html(f),i.html(j),g.val(h),!1}),c=0;c<k.length;++c)"%"==k.charAt(c)&&d++;slug_value=d>k.length/4?"":k,e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(a){var b=a.keyCode||0;return 13==b?(i.children(".save").click(),!1):27==b?(i.children(".cancel").click(),!1):void 0}).keyup(function(){g.val(this.value)}).focus()},makeSlugeditClickable=function(){a("#editable-post-name").click(function(){a("#edit-slug-buttons").children(".edit-slug").click()})},makeSlugeditClickable()),"undefined"!=typeof wpWordCount&&(a(document).triggerHandler("wpcountwords",[h.val()]),h.keyup(function(b){var c=b.keyCode||b.charCode;return c==g?!0:((13==c||8==g||46==g)&&a(document).triggerHandler("wpcountwords",[h.val()]),g=c,!0)})),wptitlehint=function(b){b=b||"title";var c=a("#"+b),d=a("#"+b+"-prompt-text");""==c.val()&&d.removeClass("screen-reader-text"),d.click(function(){a(this).addClass("screen-reader-text"),c.focus()}),c.blur(function(){""==this.value&&d.removeClass("screen-reader-text")}).focus(function(){d.addClass("screen-reader-text")}).keydown(function(b){d.addClass("screen-reader-text"),a(this).unbind(b)})},wptitlehint(),function(){function b(a){return e.height(Math.max(50,f+a.pageY)+"px"),!1}function c(){var d;e.focus(),a(document).unbind("mousemove",b).unbind("mouseup",c),d=parseInt(e.css("height"),10),d&&d>50&&5e3>d&&setUserSetting("ed_size",d)}var d,e=a("textarea#content"),f=null;!e.length||"ontouchstart"in window||(e.css("resize","none"),d=a('<div id="content-resize-handle"><br></div>'),a("#wp-content-wrap").append(d),d.on("mousedown",function(d){return f=e.height()-d.pageY,e.blur(),a(document).mousemove(b).mouseup(c),!1}))}(),"undefined"!=typeof tinymce&&(tinymce.onAddEditor.add(function(b,c){function d(){var b,c=document.getElementById("content_ifr"),d=c?parseInt(c.style.height,10):0,e=a("#content_tbl tr.mceFirst").height();return d&&e?(b=d+e+21,b-=33):!1}"content"!=c.id||tinymce.isIOS5||(c.onLoadContent.add(function(){var b,c=document.getElementById("content"),d=c?parseInt(c.style.height,10):0,e=a("#content_tbl tr.mceFirst").height()||33;(!d||50>d||d>5e3)&&(d=360),getUserSetting("ed_size")>5e3&&setUserSetting("ed_size",360),b=d-e+12,b>50&&5e3>b&&(a("#content_tbl").css("height",""),a("#content_ifr").css("height",b+"px"))}),c.onSaveContent.add(function(){var b=d();!b||50>b||b>5e3||a("textarea#content").css("height",b+"px")}),c.onPostRender.add(function(){a("#content_resize").on("mousedown.wp-mce-resize",function(){a(document).on("mouseup.wp-mce-resize",function(){var b;a(document).off("mouseup.wp-mce-resize"),b=d(),b&&b>50&&5e3>b&&setUserSetting("ed_size",b)})})}))}),a("#post-formats-select input.post-format").on("change.set-editor-class",function(){var b,c,d=this.id;d&&a(this).prop("checked")&&(b=tinymce.get("content"),b&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d)))}))});
\ No newline at end of file