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:
Alex Monk 2015-09-14 17:13:31 +01:00
parent 66dd0e2610
commit 82b62896e1
4 changed files with 17 additions and 15 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Parsoid API wrapper. * Parsoid/RESTBase+MediaWiki API wrapper.
* *
* @file * @file
* @ingroup Extensions * @ingroup Extensions
@ -109,9 +109,9 @@ class ApiVisualEditor extends ApiBase {
$resp->header( 'X-Cache: ' . $rp ); $resp->header( 'X-Cache: ' . $rp );
} }
} elseif ( $response['error'] !== '' ) { } 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 } 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']; return $response['body'];
} }
@ -347,7 +347,7 @@ class ApiVisualEditor extends ApiBase {
array() array()
); );
if ( $content === false ) { 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 ); $content = $this->parseWikitextFragment( $title, $wikitext );
if ( $content === false ) { if ( $content === false ) {
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' ); $this->dieUsage( 'Error contacting the document server', 'docserver' );
} else { } else {
$result = array( $result = array(
'result' => 'success', 'result' => 'success',
@ -570,7 +570,7 @@ class ApiVisualEditor extends ApiBase {
} }
$content = $this->postHTML( $title, $html, $parserParams ); $content = $this->postHTML( $title, $html, $parserParams );
if ( $content === false ) { 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 ); $result = array( 'result' => 'success', 'content' => $content );
@ -585,7 +585,7 @@ class ApiVisualEditor extends ApiBase {
} else { } else {
$wikitext = $this->postHTML( $title, $html, $parserParams ); $wikitext = $this->postHTML( $title, $html, $parserParams );
if ( $wikitext === false ) { 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': case 'getlanglinks':
$langlinks = $this->getLangLinks( $title ); $langlinks = $this->getLangLinks( $title );
if ( $langlinks === false ) { if ( $langlinks === false ) {
$this->dieUsage( 'Error querying MediaWiki API', 'parsoidserver' ); $this->dieUsage( 'Error querying MediaWiki API', 'api-langlinks-error' );
} else { } else {
$result = array( 'result' => 'success', 'langlinks' => $langlinks ); $result = array( 'result' => 'success', 'langlinks' => $langlinks );
} }
@ -710,6 +710,6 @@ class ApiVisualEditor extends ApiBase {
* @deprecated since MediaWiki core 1.25 * @deprecated since MediaWiki core 1.25
*/ */
public function getDescription() { 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.';
} }
} }

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Parsoid API wrapper. * Parsoid/RESTBase+MediaWiki API wrapper.
* *
* @file * @file
* @ingroup Extensions * @ingroup Extensions
@ -151,7 +151,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
} else { } else {
$wikitext = $this->postHTML( $page, $html, $parserParams ); $wikitext = $this->postHTML( $page, $html, $parserParams );
if ( $wikitext === false ) { 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. // frontend can update the page rendering without a refresh.
$result = $this->parseWikitext( $page, $newRevId ); $result = $this->parseWikitext( $page, $newRevId );
if ( $result === false ) { if ( $result === false ) {
$this->dieUsage( 'Error contacting the Parsoid server', 'parsoidserver' ); $this->dieUsage( 'Error contacting the Parsoid/RESTBase server', 'docserver' );
} }
$result['isRedirect'] = $page->isRedirect(); $result['isRedirect'] = $page->isRedirect();
@ -302,6 +302,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
* @deprecated since MediaWiki core 1.25 * @deprecated since MediaWiki core 1.25
*/ */
public function getDescription() { 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).';
} }
} }

View file

@ -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-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-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-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-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-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", "visualeditor-magiclinknodeinspector-convert-link": "Label of button that converts a magic link into a normal labeled link",

View file

@ -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 * @return {jQuery.Promise} Abortable promise resolved with a JSON object
*/ */