r41241 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41240‎ | r41241 | r41242 >
Date:02:08, 25 September 2008
Author:mrzman
Status:old
Tags:
Comment:
* (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.
Modified paths:
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/protect.js
@@ -19,14 +19,13 @@
2020 var box = document.getElementById( opts.tableId );
2121 if( !box )
2222 return false;
23 -
24 - var tbody = box.getElementsByTagName( 'tbody' )[0];
 23+
 24+ var boxbody = box.getElementsByTagName('tbody')[0]
2525 var row = document.createElement( 'tr' );
26 - tbody.appendChild( row );
 26+ boxbody.insertBefore( row, boxbody.firstChild );
2727
2828 this.existingMatch = opts.existingMatch;
2929
30 - row.appendChild( document.createElement( 'td' ) );
3130 var cell = document.createElement( 'td' );
3231 row.appendChild( cell );
3332 // If there is only one protection type, there is nothing to chain
Index: trunk/phase3/includes/ProtectionForm.php
@@ -311,10 +311,11 @@
312312 if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) {
313313 $msg = $action;
314314 }
315 - $label = Xml::element( 'label', array( 'for' => "mwProtect-level-$action" ), $msg );
316 - $out .= "<tr><td><table>" .
317 - "<tr><th>$label</th><th></th></tr>" .
318 - "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td><td>";
 315+ $out .= "<tr><td>".
 316+ Xml::openElement( 'fieldset' ) .
 317+ Xml::element( 'legend', null, $msg ) .
 318+ Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
 319+ "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td></tr><tr><td>";
319320
320321 $reasonDropDown = Xml::listDropDown( 'wpProtectReasonSelection',
321322 wfMsgForContent( 'protect-dropdown' ),
@@ -377,7 +378,10 @@
378379 Xml::input( "mwProtect-expiry-$action", 50, $this->mExpiry[$action], $attribs ) .
379380 '</td>
380381 </tr></table>';
381 - $out .= "</td></tr></table></td></tr>";
 382+ $out .= "</td></tr>" .
 383+ Xml::closeElement( 'table' ) .
 384+ Xml::closeElement( 'fieldset' ) .
 385+ "</td></tr>";
382386 }
383387
384388 $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
@@ -519,7 +523,7 @@
520524 }
521525 $script .= "[" . implode(',',$CascadeableLevels) . "];\n";
522526 $options = (object)array(
523 - 'tableId' => 'mw-protect-table2',
 527+ 'tableId' => 'mw-protect-table-move',
524528 'labelText' => wfMsg( 'protect-unchain' ),
525529 'numTypes' => count($this->mApplicableTypes),
526530 'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ),