mediawiki-skins-Vector/Vector.php
Timo Tijhof d60c8d61aa Update jquery.ui Vector theme to 1.9.2
Follows-up 3cb2ccd87863abb8a99ed7d970730ae9e4138fcc.

Various structural changes were made in jQuery UI 1.9, and the Vector
theme was not updated to accommodate for those changes.

There have also been lots of small improvements to the base theme (which
is substituted inside the Vector theme) that were made over the past few
releases that weren't backported (such as Ib099282484b for bug 67243).

And there were two new modules in jQuery UI 1.9 (menu and spinner) that
were lacking Vector theme stylesheets.

Source files generated with http://jqueryui.com/themeroller by
downloading the theme for v1.9.2 (except for jquery.ui.button.css). See
the permalink in jquery.ui.theme.css.

For jquery.ui.button.css, use latest master of jQuery UI 1.11.2-alpha:
* https://github.com/jquery/jquery-ui/blob/8825d93dc8/themes/base/button.css

This is from a newer version of jQuery UI but user MarkTraceur suggested
the file for jquery.ui.button had fixes that were not backported to 1.9
and does not cause problems with Wikimedia Commons.

Documented our patches in a PATCHES file.

Change-Id: I2a31e4a3d969a966935a50392deafd756e2b9fca
2014-12-16 21:17:56 +00:00

120 lines
4.4 KiB
PHP

<?php
/**
* Vector - Modern version of MonoBook with fresh look and many usability
* improvements.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup Skins
*/
if ( version_compare( $GLOBALS['wgVersion'], '1.25c', '<' ) ) {
echo 'This version of the Vector skin requires at least MediaWiki 1.25, you have ' . $GLOBALS['wgVersion'] .
'. You can download a more appropriate version here: https://www.mediawiki.org/wiki/Special:SkinDistributor/Vector';
exit();
}
$GLOBALS['wgExtensionCredits']['skin'][] = array(
'path' => __FILE__,
'name' => 'Vector',
'namemsg' => 'skinname-vector',
'descriptionmsg' => 'vector-skin-desc',
'url' => 'https://www.mediawiki.org/wiki/Skin:Vector',
'author' => array( 'Trevor Parscal', 'Roan Kattouw', '...' ),
'license-name' => 'GPLv2+',
);
// Register files
$GLOBALS['wgAutoloadClasses']['SkinVector'] = __DIR__ . '/SkinVector.php';
$GLOBALS['wgAutoloadClasses']['VectorTemplate'] = __DIR__ . '/VectorTemplate.php';
$GLOBALS['wgMessagesDirs']['Vector'] = __DIR__ . '/i18n';
// Register skin
SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
return new SkinVector( $config );
} );
// Register config
$GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
// Configuration options
/**
* Search form look.
* - true = use an icon search button
* - false = use Go & Search buttons
*/
$GLOBALS['wgVectorUseSimpleSearch'] = true;
/**
* Watch and unwatch as an icon rather than a link.
* - true = use an icon watch/unwatch button
* - false = use watch/unwatch text link
*/
$GLOBALS['wgVectorUseIconWatch'] = true;
// Register modules
$GLOBALS['wgResourceModules']['skins.vector.styles'] = array(
'styles' => array(
'screen.less' => array( 'media' => 'screen' ),
'screen-hd.less' => array( 'media' => 'screen and (min-width: 982px)' ),
),
'remoteSkinPath' => 'Vector',
'localBasePath' => __DIR__,
);
$GLOBALS['wgResourceModules']['skins.vector.js'] = array(
'scripts' => array(
'collapsibleTabs.js',
'vector.js',
),
'position' => 'top',
'dependencies' => array(
'jquery.throttle-debounce',
'jquery.tabIndex',
),
'remoteSkinPath' => 'Vector',
'localBasePath' => __DIR__,
);
// Apply module customizations
$GLOBALS['wgResourceModuleSkinStyles']['vector'] = array(
'jquery.tipsy' => 'skinStyles/jquery.tipsy.less',
'jquery.ui.core' => array(
'skinStyles/jquery.ui/jquery.ui.core.css',
'skinStyles/jquery.ui/jquery.ui.theme.css',
),
'jquery.ui.accordion' => 'skinStyles/jquery.ui/jquery.ui.accordion.css',
'jquery.ui.autocomplete' => 'skinStyles/jquery.ui/jquery.ui.autocomplete.css',
'jquery.ui.button' => 'skinStyles/jquery.ui/jquery.ui.button.css',
'jquery.ui.datepicker' => 'skinStyles/jquery.ui/jquery.ui.datepicker.css',
'jquery.ui.dialog' => 'skinStyles/jquery.ui/jquery.ui.dialog.css',
'jquery.ui.menu' => 'skinStyles/jquery.ui/jquery.ui.menu.css',
'jquery.ui.progressbar' => 'skinStyles/jquery.ui/jquery.ui.progressbar.css',
'jquery.ui.resizable' => 'skinStyles/jquery.ui/jquery.ui.resizable.css',
'jquery.ui.selectable' => 'skinStyles/jquery.ui/jquery.ui.selectable.css',
'jquery.ui.slider' => 'skinStyles/jquery.ui/jquery.ui.slider.css',
'jquery.ui.spinner' => 'skinStyles/jquery.ui/jquery.ui.spinner.css',
'jquery.ui.tabs' => 'skinStyles/jquery.ui/jquery.ui.tabs.css',
'jquery.ui.tooltips' => 'skinStyles/jquery.ui/jquery.ui.tooltips.css',
'mediawiki.notification' => 'skinStyles/mediawiki.notification.less',
'mediawiki.special' => 'skinStyles/mediawiki.special.less',
'mediawiki.special.preferences' => 'skinStyles/mediawiki.special.preferences.less',
'remoteSkinPath' => 'Vector',
'localBasePath' => __DIR__,
);