See also front end help.
We use the mw.hooks wrapper of jQuery.Callbacks for achieving a subscriber-publisher events pattern.
The hook names are prefixed with mw.cx as a convention.
Used for displaying a success message in the info bar. The message can be passed as the argument.
Fired whenever an error occurs. The parameter is a string (message) that will be shown in the info bar.
Fired when the frontend identifies that the user is anonymous.
Fired when the translation progress is recalculated.
Parameters:
- {object} progress Map of progress data
- {integer} progress.any Weight of translation sections with any content
- {integer} progress.human Weight of translation sections with human modified content
- {integer} progress.mt Weight of translation sections with unmodified mt content
Used to trigger the publish action.
This is fired when a word is searched in the tools search box. The search string is passed as an argument. Example subscribers are link and dictionary tools.
This is fired when a link is clicked in the source or translation column. Example subscriber is link tool.
Parameters:
- {string|jQuery} link The link element or target title.
- {string} [language] The language where the link points to.
This is fired when a reference is clicked in the source or translation column. Example subscriber is reference tool.
Parameters:
- {string} refNumber - The reference number. Example: [4]
- {string} reference - The reference content. Can be html.
- {jQuery} [$reference] - The jquery object related to reference. If passed, the reference card give and option to delete it.
- {string} [language] - Language code of language where this reference exist.
This is fired when a text is selected in the source or translation column. Example subscribers are link and dictionary tool.
Parameters:
- {string} The selected text
- {string} [language] The language where the link points to.
Fired when the source article content is loaded.
Fired when the source article content is ready from API, but not rendered at the source column.
Fires when the tools system is ready.
Every tool card fires this when it is ready. Tools manager listen for this so that it can stop showing the loading indicator.
Fires when the article is published successfully. Example subscriber is event logging (analytics) module.
Fires when publishing failed
Fires when AbuseFilter is encountered.
Fires when a saved translation is continuing
Fires when a saved translation is deleted
Used to trigger the pre-translation for a source section. Source section id is passed as argument.
Fired when the translation section changed because of any reason.
Fired when translation section receives focus.
Fired after the MT is used for the pre-translation. Link, image, template adaptation can listen for this.
Fired when the translation column is rendered and ready. No subscribers yet.
Fired when the translation section was updated using the MT card, for example with the 'restore' or 'use source text' actions.
Fired after every section in the translation column has been filled with a placeholder.
Fired when the title for the translation is changed. Check for existing title listens for this.
Fired when a cxsave API call is beginning. Can be used to indicate the progress of save.
Fired after a translation was successfully saved as a draft.
Fired after a translation save failed
Fired when the draft translation restore started
Fired when the draft translation restore finished successfully
Fired when the draft translation restore failed.
Fired when the Content Translation dashboard is ready.
Fired when the Content Translation entry point or campaign is shown. The unique campaign identifier is passed.
Fired when the Content Translation entry point or campaign is rejected by a user.
Fired when there are AbuseFilter based validation errors for the section.
Fired when there are no AbuseFilter based validation errors for the section.