Realtime Preview is currently hard-coded to only run for wikitext. This is because for most everything else, it's not helpful, and even potentially dangerous (JavaScript for example).
The Chart.JsonConfig content model provided by thee Charts extension however is safe to render, and seems to work great:
This is because behind the scenes, the JCChartContentView class is used for rendering chart pages, which feeds the JSON to the parser function, effectively making Chart.JsonConfig pages viewable without having to use the {{#chart:}} parser function on a wikitext page.
This could be a low-effort quick win for the Chart-Community-Wish-W414 project, and can be released separately from the new "visual mode".
Technical requirements
- WikiEditor (2010) – add an extension attribute that allows other extensions to register content models appropriate for use with Realtime Preview
- MediaWiki-extensions-CodeMirror – look for the aforementioned extension attribute and if present, un-hide .wikiEditor-ui-toolbar .section-secondary .group-default (but keep the duplicated search button hidden)
- Charts – register Chart.JsonConfig with the WikiEditor extension attribute
Acceptance criteria
- When editing the source of Chart pages, the "Preview" button and reload button to its left should be shown in the toolbar, just like when editing wikitext
- Everything should work as normal with Realtime Preview – that is, changes to the JSON will update the preview after a brief delay when the user stops typing
