Page MenuHomePhabricator

CodeEditor Hook for editing formulas
Open, LowestPublic



I am looking to add my snippets and autcompletions to the code editor. But I wanted to create these files outside the extension repo . So , I was lookign for a JS hook , so that , as soon Ace is loaded , my script is also loaded. Unfortunately , I couldn't find one.

The hook listed in the documentation is mediawiki hook codeEditor.configure.

When it says that it is possible to change the configuration of the ACE editor, by hooking into the MediaWiki JS hook codeEditor.configure
it seems that this hook is fired only when the page has content model of js, css or json (by looking here ). Any chance that this hook will be fired also when editing a math formula? I want to use the Ace editor session manage some math snippets

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 21 2016, 5:48 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

I'm not sure that this is about the VisualEditor integration of the CodeEditor software, or just how the MediaWiki extension works? Assuming the latter.

TheDJ added a subscriber: TheDJ.Sep 26 2016, 6:42 PM

@Falitjain Where are you using the Codeeditor, in the Visual Editor's Math panel ?

Yes , while editing the formulas.
If we add the codeeditor in Visual Editor , it is used by code block and insert formulas.

This hook is not fired by the Visual Editor plugin right now.

Also if anyone were to work on this, note the hook currently only passes the session, and not the editor config.. And I think that officially it's not proper usage of the hook strategy to begin with (which is about DOM, though you could argue the ACE objects basically wrap DOM.

Restricted Application added a project: VisualEditor. · View Herald TranscriptAug 6 2017, 2:00 PM
Deskana moved this task from To Triage to Freezer on the VisualEditor board.Aug 7 2017, 10:51 AM
Deskana triaged this task as Lowest priority.Aug 30 2018, 12:30 PM