/** @var TitleValue A corresponding TitleValue object */
private $mTitleValue = null;
+
+ /** @var bool Would deleting this page be a big deletion? */
+ private $mIsBigDeletion = null;
// @}
/**
$errors[] = array( 'immobile-target-page' );
}
} elseif ( $action == 'delete' ) {
- if ( count( $this->getUserPermissionsErrorsInternal( 'edit',
- $user, $doExpensiveQueries, true ) )
- ) {
- // If they can't edit, they shouldn't delete.
- $errors[] = array( 'delete-cantedit' );
+ $tempErrors = $this->checkPageRestrictions( 'edit',
+ $user, array(), $doExpensiveQueries, true );
+ if( !$tempErrors ) {
+ $tempErrors = $this->checkCascadingSourcesRestrictions( 'edit',
+ $user, $tempErrors, $doExpensiveQueries, true );
+ }
+ if ( $tempErrors ) {
+ // If protection keeps them from editing, they shouldn't be able to delete.
+ $errors[] = array( 'deleteprotected' );
}
if ( $doExpensiveQueries && $wgDeleteRevisionsLimit
&& !$this->userCan( 'bigdelete', $user ) && $this->isBigDeletion()
$this->mEstimateRevisions = null;
$this->mPageLanguage = false;
$this->mDbPageLanguage = null;
+ $this->mIsBigDeletion = null;
}
/**
return false;
}
- $revCount = $this->estimateRevisionCount();
- return $revCount > $wgDeleteRevisionsLimit;
+ if ( $this->mIsBigDeletion === null ) {
+ $dbr = wfGetDB( DB_SLAVE );
+
+ $innerQuery = $dbr->selectSQLText(
+ 'revision',
+ '1',
+ array( 'rev_page' => $this->getArticleID() ),
+ __METHOD__,
+ array( 'LIMIT' => $wgDeleteRevisionsLimit + 1 )
+ );
+
+ $revCount = $dbr->query(
+ 'SELECT COUNT(*) FROM (' . $innerQuery . ') AS innerQuery',
+ __METHOD__
+ );
+ $revCount = $revCount->fetchRow();
+ $revCount = $revCount['COUNT(*)'];
+
+ $this->mIsBigDeletion = $revCount > $wgDeleteRevisionsLimit;
+ }
+
+ return $this->mIsBigDeletion;
}
/**
- * Get the approximate revision count of this page.
+ * Get the approximate revision count of this page.
*
* @return int
*/
'code' => 'cantedit',
'info' => "You can't protect this page because you can't edit it"
),
- 'delete-cantedit' => array(
+ 'deleteprotected' => array(
'code' => 'cantedit',
- 'info' => "You can't delete this page because you can't edit it"
+ 'info' => "You can't delete this page because it has been protected"
),
'badaccess-group0' => array(
'code' => 'permissiondenied',
* Get HTML for an info box with an icon.
*
* @param string $text Wikitext, get this with wfMessage()->plain()
- * @param string|bool $icon Icon name, file in skins/common/images. Default: false
+ * @param string|bool $icon Icon name, file in mw-config/images. Default: false
* @param string|bool $class Additional class name to add to the wrapper div. Default: false.
*
* @return string
public function getInfoBox( $text, $icon = false, $class = false ) {
$text = $this->parse( $text, true );
$icon = ( $icon == false ) ?
- '../skins/common/images/info-32.png' :
- '../skins/common/images/' . $icon;
+ 'images/info-32.png' :
+ 'images/' . $icon;
$alt = wfMessage( 'config-information' )->text();
return Html::infoBox( $text, $icon, $alt, $class, false );
<title><?php $this->outputTitle(); ?></title>
<?php echo $this->getCssUrl() . "\n"; ?>
<?php echo $this->getJQuery() . "\n"; ?>
- <?php echo Html::linkedScript( '../skins/common/config.js' ) . "\n"; ?>
+ <?php echo Html::linkedScript( 'config.js' ) . "\n"; ?>
</head>
<?php echo Html::openElement( 'body', array( 'class' => $this->getDir() ) ) . "\n"; ?>
<div id="mw-panel">
<div class="portal" id="p-logo">
- <a style="background-image: url(../skins/common/images/mediawiki.png);"
+ <a style="background-image: url(images/installer-logo.png);"
href="https://www.mediawiki.org/"
title="Main Page"></a>
</div>
<title><?php $this->outputTitle(); ?></title>
<?php echo $this->getCssUrl() . "\n"; ?>
<?php echo $this->getJQuery(); ?>
- <?php echo Html::linkedScript( '../skins/common/config.js' ); ?>
+ <?php echo Html::linkedScript( 'config.js' ); ?>
</head>
<body style="background-image: none">
protected function startLiveBox() {
$this->addHTML(
'<div id="config-spinner" style="display:none;">' .
- '<img src="../skins/common/images/ajax-loader.gif" /></div>' .
+ '<img src="images/ajax-loader.gif" /></div>' .
'<script>jQuery( "#config-spinner" ).show();</script>' .
'<div id="config-live-log">' .
'<textarea name="LiveLog" rows="10" cols="30" readonly="readonly">'
'config_wgRightsIcon' => '[license_button]',
) );
$styleUrl = $server . dirname( dirname( $this->parent->getUrl() ) ) .
- '/skins/common/config-cc.css';
+ '/mw-config/config-cc.css';
$iframeUrl = 'http://creativecommons.org/license/?' .
wfArrayToCgi( array(
'partner' => 'MediaWiki',
// If the page has a history, insert a warning
if ( $hasHistory ) {
- $revisions = $this->mTitle->estimateRevisionCount();
+ $title = $this->getTitle();
+
+ // The following can use the real revision count as this is only being shown for users that can delete
+ // this page.
+ // This, as a side-effect, also makes sure that the following query isn't being run for pages with a
+ // larger history, unless the user has the 'bigdelete' right (and is about to delete this page).
+ $dbr = wfGetDB( DB_SLAVE );
+ $revisions = $edits = (int)$dbr->selectField(
+ 'revision',
+ 'COUNT(rev_page)',
+ array( 'rev_page' => $title->getArticleID() ),
+ __METHOD__
+ );
+
// @todo FIXME: i18n issue/patchwork message
$this->getContext()->getOutput()->addHTML( '<strong class="mw-delete-warning-revisions">' .
wfMessage( 'historywarning' )->numParams( $revisions )->parse() .
'</strong>'
);
- if ( $this->mTitle->isBigDeletion() ) {
+ if ( $title->isBigDeletion() ) {
global $wgDeleteRevisionsLimit;
$this->getContext()->getOutput()->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n",
array(
"exbeforeblank": "content before blanking was: \"$1\"",
"delete-confirm": "Delete \"$1\"",
"delete-legend": "Delete",
- "historywarning": "<strong>Warning:</strong> The page you are about to delete has a history with approximately $1 {{PLURAL:$1|revision|revisions}}:",
+ "historywarning": "<strong>Warning:</strong> The page you are about to delete has a history with $1 {{PLURAL:$1|revision|revisions}}:",
"confirmdeletetext": "You are about to delete a page along with all of its history.\nPlease confirm that you intend to do this, that you understand the consequences, and that you are doing this in accordance with [[{{MediaWiki:Policy-url}}|the policy]].",
"actioncomplete": "Action complete",
"actionfailed": "Action failed",
"delete-edit-reasonlist": "Edit deletion reasons",
"delete-toobig": "This page has a large edit history, over $1 {{PLURAL:$1|revision|revisions}}.\nDeletion of such pages has been restricted to prevent accidental disruption of {{SITENAME}}.",
"delete-warning-toobig": "This page has a large edit history, over $1 {{PLURAL:$1|revision|revisions}}.\nDeleting it may disrupt database operations of {{SITENAME}};\nproceed with caution.",
- "delete-cantedit": "You cannot delete this page because you do not have permission to edit it.",
+ "deleteprotected": "You cannot delete this page because it has been protected.",
"deleting-backlinks-warning": "'''Warning:''' [[Special:WhatLinksHere/{{FULLPAGENAME}}|Other pages]] link to or transclude the page you are about to delete.",
"rollback": "Roll back edits",
"rollback_short": "Rollback",
"exbeforeblank": "Automated deletion reason when deleting a page for admins providing that the page was blanked before deletion.\n\nParameters:\n* $1 - content before blanking",
"delete-confirm": "Used as page title. Parameters:\n* $1 - the page title\n{{Identical|Delete}}",
"delete-legend": "{{Identical|Delete}}",
- "historywarning": "Warning when about to delete a page that has history.\n\nFollowed by a link which points to the history page.\n\nParameters:\n* $1 - the <b>approximate</b> number of revisions that the page has, the message should not claim to give an exact count",
+ "historywarning": "Warning when about to delete a page that has history.\n\nFollowed by a link which points to the history page.\n\nParameters:\n* $1 - the number of revisions that the page has",
"confirmdeletetext": "Introduction shown when deleting a page.\n\nRefers to {{msg-mw|Policy-url}}.",
"actioncomplete": "Used in several situations, for example when a page has been deleted.\n\nSee also:\n* {{msg-mw|Actionfailed|page title}}",
"actionfailed": "Used as page title when the submit operation failed, in [[Special:RevisionDelete]].\n\nSee also:\n* {{msg-mw|Actioncomplete|page title}}",
"delete-edit-reasonlist": "Shown beneath the page deletion form on the right side. It is a link to {{msg-mw|Deletereason-dropdown|notext=1}}.\n\nSee also:\n* {{msg-mw|Ipb-edit-dropdown}}\n* {{msg-mw|Protect-edit-reasonlist}}.\n{{Identical|Edit delete reasons}}",
"delete-toobig": "Parameters:\n* $1 - the upper limit of number of revisions\nSee also:\n* {{msg-mw|Delete-warning-toobig}}",
"delete-warning-toobig": "Parameters:\n* $1 - the upper limit of number of revisions\nSee also:\n* {{msg-mw|Delete-toobig}}",
- "delete-cantedit": "Used as error message when deleting the page.",
+ "deleteprotected": "Used as error message when deleting the page.",
"deleting-backlinks-warning": "A warning shown when a page that is being deleted has at least one link to it or is transcluded in at least one page.",
"rollback": "{{Identical|Rollback}}",
"rollback_short": "{{Identical|Rollback}}",
--- /dev/null
+/**
+ * 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;
+}
--- /dev/null
+.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;
+}
--- /dev/null
+( function ( $ ) {
+ $( function () {
+ var $label, labelText;
+
+ function syncText() {
+ var value = $(this).val()
+ .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
+ .replace( /&/, '&' )
+ .replace( /__+/g, '_' )
+ .replace( /^_+/, '' )
+ .replace( /_+$/, '' );
+ value = value.substr( 0, 1 ).toUpperCase() + value.substr( 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 ) );
'styles' => 'resources/src/mediawiki.special/mediawiki.special.version.css',
),
+ /* MediaWiki Installer */
+
+ 'mediawiki.legacy.config' => array(
+ // Used in the web installer. Test it after modifying this definition!
+ // These files are not actually loaded via ResourceLoader, so dependencies etc. won't work.
+ 'scripts' => 'mw-config/config.js',
+ 'styles' => 'mw-config/config.css',
+ ),
+
/* MediaWiki Legacy */
'mediawiki.legacy.ajax' => array(
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => $GLOBALS['wgStyleDirectory'],
),
- 'mediawiki.legacy.config' => array(
- // Used in the web installer. Test it after modifying this definition!
- 'scripts' => 'common/config.js',
- 'styles' => array( 'common/config.css' ),
- 'remoteBasePath' => $GLOBALS['wgStylePath'],
- 'localBasePath' => $GLOBALS['wgStyleDirectory'],
- 'dependencies' => 'mediawiki.legacy.wikibits',
- ),
'mediawiki.legacy.protect' => array(
'scripts' => 'common/protect.js',
'remoteBasePath' => $GLOBALS['wgStylePath'],
// Remove focus glow on input[type="search"]
outline: 0;
}
+
+ // Remove red outline from inputs which have required field and invalid content.
+ // This is a Firefox only issue
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid
+ &:invalid {
+ box-shadow: none;
+ }
}
textarea.mw-ui-input {
+++ /dev/null
-/**
- * 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;
-}
+++ /dev/null
-.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;
-}
+++ /dev/null
-( function ( $ ) {
- $( function () {
- var $label, labelText;
-
- function syncText() {
- var value = $(this).val()
- .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
- .replace( /&/, '&' )
- .replace( /__+/g, '_' )
- .replace( /^_+/, '' )
- .replace( /_+$/, '' );
- value = value.substr( 0, 1 ).toUpperCase() + value.substr( 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 ) );