Revisions: Better error handling.

* Shows an error message if the current diff can't be loaded.
* For bulk pre-loading, catches errors, and cuts subsequent requests in half, until eventually giving up.
* Some CSS fixes related to this, and the loading spinner.
* `wp.revisions.loadAll()` now returns a promise representing whether or not all revisions could be loaded.

Fixes #24758.

git-svn-id: https://develop.svn.wordpress.org/trunk@24732 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2013-07-18 16:35:19 +00:00
parent 93943d6cb9
commit 3dd36021d8
3 changed files with 63 additions and 17 deletions

View File

@@ -186,7 +186,8 @@ require_once( './admin-header.php' );
</script>
<script id="tmpl-revisions-diff" type="text/html">
<div class="loading-indicator"></div>
<div class="loading-indicator"><span class="spinner"></span></div>
<div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
<div class="diff">
<# _.each( data.fields, function( field ) { #>
<h3>{{ field.name }}</h3>