[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/js/ -> inline-edit-post.min.js (source)

   1  /*! This file is auto-generated */
   2  window.wp=window.wp||{},function(h,a){window.inlineEditPost={init:function(){var i=this,t=h("#inline-edit"),e=h("#bulk-edit");i.type=h("table.widefat").hasClass("pages")?"page":"post",i.what="#post-",t.keyup(function(t){if(27===t.which)return inlineEditPost.revert()}),e.keyup(function(t){if(27===t.which)return inlineEditPost.revert()}),h(".cancel",t).click(function(){return inlineEditPost.revert()}),h(".save",t).click(function(){return inlineEditPost.save(this)}),h("td",t).keydown(function(t){if(13===t.which&&!h(t.target).hasClass("cancel"))return inlineEditPost.save(this)}),h(".cancel",e).click(function(){return inlineEditPost.revert()}),h('#inline-edit .inline-edit-private input[value="private"]').click(function(){var t=h("input.inline-edit-password-input");h(this).prop("checked")?t.val("").prop("disabled",!0):t.prop("disabled",!1)}),h("#the-list").on("click",".editinline",function(){h(this).attr("aria-expanded","true"),inlineEditPost.edit(this)}),h("#bulk-edit").find("fieldset:first").after(h("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(h("#inline-edit label.inline-edit-tags").clone()),h('select[name="_status"] option[value="future"]',e).remove(),h("#doaction, #doaction2").click(function(t){var e;i.whichBulkButtonId=h(this).attr("id"),e=i.whichBulkButtonId.substr(2),"edit"===h('select[name="'+e+'"]').val()?(t.preventDefault(),i.setBulk()):0<h("form#posts-filter tr.inline-editor").length&&i.revert()})},toggle:function(t){var e=this;"none"===h(e.what+e.getId(t)).css("display")?e.revert():e.edit(t)},setBulk:function(){var i="",t=this.type,n=!0;if(this.revert(),h("#bulk-edit td").attr("colspan",h("th:visible, td:visible",".widefat:first thead").length),h("table.widefat tbody").prepend(h("#bulk-edit")).prepend('<tr class="hidden"></tr>'),h("#bulk-edit").addClass("inline-editor").show(),h('tbody th.check-column input[type="checkbox"]').each(function(){if(h(this).prop("checked")){n=!1;var t,e=h(this).val();t=h("#inline_"+e+" .post_title").html()||inlineEditL10n.notitle,i+='<div id="ttle'+e+'"><a id="_'+e+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+t+"</div>"}}),n)return this.revert();h("#bulk-titles").html(i),h("#bulk-titles a").click(function(){var t=h(this).attr("id").substr(1);h('table.widefat input[value="'+t+'"]').prop("checked",!1),h("#ttle"+t).remove()}),"post"===t&&h("tr.inline-editor textarea[data-wp-taxonomy]").each(function(t,e){h(e).autocomplete("instance")||h(e).wpTagsSuggest()}),h("html, body").animate({scrollTop:0},"fast")},edit:function(a){var t,s,e,i,n,o,l,r,d,c,p=this,u=!0;for(p.revert(),"object"==typeof a&&(a=p.getId(a)),t=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===p.type&&t.push("post_parent"),s=h("#inline-edit").clone(!0),h("td",s).attr("colspan",h("th:visible, td:visible",".widefat:first thead").length),h(p.what+a).removeClass("is-expanded").hide().after(s).after('<tr class="hidden"></tr>'),e=h("#inline_"+a),h(':input[name="post_author"] option[value="'+h(".post_author",e).text()+'"]',s).val()||h(':input[name="post_author"]',s).prepend('<option value="'+h(".post_author",e).text()+'">'+h("#"+p.type+"-"+a+" .author").text()+"</option>"),1===h(':input[name="post_author"] option',s).length&&h("label.inline-edit-author",s).hide(),r=0;r<t.length;r++)(d=h("."+t[r],e)).find("img").replaceWith(function(){return this.alt}),d=d.text(),h(':input[name="'+t[r]+'"]',s).val(d);if("open"===h(".comment_status",e).text()&&h('input[name="comment_status"]',s).prop("checked",!0),"open"===h(".ping_status",e).text()&&h('input[name="ping_status"]',s).prop("checked",!0),"sticky"===h(".sticky",e).text()&&h('input[name="sticky"]',s).prop("checked",!0),h(".post_category",e).each(function(){var t,e=h(this).text();e&&(t=h(this).attr("id").replace("_"+a,""),h("ul."+t+"-checklist :checkbox",s).val(e.split(",")))}),h(".tags_input",e).each(function(){var t=h(this),e=h(this).attr("id").replace("_"+a,""),i=h("textarea.tax_input_"+e,s),n=inlineEditL10n.comma;t.find("img").replaceWith(function(){return this.alt}),(t=t.text())&&(","!==n&&(t=t.replace(/,/g,n)),i.val(t)),i.wpTagsSuggest()}),"future"!==(i=h("._status",e).text())&&h('select[name="_status"] option[value="future"]',s).remove(),c=h(".inline-edit-password-input").prop("disabled",!1),"private"===i&&(h('input[name="keep_private"]',s).prop("checked",!0),c.val("").prop("disabled",!0)),0<(n=h('select[name="post_parent"] option[value="'+a+'"]',s)).length){for(o=n[0].className.split("-")[1],l=n;u&&0!==(l=l.next("option")).length;)l[0].className.split("-")[1]<=o?u=!1:(l.remove(),l=n);n.remove()}return h(s).attr("id","edit-"+a).addClass("inline-editor").show(),h(".ptitle",s).focus(),!1},save:function(n){var t,e=h(".post_status_page").val()||"";return"object"==typeof n&&(n=this.getId(n)),h("table.widefat .spinner").addClass("is-active"),t={action:"inline-save",post_type:typenow,post_ID:n,edit_date:"true",post_status:e},t=h("#edit-"+n).find(":input").serialize()+"&"+h.param(t),h.post(ajaxurl,t,function(t){var e=h("#edit-"+n+" .inline-edit-save .notice-error"),i=e.find(".error");h("table.widefat .spinner").removeClass("is-active"),h(".ac_results").hide(),t?-1!==t.indexOf("<tr")?(h(inlineEditPost.what+n).siblings("tr.hidden").addBack().remove(),h("#edit-"+n).before(t).remove(),h(inlineEditPost.what+n).hide().fadeIn(400,function(){h(this).find(".editinline").attr("aria-expanded","false").focus(),a.a11y.speak(inlineEditL10n.saved)})):(t=t.replace(/<.[^<>]*?>/g,""),e.removeClass("hidden"),i.html(t),a.a11y.speak(i.text())):(e.removeClass("hidden"),i.html(inlineEditL10n.error),a.a11y.speak(inlineEditL10n.error))},"html"),!1},revert:function(){var t=h(".widefat"),e=h(".inline-editor",t).attr("id");return e&&(h(".spinner",t).removeClass("is-active"),h(".ac_results").hide(),"bulk-edit"===e?(h("#bulk-edit",t).removeClass("inline-editor").hide().siblings(".hidden").remove(),h("#bulk-titles").empty(),h("#inlineedit").append(h("#bulk-edit")),h("#"+inlineEditPost.whichBulkButtonId).focus()):(h("#"+e).siblings("tr.hidden").addBack().remove(),e=e.substr(e.lastIndexOf("-")+1),h(this.what+e).show().find(".editinline").attr("aria-expanded","false").focus())),!1},getId:function(t){var e=h(t).closest("tr").attr("id").split("-");return e[e.length-1]}},h(document).ready(function(){inlineEditPost.init()}),h(document).on("heartbeat-tick.wp-check-locked-posts",function(t,e){var o=e["wp-check-locked-posts"]||{};h("#the-list tr").each(function(t,e){var i,n,a=e.id,s=h(e);o.hasOwnProperty(a)?s.hasClass("wp-locked")||(i=o[a],s.find(".column-title .locked-text").text(i.text),s.find(".check-column checkbox").prop("checked",!1),i.avatar_src&&(n=h('<img class="avatar avatar-18 photo" width="18" height="18" alt="" />').attr("src",i.avatar_src.replace(/&amp;/g,"&")),s.find(".column-title .locked-avatar").empty().append(n)),s.addClass("wp-locked")):s.hasClass("wp-locked")&&s.removeClass("wp-locked").find(".locked-info span").empty()})}).on("heartbeat-send.wp-check-locked-posts",function(t,e){var i=[];h("#the-list tr").each(function(t,e){e.id&&i.push(e.id)}),i.length&&(e["wp-check-locked-posts"]=i)}).ready(function(){void 0!==a&&a.heartbeat&&a.heartbeat.interval(15)})}(jQuery,window.wp);


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7