Ticket #29820: 29820.patch
File 29820.patch, 3.1 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/plugin-install.js
1 /* global plugininstallL10n, tb_click , confirm*/1 /* global plugininstallL10n, tb_click */ 2 2 3 3 /* Plugin Browser Thickbox related JS*/ 4 4 var tb_position; -
src/wp-admin/js/updates.js
1 1 window.wp = window.wp || {}; 2 2 3 (function( $, wp ) { 4 3 (function( $, wp, pagenow, ajaxurl ) { 5 4 wp.updates = {}; 6 5 7 6 /** … … 52 51 var count, 53 52 pluginCount, 54 53 $adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ), 55 $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ) 54 $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ), 56 55 $pluginsMenuItem = $( '#menu-plugins' ); 57 56 58 57 … … 153 152 if ( jqxhr.responseJSON && jqxhr.responseJSON.data && jqxhr.responseJSON.data.error ) { 154 153 alertText += ': ' + jqxhr.responseJSON.data.error; 155 154 } 156 alert( alertText );155 window.alert( alertText ); 157 156 if ( jqxhr.responseJSON && jqxhr.responseJSON.data && jqxhr.responseJSON.data.slug ) { 158 157 wp.updates.updateError( jqxhr.responseJSON ); 159 158 } … … 162 161 * Check the queue. 163 162 */ 164 163 wp.updates.queueChecker(); 165 } 164 }; 166 165 167 166 /** 168 167 * On a successful plugin update, update the UI with the result. … … 262 261 if ( jqxhr.responseJSON && jqxhr.responseJSON.data && jqxhr.responseJSON.data.error ) { 263 262 alertText += ': ' + jqxhr.responseJSON.data.error; 264 263 } 265 alert( alertText );264 window.alert( alertText ); 266 265 if ( jqxhr.responseJSON && jqxhr.responseJSON.data && jqxhr.responseJSON.data.slug ) { 267 266 wp.updates.installError( jqxhr.responseJSON ); 268 267 } … … 322 321 wp.updates.installPlugin( job.data.slug ); 323 322 break; 324 323 default: 325 console.log( 'Failed to exect queued update job.' );326 console.log( job );324 window.console.log( 'Failed to exect queued update job.' ); 325 window.console.log( job ); 327 326 break; 328 327 } 329 328 }; … … 336 335 } ); 337 336 338 337 $( '#bulk-action-form' ).on( 'submit', function( e ) { 339 var checkbox, plugin, slug;338 var $checkbox, plugin, slug; 340 339 341 340 if ( $( '#bulk-action-selector-top' ).val() == 'update-selected' ) { 342 341 e.preventDefault(); … … 355 354 356 355 $( '.plugin-card .update-now' ).on( 'click', function( e ) { 357 356 e.preventDefault(); 358 $button = $( e.target );357 var $button = $( e.target ); 359 358 wp.updates.updatePlugin( $button.data( 'plugin' ), $button.data( 'slug' ) ); 360 359 } ); 361 360 362 361 $( '.plugin-card .install-now' ).on( 'click', function( e ) { 363 362 e.preventDefault(); 364 $button = $( e.target );363 var $button = $( e.target ); 365 364 if ( $button.hasClass( 'button-disabled' ) ) { 366 365 return; 367 366 } … … 389 388 390 389 } ); 391 390 392 })( jQuery, window.wp );391 })( jQuery, window.wp, window.pagenow, window.ajaxurl );