Ticket #31739: 31739.diff
File 31739.diff, 2.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/plugin-install.php
561 561 break; 562 562 case 'update_available': 563 563 if ( $status['url'] ) { 564 echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) .'</a>';564 echo '<a data-slug="' . esc_attr( $api->slug ) . '" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) .'</a>'; 565 565 } 566 566 break; 567 567 case 'newer_installed': -
src/wp-admin/js/updates.js
1 /* global tb_remove */ 1 2 window.wp = window.wp || {}; 2 3 3 4 (function( $, wp, pagenow ) { … … 470 471 wp.updates.updatePlugin( $button.data( 'plugin' ), $button.data( 'slug' ) ); 471 472 } ); 472 473 474 // 475 $( '#plugin-information #plugin-information-footer a' ).on( 'click' , function( e ) { 476 var target = window.parent == window ? null : window.parent, 477 data; 478 $.support.postMessage = !! window.postMessage; 479 if ( $.support.postMessage === false || target === null ) 480 return; 481 482 e.preventDefault(); 483 484 data = { 485 'action' : 'updatePlugin', 486 'slug' : $(this).data('slug') 487 }; 488 489 target.postMessage( JSON.stringify( data ), window.location.origin ); 490 }); 491 473 492 } ); 474 493 475 494 $( window ).on( 'message', function( e ) { … … 484 503 485 504 message = $.parseJSON( event.data ); 486 505 487 if ( typeof message.action === 'undefined' || message.action !== 'decrementUpdateCount') {506 if ( typeof message.action === 'undefined' ) { 488 507 return; 489 508 } 490 509 491 wp.updates.decrementCount( message.upgradeType ); 510 switch (message.action){ 511 case 'decrementUpdateCount' : 512 wp.updates.decrementCount( message.upgradeType ); 513 break; 514 case 'updatePlugin' : 515 tb_remove(); 516 $( '.plugin-update-tr[data-slug="' + message.slug + '"]' ).focus().find( '.update-link' ).trigger( 'click' ); 517 break; 518 } 492 519 520 521 493 522 } ); 494 523 495 524 /*