MediaWiki talk:Common.js/Archive 21
Appearance
![]() | This is an archive of past discussions about MediaWiki:Common.js. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 15 | ← | Archive 19 | Archive 20 | Archive 21 | Archive 22 | Archive 23 |
Protected edit request on 28 February 2014
![]() | This edit request to MediaWiki:Common.js has been answered. Set the |answered= parameter to no to reactivate your request. |
Hi again!
Could someone make this update too? Helder.wiki 21:59, 28 February 2014 (UTC)
- Done. — Edokter (talk) — 23:00, 28 February 2014 (UTC)
Protected edit request on 28 February 2014
![]() | This edit request to MediaWiki:Common.js/edit.js has been answered. Set the |answered= parameter to no to reactivate your request. |
Hi!
Could someone implement a fix for the problem which causes "Uncaught TypeError: Cannot call method 'addMessages' of undefined"? This was reported in 2012... Helder.wiki 21:50, 28 February 2014 (UTC)
- From jQuery docs for $.getScript(): "The callback is fired once the script has been loaded but not necessarily executed." In other word, it is no different then using importScript. Has this been tested? — Edokter (talk) — 23:12, 28 February 2014 (UTC)
- I'm not sure I understand: if importScript is asynchronous, what guarantee do we have that a line of code put after it will be executed only after the script is loaded?
- Anyway, $.getScript() is in use on pt:MediaWiki:Gadget-refToolbar.js since 2012 with no problems so far. Helder.wiki 15:53, 1 March 2014 (UTC)
- Both methods are asynchronous, which is why I would like a code reviews first. — Edokter (talk) — 16:02, 1 March 2014 (UTC)
- @Krinkle, Matma Rex, and TheDJ: ^. Helder.wiki 16:31, 3 March 2014 (UTC)
- @Edokter and Helder.wiki:
importScript
is definitely always asynchronous and has no callback, so it is definitely a bad choice here. The situation with$.getScript
's callback is rather complicated at a glance and I really don't feel like digging through hundreds of lines of code right now to find out what exactly happens (Krinkle knows jQuery internals better than I do), but it is also definitely better here thanimportScript
since it has at least some chance of firing only after the script was executed :) - The proper way to solve this, of course, would be to convert these scripts to default-enabled gadgets which will let you sanely specify dependencies between them and other modules. Matma Rex talk 19:03, 3 March 2014 (UTC)
- @Edokter and Helder.wiki: