Changeset 27280
- Timestamp:
- 02/26/2014 06:54:26 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
r26518 r27280 93 93 function after() {} 94 94 95 /** 96 * Output JavaScript that calls function to decrement the update counts. 97 * 98 * @since 3.9.0 99 */ 100 protected function decrement_update_count( $type ) { 101 if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) { 102 return; 103 } 104 echo '<script type="text/javascript"> 105 (function( wp ) { 106 if ( wp && wp.updates.decrementCount ) { 107 wp.updates.decrementCount( "' . $type . '" ); 108 } 109 })( window.wp ); 110 </script>'; 111 } 95 112 } 96 113 … … 124 141 echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) .'"></iframe>'; 125 142 } 143 144 $this->decrement_update_count( 'plugin' ); 126 145 127 146 $update_actions = array( … … 253 272 flush(); 254 273 } 274 275 /** 276 * Output JavaScript that sends message to parent window to decrement the update counts. 277 * 278 * @since 3.9.0 279 */ 280 protected function decrement_update_count( $type ) { 281 if ( ! $this->result || is_wp_error( $this->result ) || 'up_to_date' === $this->result ) { 282 return; 283 } 284 echo '<script type="text/javascript"> 285 if ( window.postMessage && JSON ) { 286 window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname ); 287 } 288 </script>'; 289 } 255 290 } 256 291 … … 273 308 function after($title = '') { 274 309 parent::after($this->plugin_info['Title']); 310 $this->decrement_update_count( 'plugin' ); 275 311 } 276 312 function bulk_footer() { … … 307 343 function after($title = '') { 308 344 parent::after( $this->theme_info->display('Name') ); 345 $this->decrement_update_count( 'theme' ); 309 346 } 310 347 … … 480 517 481 518 function after() { 519 $this->decrement_update_count( 'theme' ); 482 520 483 521 $update_actions = array(); … … 562 600 563 601 function bulk_footer() { 602 $this->decrement_update_count( 'translation' ); 564 603 $update_actions = array(); 565 604 $update_actions['updates_page'] = '<a href="' . self_admin_url( 'update-core.php' ) . '" title="' . esc_attr__( 'Go to WordPress Updates page' ) . '" target="_parent">' . __( 'Return to WordPress Updates' ) . '</a>'; -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r27047 r27280 561 561 562 562 if ( !isset( $current->response[ $plugin ] ) ) { 563 $this->skin->set_result( true);563 $this->skin->set_result('up_to_date'); 564 564 $this->skin->before(); 565 565 $this->skin->feedback('up_to_date'); … … 864 864 $this->skin->before(); 865 865 $this->skin->set_result(false); 866 $this->skin->error( 'up_to_date');866 $this->skin->error( 'up_to_date' ); 867 867 $this->skin->after(); 868 868 return false; … … 949 949 $this->skin->set_result(true); 950 950 $this->skin->before(); 951 $this->skin->feedback( 'up_to_date');951 $this->skin->feedback( 'up_to_date' ); 952 952 $this->skin->after(); 953 953 $results[$theme] = true; -
trunk/src/wp-admin/plugins.php
r27158 r27280 114 114 $parent_file = 'plugins.php'; 115 115 116 wp_enqueue_script( 'updates' ); 116 117 require_once(ABSPATH . 'wp-admin/admin-header.php'); 117 118 -
trunk/src/wp-admin/update-core.php
r27205 r27280 12 12 wp_enqueue_style( 'plugin-install' ); 13 13 wp_enqueue_script( 'plugin-install' ); 14 wp_enqueue_script( 'updates' ); 14 15 add_thickbox(); 15 16 -
trunk/src/wp-admin/update.php
r27158 r27280 38 38 $nonce = 'bulk-update-plugins'; 39 39 40 wp_enqueue_script( 'jquery');40 wp_enqueue_script( 'updates' ); 41 41 iframe_header(); 42 42 … … 55 55 $parent_file = 'plugins.php'; 56 56 $submenu_file = 'plugins.php'; 57 58 wp_enqueue_script( 'updates' ); 57 59 require_once(ABSPATH . 'wp-admin/admin-header.php'); 58 60 … … 155 157 156 158 wp_enqueue_script( 'customize-loader' ); 159 wp_enqueue_script( 'updates' ); 157 160 158 161 $title = __('Update Theme'); … … 186 189 $nonce = 'bulk-update-themes'; 187 190 188 wp_enqueue_script( 'jquery');191 wp_enqueue_script( 'updates' ); 189 192 iframe_header(); 190 193 -
trunk/src/wp-includes/script-loader.php
r27271 r27280 482 482 ) ); 483 483 484 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery' ) ); 485 484 486 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 485 487
Note: See TracChangeset
for help on using the changeset viewer.