mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Change a bunch of parsoid references to acknowledge that RESTBase is sometimes in the middle
Bug: T112339 Change-Id: I0eac521a89fc399de168408ef55c9143c0db742a
This commit is contained in:
parent
66dd0e2610
commit
82b62896e1
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Parsoid API wrapper.
|
||||
* Parsoid/RESTBase+MediaWiki API wrapper.
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
|
@ -109,9 +109,9 @@ class ApiVisualEditor extends ApiBase {
|
|||
$resp->header( 'X-Cache: ' . $rp );
|
||||
}
|
||||
} elseif ( $response['error'] !== '' ) {
|
||||
$this->dieUsage( 'parsoidserver-http-error: ' . $response['error'], $response['error'] );
|
||||
$this->dieUsage( 'docserver-http-error: ' . $response['error'], $response['error'] );
|
||||
} else { // error null, code not 200
|
||||
$this->dieUsage( 'parsoidserver-http: HTTP ' . $response['code'], $response['code'] );
|
||||
$this->dieUsage( 'docserver-http: HTTP ' . $response['code'], $response['code'] );
|
||||
}
|
||||
return $response['body'];
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
array()
|
||||
);
|
||||
if ( $content === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the document server', 'docserver' );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
}
|
||||
$content = $this->parseWikitextFragment( $title, $wikitext );
|
||||
if ( $content === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the document server', 'docserver' );
|
||||
} else {
|
||||
$result = array(
|
||||
'result' => 'success',
|
||||
|
@ -570,7 +570,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
}
|
||||
$content = $this->postHTML( $title, $html, $parserParams );
|
||||
if ( $content === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the document server', 'docserver' );
|
||||
}
|
||||
}
|
||||
$result = array( 'result' => 'success', 'content' => $content );
|
||||
|
@ -585,7 +585,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
} else {
|
||||
$wikitext = $this->postHTML( $title, $html, $parserParams );
|
||||
if ( $wikitext === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the document server', 'docserver' );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
case 'getlanglinks':
|
||||
$langlinks = $this->getLangLinks( $title );
|
||||
if ( $langlinks === false ) {
|
||||
$this->dieUsage( 'Error querying MediaWiki API', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error querying MediaWiki API', 'api-langlinks-error' );
|
||||
} else {
|
||||
$result = array( 'result' => 'success', 'langlinks' => $langlinks );
|
||||
}
|
||||
|
@ -710,6 +710,6 @@ class ApiVisualEditor extends ApiBase {
|
|||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getDescription() {
|
||||
return 'Returns HTML5 for a page from the parsoid service.';
|
||||
return 'Returns HTML5 for a page from RESTBase or the Parsoid service.';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Parsoid API wrapper.
|
||||
* Parsoid/RESTBase+MediaWiki API wrapper.
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
|
@ -151,7 +151,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
} else {
|
||||
$wikitext = $this->postHTML( $page, $html, $parserParams );
|
||||
if ( $wikitext === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the Parsoid/RESTbase server', 'docserver' );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
// frontend can update the page rendering without a refresh.
|
||||
$result = $this->parseWikitext( $page, $newRevId );
|
||||
if ( $result === false ) {
|
||||
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' );
|
||||
$this->dieUsage( 'Error contacting the Parsoid/RESTBase server', 'docserver' );
|
||||
}
|
||||
|
||||
$result['isRedirect'] = $page->isRedirect();
|
||||
|
@ -302,6 +302,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
|||
* @deprecated since MediaWiki core 1.25
|
||||
*/
|
||||
public function getDescription() {
|
||||
return 'Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).';
|
||||
return 'Save an HTML5 page to MediaWiki (converted to wikitext via RESTBase or the ' .
|
||||
'Parsoid service).';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
"visualeditor-linknodeinspector-title": "Title of inspector for editing auto-numbered, external, labelless links.\n\nSee also:\n* {{msg-mw|Visualeditor-annotationbutton-linknode-tooltip}}",
|
||||
"visualeditor-loaderror-message": "Text shown in a message box when the editor fails to load properly due to a RESTBase call failing.\n\nParameters:\n* $1 - an error message",
|
||||
"visualeditor-loaderror-title": "Text shown as the title of a message box when the editor fails to load properly for some reason.",
|
||||
"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-err\"",
|
||||
"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. \"docserver-http-error\"",
|
||||
"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-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-magiclinknodeinspector-convert-link": "Label of button that converts a magic link into a normal labeled link",
|
||||
|
|
|
@ -86,7 +86,8 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* Request the page HTML and various metadata from the MediaWiki API and Parsoid.
|
||||
* Request the page HTML and various metadata from the MediaWiki API (which will use
|
||||
* Parsoid or RESTBase).
|
||||
*
|
||||
* @return {jQuery.Promise} Abortable promise resolved with a JSON object
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue