TabbedLanguages rewrite
For some reason, at [[γ]] the Translingual categories still show up in the Greek tab. Can you investigate why? Also, the gadget tends to interact funnily with AJAX preview (I think it sometimes even prevents it from working altogether; it often falls back to plain preview)
I also thought about fixing up section links in definitions to point to English inside TL (since this is an issue primarily for TL users anyway).
Also, you might want to have a look at MutationObserver. I used it in User:Kephir/gadgets/nectie.js, which may also interest you.
[[γ]] is broken because it is miscategorized. Letters of a script are supposed to have "Category:X script characters", not "Category:X script". Apparently all the Greek characters are similarly miscategorized. This isn't related to the rewrite; those entries were having their categories misplaced before as well.
Regarding AJAX preview: I've fixed the issue that was causing the language tab buttons to malfunction. I haven't noticed any other issues.
I've actually used MutationObservers before, but I didn't know that they could be used to detect when new elements are loaded onto the page. Fascinating. I've changed the script to use those instead. Thanks.
I notice that you changed MediaWiki:Gadgets-definition so that TL isn't loaded from the top, with the summary "seems to cause problems". Which problems specifically are you referring to? As you probably gathered, having the script run before/while the content loads was the entire point of the rewrite, so fixing the issues blocking top-position deployment are high priority for this script.
"TypeError: bodyContent is undefined". I think you might have already fixed it, though.
As for categories… I looked at the script and I cannot gather why sortCats()
is supposed to work in the first place. Can you explain the intent behind it to me?
The miscategorisation was done by {{Greek character info}}
and ultimately {{character info}}
, of which I just edited the former; I could also "fix" it by replacing it with {{character info/new}}
which currently does not apply any categories at all. Not sure what should be done about it, really.
I'm not sure what you mean by the intent regarding sortCats... The function goes through the categories placing them into language sections, moving on to the next language section if the category name begins with the name of the next section's language, except if the category also matches /letter\snames$|script\scharacters$|mythology$/
, which, afaik, covers all the exception categories that start with language names without being related to the language. (Example: "Category:Greek script characters" begins with "Greek" but doesn't indicate the start of a Greek section.)
…and the categories are guaranteed to be in the order in which they are rendered on the page? In that case, I need no further explanation.
I fixed one bug that was causing a "TypeError: bodyContent is undefined" within ten minutes of the original deployment. Is it possible that this was the bug you saw? If so, any objections to re-adding [top]?
No, I think we can re-enable it now.
Hmm, there still seem to be some funky interactions between this rewrite and live preview. It looks like the JavaScript does not even run sometimes.
I suggest you better revert to the old version, develop the rewrite in WT:JSSAND (install w:User:Kephir/gadgets/jssand.js beforehand) or as a browser user script, test it thoroughly and then deploy.
I thought for a while that it is either this or my OrangeLinks rewrite, but now I suspect that this is MediaWiki acting up. We have had an update recently, and I vaguely remember similar problems on previous update… they might have downgraded libraries to alleviate that. Or something like that. I cannot really recall the details.