summaryrefslogtreecommitdiff
path: root/www/wiki/mw-config
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2019-07-31 14:50:50 -0300
committerYaco <franco@reevo.org>2019-07-31 14:50:50 -0300
commit3848848fc3bc2db035c824f1453635949505d76e (patch)
tree71fd898ebb220e7ba034cf2bc1bf708fdd0d6219 /www/wiki/mw-config
parent2dfe0b926fe5c6c4f27ad1f9bc1c1377cb091111 (diff)
ACTUALIZA MW a 1.31.3, SMW a 3.0.2 y extensiones menores
Diffstat (limited to 'www/wiki/mw-config')
-rw-r--r--www/wiki/mw-config/config.css5
-rw-r--r--www/wiki/mw-config/config.js53
-rw-r--r--www/wiki/mw-config/index.php6
3 files changed, 57 insertions, 7 deletions
diff --git a/www/wiki/mw-config/config.css b/www/wiki/mw-config/config.css
index ea5835d4..2468c715 100644
--- a/www/wiki/mw-config/config.css
+++ b/www/wiki/mw-config/config.css
@@ -174,6 +174,11 @@
min-width: 20em;
}
+/* Hide empty live-log textarea */
+#config-live-log textarea:empty {
+ display: none;
+}
+
/* tooltip styles */
.config-help-field-hint {
display: none;
diff --git a/www/wiki/mw-config/config.js b/www/wiki/mw-config/config.js
index c745ce44..99290f44 100644
--- a/www/wiki/mw-config/config.js
+++ b/www/wiki/mw-config/config.js
@@ -1,3 +1,4 @@
+/* global extDependencyMap */
( function ( $ ) {
$( function () {
var $label, labelText;
@@ -72,21 +73,23 @@
// Hide "other" textboxes by default
// Should not be done in CSS for javascript disabled compatibility
- $( '.enabledByOther' ).closest( '.config-block' ).hide();
+ if ( !$( '#config__NamespaceType_other' ).is( ':checked' ) ) {
+ $( '.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' );
+ $textbox.prop( 'readonly', false ).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]' );
+ $label = $( 'label[for="config__NamespaceType_site-name"]' );
labelText = $label.text();
$label.text( labelText.replace( '$1', '' ) );
$( '#config_wgSitename' ).on( 'keyup change', syncText ).each( syncText );
@@ -100,5 +103,49 @@
$memc.hide( 'slow' );
}
} );
+
+ function areReqsSatisfied( name ) {
+ var i, ext, skin, node;
+ if ( !extDependencyMap[ name ] ) {
+ return true;
+ }
+
+ if ( extDependencyMap[ name ].extensions ) {
+ for ( i in extDependencyMap[ name ].extensions ) {
+ ext = extDependencyMap[ name ].extensions[ i ];
+ node = document.getElementById( 'config_ext-' + ext );
+ if ( !node || !node.checked ) {
+ return false;
+ }
+ }
+ }
+ if ( extDependencyMap[ name ].skins ) {
+ for ( i in extDependencyMap[ name ].skins ) {
+ skin = extDependencyMap[ name ].skins[ i ];
+ node = document.getElementById( 'config_skin-' + skin );
+ if ( !node || !node.checked ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ // Disable checkboxes if the extension has dependencies
+ $( '.mw-ext-with-dependencies input' ).prop( 'disabled', true );
+ $( '.config-ext-input[data-name]' ).on( 'change', function () {
+ $( '.mw-ext-with-dependencies input' ).each( function () {
+ var name = this.getAttribute( 'data-name' );
+ if ( areReqsSatisfied( name ) ) {
+ // Re-enable it!
+ this.disabled = false;
+ } else {
+ // Uncheck and disable the checkbox
+ this.checked = false;
+ this.disabled = true;
+ }
+ } );
+ } );
} );
}( jQuery ) );
diff --git a/www/wiki/mw-config/index.php b/www/wiki/mw-config/index.php
index 10b8d973..a47822bb 100644
--- a/www/wiki/mw-config/index.php
+++ b/www/wiki/mw-config/index.php
@@ -1,5 +1,5 @@
<?php
-// @codingStandardsIgnoreFile Generic.Arrays.DisallowLongArraySyntax
+// phpcs:disable Generic.Arrays.DisallowLongArraySyntax
/**
* New version of MediaWiki web-based config/installation
*
@@ -23,9 +23,8 @@
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
+// phpcs:ignore MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'mw-config/index.php' );
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
@@ -80,5 +79,4 @@ function wfInstallerMain() {
$session = $installer->execute( $session );
$_SESSION['installData'][$fingerprint] = $session;
-
}