r11302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11301‎ | r11302 | r11303 >
Date:23:11, 11 October 2005
Author:tomgilder
Status:old
Tags:
Comment:
More preferences improvements:
* Change tabs onmousedown
* RTL fixes
* Properly disable email options
* more!
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)
  • /trunk/phase3/skins/monobook/rtl.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/rtl.css
@@ -190,16 +190,21 @@
191191 * html #column-one { right: 0; }
192192
193193 /* js pref toc */
194 -#preftoc { float: right; }
195 -/* workaround for moz bug, displayed bullets on left side */
196 -#preftoc li { list-style: none; }
197 -#prefcontrol { float: right; }
198 -fieldset.prefsection,
199 -fieldset.operaprefsection {
200 - margin-left: 0 !important;
201 - margin-right: 15em;
 194+
 195+#preftoc {
 196+ margin-right: 1em;
202197 }
203198
 199+.preferences-save-success, #preftoc li, .prefsection fieldset {
 200+ float: right;
 201+}
 202+
 203+.prefsection {
 204+ padding-right: 2em;
 205+}
 206+
 207+/* workaround for moz bug, displayed bullets on left side */
 208+
204209 #toc ul {
205210 text-align: right;
206211 }
Index: trunk/phase3/skins/monobook/main.css
@@ -914,6 +914,7 @@
915915 margin: 0;
916916 padding: 0;
917917 width: 100%;
 918+ clear: both;
918919 }
919920 #preftoc li {
920921 margin: 1px -2px 1px 2px;
@@ -957,12 +958,12 @@
958959 }
959960 #prefcontrol {
960961 padding-top: 2em;
961 - clear: left;
 962+ clear: both;
962963 }
963964 #preferences {
964965 margin: 0;
965966 border: 1px solid #aaa;
966 - clear: left;
 967+ clear: both;
967968 padding: 1.5em;
968969 background-color: #F9F9F9;
969970 }
@@ -990,10 +991,12 @@
991992 margin-top: 0;
992993 background-color: #FFC1C1;
993994 padding: .2em .7em;
994 - clear: left;
 995+ clear: both;
