This advances T140664 as well, because it encourages module
loading logic from the skin to be in this single method.
Update the tests for setupSkinUserCss(), to now target
getDefaultModules() instead, given setupSkinUserCss() no longer
provides these behaviours. Had to move where the mock object
was created so that it can be injected in the skin (previously
it could be passed as parameter). Besides, its generally best-
practice to create mocks and stubs within the test anyhow, not in
the data provider.
Bug: T140664
Depends-On: Ib2b19ba165a9d646a770702cdf1724509156b93e
Change-Id: I3404c1c2a7e8eae0b803b31f333cb9b837f43d4a
I was bored. What? Don't look at me that way.
I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.
Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
Follows-up a464d1d41 which changed OutputPage::headElement()
to join pieces by a line break instead of hardcoding line breaks
after (some) generated pieces.
This caused a minor regression in the form of a blank line between
<html> and <head> on every page, because I missed the one that
came from this class.
Change-Id: I5e48b852809699b205f4581c833605f3e232610a
This fixes three issues with the installer:
1) Make sure LocalizationCache can find the installer's i18n files.
2) Make sure we don't try to use an SqlBagOStuff for caching before we have
a functioning database.
3) Don't try to output HTML when redirecting (this is unrelated to
MediaWikiServices, but came up during testing)
Bug: T135169
Change-Id: I7caa932024cd771d6fa226a3ac6001c3148ecc9c
* Remove ResourceLoaderFileModule::getLessCompiler(). There is no reason for a
module to need to get a compiler in a different manner than
ResourceLoader::getLessCompiler().
* Add ResourceLoaderModule::getLessVars(). This method provides a means for
subclasses to easily inject custom LESS variables. The default implementation
simply returns an empty array.
* Make the $context parameter for ResourceLoaderFileModule::readStyleFiles()
non-optional (via graceful deprecation). The only callers I found were either
already calling it with a ResourceLoader context, or had a perfectly usable
ResourceLoaderContext in local scope.
* Make ResourceLoaderFileModule::{readStyleFile,getLessCompiler} require a
context. These methods are protected, so I didn't bother with a deprecation.
* Call ksort() on the LESS variables array in the only place it matters -- when
hashing its serialized representation to construct a cache lookup key. This
relieves getLessVars() subclasses from having to remember to re-sort the
variables array if they modify it.
* These changes make it possible to substantially simplify
ResourceLoaderEditToolbarModule, because the only thing it needs to do now is
implement its own getLessVars() method.
* This also allows it to be versioned like any other ResourceLoaderFileModule,
rather than having to use enableModuleContentVersion().
Change-Id: Ic3eab71691e502bfe19bdf4eb6f82cc679a7782f
Vector now has a skin.json and the PHP entry point is just a stub, so
including it doesn't do anything. We can read from the skin.json file
and register the module properly instead of depending upon implicit
globals.
Also make ExtensionRegistry::__construct() not fail if $wgObjectCaches
is not set up properly, which is the case sometimes in the installer.
Bug: T98043
Change-Id: I5a653b095665092f8a27416b8a7f28ebf7d4d8c1
- Added/removed spaces around parenthesis
- Added newline in empty blocks
- Added space after switch/foreach/function
- Use tabs at begin of line
- Add newline at end of file
Change-Id: I244cdb2c333489e1020931bf4ac5266a87439f0d
MediaWiki installer works fine in a bareskin
mode without Vector features, so do not
throw errors in the PHP error log just because
we don't have "skins" project extracted.
The message in the PHP error log:
Warning: include_once(w/skins/Vector/Vector.php): failed to open stream: No such file or directory in w/includes/installer/WebInstallerOutput.php on line 135
Stack trace:
1. {main}() w/mw-config/index.php:0
2. wfInstallerMain() w/mw-config/index.php:38
3. WebInstaller->execute() w/mw-config/index.php:79
4. WebInstaller->outputCss() w/includes/installer/WebInstaller.php:185
5. WebInstallerOutput->getCSS() w/includes/installer/WebInstaller.php:1200
Change-Id: I7b8bd77f5868af2ccf464e48db771f2e8e0472ff
The WebInstaller don't use classes, so it broke after Vector skin changed
to use classes instead of ID's
See: Iae873906abcd8b2a986e5f728f0ce207256de770
Bug: 70190
Change-Id: Ia70498a0ee7c99d000790223c44feddce73a5416
The CSS and JS files are definitely used only by the installer.
As for the images:
* mediawiki.png is still used directly by some error pages
(includes/PHPVersionError.php, includes/templates/NoLocalSettings.php)
* ajax-loader.gif is still used by shared.css
* bullet.gif is mysteriously used by *something*, according to the
logs at bug 69277 comment 11; I currently have no idea what, so
let's keep it here for a while
* All other ones don't grep (outside of the installer itself) and
don't appear in the logs on bug 69277.
Bug: 69277
Change-Id: I9146d9211a807911a5e0cfaa1dd3ab8170f333ca
This makes it behave exactly like a custom skin, with the caveat that
it is still hardcoded in several places :(, most notably lots of
skinStyles in Resources.php, the installer and some tests.
* Renamed directory to reflect skin name.
* Split skin classes to separate PHP files.
* Removed core autoloader entries for skin classes.
* Changed the hack in Setup.php to require_once the skin PHP file, as
the skin is now registered there.
* Extracted skin-specific localisation messages.
* Extracted skin-specific resources. Did not touch skinStyles yet.
* Hacked up the installer not to fall over entirely if Vector is
missing.
* Adjusted hardcoded paths in some more places...
Change-Id: Idfffc1430790b3a104cc9835a6367137bcbf0e4e
Also:
* Fix incorrect documentation comment of ResourceLoaderModule::getStyles(),
it doesn't return a string, it never has.
* Remove spurious space in count() call.
* Fix spelling of in "proper".
Change-Id: I000393636f7b9015ad1bacfbb3eb8a6ad8695d72
Instead of passing around the direction in the request, just set
'css=1'. We already have the language code and directionality
available and even rely on it between requests to set other
localisation-related things.
Change-Id: I717cb299b3639024e79880039e0d1f2ff273ab44
For consistency in module naming: skins.* contains the modules for
particular skins, mediawiki.* contains the modules for core MediaWiki
itself. Clearly this belongs more to the latter than the former.
'skinning' is probably the best thing to name these to not sound silly
and avoid confusion with actual skins.
(The fact that there are files in skins/ that are not skin-related is
a remnant of bad decisions in the past. I want to clean that up as
well this year.)
Updated release notes and usages, kept old definitions for HTML
backwards-compatibility (for 30 days on WMF deployment).
I intend to backport this to 1.23 (sans the compatibility modules).
Otherwise the current module names become "public API" and we either
break compatibility later or support them forever.
Change-Id: I3947eaacd389eaba32f6fc8370395caec4aa1edb
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.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
This is a follow-up to Ide17d5af13c416c62a40029848ac17ba24eb5563.
However, I could not fix the "minor style" issue mentioned there
because this would make the line to long.
I fixed lots and lots of other issues instead, e.g.:
* "void" isn't a thing. Added "return null" instead.
* Removed documentation that said "a constructor is a constructor".
* Use "string[]" and such instead of "array" if possible.
Change-Id: I9658c2af58862f1d634cf1b2ba4c9d0f27ee7608
Ideally it would be possible to add these as dependencies and also make them depend on each other
instead of partially duplicating the list of stylesheets, but ResourceLoader’s dependencies are
completely broken for skin stylesheets.
Followup to Ia193571afffff36ecb1f14ee9036fb9bb98347e7
Change-Id: I56758908c2f41430c7301a0ea6a4cf8b1eaa7fd8
* Remove duplication of styles in skins.monobook and skins.vector by
creating skins.common.
* At same time allow VectorBeta to replace Vector-specific skin styles
without having to worry about common styles.
Dependency: Ie32a28f8f8c5fc8e4d0890a3d7d96bc82b39c481
Change-Id: Ia193571afffff36ecb1f14ee9036fb9bb98347e7
Includes the following improvements:
* Use the ResourceLoader module definitions (with a hardcoded list of
module names) instead of a hardcoded list of filenames.
* Make the errors more discoverable like we do in load.php, prepending
them instead of burying them in the middle somewhere.
Bug: 55589
Change-Id: Iab78a60209ab46a10d4c492c75527e717f36f803
* Remove one of the two uses of Xml::encodeJsVar(): to encode an
unused JS variable dbTypes. The remaining use is only after
installation is complete.
* Add an environmental check to ensure the JSON functions are
available before attempting installation.
Bug: 54774
Change-Id: Ifb8859026b853ef3f328b796945a973c4add7eeb
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)
Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
Doing this in steps of roughly 100 changes per commit, so that it remains
reviewable. This should be the one but last change set with the "easy"
ones for core.
Change-Id: If894a92dd65b2f5f4f096b9133685eb3b067a1d8
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.
Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;
Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
This commit is supposed to fix bug 31236.
Refactored getCSS to load files more generically.
Applied CSSJanus transform to all CSS files.
Updated release notes.
Change-Id: I4418a0dcb40fe181dc62a14a9f65b658e3c0d473
* fix on-the-loose fixalpha() call
-- Calls should not be dangling loose like that
-- Removed local calls from skins and installer
-- instead calling from the IEFixes script (which is loaded raw by wikibits which is loaded from the bottom, as are all legacy scripts)
* Removing usage of 'skinpath' and 'skin' globals in wikibits.js, those aren't globals per se since introduction of mw.config and $wgLegacyJavaScriptGlobals
* Wrapping wikibits.js in closure to avoid leakage of "local" variables. This shouldn't break anything as it is loaded through resource loader which, in production mode, wraps it in a closure anyway.
* adding explicit posision=>bottom for wikibits. 'bottom' is default but repeating here since it must not change for legacy reasons.