Re: [MediaWiki-l] mw.util not loading with RL

2017-06-29 Thread Huji Lee
Excellent point, thanks for sharing! On Thu, Jun 29, 2017 at 4:50 PM, Krinkle wrote: > You might prefer the using the $.when() idiom for this, which waits for > multiple concurrent promises, and is usable here given that $() is > essentially a shortcut to the internal $.ready promise, which is p

Re: [MediaWiki-l] mw.util not loading with RL

2017-06-29 Thread Krinkle
You might prefer the using the $.when() idiom for this, which waits for multiple concurrent promises, and is usable here given that $() is essentially a shortcut to the internal $.ready promise, which is publicly available per https://api.jquery.com/jQuery.ready/ – The following has worked for year

Re: [MediaWiki-l] mw.util not loading with RL

2017-06-03 Thread Huji Lee
Thanks again, Brion. As a follow-up note: we were not alone! Many other wikis suffered from the dependency changes. https://phabricator.wikimedia.org/T164242 is addressing this across all WMF wikis. On Sun, May 21, 2017 at 9:01 PM, Brion Vibber wrote: > On Sun, May 21, 2017 at 4:40 PM, Huji Lee

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-21 Thread Brion Vibber
On Sun, May 21, 2017 at 4:40 PM, Huji Lee wrote: > Fair point. What is the ideal way to code on-module-ready in user scripts? > If you both need to manipulate part of the page and need a specific module, probably this: // If we haven't already started loading the module, start loading it: mw.lo

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-21 Thread Huji Lee
Fair point. What is the ideal way to code on-module-ready in user scripts? On Sat, May 20, 2017 at 5:34 PM, Brion Vibber wrote: > On Sat, May 20, 2017 at 8:43 PM, Huji Lee wrote: > > > Thanks for taking the time to review these Brion. I will fix every one of > > them. I am still curious though:

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-20 Thread Brion Vibber
On Sat, May 20, 2017 at 8:43 PM, Huji Lee wrote: > Thanks for taking the time to review these Brion. I will fix every one of > them. I am still curious though: how can it only occur some of the time? A > static script shall always run the same way, no? > The scripts are loaded asynchronously, so

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-20 Thread Huji Lee
Thanks for taking the time to review these Brion. I will fix every one of them. I am still curious though: how can it only occur some of the time? A static script shall always run the same way, no? On Fri, May 19, 2017 at 7:35 PM, Brion Vibber wrote: > Also check your user JS; this looks like it

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Brion Vibber
Also check your user JS; this looks like it may be yours and looks like it would cause this kind of err: https://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Huji/vector.js $(function () { ... var y = mw.util.addPortletLink('p-cactions', url+"§ion=0", 'ویرایش لید', 'ca-edit-0',

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Brion Vibber
There's also these, which run immediately if the conditions match: /** * Source codes pages direction and and pre white-space */if ([2, 4, 8].indexOf(mw.config.get('wgNamespaceNumber')) !== -1) { if (/\.(js|css|py)$/.test(mw.config.get('wgPageName'))) { mw.util.addCSS('.di

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Brion Vibber
Does it happen only on the main page perhaps? The MediaWiki:Common.js on fa.wikipedia contains this reference to mw.util that is wrapped in an on-dom-ready instead of a module load wrapper: /** Main Page layout fixes *

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Huji Lee
Okay let me clarify: mw.util *is listed* as a dependency. Otherwise refreshing the page wouldn't fix it. On Fri, May 19, 2017 at 11:38 AM, Amir Ladsgroup wrote: > It's already announced that this won't be loaded by default anymore. You > need to add it as a dependency. > > Best > > On Fri, May 1

Re: [MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Amir Ladsgroup
It's already announced that this won't be loaded by default anymore. You need to add it as a dependency. Best On Fri, May 19, 2017, 5:54 PM Huji Lee wrote: > Hi > > This is an issue I am experiencing on Persian Wikipedia (FAWP) for the last > couple of weeks. I have replicated it in different m

[MediaWiki-l] mw.util not loading with RL

2017-05-19 Thread Huji Lee
Hi This is an issue I am experiencing on Persian Wikipedia (FAWP) for the last couple of weeks. I have replicated it in different machines, and after clearing the cache (or using incognito). I have replicated it in Firefox and in Chrome. When you open a page, some times certain widgets (e.g. Twin