Changeset 29577
- Timestamp:
- 08/22/2014 06:54:08 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
wp-admin/includes/ajax-actions.php (modified) (1 diff)
-
wp-includes/js/mce-view.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r29559 r29577 2724 2724 2725 2725 if ( empty( $shortcode ) ) { 2726 wp_send_json_error( array( 'statusText' => __( 'No items found.' ) ) ); 2726 wp_send_json_error( array( 2727 'type' => 'no-items', 2728 'message' => __( 'No items found.' ), 2729 ) ); 2727 2730 } 2728 2731 -
trunk/src/wp-includes/js/mce-view.js
r29571 r29577 562 562 if ( this.parsed ) { 563 563 this.setIframes( this.parsed ); 564 } else if ( this.parsed === false ){565 this. setContent( '<p>' + this.original + '</p>', 'replace');564 } else { 565 this.fail(); 566 566 } 567 567 }, … … 577 577 } 578 578 } ) 579 .always( function() {580 self.parsed = false;581 } )582 579 .done( function( response ) { 583 580 if ( response ) { 584 581 self.parsed = response; 585 582 self.setIframes( response ); 583 } else { 584 self.fail( true ); 586 585 } 587 586 } ) 588 587 .fail( function( response ) { 589 if ( response && response.message ) { 590 if ( ( response.type === 'not-embeddable' && self.type === 'embed' ) || 591 response.type === 'not-ssl' ) { 592 593 self.setError( response.message, 'admin-media' ); 594 } else { 595 self.setContent( '<p>' + self.original + '</p>', 'replace' ); 596 } 597 } else if ( response && response.statusText ) { 598 self.setError( response.statusText, 'admin-media' ); 599 } 588 self.fail( response || true ); 600 589 } ); 590 }, 591 592 fail: function( error ) { 593 if ( ! this.error ) { 594 if ( error ) { 595 this.error = error 596 } else { 597 return; 598 } 599 } 600 601 if ( this.error.message ) { 602 if ( ( this.error.type === 'not-embeddable' && this.type === 'embed' ) || this.error.type === 'not-ssl' || 603 this.error.type === 'no-items' ) { 604 605 this.setError( this.error.message, 'admin-media' ); 606 } else { 607 this.setContent( '<p>' + this.original + '</p>', 'replace' ); 608 } 609 } else if ( this.error.statusText ) { 610 this.setError( this.error.statusText, 'admin-media' ); 611 } else if ( this.original ) { 612 this.setContent( '<p>' + this.original + '</p>', 'replace' ); 613 } 601 614 }, 602 615
Note: See TracChangeset
for help on using the changeset viewer.