mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Merge "More gracefully handle situations where Parsoid returns a timeout failure code (HTTP 504)"
This commit is contained in:
commit
3a378ccc6c
|
@ -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',
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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}}",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue