WordPress/wp-admin/js/dashboard.min.js
desrosj 2d74427834 Build/Test Tools: Support NodeJS 14.x in the 5.5 branch.
This updates the 5.5 branch to support the latest LTS version of NodeJS (currently 14.x) in an effort to allow the same version of NodeJS to be used across all WordPress branches receiving security updates as a courtesy.

In addition to backporting the package updates that happened after branching 5.5, dependencies that were removed in future releases have also been updated to their latest versions.

Props desrosj, dd32, netweb, jorbin.
Merges [48705,49636,49933,49937,49939-49940,49983,49989-49990,50016-50017,50126,50176,50185] to the 5.5 branch.
See #52341.
Built from https://develop.svn.wordpress.org/branches/5.5@50188


git-svn-id: http://core.svn.wordpress.org/branches/5.5@49866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-05 03:06:34 +00:00

2 lines
8.1 KiB
JavaScript

/*! This file is auto-generated */
window.wp=window.wp||{},jQuery(document).ready(function(s){var t,n=s("#welcome-panel"),e=s("#wp_welcome_panel-hide");t=function(e){s.post(ajaxurl,{action:"update-welcome-panel",visible:e,welcomepanelnonce:s("#welcomepanelnonce").val()})},n.hasClass("hidden")&&e.prop("checked")&&n.removeClass("hidden"),s(".welcome-panel-close, .welcome-panel-dismiss a",n).click(function(e){e.preventDefault(),n.addClass("hidden"),t(0),s("#wp_welcome_panel-hide").prop("checked",!1)}),e.click(function(){n.toggleClass("hidden",!this.checked),t(this.checked?1:0)}),window.ajaxWidgets=["dashboard_primary"],window.ajaxPopulateWidgets=function(e){function t(e,t){var n,o=s("#"+t+" div.inside:visible").find(".widget-loading");o.length&&(n=o.parent(),setTimeout(function(){n.load(ajaxurl+"?action=dashboard-widgets&widget="+t+"&pagenow="+pagenow,"",function(){n.hide().slideDown("normal",function(){s(this).css("display","")})})},500*e))}e?(e=e.toString(),-1!==s.inArray(e,ajaxWidgets)&&t(0,e)):s.each(ajaxWidgets,t)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),window.quickPressLoad=function(){var t,n,o,i,a,e=s("#quickpost-action");s('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!1),t=s("#quick-press").submit(function(e){e.preventDefault(),s("#dashboard_quick_press #publishing-action .spinner").show(),s('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),s.post(t.attr("action"),t.serializeArray(),function(e){var t;s("#dashboard_quick_press .inside").html(e),s("#quick-press").removeClass("initial-form"),quickPressLoad(),(t=s(".drafts ul li").first()).css("background","#fffbe5"),setTimeout(function(){t.css("background","none")},1e3),s("#title").focus()})}),s("#publish").click(function(){e.val("post-quickpress-publish")}),s("#quick-press").on("click focusin",function(){wpActiveEditor="content"}),document.documentMode&&document.documentMode<9||(s("body").append('<div class="quick-draft-textarea-clone" style="display: none;"></div>'),n=s(".quick-draft-textarea-clone"),o=s("#content"),i=o.height(),a=s(window).height()-100,n.css({"font-family":o.css("font-family"),"font-size":o.css("font-size"),"line-height":o.css("line-height"),"padding-bottom":o.css("paddingBottom"),"padding-left":o.css("paddingLeft"),"padding-right":o.css("paddingRight"),"padding-top":o.css("paddingTop"),"white-space":"pre-wrap","word-wrap":"break-word",display:"none"}),o.on("focus input propertychange",function(){var e=s(this),t=e.val()+"&nbsp;",t=n.css("width",e.css("width")).text(t).outerHeight()+2;o.css("overflow-y","auto"),t===i||a<=t&&a<=i||(i=a<t?a:t,o.css("overflow","hidden"),e.css("height",i+"px"))}))},window.quickPressLoad(),s(".meta-box-sortables").sortable("option","containment","#wpwrap")}),jQuery(function(r){"use strict";var m=window.communityEventsData||{},s=wp.date.dateI18n,c=wp.date.format,d=wp.i18n.sprintf,l=wp.i18n.__,u=wp.i18n._x,p=window.wp.communityEvents={initialized:!1,model:null,init:function(){var e;p.initialized||(e=r("#community-events"),r(".community-events-errors").attr("aria-hidden","true").removeClass("hide-if-js"),e.on("click",".community-events-toggle-location, .community-events-cancel",p.toggleLocationForm),e.on("submit",".community-events-form",function(e){var t=r.trim(r("#community-events-location").val());e.preventDefault(),t&&p.getEvents({location:t})}),m&&m.cache&&m.cache.location&&m.cache.events?p.renderEventsTemplate(m.cache,"app"):p.getEvents(),p.initialized=!0)},toggleLocationForm:function(e){var t=r(".community-events-toggle-location"),n=r(".community-events-cancel"),o=r(".community-events-form"),i=r();"object"==typeof e&&(i=r(e.target),e="true"==t.attr("aria-expanded")?"hide":"show"),"hide"===e?(t.attr("aria-expanded","false"),n.attr("aria-expanded","false"),o.attr("aria-hidden","true"),i.hasClass("community-events-cancel")&&t.focus()):(t.attr("aria-expanded","true"),n.attr("aria-expanded","true"),o.attr("aria-hidden","false"))},getEvents:function(t){var n,o=this,e=r(".community-events-form").children(".spinner");(t=t||{})._wpnonce=m.nonce,t.timezone=window.Intl?window.Intl.DateTimeFormat().resolvedOptions().timeZone:"",n=t.location?"user":"app",e.addClass("is-active"),wp.ajax.post("get-community-events",t).always(function(){e.removeClass("is-active")}).done(function(e){"no_location_available"===e.error&&(t.location?e.unknownCity=t.location:delete e.error),o.renderEventsTemplate(e,n)}).fail(function(){o.renderEventsTemplate({location:!1,events:[],error:!0},n)})},renderEventsTemplate:function(e,t){var n,o,i=/%(?:\d\$)?s/g,a=r(".community-events-toggle-location"),s=r("#community-events-location-message"),c=r(".community-events-results");e.events=p.populateDynamicEventFields(e.events,m.time_format),o={".community-events":!0,".community-events-loading":!1,".community-events-errors":!1,".community-events-error-occurred":!1,".community-events-could-not-locate":!1,"#community-events-location-message":!1,".community-events-toggle-location":!1,".community-events-results":!1},e.location.ip?(s.text(m.l10n.attend_event_near_generic),n=e.events.length?wp.template("community-events-event-list"):wp.template("community-events-no-upcoming-events"),c.html(n(e)),o["#community-events-location-message"]=!0,o[".community-events-toggle-location"]=!0,o[".community-events-results"]=!0):e.location.description?(n=wp.template("community-events-attend-event-near"),s.html(n(e)),n=e.events.length?wp.template("community-events-event-list"):wp.template("community-events-no-upcoming-events"),c.html(n(e)),"user"===t&&wp.a11y.speak(m.l10n.city_updated.replace(i,e.location.description),"assertive"),o["#community-events-location-message"]=!0,o[".community-events-toggle-location"]=!0,o[".community-events-results"]=!0):e.unknownCity?(n=wp.template("community-events-could-not-locate"),r(".community-events-could-not-locate").html(n(e)),wp.a11y.speak(m.l10n.could_not_locate_city.replace(i,e.unknownCity)),o[".community-events-errors"]=!0,o[".community-events-could-not-locate"]=!0):e.error&&"user"===t?(wp.a11y.speak(m.l10n.error_occurred_please_try_again),o[".community-events-errors"]=!0,o[".community-events-error-occurred"]=!0):(s.text(m.l10n.enter_closest_city),o["#community-events-location-message"]=!0,o[".community-events-toggle-location"]=!0),_.each(o,function(e,t){r(t).attr("aria-hidden",!e)}),a.attr("aria-expanded",o[".community-events-toggle-location"]),e.location&&(e.location.ip||e.location.latitude)?(p.toggleLocationForm("hide"),"user"===t&&a.focus()):p.toggleLocationForm("show")},populateDynamicEventFields:function(e,o){e=JSON.parse(JSON.stringify(e));return r.each(e,function(e,t){var n=p.getTimeZone(1e3*t.start_unix_timestamp);t.user_formatted_date=p.getFormattedDate(1e3*t.start_unix_timestamp,1e3*t.end_unix_timestamp,n),t.user_formatted_time=s(o,1e3*t.start_unix_timestamp,n),t.timeZoneAbbreviation=p.getTimeZoneAbbreviation(1e3*t.start_unix_timestamp)}),e},getTimeZone:function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;return t=void 0===t?p.getFlippedTimeZoneOffset(e):t},getFlippedTimeZoneOffset:function(e){return-1*new Date(e).getTimezoneOffset()},getTimeZoneAbbreviation:function(e){var t,n=new Date(e).toLocaleTimeString(void 0,{timeZoneName:"short"}).split(" ");return void 0===(t=3===n.length?n[2]:t)&&(n=p.getFlippedTimeZoneOffset(e),e=-1===Math.sign(n)?"":"+",t=u("GMT","Events widget offset prefix")+e+n/60),t},getFormattedDate:function(e,t,n){var o=l("l, M j, Y"),i=l("%1$s %2$d\u2013%3$d, %4$d"),a=l("%1$s %2$d \u2013 %3$s %4$d, %5$d"),n=t&&c("Y-m-d",e)!==c("Y-m-d",t)?c("Y-m",e)===c("Y-m",t)?d(i,s(u("F","upcoming events month format"),e,n),s(u("j","upcoming events day format"),e,n),s(u("j","upcoming events day format"),t,n),s(u("Y","upcoming events year format"),t,n)):d(a,s(u("F","upcoming events month format"),e,n),s(u("j","upcoming events day format"),e,n),s(u("F","upcoming events month format"),t,n),s(u("j","upcoming events day format"),t,n),s(u("Y","upcoming events year format"),t,n)):s(o,e,n);return n}};r("#dashboard_primary").is(":visible")?p.init():r(document).on("postbox-toggled",function(e,t){t=r(t);"dashboard_primary"===t.attr("id")&&t.is(":visible")&&p.init()})});