MediaWiki talk:Common.js/Archive 21: Difference between revisions

Content deleted Content added
MalnadachBot (talk | contribs)
m Fixed Lint errors. (Task 12)
Line 107:
::Yep! They are loading those URLs just because the English version is not (yet) made up of small RL modules. I could update them to use English Wikipedia's [//en.wikipedia.org/w/load.php load.php] to get the minified version once the code is migrated to gadgets. [[User:Helder.wiki|Helder.wiki]] 20:25, 7 April 2014 (UTC)
:::I don't think that's proper use of load.php. JS modules are loaded by way of a call to mw.loader.load(). <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 20:51, 7 April 2014 (UTC)
::::What I meant was that other wikis could use something like<br /><syntaxhighlight lang="javascript" enclose="none"inline>mw.loader.load( '//bits.wikimedia.org/en.wikipedia.org/load.php?modules=ext.gadget.EXAMPLE&only=scripts' )</syntaxhighlight><br />instead of<br /><syntaxhighlight lang="javascript" enclose="none"inline>mw.loader.load( '//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-EXAMPLE.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' )</syntaxhighlight><br />to get the minified version of the module <code>ext.gadget.EXAMPLE</code>.
::::Anyway, that is only for other wikis. The loader on English Wikipedia will use just <syntaxhighlight lang="javascript" enclose="none"inline>mw.loader.load( 'ext.gadget.EXAMPLE' )</syntaxhighlight> to load the modules by their names (since they are local). [[User:Helder.wiki|Helder.wiki]] 21:02, 7 April 2014 (UTC)
:::::Yes, but what I meant is; does load.php even support this manner of loading js modules? I've never seen it like this. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 21:09, 7 April 2014 (UTC)
::::::Never mind, should work in theory. Only plus is minification though. Doesn't save http requests. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 21:14, 7 April 2014 (UTC)
Line 136:
* [[MediaWiki:Gadget-refToolbar.js]]: update the loader with [[Special:Diff/534203339/603903140|these changes]].
* [[MediaWiki:Common.js/edit.js]]: [[Special:Diff/603512406/603903897|remove the code]] which is now in the loader.
* Re-create [[MediaWiki:RefToolbarBase.js]] with<blockquote><syntaxhighlight lang="javascript" enclose="none"inline>mw.log.warn( '[[w:en:MediaWiki:RefToolbarBase.js]] was moved to [[w:en:MediaWiki:Gadget-refToolbarBase.js]].' );</syntaxhighlight><br /><syntaxhighlight lang="javascript" enclose="none"inline>mw.loader.load( '//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-refToolbarBase.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' );</syntaxhighlight></blockquote>for the convenience of other wikis which import this page into their site JS or gadgets
[[User:Helder.wiki|Helder.wiki]] 18:02, 12 April 2014 (UTC)
:All that's needed is a nice description. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 18:51, 12 April 2014 (UTC)