jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356177 )
Change subject: CX2: Tools documentation ...................................................................... CX2: Tools documentation Change-Id: I82ebf24036519f2d62198e991d6359eb371ac4cc --- M doc/ContentTranslation-v2.md 1 file changed, 23 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Nikerabbit: Looks good to me, approved diff --git a/doc/ContentTranslation-v2.md b/doc/ContentTranslation-v2.md index 62a97f1..b785a18 100644 --- a/doc/ContentTranslation-v2.md +++ b/doc/ContentTranslation-v2.md @@ -120,3 +120,26 @@ 1. In case of translation unit that is restored, this will cause unwanted adaptation. The adaptation should be conditional. Section Translation unit's target document get initialized to a placeholder. And when user click on that placeholder, the actual translation begins. This behavior adds some complication. SectionTranslationUnit is also created for any block level elements such as figure captions, table rows or any such elements inside a section. Those elements cannot have a placeholder. + +Translation tools +----------------- +Every translation unit UI model can define a set of attached translation tools. +``` +tools = { + search: [ 'click' ], // The search tool gis shown when this translation unit is clicked + formatter: { + // Tools can be triggered by multiple different events + triggers: [ 'select', 'click', 'focus' ], + // Connect the events from the tool to handlers in this translation unit. + events: { + newlink: 'showNewLinkTool' + } + } +} +``` + +It is mw.cx.ui.TranslationView that connects the translation units and tools. The showTool event from translation unit is handled by mw.cx.ui.TranslationView and it fires mw.cx.ui.TranslationView.prototype.showTranslationTool. + +When a click is recieved on a translation unit, the unit is activated and it emits 'activate' event. On every 'activate' event all translation tools are first hidden by the mw.cx.ui.TranslationView. + +Nested section translation units are problematic in this case too. Section level translation unit tools will be shown more than once when the event propagates. -- To view, visit https://gerrit.wikimedia.org/r/356177 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82ebf24036519f2d62198e991d6359eb371ac4cc Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits