* Hides the update button for expired plugin or theme uploads.
* On the "Update plugin/theme from uploaded zip" screen, once the upload has expired,
* hides the "Replace current with uploaded" button and displays a warning.
$document.ready( function( $ ) {
var $overwrite, $warning;
if ( ! $body.hasClass( 'update-php' ) ) {
$overwrite = $( 'a.update-from-upload-overwrite' );
$warning = $( '.update-from-upload-expired' );
if ( ! $overwrite.length || ! $warning.length ) {
$warning.removeClass( 'hidden' );
if ( window.wp && window.wp.a11y ) {
window.wp.a11y.speak( $warning.text() );
7140000 // 119 minutes. The uploaded file is deleted after 2 hours.
// Fire a custom jQuery event at the end of window resize.
* Triggers the WP window-resize event.
function triggerEvent() {
$document.trigger( 'wp-window-resized' );
* Fires the trigger event again after 200 ms.
window.clearTimeout( timeout );
timeout = window.setTimeout( triggerEvent, 200 );
$window.on( 'resize.wp-fire-once', fireOnce );
// Make Windows 8 devices play along nicely.
if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) {
var msViewportStyle = document.createElement( 'style' );
msViewportStyle.appendChild(
document.createTextNode( '@-ms-viewport{width:auto!important}' )
document.getElementsByTagName( 'head' )[0].appendChild( msViewportStyle );