Extension:GlobalCssJs

Usage
This extension allows loading of global css and js from a central wiki (good for use on wiki farms). Both overall CSS/JS can be added (via MediaWiki:Global.css and MediaWiki:Global.js on the central wiki), as well as user CSS/JS. In order for the global site CSS/JS to work, the local site CSS/JS must be enabled for each respective function to work. In order for the global user CSS/JS to work, the user must have the same username on the local wiki and the central wiki, they must have enabled the "Enable Global User CSS/JS" in their Special:Preferences, and the user CSS and/or JS must be enabled on the local wiki for each respective function to work as well.

You can set the preference for user css/js to be automatically enabled, but it is not recommended to do so on wikis without a shared user database, as it opens up a potential XSS vector, which allows other users to hijack the user's account, among other things.

Currently, the global CSS and JS is loaded after the local CSS and JS, so it overrides all the other styles. This should hopefully be fixed sometime soon.

Download instructions
Please copy and paste the code found below and place it in  and. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php (obviously replace "path_to_wiki" with the path to your wiki's index.php file, such as http://www.mediawiki.org/w/index.php

$wgGlobalCssJsUrl
Default value: null

This is the URL (including the http://) to the wiki where you are loading the global css/js from. The url must be the path to that wiki's index.php.

If you do not set this, the extension will not run.