https://bugzilla.wikimedia.org/show_bug.cgi?id=47872

--- Comment #5 from Krinkle <[email protected]> ---
Rephrasing bug to be about mwCustomEditButtons to avoid mixed subjects.

So in summary: mwCustomEditButtons is very ugly and undocumented. But it used
to be the only way to add buttons to the toolbar. Though (as pointed out by
various comments) it is a coincidence that most existing usages have survived
without causing errors, but it is the case.

How mwCustomEditButtons works now:
* Initialise to empty array from top queue
* Hook in document ready
* Iterate through array (e.g. items added before the page load) and call
mw.toolbar.addButton for each one.

The state is that most existing usages of mwCustomEditButtons happen from a
site or user script at run-time in the global scope. And this works fine
because they are blocking script tags.

Now that $.ready() (the jquery callback list, not the event itself) is
triggered before site/user script load (the site/user script still load from
the bottom) it means the code that iterates through the legacy array will not
get any of the items because they're not in the array yet at that time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to