diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /mw-config | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'mw-config')
-rw-r--r-- | mw-config/config-cc.css | 56 | ||||
-rw-r--r-- | mw-config/config.css | 174 | ||||
-rw-r--r-- | mw-config/config.js | 108 | ||||
-rw-r--r-- | mw-config/images/ajax-loader.gif | bin | 0 -> 1788 bytes | |||
-rw-r--r-- | mw-config/images/bullet.gif | bin | 0 -> 50 bytes | |||
-rw-r--r-- | mw-config/images/critical-32.png | bin | 0 -> 1758 bytes | |||
-rw-r--r-- | mw-config/images/download-32.png | bin | 0 -> 1759 bytes | |||
-rw-r--r-- | mw-config/images/info-32.png | bin | 0 -> 1892 bytes | |||
-rw-r--r-- | mw-config/images/installer-logo.png | bin | 0 -> 16707 bytes | |||
-rw-r--r-- | mw-config/images/tick-32.png | bin | 0 -> 1103 bytes | |||
-rw-r--r-- | mw-config/images/warning-32.png | bin | 0 -> 1299 bytes | |||
-rw-r--r-- | mw-config/index.php | 18 | ||||
-rw-r--r-- | mw-config/index.php5 | 7 | ||||
-rw-r--r-- | mw-config/overrides.php | 5 |
14 files changed, 363 insertions, 5 deletions
diff --git a/mw-config/config-cc.css b/mw-config/config-cc.css new file mode 100644 index 00000000..ecd10fa6 --- /dev/null +++ b/mw-config/config-cc.css @@ -0,0 +1,56 @@ +/** + * Copy of CC standard stylesheet, plus tweaks for iframe usage + */ + +body { + margin: 0; + background: #eee; + font-family: Verdana; + color: #333; +} + +#main { + border: 1px solid #D0D0D0; + background: #fff; + margin: 0.5em; +} + +/** + * Looks like you have to specify the width of #menu + * or IE5 Mac stretches it all the way across the div, and + * Opera streches it half way. + */ + +#main #menu { + border-left: 1px dotted #ccc; + float: right; + width: 230px; + background: white; + margin: 0 0 10px 10px; +} + +td, h3, p, h1, pre { + margin: 0 20px 20px 20px; + font-size: 11px; + line-height: 140%; +} + +.header { + padding-left: 10px; + padding-top: 10px; +} + +.nav { + padding-left: 10px; + padding-bottom: 10px; + font-size: 11px; + margin-bottom: 16px; +} + +#menu p { + font-size: 11px; +} + +.dent { + margin-left: 64px; +} diff --git a/mw-config/config.css b/mw-config/config.css new file mode 100644 index 00000000..17b20392 --- /dev/null +++ b/mw-config/config.css @@ -0,0 +1,174 @@ +.env-check { + font-size: 90%; + margin: 1em 0 1em 2.5em; +} + +.config-section { + margin-top: 2em; +} + +.config-block { + margin-top: 2em; + display: block; + +} + +.config-block-label { + display: block; + margin-bottom: .2em; +} + +.config-block-label label, .config-label { + font-weight: bold; + padding-right: .5em; + padding-top: .2em; +} + +.config-block-elements { + margin-left: 2em; +} + +.config-block-elements li { + list-style: none; +} + +.config-input { + clear: left; + zoom: 100%; /* IE hack */ +} + +.config-page-wrapper { + padding: 0.5em; +} + +.config-page-list { + float: right; + width: 12em; + border: 1px solid #aaa; + background: #fff; + padding: 0.5em; + /* 3em left margin to leave space between the list and the page-content */ + margin: 0.5em 0.5em 0.5em 3.5em; +} + +.config-page { + padding: 0.5em 0.5em 0.5em 2em; + margin: 0.5em 0.5em 0.5em 0.5em; + background: #eee; +} + +.config-submit { + clear: left; + text-align: center; + padding: 1em; +} + +.config-submit input { + margin-left: 0.5em; + margin-right: 0.5em; +} + +.config-page-disabled { + color: #aaa; +} + +.config-error-box { + border: 2px solid #f00; +} + +.config-page-current { + font-weight: bold; +} + +.config-message { + display: list-item; + line-height: 1.5em; + /* @embed */ + list-style-image: url(images/bullet.gif); + list-style-type: square; +} + +.config-input-text { + width: 20em; + margin-right: 1em; +} + +.config-input-check { + margin-left: 10em; +} + +.config-skins-item { + /* Clearfix */ + clear: left; + overflow: hidden; +} + +.config-skins-item .config-input-check { + margin-left: 10em; + width: 20em; + float: left; +} + +.config-skins-item .config-skins-use-as-default { + float: left; +} + +.error { + color: red; + background-color: #fff; + font-weight: bold; + left: 1em; + font-size: 100%; +} + +.config-settings-block { + list-style-type: none; + list-style-image: none; + margin: 0; + padding: 0; +} + +.btn-install { + font-weight: bold; + font-size: 110%; + padding: .2em .3em; +} + +.success-message { + font-weight: bold; + font-size: 110%; + color: green; +} + +.success-box { + font-size: 130%; +} + +.config-cc-wrapper { + clear: left; + /* If you change this height, also change it in WebInstallerOptions::submitCC() */ + height: 54em; +} + +.config-plainlink a { + background: none !important; + padding: 0 !important; +} + +.config-download-link { + font-size: 1.8em; + margin-left: 2em; +} + +.config-download-link a { + background: url(images/download-32.png) no-repeat center left; + padding-left: 40px; /* 32 px for the image (above), plus some breathing room */ + height: 32px; /* provide enough vertical room for the image */ + display: inline-block; /* allow the height property (above) to work */ + line-height: 32px; /* center the text vertically */ +} + +#config-live-log { + overflow: hidden; + min-width: 20em; +} diff --git a/mw-config/config.js b/mw-config/config.js new file mode 100644 index 00000000..cf17aef7 --- /dev/null +++ b/mw-config/config.js @@ -0,0 +1,108 @@ +( function ( $ ) { + $( function () { + var $label, labelText; + + function syncText() { + var value = $(this).val() + .replace( /[\[\]\{\}|#<>%+? ]/g, '_' ) + .replace( /&/, '&' ) + .replace( /__+/g, '_' ) + .replace( /^_+/, '' ) + .replace( /_+$/, '' ); + value = value.charAt( 0 ).toUpperCase() + value.slice( 1 ); + $label.text( labelText.replace( '$1', value ) ); + } + + // Set up the help system + $( '.mw-help-field-data' ) + .hide() + .closest( '.mw-help-field-container' ) + .find( '.mw-help-field-hint' ) + .show() + .click( function () { + $(this) + .closest( '.mw-help-field-container' ) + .find( '.mw-help-field-data' ) + .slideToggle( 'fast' ); + } ); + + // Show/hide code for DB-specific options + // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here? + $( '.dbRadio' ).each( function () { + $( document.getElementById( $(this).attr( 'rel' ) ) ).hide(); + } ); + $( document.getElementById( $( '.dbRadio:checked' ).attr( 'rel' ) ) ).show(); + $( '.dbRadio' ).click( function () { + var $checked = $( '.dbRadio:checked' ), + $wrapper = $( document.getElementById( $checked.attr( 'rel' ) ) ); + if ( $wrapper.is( ':hidden' ) ) { + $( '.dbWrapper' ).hide( 'slow' ); + $wrapper.show( 'slow' ); + } + } ); + + // Scroll to the bottom of upgrade log + $( '#config-live-log' ).children( 'textarea' ).each( function () { + this.scrollTop = this.scrollHeight; + } ); + + // Show/hide Creative Commons thingy + $( '.licenseRadio' ).click( function () { + var $wrapper = $( '#config-cc-wrapper' ); + if ( $( '#config__LicenseCode_cc-choose' ).is( ':checked' ) ) { + $wrapper.show( 'slow' ); + } else { + $wrapper.hide( 'slow' ); + } + } ); + + // Show/hide random stuff (email, upload) + $( '.showHideRadio' ).click( function () { + var $wrapper = $( '#' + $(this).attr( 'rel' ) ); + if ( $(this).is( ':checked' ) ) { + $wrapper.show( 'slow' ); + } else { + $wrapper.hide( 'slow' ); + } + } ); + $( '.hideShowRadio' ).click( function () { + var $wrapper = $( '#' + $(this).attr( 'rel' ) ); + if ( $(this).is( ':checked' ) ) { + $wrapper.hide( 'slow' ); + } else { + $wrapper.show( 'slow' ); + } + } ); + + // Hide "other" textboxes by default + // Should not be done in CSS for javascript disabled compatibility + $( '.enabledByOther' ).closest( '.config-block' ).hide(); + + // Enable/disable "other" textboxes + $( '.enableForOther' ).click( function () { + var $textbox = $( document.getElementById( $(this).attr( 'rel' ) ) ); + // FIXME: Ugh, this is ugly + if ( $(this).val() === 'other' ) { + $textbox.removeProp( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' ); + } else { + $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' ); + } + } ); + + // Synchronize radio button label for sitename with textbox + $label = $( 'label[for=config__NamespaceType_site-name]' ); + labelText = $label.text(); + $label.text( labelText.replace( '$1', '' ) ); + $( '#config_wgSitename' ).on( 'keyup change', syncText ).each( syncText ); + + // Show/Hide memcached servers when needed + $( 'input[name$="config_wgMainCacheType"]' ).change( function () { + var $memc = $( '#config-memcachewrapper' ); + if ( $( 'input[name$="config_wgMainCacheType"]:checked' ).val() === 'memcached' ) { + $memc.show( 'slow' ); + } else { + $memc.hide( 'slow' ); + } + } ); + } ); +}( jQuery ) ); diff --git a/mw-config/images/ajax-loader.gif b/mw-config/images/ajax-loader.gif Binary files differnew file mode 100644 index 00000000..72203fdd --- /dev/null +++ b/mw-config/images/ajax-loader.gif diff --git a/mw-config/images/bullet.gif b/mw-config/images/bullet.gif Binary files differnew file mode 100644 index 00000000..b43de48a --- /dev/null +++ b/mw-config/images/bullet.gif diff --git a/mw-config/images/critical-32.png b/mw-config/images/critical-32.png Binary files differnew file mode 100644 index 00000000..9b38e6a2 --- /dev/null +++ b/mw-config/images/critical-32.png diff --git a/mw-config/images/download-32.png b/mw-config/images/download-32.png Binary files differnew file mode 100644 index 00000000..e5b8318e --- /dev/null +++ b/mw-config/images/download-32.png diff --git a/mw-config/images/info-32.png b/mw-config/images/info-32.png Binary files differnew file mode 100644 index 00000000..ab09e1d5 --- /dev/null +++ b/mw-config/images/info-32.png diff --git a/mw-config/images/installer-logo.png b/mw-config/images/installer-logo.png Binary files differnew file mode 100644 index 00000000..c6bd8686 --- /dev/null +++ b/mw-config/images/installer-logo.png diff --git a/mw-config/images/tick-32.png b/mw-config/images/tick-32.png Binary files differnew file mode 100644 index 00000000..34cfa9ce --- /dev/null +++ b/mw-config/images/tick-32.png diff --git a/mw-config/images/warning-32.png b/mw-config/images/warning-32.png Binary files differnew file mode 100644 index 00000000..0400734c --- /dev/null +++ b/mw-config/images/warning-32.png diff --git a/mw-config/index.php b/mw-config/index.php index 570b426e..a6cebc39 100644 --- a/mw-config/index.php +++ b/mw-config/index.php @@ -20,9 +20,18 @@ * @file */ +// Bail if PHP is too low +if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) { + // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+ + require dirname( dirname( __FILE__ ) ) . '/includes/PHPVersionError.php'; + wfPHPVersionError( 'mw-config/index.php' ); +} + define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' ); define( 'MEDIAWIKI_INSTALL', true ); +// Resolve relative to regular MediaWiki root +// instead of mw-config subdirectory. chdir( dirname( __DIR__ ) ); require dirname( __DIR__ ) . '/includes/WebStart.php'; @@ -34,6 +43,15 @@ function wfInstallerMain() { $installer = InstallerOverrides::getWebInstaller( $wgRequest ); if ( !$installer->startSession() ) { + + if ( $installer->request->getVal( "css" ) ) { + // Do not display errors on css pages + $installer->outputCss(); + exit; + } + + $errors = $installer->getPhpErrors(); + $installer->showError( 'config-session-error', $errors[0] ); $installer->finish(); exit; } diff --git a/mw-config/index.php5 b/mw-config/index.php5 index bc9e891b..88986532 100644 --- a/mw-config/index.php5 +++ b/mw-config/index.php5 @@ -1,7 +1,7 @@ <?php /** - * Version of mw-config/index.php to used in web server requiring .php5 - * extension to execute scripts with PHP5 engine. + * Version of mw-config/index.php to be used in web servers that require the .php5 + * extension to execute scripts with the PHP5 engine. * * 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 @@ -21,5 +21,6 @@ * @file */ -define('MW_INSTALL_PHP5_EXT', 1); +define( 'MW_INSTALL_PHP5_EXT', 1 ); + require './index.php'; diff --git a/mw-config/overrides.php b/mw-config/overrides.php index d3d85bbb..57581525 100644 --- a/mw-config/overrides.php +++ b/mw-config/overrides.php @@ -1,8 +1,9 @@ <?php /** * MediaWiki installer overrides. - * Modify this file if you are a packager who needs to modify the behavior of the MediaWiki installer. - * Altering it is preferred over changing anything in /includes. + * Modify this file if you are a packager who needs to modify the behavior of + * the MediaWiki installer. Altering it is preferred over changing anything in + * /includes. * * Note: this file doesn't gets included from a global scope, don't use globals directly. * |