Hi, I am working on a user script extending the default search bar on the top right (in Vector) -- in fact, I am refactoring my old code (old doc and half-backed newer version).
For this new version, I search to use the mediawiki.Title module to manage the titles of non-local wikis (e.g. manage titles of enwiki on frwiki). I can retrieve or pre-load the data of the non-local wikis, but I don’t see a way to use it in the mediawiki.Title functions (there are 4 wgJSVariables to replace, like wgFormattedNamespaces). From what I understand:
- either I have to copy the code of mediawiki.Title and add some 'context' variable at the end of the functions (e.g. Title.newFromText); I already did it and it works, but it is quite a waste of resources to reimplement the same thing with only a few changes;
- a sub-option is to add these 'context' variables in the main code and in the wider mediaWiki object (to make it really abstract instead of attached to the local wiki), but it is quite an important task;
- either I have to reuse the implementation of the mediawiki.Title module by re-executing the same code with a different mediaWiki object, but I didn’t find, in the doc of the ResourceLoader, a way to re-execute a module in a different context (and I’m even not really sure it is possible -- I have some difficulties to track the references of the various involved objects).
Thanks!