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

2 lines
19 KiB
JavaScript

/*! This file is auto-generated */
!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,o=wp.i18n.sprintf;function r(e,t,n){var i;i=void 0!==n?o(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):o(q("%1$s is deprecated since version %2$s with no alternative available."),e,t),$.console.warn(i)}function e(i,o,s){var a={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(a,e,{get:function(){return r(n,s,t.alternative),t.func()}}):Object.defineProperty(a,e,{get:function(){return r(n,s,"wp.i18n"),t}})}),a}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n,"5.5.0"),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n,"5.5.0"),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n,"5.5.0"),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n,"5.5.0"),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n,"5.5.0"),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n,"5.5.0"),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n,"5.5.0"),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n,"5.5.0"),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n,"5.5.0"),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n,"5.5.0"),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n,"5.5.0"),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n,"5.5.0"),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n,"5.5.0"),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n,"5.5.0"),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n,"5.5.0"),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n,"5.5.0"),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").click(function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=W("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").delegate("a","click",function(e){var t,n=W(this);if(e.preventDefault(),n.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=W(n.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,a=!1,l=W("#permalink_structure"),n=W(".permalink-structure input:radio"),c=W("#custom_selection"),i=W(".form-table.permalink-structure .available-structure-tags button");function d(e){-1!==l.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function s(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(l.val(this.value),i.each(function(){d(W(this))}))}),l.on("click input",function(){c.prop("checked",!0)}),l.on("focus",function(e){a=!0,W(this).off(e)}),i.each(function(){d(W(this))}),l.on("change",function(){i.each(function(){d(W(this))})}),i.on("click",function(){var e,t=l.val(),n=l[0].selectionStart,i=l[0].selectionEnd,o=W(this).text().trim(),s=W(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),l.val("/"===t?"":t),W("#custom_selection_updated").text(s),void d(W(this));a||0!==n||0!==i||(n=i=t.length),c.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),l.val(t.substr(0,n)+o+t.substr(i)),W("#custom_selection_updated").text(s),d(W(this)),a&&l[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,l[0].setSelectionRange(e,e),l.focus())}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=W("input.current-page"),m=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),f=-1!==navigator.userAgent.indexOf("Android"),v=W("#adminmenuwrap"),b=W("#wpwrap"),g=W("#adminmenu"),w=W("#wp-responsive-overlay"),k=W("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),L=W(".meta-box-sortables"),y=!1,x=W("#wpadminbar"),S=0,P=!1,T=!1,M=0,_=!1,D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()},E=W(".wp-header-end");function A(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function O(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)<t-n&&(n=t-i),a<n&&(n=a),1<n?r.css("margin-top","-"+n+"px"):r.css("margin-top","")}function j(){W(".notice.is-dismissible").each(function(){var t=W(this),e=W('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>');e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(D.menu+D.adminbar<D.window||D.menu+D.adminbar+20>D.wpwrap)I();else{if(_=!0,D.menu+D.adminbar>D.window){if(t<0)return void(P||(T=!(P=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+D.window>Q.height()-1)return void(T||(P=!(T=!0),v.css({position:"fixed",top:"",bottom:0})));S<t?P?(P=!1,(M=v.offset().top-D.adminbar-(t-S))+D.menu+D.adminbar<t+D.window&&(M=t+D.window-D.menu-D.adminbar),v.css({position:"absolute",top:M,bottom:""})):!T&&v.offset().top+D.menu<t+D.window&&(T=!0,v.css({position:"fixed",top:"",bottom:0})):t<S?T?(T=!1,(M=v.offset().top-D.adminbar+(S-t))+D.menu>t+D.window&&(M=t),v.css({position:"absolute",top:M,bottom:""})):!P&&v.offset().top>=t+D.adminbar&&(P=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(P=T=!1,0<(M=t+D.window-D.menu-D.adminbar-1)?v.css({position:"absolute",top:M,bottom:""}):I())}S=t}}function F(){D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()}}function I(){!h&&_&&(P=T=_=!1,v.css({position:"",top:"",bottom:""}))}function K(){F(),g.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):D.menu+D.adminbar>D.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return $.innerWidth&&(e=Math.max($.innerWidth,document.documentElement.clientWidth)),e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782<e?"folded":"open",Q.trigger("wp-menu-state-set",{state:r})}g.on("click.wp-submenu-head",".wp-submenu-head",function(e){W(e.target).parent().siblings("a").get(0).click()}),W("#collapse-button").on("click.collapse-menu",function(){var e=B()||961;W("#adminmenu div.wp-submenu").css("margin-top",""),r=e<960?V.hasClass("auto-fold")?(V.removeClass("auto-fold").removeClass("folded"),setUserSetting("unfold",1),setUserSetting("mfold","o"),"open"):(V.addClass("auto-fold"),setUserSetting("unfold",0),"folded"):V.hasClass("folded")?(V.removeClass("folded"),setUserSetting("mfold","o"),"open"):(V.addClass("folded"),setUserSetting("mfold","f"),"folded"),Q.trigger("wp-collapse-menu",{state:r})}),Q.on("wp-menu-state-set wp-collapse-menu wp-responsive-activate wp-responsive-deactivate",A),("ontouchstart"in $||/IEMobile\/[1-9]/.test(navigator.userAgent))&&(e=h?"touchstart":"click",V.on(e+".wp-mobile-hover",function(e){g.data("wp-responsive")||W(e.target).closest("#adminmenu").length||g.find("li.opensub").removeClass("opensub")}),g.find("a.wp-has-submenu").on(e+".wp-mobile-hover",function(e){var t=W(this).parent();g.data("wp-responsive")||t.hasClass("opensub")||t.hasClass("wp-menu-open")&&!(t.width()<40)||(e.preventDefault(),O(t),g.find("li.opensub").removeClass("opensub"),t.addClass("opensub"))})),h||f||(g.find("li.wp-has-submenu").hoverIntent({over:function(){var e=W(this),t=e.find(".wp-submenu"),n=parseInt(t.css("top"),10);isNaN(n)||-5<n||g.data("wp-responsive")||(O(e),g.find("li.opensub").removeClass("opensub"),e.addClass("opensub"))},out:function(){g.data("wp-responsive")||W(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90}),g.on("focus.adminmenu",".wp-submenu a",function(e){g.data("wp-responsive")||W(e.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(e){g.data("wp-responsive")||W(e.target).closest("li.menu-top").removeClass("opensub")}).find("li.wp-has-submenu.wp-not-current-submenu").on("focusin.adminmenu",function(){O(W(this))})),E.length||(E=W(".wrap h1, .wrap h2").first()),W("div.updated, div.error, div.notice").not(".inline, .below-h2").insertAfter(E),Q.on("wp-updates-notice-added wp-plugin-install-error wp-plugin-update-error wp-plugin-delete-error wp-theme-install-error wp-theme-delete-error",j),screenMeta.init(),V.on("click","tbody > tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0<i&&0<o&&i!=o&&(i<o?n.slice(i,o):n.slice(o,i)).prop("checked",function(){return!!W(this).closest("tr").is(":visible")&&s})}var t=W(u=this).closest("tbody").find(":checkbox").filter(":visible:enabled").not(":checked");return W(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0===t.length}),!0}),V.on("click.wp-toggle-checkboxes","thead .check-column :checkbox, tfoot .check-column :checkbox",function(e){var t=W(this),n=t.closest("table"),i=t.prop("checked"),o=e.shiftKey||t.data("wp-toggle");n.children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!W(this).is(":hidden,:disabled")&&(o?!W(this).prop("checked"):!!i)}),n.children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!o&&!!i})}),W("#wpbody-content").on({focusin:function(){clearTimeout(t),a=W(this).find(".row-actions"),W(".row-actions").not(this).removeClass("visible"),a.addClass("visible")},focusout:function(){t=setTimeout(function(){a.removeClass("visible")},30)}},".table-view-list .has-row-actions"),W("tbody").on("click",".toggle-row",function(){W(this).closest("tr").toggleClass("is-expanded")}),W("#default-password-nag-no").click(function(){return setUserSetting("default_password_nag","hide"),W("div.default-password-nag").hide(),!1}),W("#newcontent").bind("keydown.wpevent_InsertTab",function(e){var t,n,i,o,s=e.target;if(27==e.keyCode)return e.preventDefault(),void W(s).data("tab-out",!0);9!=e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||(W(s).data("tab-out")?W(s).data("tab-out",!1):(t=s.selectionStart,n=s.selectionEnd,i=s.value,document.selection?(s.focus(),document.selection.createRange().text="\t"):0<=t&&(o=this.scrollTop,s.value=i.substring(0,t).concat("\t",i.substring(n)),s.selectionStart=s.selectionEnd=t+1,this.scrollTop=o),e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()))}),p.length&&p.closest("form").submit(function(){-1==W('select[name="action"]').val()&&-1==W('select[name="action2"]').val()&&p.val()==m&&p.val("1")}),W('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function(){W('select[name^="action"]').val("-1")}),W("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(e){e.target.scrollIntoView&&e.target.scrollIntoView(!1)}),(d=W("form.wp-upload-form")).length&&(l=d.find('input[type="submit"]'),c=d.find('input[type="file"]'),R(),c.on("change",R)),h||(H.on("scroll.pin-menu",U),Q.on("tinymce-editor-init.pin-menu",function(e,t){t.on("wp-autoresize",F)})),$.wpResponsive={init:function(){var e=this;this.maybeDisableSortables=this.maybeDisableSortables.bind(this),Q.on("wp-responsive-activate.wp-responsive",function(){e.activate()}).on("wp-responsive-deactivate.wp-responsive",function(){e.deactivate()}),W("#wp-admin-bar-menu-toggle a").attr("aria-expanded","false"),W("#wp-admin-bar-menu-toggle").on("click.wp-responsive",function(e){e.preventDefault(),x.find(".hover").removeClass("hover"),b.toggleClass("wp-responsive-open"),b.hasClass("wp-responsive-open")?(W(this).find("a").attr("aria-expanded","true"),W("#adminmenu a:first").focus()):W(this).find("a").attr("aria-expanded","false")}),g.on("click.wp-responsive","li.wp-has-submenu > a",function(e){g.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1<navigator.userAgent.indexOf("AppleWebKit/")?H.width():$.innerWidth)<=782||L.find(".ui-sortable-handle:visible").length<=1&&jQuery(".columns-prefs-1 input").prop("checked")?this.disableSortables():this.enableSortables()},activate:function(){K(),V.hasClass("auto-fold")||V.addClass("auto-fold"),g.data("wp-responsive",1),this.disableSortables()},deactivate:function(){K(),g.removeData("wp-responsive"),this.maybeDisableSortables()},trigger:function(){var e=B();e&&(e<=782?y||(Q.trigger("wp-responsive-activate"),y=!0):y&&(Q.trigger("wp-responsive-deactivate"),y=!1),e<=480?this.enableOverlay():this.disableOverlay(),this.maybeDisableSortables())},enableOverlay:function(){0===w.length&&(w=W('<div id="wp-responsive-overlay"></div>').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),W(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(L.length)try{L.sortable("disable"),L.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(L.length)try{L.sortable("enable"),L.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=W("#collapse-button");i="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),$.wpResponsive.init(),K(),N(),A(),j(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").focus(),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(s,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window);