Merge "More gracefully handle situations where Parsoid returns a timeout failure code (HTTP 504)"

This commit is contained in:
jenkins-bot 2014-03-13 00:54:29 +00:00 committed by Gerrit Code Review
commit 3a378ccc6c
4 changed files with 13 additions and 1 deletions

View file

@ -204,6 +204,7 @@ $wgResourceModules += array(
// Messages needed by VE in init phase only (rest go below)
'visualeditor-loadwarning',
'visualeditor-loadwarning-token',
'visualeditor-timeout',
'visualeditor-notification-created',
'visualeditor-notification-restored',
'visualeditor-notification-saved',

View file

@ -158,6 +158,7 @@
"visualeditor-linkinspector-suggest-redirect-page": "{{PLURAL:$1|Redirect page|Redirect pages}}",
"visualeditor-loadwarning": "Error loading data from server: $1. Would you like to retry?",
"visualeditor-loadwarning-token": "Error loading edit token from server: $1. Would you like to retry?",
"visualeditor-timeout":"It looks like full editing is currently unavailable; would you like to edit in source mode instead?",
"visualeditor-mainnamespacepagelink": "Project:Main namespace",
"visualeditor-media-input-placeholder": "Search for media",
"visualeditor-meta-tool": "Options",

View file

@ -163,6 +163,7 @@
"visualeditor-linkinspector-suggest-redirect-page": "Label for suggested redirect pages in the link inspector. Parameters:\n* $1 - number of redirect pages, used for plural\n{{Identical|Redirect page}}",
"visualeditor-loadwarning": "Text (JavaScript confirm()) shown when the editor fails to load properly.\n\nParameters:\n* $1 - the error message from the server, in English. e.g. \"parsoidserver-http-bad-status: 404\"",
"visualeditor-loadwarning-token": "Text (JavaScript confirm()) shown when the editor fails to load properly.\n\nParameters:\n* $1 - the error message from the server.",
"visualeditor-timeout":"Text (JavaScript confirm()) shown when the editor fails to load properly due to a 504 Gateway Timeout error.",
"visualeditor-mainnamespacepagelink": "Name of a page describing the main namespace (NS0) in this project.\n{{doc-important|Do not translate \"Project\"; it is automatically converted to the wiki's project namespace.}}",
"visualeditor-media-input-placeholder": "Place holder text for media search input",
"visualeditor-meta-tool": "Text of tool in the toolbar the lets users set categories, language links and other page settings.\n{{Identical|Options}}",

View file

@ -315,10 +315,19 @@ ve.init.mw.ViewPageTarget.prototype.onLoadError = function ( jqXHR, status ) {
// The response.status check here is to catch aborts triggered by navigation away from the page
if (
status !== 'abort' &&
( !jqXHR || jqXHR.status !== 0 ) &&
( !jqXHR || ( jqXHR.status !== 0 && jqXHR.status !== 504 ) ) &&
confirm( ve.msg( 'visualeditor-loadwarning', status ) )
) {
this.load();
} else if (
jqXHR && jqXHR.status === 504 &&
confirm( ve.msg( 'visualeditor-timeout' ) )
) {
if ( 'veaction' in this.currentUri.query ) {
delete this.currentUri.query.veaction;
}
this.currentUri.query.action = 'edit';
window.location.href = this.currentUri.toString();
} else {
this.activating = false;
// User interface changes