On 2015-04-26 3:50 PM, 晒太阳的冰 wrote:
> Hi Daniel,
> Thank you for your response. I guess it is still possible if I modify the
> mediawiki's core file.
>
> I guess the jQuery were load alone.
> Example:
> http://bits.moegirl.org/zh/load.php?debug=false&lang=zh-cn&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20150420T213953Z
That is not jQuery alone. That is request contains two modules, 'jquery'
and 'mediawiki'. The latter being the `mw` base library, the loader that
handles loading of all other modules, and mw.log stub.

Even if you got rid of jQuery loading this would still need to be loaded
since it's the base MW code that is required for EVERY single other
module MediaWiki uses requires.

> And I could add external js by
> function addjQuery(){
>    global $wgOut;
>    $wgOut->addHeadItem ( .............
>
> The possible problem here is that ResourceLoader might collapse without
> native jQuery. Also, I have no idea how jQuery were loaded with
> ResourceLoader .
All that'll do is load an additional and conflicting jQuery slowing down
your site. It likely won't be in the correct order (that 'mediawiki'
library requires jQuery which would have to be loaded before it). And if
that head element is inserted in between a module that adds extra things
to jQuery (like a jQuery plugin or our 'jquery.mediawiki' extras) and
another module that depends on those extras it will trample the global
jQuery with a version that doesn't have those additions and break every
module afterwards that depends on them.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to