From 2e373adf837557367b63feea4e02ebe84dee952a Mon Sep 17 00:00:00 2001 From: Alex Z Date: Thu, 25 Sep 2008 02:08:59 +0000 Subject: [PATCH] * (bug 15701) Protection form was too wide for some browsers as 2 columns, switching to 1 column format. * Move the "unlock move permissions" checkbox to a more logical place with the options for move protection, instead of with the cascading checkbox. --- includes/ProtectionForm.php | 16 ++++++++++------ skins/common/protect.js | 7 +++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 060fb59a24..85088316fc 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -311,10 +311,11 @@ class ProtectionForm { if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) { $msg = $action; } - $label = Xml::element( 'label', array( 'for' => "mwProtect-level-$action" ), $msg ); - $out .= "" . - "" . - "
$label
" . $this->buildSelector( $action, $selected ) . ""; + $out .= "
". + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, $msg ) . + Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) . + "
" . $this->buildSelector( $action, $selected ) . "
"; $reasonDropDown = Xml::listDropDown( 'wpProtectReasonSelection', wfMsgForContent( 'protect-dropdown' ), @@ -377,7 +378,10 @@ class ProtectionForm { Xml::input( "mwProtect-expiry-$action", 50, $this->mExpiry[$action], $attribs ) . '
'; - $out .= ""; + $out .= "" . + Xml::closeElement( 'table' ) . + Xml::closeElement( 'fieldset' ) . + ""; } $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' ); @@ -519,7 +523,7 @@ class ProtectionForm { } $script .= "[" . implode(',',$CascadeableLevels) . "];\n"; $options = (object)array( - 'tableId' => 'mw-protect-table2', + 'tableId' => 'mw-protect-table-move', 'labelText' => wfMsg( 'protect-unchain' ), 'numTypes' => count($this->mApplicableTypes), 'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ), diff --git a/skins/common/protect.js b/skins/common/protect.js index ab1ea30e1e..d9650c829a 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -19,14 +19,13 @@ var ProtectionForm = { var box = document.getElementById( opts.tableId ); if( !box ) return false; - - var tbody = box.getElementsByTagName( 'tbody' )[0]; + + var boxbody = box.getElementsByTagName('tbody')[0] var row = document.createElement( 'tr' ); - tbody.appendChild( row ); + boxbody.insertBefore( row, boxbody.firstChild ); this.existingMatch = opts.existingMatch; - row.appendChild( document.createElement( 'td' ) ); var cell = document.createElement( 'td' ); row.appendChild( cell ); // If there is only one protection type, there is nothing to chain -- 2.20.1