mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-25 12:33:19 +00:00
f035ce51f1
What: Add hook that runs after a save attempt is made in ApiVisualEditorEdit. The hook receives the same data available in ApiVisualEditorEdit, and implementations of the hook can modify the API response. Also introduce templated parameters (https://www.mediawiki.org/wiki/API:Templated_parameters) in the API parameters; this allows plugins to pass arbitrary data along with their request using e.g. plugins=linkrecommendation&data-linkrecommendation=foo Add ServiceWiring files, a PHP namespace, and a HookRunner class to support the above changes. Why: VE plugins may wish to send additional data when saving an edit and take action based on that data on the server-side. See for example the AddLink plugin in I7a052f8e which sends annotation data, and then uses the new hook to perform a database operation. Change-Id: I392691475fbdcec766acbd832600e82efcb5bfe8
73 lines
5.1 KiB
JSON
73 lines
5.1 KiB
JSON
{
|
|
"@metadata": {
|
|
"authors": [
|
|
"Alex Monk",
|
|
"Amir E. Aharoni",
|
|
"Anomie",
|
|
"Christian Williams",
|
|
"David Lynch",
|
|
"Ed Sanders",
|
|
"Erik Moeller",
|
|
"James D. Forrester",
|
|
"lokal-profil",
|
|
"Moriel Schottlender",
|
|
"Raimond Spekking",
|
|
"Roan Kattouw",
|
|
"Rob Moen",
|
|
"Siebrand Mazeland",
|
|
"Timo Tijhof",
|
|
"Trevor Parscal",
|
|
"Umherirrender",
|
|
"Yuki Shira"
|
|
]
|
|
},
|
|
"apierror-visualeditor-badcachekey": "No cached serialization found with that key",
|
|
"apierror-visualeditor-difffailed": "Diff failed",
|
|
"apierror-visualeditor-docserver-http-error": "Error contacting the Parsoid/RESTBase server: $1",
|
|
"apierror-visualeditor-docserver-http": "Error contacting the Parsoid/RESTBase server (HTTP $1)",
|
|
"apierror-visualeditor-docserver-unconfigured": "The VirtualRESTService for the document server is not defined; see https://www.mediawiki.org/wiki/Extension:VisualEditor",
|
|
"apierror-visualeditor-docserver": "Error contacting the Parsoid/RESTBase server (no response)",
|
|
"apierror-visualeditor-latestnotfound": "Could not find latest revision for title",
|
|
"apihelp-visualeditor-description": "Returns HTML5 for a page from the Parsoid service.",
|
|
"apihelp-visualeditor-param-basetimestamp": "When saving, set this to the timestamp of the revision that was edited. Used to detect edit conflicts.",
|
|
"apihelp-visualeditor-param-badetag": "If RESTBase query returned a seemingly invalid ETag, pass it here for logging purposes.",
|
|
"apihelp-visualeditor-param-cachekey": "For serialize or diff, use the result of a previous serializeforcache request with this key. Overrides $1html.",
|
|
"apihelp-visualeditor-param-editintro": "Edit intro to add to notices.",
|
|
"apihelp-visualeditor-param-etag": "ETag to send.",
|
|
"apihelp-visualeditor-param-format": "The format of the output.",
|
|
"apihelp-visualeditor-param-html": "HTML to send to Parsoid to convert to wikitext.",
|
|
"apihelp-visualeditor-param-oldid": "The revision number to use (defaults to latest revision).",
|
|
"apihelp-visualeditor-param-paction": "Action to perform.",
|
|
"apihelp-visualeditor-param-page": "The page to perform actions on.",
|
|
"apihelp-visualeditor-param-preload": "The page to use content from if the fetched page has no content yet.",
|
|
"apihelp-visualeditor-param-preloadparams": "Parameters to substitute into the preload page, if present.",
|
|
"apihelp-visualeditor-param-pst": "Pre-save transform wikitext before sending it to Parsoid (paction=parsefragment).",
|
|
"apihelp-visualeditor-param-section": "The section on which to act.",
|
|
"apihelp-visualeditor-param-starttimestamp": "When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.",
|
|
"apihelp-visualeditor-param-stash": "When saving, set this true if you want to use the stashing API.",
|
|
"apihelp-visualeditor-param-wikitext": "Wikitext to send to Parsoid to convert to HTML (paction=parsefragment).",
|
|
"apihelp-visualeditor-summary": "Returns HTML5 for a page from the Parsoid service.",
|
|
"apihelp-visualeditoredit-description": "Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).",
|
|
"apihelp-visualeditoredit-param-basetimestamp": "When saving, set this to the timestamp of the revision that was edited. Used to detect edit conflicts.",
|
|
"apihelp-visualeditoredit-param-cachekey": "Use the result of a previous serializeforcache request with this key. Overrides $1html.",
|
|
"apihelp-visualeditoredit-param-captchaid": "Captcha ID (when saving with a captcha response).",
|
|
"apihelp-visualeditoredit-param-captchaword": "Answer to the captcha (when saving with a captcha response).",
|
|
"apihelp-visualeditoredit-param-plugins": "Plugins associated with the API request.",
|
|
"apihelp-visualeditoredit-param-data-{plugin}": "Arbitrary data sent by a plugin with the API request.",
|
|
"apihelp-visualeditoredit-param-etag": "ETag to send.",
|
|
"apihelp-visualeditoredit-param-html": "HTML to send to Parsoid in exchange for wikitext.",
|
|
"apihelp-visualeditoredit-param-minor": "Flag for minor edit.",
|
|
"apihelp-visualeditoredit-param-needcheck": "When saving, set this parameter if the revision might have roundtrip problems. This will result in the edit being tagged.",
|
|
"apihelp-visualeditoredit-param-oldid": "The revision number to use. Defaults to latest revision. Use 0 for a new page.",
|
|
"apihelp-visualeditoredit-param-paction": "Action to perform.",
|
|
"apihelp-visualeditoredit-param-page": "The page to perform actions on.",
|
|
"apihelp-visualeditoredit-param-section": "The section on which to act.",
|
|
"apihelp-visualeditoredit-param-sectiontitle": "Title for new section.",
|
|
"apihelp-visualeditoredit-param-starttimestamp": "When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.",
|
|
"apihelp-visualeditoredit-param-summary": "Edit summary.",
|
|
"apihelp-visualeditoredit-param-tags": "Change tags to apply to the edit.",
|
|
"apihelp-visualeditoredit-param-watchlist": "{{int:apihelp-edit-param-watchlist}}",
|
|
"apihelp-visualeditoredit-param-wikitext": "The wikitext to act with.",
|
|
"apihelp-visualeditoredit-summary": "Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service)."
|
|
}
|