From 2227434785a7b168982b126fee1235639beae5e7 Mon Sep 17 00:00:00 2001 From: Tom Gilder Date: Tue, 11 Oct 2005 23:11:33 +0000 Subject: [PATCH] More preferences improvements: * Change tabs onmousedown * RTL fixes * Properly disable email options * more! --- RELEASE-NOTES | 1 + includes/SpecialPreferences.php | 51 ++++++++++++++++++++------------- languages/Language.php | 2 +- skins/common/wikibits.js | 2 +- skins/monobook/main.css | 9 ++++-- skins/monobook/rtl.css | 21 ++++++++------ 6 files changed, 53 insertions(+), 33 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f0461f40c0..7307e61fff 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -143,6 +143,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 3163) Full translation of LanguageBr * (bug 3617) Update for portuguese language (pt) * Namespaces hacks on LanguagePl +* New preferences design and reorganisation === Caveats === diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index e0fe2960f7..d00265b6a2 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -51,7 +51,7 @@ class PreferencesForm { $this->mDate = $request->getVal( 'wpDate' ); $this->mUserEmail = $request->getVal( 'wpUserEmail' ); $this->mRealName = $wgAllowRealName ? $request->getVal( 'wpRealName' ) : ''; - $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0; + $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 0 : 1; $this->mNick = $request->getVal( 'wpNick' ); $this->mUserLanguage = $request->getVal( 'wpUserLanguage' ); $this->mUserVariant = $request->getVal( 'wpUserVariant' ); @@ -385,15 +385,16 @@ class PreferencesForm { } - function getToggle( $tname, $trailer = false) { + function getToggle( $tname, $trailer = false, $disabled = false ) { global $wgUser, $wgLang; $this->mUsedToggles[$tname] = true; $ttext = $wgLang->getUserToggle( $tname ); $checked = $wgUser->getOption( $tname ) == 1 ? ' checked="checked"' : ''; + $disabled = $disabled ? ' disabled="disabled"' : ''; $trailer = $trailer ? $trailer : ''; - return "
" . + return "
" . " $trailer
\n"; } @@ -463,13 +464,16 @@ class PreferencesForm { $this->mUserEmail = htmlspecialchars( $this->mUserEmail ); $this->mRealName = htmlspecialchars( $this->mRealName ); $this->mNick = htmlspecialchars( $this->mNick ); - if ( $this->mEmailFlag ) { $emfc = 'checked="checked"'; } + if ( !$this->mEmailFlag ) { $emfc = 'checked="checked"'; } else { $emfc = ''; } + if ($wgEmailAuthentication && ($this->mUserEmail != '') ) { if( $wgUser->getEmailAuthenticationTimestamp() ) { $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationTimestamp(), true ) ).'
'; + $disableEmailPrefs = false; } else { + $disableEmailPrefs = true; $skin = $wgUser->getSkin(); $emailauthenticated = wfMsg('emailnotauthenticated').'
' . $skin->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Confirmemail' ), @@ -477,6 +481,7 @@ class PreferencesForm { } } else { $emailauthenticated = ''; + $disableEmailPrefs = false; } if ($this->mUserEmail == '') { @@ -485,10 +490,10 @@ class PreferencesForm { $ps = $this->namespacesCheckboxes(); - $enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages' ) : ''; - $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages' ) : ''; - $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits' ) : ''; - $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr' ) : ''; + $enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages', false, $disableEmailPrefs ) : ''; + $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : ''; + $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : ''; + $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : ''; $prefs_help_email_enotif = ( $wgEnotifWatchlist || $wgEnotifUserTalk) ? ' ' . wfMsg('prefs-help-email-enotif') : ''; $prefs_help_realname = ''; @@ -520,24 +525,24 @@ class PreferencesForm { if ($wgAllowRealName) { $wgOut->addHTML( $this->addRow( - wfMsg('yourrealname'), - "mRealName}\" size='25' />" + '', + "mRealName}\" size='25' />" ) ); } if ($wgEnableEmail) { $wgOut->addHTML( $this->addRow( - wfMsg( 'youremail' ), - "mUserEmail}\" size='25' />" + '', + "mUserEmail}\" size='25' />" ) ); } $wgOut->addHTML( $this->addRow( - wfMsg( 'yournick' ), - "mNick}\" size='25' />" + '', + "mNick}\" size='25' />" ) . # FIXME: The part should be where the   is, getToggle() needs # to be changed to out return its output in two parts. -ævar @@ -564,7 +569,12 @@ class PreferencesForm { $selbox .= "\n"; } } - $wgOut->addHTML( $this->addRow( wfMsg('yourlanguage'), "" )); + $wgOut->addHTML( + $this->addRow( + '', + "" + ) + ); /* see if there are multiple language variants to choose from*/ if(!$wgDisableLangConversion) { @@ -614,11 +624,12 @@ class PreferencesForm { $enotifwatchlistpages. $enotifusertalkpages. $enotifminoredits ); - if ($wgEnableUserEmail) { - $emf = wfMsg( 'emailflag' ); - $wgOut->addHTML( - "
" ); - } + if ($wgEnableUserEmail) { + $emf = wfMsg( 'emailflag' ); + $disabled = $disableEmailPrefs ? ' disabled="disabled"' : ''; + $wgOut->addHTML( + "
" ); + } $wgOut->addHTML( '' ); } diff --git a/languages/Language.php b/languages/Language.php index 937b1e0229..bb12d1a3db 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -892,7 +892,7 @@ $2 List redirects   Search for $3 $9", 'timezoneoffset' => 'Offset¹', 'servertime' => 'Server time', 'guesstimezone' => 'Fill in from browser', -'emailflag' => 'Disable email from other users', +'emailflag' => 'Enable email from other users', 'defaultns' => 'Search in these namespaces by default:', 'default' => 'default', 'files' => 'Files', diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index f324e89907..8773df98b3 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -141,7 +141,7 @@ function tabbedprefs() { if(i == 0) li.className = 'selected'; var a = document.createElement('a'); a.href = '#' + sections[i].secid; - a.onclick = uncoversection; + a.onmousedown = a.onclick = uncoversection; a.appendChild(document.createTextNode(sections[i].text)); a.secid = sections[i].secid; li.appendChild(a); diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 98220bf1b1..ffabcd0dbd 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -914,6 +914,7 @@ head:first-child+body #footer li { white-space: nowrap; } margin: 0; padding: 0; width: 100%; + clear: both; } #preftoc li { margin: 1px -2px 1px 2px; @@ -957,12 +958,12 @@ head:first-child+body #footer li { white-space: nowrap; } } #prefcontrol { padding-top: 2em; - clear: left; + clear: both; } #preferences { margin: 0; border: 1px solid #aaa; - clear: left; + clear: both; padding: 1.5em; background-color: #F9F9F9; } @@ -990,10 +991,12 @@ div.prefsectiontip { margin-top: 0; background-color: #FFC1C1; padding: .2em .7em; - clear: left; + clear: both; } .btnSavePrefs { font-weight: bold; + padding-left: .3em; + padding-right: .3em; } .preferences-save-success { diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css index fbd19768d9..92bbf3e60e 100644 --- a/skins/monobook/rtl.css +++ b/skins/monobook/rtl.css @@ -190,16 +190,21 @@ li#pt-login { * html #column-one { right: 0; } /* js pref toc */ -#preftoc { float: right; } -/* workaround for moz bug, displayed bullets on left side */ -#preftoc li { list-style: none; } -#prefcontrol { float: right; } -fieldset.prefsection, -fieldset.operaprefsection { - margin-left: 0 !important; - margin-right: 15em; + +#preftoc { + margin-right: 1em; +} + +.preferences-save-success, #preftoc li, .prefsection fieldset { + float: right; } +.prefsection { + padding-right: 2em; +} + +/* workaround for moz bug, displayed bullets on left side */ + #toc ul { text-align: right; } -- 2.20.1