995996 }
996997 .btnSavePrefs {
997998 font-weight: bold;
 999+ padding-left: .3em;
 1000+ padding-right: .3em;
9981001 }
9991002
10001003 .preferences-save-success {
Index: trunk/phase3/skins/common/wikibits.js
@@ -141,7 +141,7 @@
142142 if(i == 0) li.className = 'selected';
143143 var a = document.createElement('a');
144144 a.href = '#' + sections[i].secid;
145 - a.onclick = uncoversection;
 145+ a.onmousedown = a.onclick = uncoversection;
146146 a.appendChild(document.createTextNode(sections[i].text));
147147 a.secid = sections[i].secid;
148148 li.appendChild(a);
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -51,7 +51,7 @@
5252 $this->mDate = $request->getVal( 'wpDate' );
5353 $this->mUserEmail = $request->getVal( 'wpUserEmail' );
5454 $this->mRealName = $wgAllowRealName ? $request->getVal( 'wpRealName' ) : '';
55 - $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0;
 55+ $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 0 : 1;
5656 $this->mNick = $request->getVal( 'wpNick' );
5757 $this->mUserLanguage = $request->getVal( 'wpUserLanguage' );
5858 $this->mUserVariant = $request->getVal( 'wpUserVariant' );
@@ -385,15 +385,16 @@
386386 }
387387
388388
389 - function getToggle( $tname, $trailer = false) {
 389+ function getToggle( $tname, $trailer = false, $disabled = false ) {
390390 global $wgUser, $wgLang;
391391
392392 $this->mUsedToggles[$tname] = true;
393393 $ttext = $wgLang->getUserToggle( $tname );
394394
395395 $checked = $wgUser->getOption( $tname ) == 1 ? ' checked="checked"' : '';
 396+ $disabled = $disabled ? ' disabled="disabled"' : '';
396397 $trailer = $trailer ? $trailer : '';
397 - return "<div class='toggle'><input type='checkbox' value='1' id=\"$tname\" name=\"wpOp$tname\"$checked />" .
 398+ return "<div class='toggle'><input type='checkbox' value='1' id=\"$tname\" name=\"wpOp$tname\"$checked$disabled />" .
398399 " <span class='toggletext'><label for=\"$tname\">$ttext</label>$trailer</span></div>\n";
399400 }
400401
@@ -463,13 +464,16 @@
464465 $this->mUserEmail = htmlspecialchars( $this->mUserEmail );
465466 $this->mRealName = htmlspecialchars( $this->mRealName );
466467 $this->mNick = htmlspecialchars( $this->mNick );
467 - if ( $this->mEmailFlag ) { $emfc = 'checked="checked"'; }
 468+ if ( !$this->mEmailFlag ) { $emfc = 'checked="checked"'; }
468469 else { $emfc = ''; }
469470
 471+
470472 if ($wgEmailAuthentication && ($this->mUserEmail != '') ) {
471473 if( $wgUser->getEmailAuthenticationTimestamp() ) {
472474 $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'<br />';
 475+ $disableEmailPrefs = false;
473476 } else {
 477+ $disableEmailPrefs = true;
474478 $skin = $wgUser->getSkin();
475479 $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
476480 $skin->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Confirmemail' ),
@@ -477,6 +481,7 @@
478482 }
479483 } else {
480484 $emailauthenticated = '';
 485+ $disableEmailPrefs = false;
481486 }
482487
483488 if ($this->mUserEmail == '') {
@@ -485,10 +490,10 @@
486491
487492 $ps = $this->namespacesCheckboxes();
488493
489 - $enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages' ) : '';
490 - $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages' ) : '';
491 - $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits' ) : '';
492 - $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr' ) : '';
 494+ $enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages', false, $disableEmailPrefs ) : '';
 495+ $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : '';
 496+ $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : '';
 497+ $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : '';
493498 $prefs_help_email_enotif = ( $wgEnotifWatchlist || $wgEnotifUserTalk) ? ' ' . wfMsg('prefs-help-email-enotif') : '';
494499 $prefs_help_realname = '';
495500
@@ -520,24 +525,24 @@
521526 if ($wgAllowRealName) {
522527 $wgOut->addHTML(
523528 $this->addRow(
524 - wfMsg('yourrealname'),
525 - "<input type='text' name='wpRealName' value=\"{$this->mRealName}\" size='25' />"
 529+ '<label for="wpRealName">' . wfMsg('yourrealname') . '</label>',
 530+ "<input type='text' name='wpRealName' id='wpRealName' value=\"{$this->mRealName}\" size='25' />"
526531 )
527532 );
528533 }
529534 if ($wgEnableEmail) {
530535 $wgOut->addHTML(
531536 $this->addRow(
532 - wfMsg( 'youremail' ),
533 - "<input type='text' name='wpUserEmail' value=\"{$this->mUserEmail}\" size='25' />"
 537+ '<label for="wpUserEmail">' . wfMsg( 'youremail' ) . '</label>',
 538+ "<input type='text' name='wpUserEmail' id='wpUserEmail' value=\"{$this->mUserEmail}\" size='25' />"
534539 )
535540 );
536541 }
537542
538543 $wgOut->addHTML(
539544 $this->addRow(
540 - wfMsg( 'yournick' ),
541 - "<input type='text' name='wpNick' value=\"{$this->mNick}\" size='25' />"
 545+ '<label for="wpNick">' . wfMsg( 'yournick' ) . '</label>',
 546+ "<input type='text' name='wpNick' id='wpNick' value=\"{$this->mNick}\" size='25' />"
542547 ) .
543548 # FIXME: The <input> part should be where the &nbsp; is, getToggle() needs
544549 # to be changed to out return its output in two parts. -ævar
@@ -564,7 +569,12 @@
565570 $selbox .= "<option value=\"$code\"$sel>$code - $name</option>\n";
566571 }
567572 }
568 - $wgOut->addHTML( $this->addRow( wfMsg('yourlanguage'), "<select name='wpUserLanguage'>$selbox</select>" ));
 573+ $wgOut->addHTML(
 574+ $this->addRow(
 575+ '<label for="wpUserLanguage">' . wfMsg('yourlanguage') . '</label>',
 576+ "<select name='wpUserLanguage' id='wpUserLanguage'>$selbox</select>"
 577+ )
 578+ );
569579
570580 /* see if there are multiple language variants to choose from*/
571581 if(!$wgDisableLangConversion) {
@@ -614,11 +624,12 @@
615625 $enotifwatchlistpages.
616626 $enotifusertalkpages.
617627 $enotifminoredits );
618 - if ($wgEnableUserEmail) {
619 - $emf = wfMsg( 'emailflag' );
620 - $wgOut->addHTML(
621 - "<div><input type='checkbox' $emfc value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label></div>" );
622 - }
 628+ if ($wgEnableUserEmail) {
 629+ $emf = wfMsg( 'emailflag' );
 630+ $disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
 631+ $wgOut->addHTML(
 632+ "<div><input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label></div>" );
 633+ }
623634
624635 $wgOut->addHTML( '</fieldset>' );
625636 }
Index: trunk/phase3/RELEASE-NOTES
@@ -143,6 +143,7 @@
144144 * (bug 3163) Full translation of LanguageBr
145145 * (bug 3617) Update for portuguese language (pt)
146146 * Namespaces hacks on LanguagePl
 147+* New preferences design and reorganisation
147148
148149
149150 === Caveats ===
Index: trunk/phase3/languages/Language.php
@@ -892,7 +892,7 @@
893893 'timezoneoffset' => 'Offset¹',
894894 'servertime' => 'Server time',
895895 'guesstimezone' => 'Fill in from browser',
896 -'emailflag' => 'Disable email from other users',
 896+'emailflag' => 'Enable email from other users',
897897 'defaultns' => 'Search in these namespaces by default:',
898898 'default' => 'default',
899899 'files' => 'Files',

Status & tagging log