WordPress/wp-admin/js/post.min.js

2 lines
18 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(n){var t=!1,a=wp.i18n.__;window.commentsBox={st:0,get:function(t,e){var i=this.st;return this.st+=e=e||20,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:i,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").text(a("Show more comments")))):void(1!=t?n("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>"):n("#show-comments").text(a("No more comments found.")))}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){n(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=n('input[value="_thumbnail_id"]',"#list-table");0<e.length&&n("#meta\\["+e.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(t)},window.WPRemoveThumbnail=function(t){n.post(ajaxurl,{action:"set-post-thumbnail",post_id:n("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:t,cookie:encodeURIComponent(document.cookie)},function(t){"0"==t?alert(a("Could not set that as the thumbnail image. Try a different attachment.")):WPSetThumbnailHTML(t)})},n(document).on("heartbeat-send.refresh-lock",function(t,e){var i=n("#active_post_lock").val(),a=n("#post_ID").val(),s={};a&&n("#post-lock-dialog").length&&(s.post_id=a,i&&(s.lock=i),e["wp-refresh-post-lock"]=s)}).on("heartbeat-tick.refresh-lock",function(t,e){var i,a;e["wp-refresh-post-lock"]&&((i=e["wp-refresh-post-lock"]).lock_error?(a=n("#post-lock-dialog")).length&&!a.is(":visible")&&(wp.autosave&&(n(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),a.removeClass("saving").addClass("saved"),n(window).off("beforeunload.edit-post")}),a.addClass("saving"),wp.autosave.server.triggerSave()),i.lock_error.avatar_src&&(e=n("<img />",{class:"avatar avatar-64 photo",width:64,height:64,alt:"",src:i.lock_error.avatar_src,srcset:i.lock_error.avatar_src_2x?i.lock_error.avatar_src_2x+" 2x":void 0}),a.find("div.post-locked-avatar").empty().append(e)),a.show().find(".currently-editing").text(i.lock_error.text),a.find(".wp-tab-first").focus()):i.new_lock&&n("#active_post_lock").val(i.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(s){var n,t;function i(){n=!1,window.clearTimeout(t),t=window.setTimeout(function(){n=!0},3e5)}s(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var i,a=s("#wp-auth-check-wrap");(n||a.length&&!a.hasClass("hidden"))&&(i=s("#post_ID").val())&&s("#_wpnonce").val()&&(e["wp-refresh-post-nonces"]={post_id:i})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(i(),e.replace&&s.each(e.replace,function(t,e){s("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){i()})}(jQuery),jQuery(document).ready(function(u){var p,e,i,a,s,n,o,l,c,t,r,d,h=u("#content"),f=u(document),v=u("#post_ID").val()||0,m=u("#submitpost"),w=!0,b=u("#post-visibility-select"),g=u("#timestampdiv"),k=u("#post-status-select"),_=!!window.navigator.platform&&-1!==window.navigator.platform.indexOf("Mac"),y=new ClipboardJS(".copy-attachment-url.edit-media"),x=wp.i18n.__,C=wp.i18n._x;function D(t){r.hasClass("wp-editor-expand")||(c?o.theme.resizeTo(null,l+t.pageY):h