Merge "Allow two-tier setup of transwiki import sources"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 19 Aug 2014 18:35:55 +0000 (18:35 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 19 Aug 2014 18:35:55 +0000 (18:35 +0000)
29 files changed:
includes/Title.php
includes/api/ApiBase.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerPage.php
includes/page/Article.php
languages/i18n/en.json
languages/i18n/qqq.json
mw-config/config-cc.css [new file with mode: 0644]
mw-config/config.css [new file with mode: 0644]
mw-config/config.js [new file with mode: 0644]
mw-config/images/ajax-loader.gif [new file with mode: 0644]
mw-config/images/bullet.gif [new file with mode: 0644]
mw-config/images/critical-32.png [new file with mode: 0644]
mw-config/images/download-32.png [new file with mode: 0644]
mw-config/images/info-32.png [new file with mode: 0644]
mw-config/images/installer-logo.png [new file with mode: 0644]
mw-config/images/tick-32.png [new file with mode: 0644]
mw-config/images/warning-32.png [new file with mode: 0644]
resources/Resources.php
resources/src/mediawiki.ui/components/inputs.less
skins/common/config-cc.css [deleted file]
skins/common/config.css [deleted file]
skins/common/config.js [deleted file]
skins/common/images/critical-32.png [deleted file]
skins/common/images/download-32.png [deleted file]
skins/common/images/info-32.png [deleted file]
skins/common/images/tick-32.png [deleted file]
skins/common/images/warning-32.png [deleted file]

index 526bc92..15ff216 100644 (file)
@@ -158,6 +158,9 @@ class Title {
 
        /** @var TitleValue A corresponding TitleValue object */
        private $mTitleValue = null;
+
+       /** @var bool Would deleting this page be a big deletion? */
+       private $mIsBigDeletion = null;
        // @}
 
        /**
@@ -2258,11 +2261,15 @@ class Title {
                                $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()
@@ -3271,6 +3278,7 @@ class Title {
                $this->mEstimateRevisions = null;
                $this->mPageLanguage = false;
                $this->mDbPageLanguage = null;
+               $this->mIsBigDeletion = null;
        }
 
        /**
@@ -4377,12 +4385,32 @@ class Title {
                        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
         */
index db62be0..c05a833 100644 (file)
@@ -1411,9 +1411,9 @@ abstract class ApiBase extends ContextSource {
                        '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',
index 68c2ebe..3a3e809 100644 (file)
@@ -667,7 +667,7 @@ class WebInstaller extends Installer {
         * 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
@@ -675,8 +675,8 @@ class WebInstaller extends Installer {
        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 );
index 0ce2007..f797ef9 100644 (file)
@@ -265,7 +265,7 @@ class WebInstallerOutput {
        <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"; ?>
@@ -290,7 +290,7 @@ class WebInstallerOutput {
 
 <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>
@@ -314,7 +314,7 @@ class WebInstallerOutput {
        <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">
index 9fdee76..2a9c54c 100644 (file)
@@ -187,7 +187,7 @@ abstract class WebInstallerPage {
        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">'
@@ -1176,7 +1176,7 @@ class WebInstallerOptions extends WebInstallerPage {
                        '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',
index c54c692..da88a69 100644 (file)
@@ -1624,7 +1624,20 @@ class Article implements Page {
 
                // 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() .
@@ -1635,7 +1648,7 @@ class Article implements Page {
                                '</strong>'
                        );
 
-                       if ( $this->mTitle->isBigDeletion() ) {
+                       if ( $title->isBigDeletion() ) {
                                global $wgDeleteRevisionsLimit;
                                $this->getContext()->getOutput()->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n",
                                        array(
index 70c503b..9fce4df 100644 (file)
        "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",
index 3c3f727..0dd0881 100644 (file)
        "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}}",
diff --git a/mw-config/config-cc.css b/mw-config/config-cc.css
new file mode 100644 (file)
index 0000000..ecd10fa
--- /dev/null
@@ -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 (file)
index 0000000..17b2039
--- /dev/null
@@ -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 (file)
index 0000000..2886e08
--- /dev/null
@@ -0,0 +1,108 @@
+( function ( $ ) {
+       $( function () {
+               var $label, labelText;
+
+               function syncText() {
+                       var value = $(this).val()
+                               .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
+                               .replace( /&/, '&amp;' )
+                               .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 ) );
diff --git a/mw-config/images/ajax-loader.gif b/mw-config/images/ajax-loader.gif
new file mode 100644 (file)
index 0000000..72203fd
Binary files /dev/null and b/mw-config/images/ajax-loader.gif differ
diff --git a/mw-config/images/bullet.gif b/mw-config/images/bullet.gif
new file mode 100644 (file)
index 0000000..b43de48
Binary files /dev/null and b/mw-config/images/bullet.gif differ
diff --git a/mw-config/images/critical-32.png b/mw-config/images/critical-32.png
new file mode 100644 (file)
index 0000000..9b38e6a
Binary files /dev/null and b/mw-config/images/critical-32.png differ
diff --git a/mw-config/images/download-32.png b/mw-config/images/download-32.png
new file mode 100644 (file)
index 0000000..e5b8318
Binary files /dev/null and b/mw-config/images/download-32.png differ
diff --git a/mw-config/images/info-32.png b/mw-config/images/info-32.png
new file mode 100644 (file)
index 0000000..ab09e1d
Binary files /dev/null and b/mw-config/images/info-32.png differ
diff --git a/mw-config/images/installer-logo.png b/mw-config/images/installer-logo.png
new file mode 100644 (file)
index 0000000..8c42118
Binary files /dev/null and b/mw-config/images/installer-logo.png differ
diff --git a/mw-config/images/tick-32.png b/mw-config/images/tick-32.png
new file mode 100644 (file)
index 0000000..34cfa9c
Binary files /dev/null and b/mw-config/images/tick-32.png differ
diff --git a/mw-config/images/warning-32.png b/mw-config/images/warning-32.png
new file mode 100644 (file)
index 0000000..0400734
Binary files /dev/null and b/mw-config/images/warning-32.png differ
index 3a74026..092660c 100644 (file)
@@ -1383,6 +1383,15 @@ return array(
                '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(
@@ -1400,14 +1409,6 @@ return 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'],
index 6996ab8..0a50e10 100644 (file)
                // 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 {
diff --git a/skins/common/config-cc.css b/skins/common/config-cc.css
deleted file mode 100644 (file)
index ecd10fa..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * 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/skins/common/config.css b/skins/common/config.css
deleted file mode 100644 (file)
index 17b2039..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-.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/skins/common/config.js b/skins/common/config.js
deleted file mode 100644 (file)
index 2886e08..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-( function ( $ ) {
-       $( function () {
-               var $label, labelText;
-
-               function syncText() {
-                       var value = $(this).val()
-                               .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
-                               .replace( /&/, '&amp;' )
-                               .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 ) );
diff --git a/skins/common/images/critical-32.png b/skins/common/images/critical-32.png
deleted file mode 100644 (file)
index 9b38e6a..0000000
Binary files a/skins/common/images/critical-32.png and /dev/null differ
diff --git a/skins/common/images/download-32.png b/skins/common/images/download-32.png
deleted file mode 100644 (file)
index e5b8318..0000000
Binary files a/skins/common/images/download-32.png and /dev/null differ
diff --git a/skins/common/images/info-32.png b/skins/common/images/info-32.png
deleted file mode 100644 (file)
index ab09e1d..0000000
Binary files a/skins/common/images/info-32.png and /dev/null differ
diff --git a/skins/common/images/tick-32.png b/skins/common/images/tick-32.png
deleted file mode 100644 (file)
index 34cfa9c..0000000
Binary files a/skins/common/images/tick-32.png and /dev/null differ
diff --git a/skins/common/images/warning-32.png b/skins/common/images/warning-32.png
deleted file mode 100644 (file)
index 0400734..0000000
Binary files a/skins/common/images/warning-32.png and /dev/null differ