Commit graph

20 commits

Author SHA1 Message Date
Timo Tijhof
19a40cd3ad resourceloader: Implement support for 'site' into mw.loader
* No longer a dedicated <script> with only=scripts.
  This means it creates no extra script request and becomes a versioned
  request using data from the startup module.

* No longer in group=site.
  This means it collapses into the existing bottom queue.
  Not even one dedicated script request, but zero.

* No longer exclude from module storage. This can be cached like any other module.
  It was previously excluded because it was already loaded separately.

* Change mw.loader#execute to special-case the 'site' module with $.globalEval.

* Add hack to ensure the styles of the 'site' module still load without
  JavaScript, in the top, and after the ResourceLoaderDynamicStyles marker.
  This unfortunately stays its own request. Not sure how to avoid that.

Bug: T32358
Bug: T106736
Bug: T102077
Change-Id: I291a8c3aae1a71760bec58161891c1bd77c9b724
2015-07-29 20:12:01 +00:00
Kunal Mehta
870f50d45c resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule constructor
This makes it easier for subclasses to use ResourceLoaderWikiModule. Currently
many subclasses of this simply need to override the getPages() method.

UserModule and SiteModule keep their getPages override due to the set of pages
being dependent on context.

Change-Id: I388531398671afacfec36c6c5746d72267b5bdac
2015-03-03 17:17:02 +00:00
Timo Tijhof
041bfb3726 resourceloader: Let $wgUseSiteCss protect MediaWiki:Print.css as well
Follows-up 12a9f0564d.

Change-Id: Id67f98e9d624191d69def262763dbba33050606f
2015-03-01 16:26:31 +01:00
Legoktm
099602556d Revert "Set site logo url in ResourceLoaderSiteModule instead of inline styles"
This caused bug 71334. The logo should be split out
into its own ResourceLoader module rather than
being in the site module.

This reverts commit efe0169c59.

Bug: 71334
Change-Id: I0234e78f93c2eb6574bae4ad48941498709ae528
2014-09-25 21:17:54 +00:00
tholam
efe0169c59 Set site logo url in ResourceLoaderSiteModule instead of inline styles
Requires skins to use the 'mw-wiki-logo' class on the logo element
for the styles to apply. This is backwards compatible with skins
not using that class and using inline styles instead.

Bug: 56257
Change-Id: I89e32fcd27c9f07e889aa5b67d7d97d06b412aea
2014-09-22 18:12:02 +00:00
Kunal Mehta
4b1a87c96e includes/resourceloader/: Use Config instead of globals
Change-Id: Iaa1f4ae9c397575c9bb86dacbc342456e6f5f532
2014-08-07 18:47:34 +01:00
umherirrender
dcf6955e5c Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
2014-04-20 23:33:05 +02:00
MatmaRex
02919f7529 Remove the $wgHandheldStyle config variable entirely
Added back in 2008 (dc821ec1 / r38116), it was only ever implemented
for Monobook and didn't do anything in other skins.

The only use-case given was using Chick's CSS for mobile devices with
Monobook being the default skin - and now Chick is no more and
Monobook isn't the default.

It was also used to decide whether to load styles from
MediaWiki:Handheld.css (they were loaded if it was set to anything).
That message has been removed as well.

Bug: 47504
Change-Id: Ia8d79b4a637a227eb1879fbb874173fdd9bd6d99
2013-05-19 15:39:34 +02:00
Timo Tijhof
12a9f0564d ResourceLoader: Honor $wgAllow* settings in site/user modules
Bug: 46858
Change-Id: I17b3a2c1df5d52458f92c715242003b34111432c
2013-04-03 23:46:11 +02:00
umherirrender
9d19d7342a Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I7db616db8c969567d420c0161fa207b366e292b6
2012-10-19 22:03:05 +02:00
Alexandre Emsenhuber
7d9016943d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1815587ab2eeb24623ce4bf1c695088bd3f1c2ea
2012-04-30 09:16:10 +02:00
Sam Reed
16c194d0ae Fixup/add documentation
Remove trailing whitespace
2011-05-21 17:45:20 +00:00
Sam Reed
c0830dd868 2 subclasses of ResourceLoaderWikiModule implement a duplicate version of getFlip. Move it up into ResourceLoaderWikiModule
(Almost looks like it could all go into ResourceLoaderModule... But that uses a different version, seemingly, the only one. 3 other subclasses of ResourceLoaderModule implement the same version of getFlip as is moved into a parent class here... Seems daft to have a different version in the base abstract class... Minor oversight?)

Some documentation
2011-02-18 00:33:45 +00:00
Roan Kattouw
f29d0359d1 Apply $wgContLang-based flip logic to site and user modules too. I swear we did this at some point 2011-02-11 09:27:02 +00:00
Tim Starling
fc6f65a85b Fixes for ResourceLoaderWikiModule r72776. No serious bugs found, do not merge before deployment.
* Specify page titles as strings instead of split NS/DBK, as suggested by Roan on CR. It seemed sensible to me.
* Pass a Title object to getContent() instead of a string, to avoid unnecessary object construction overhead
* "*" and "/" are valid title characters. Check module input for JS comment end tokens.
* Fixed inappropriate conversion to boolean, when checking result of getContent(). Presumably the idea was to omit empty sections and errors, so that's what I did. Maybe an informative error message would be better in the error case.
* Use LinkBatch for selecting multiple page rows instead of Database::makeWhereFrom2d(). 
* Fixed assignment expression.
2011-02-08 06:34:38 +00:00
Trevor Parscal
c519873cdc Fixed Doxygen incompatible JSDoc style comments (bad Trevor!) as per some comments on r75036. 2010-11-05 18:33:50 +00:00
Tim Starling
06b2b1bd66 Resource loader minor changes. Fix for r73668 etc.
* Break long lines.
* Convert long or unnecessary ternary operator usages to if/else.
* Fixed excessively clever assignment expressions.
* Rename $cache to $cacheEntry.
* Removed unnecessary web invocation guards. Their perlish form was making me uncomfortable. BTW, unlike in Perl, die() is not a function, it's a special case in the PHP grammar which very roughly simulates the Perl syntax:

die "x"; // works
0 || die("x"); // works
0 || (die); // works
0 || (die "x"); // fail!
2010-11-03 07:58:03 +00:00
Trevor Parscal
875b166278 Whitespace, comments and general cleanup. 2010-10-20 00:25:20 +00:00
Trevor Parscal
70bae52c12 Part 2 of 2, moved ResourceLoader*Module classes to their own files - this commit removes the non file specific code. 2010-10-19 18:31:09 +00:00
Trevor Parscal
032ef610dd Part 1 of 2, moving ResourceLoader*Module classes to their own files - this commit copies the ResourceLoaderModules.php file to each of the new files, as to maintain revision history. The next revision will remove non file specific code. 2010-10-19 18:25:42 +00:00