r49553 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49552‎ | r49553 | r49554 >
Date:03:51, 16 April 2009
Author:werdna
Status:deferred
Tags:
Comment:
* Clarify descriptions of some preferences.
* General usability work in trying to make preferences screen consistent.
* Split off the Misc section into 'Page rendering', there are only two settings now left in Misc.
* Add some defaults for the stub threshold setting.
* Force 20% width on mw-label column for consistency between preferences tabs.
* Style the submit button and visually separate it from the other two.
Modified paths:
  • /branches/preferences-work/phase3/includes/HTMLForm.php (modified) (history)
  • /branches/preferences-work/phase3/includes/Preferences.php (modified) (history)
  • /branches/preferences-work/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /branches/preferences-work/phase3/skins/common/htmlform.js (modified) (history)
  • /branches/preferences-work/phase3/skins/common/shared.css (modified) (history)
  • /branches/preferences-work/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: branches/preferences-work/phase3/skins/monobook/main.css
@@ -1031,15 +1031,16 @@
10321032 .mainLegend {
10331033 display: none;
10341034 }
1035 -div.prefsectiontip {
 1035+td.htmlform-tip {
10361036 font-size: x-small;
10371037 padding: .2em 2em;
10381038 color: #666;
10391039 }
1040 -.btnSavePrefs {
 1040+.mw-htmlform-submit {
10411041 font-weight: bold;
10421042 padding-left: .3em;
10431043 padding-right: .3em;
 1044+ margin-right: 2em;
10441045 }
10451046
10461047 .preferences-login {
Index: branches/preferences-work/phase3/skins/common/shared.css
@@ -74,7 +74,7 @@
7575 body.rtl td.mw-input { text-align: right; }
7676 body.rtl td.mw-submit { text-align: right; }
7777
78 -td.mw-label { vertical-align: top; }
 78+td.mw-label { vertical-align: top; width: 20%; }
7979 td.mw-submit { white-space: nowrap; }
8080
8181 /**
Index: branches/preferences-work/phase3/skins/common/htmlform.js
@@ -6,6 +6,9 @@
77 var select = fields[i];
88
99 addHandler( select, 'change', htmlforms.selectOrOtherSelectChanged );
 10+
 11+ // Use a fake 'e' to update it.
 12+ htmlforms.selectOrOtherSelectChanged( { 'target': select } );
1013 }
1114 } );
1215
Index: branches/preferences-work/phase3/includes/HTMLForm.php
@@ -21,6 +21,7 @@
2222 'toggle' => 'HTMLCheckField',
2323 'int' => 'HTMLIntField',
2424 'info' => 'HTMLInfoField',
 25+ 'selectorother' => 'HTMLSelectOrOtherField',
2526 );
2627
2728 function __construct( $descriptor, $messagePrefix ) {
@@ -192,6 +193,8 @@
193194 if ( isset($this->mSubmitID) )
194195 $attribs['id'] = $this->mSubmitID;
195196
 197+ $attribs['class'] = 'mw-htmlform-submit';
 198+
196199 $html .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";
197200
198201 if ($this->mShowReset) {
@@ -543,6 +546,14 @@
544547 class HTMLSelectOrOtherField extends HTMLTextField {
545548 static $jsAdded = false;
546549
 550+ function __construct( $params ) {
 551+ if (! array_key_exists('other', $params['options']) ) {
 552+ $params['options']['other'] = wfMsg( 'htmlform-selectorother-other' );
 553+ }
 554+
 555+ parent::__construct( $params );
 556+ }
 557+
547558 function getInputHTML( $value ) {
548559 $valInSelect = array_key_exists( $value, $this->mParams['options'] );
549560
Index: branches/preferences-work/phase3/includes/Preferences.php
@@ -374,18 +374,26 @@
375375 'label-message' => 'tog-underline',
376376 'section' => 'rendering',
377377 );
 378+
 379+ $stubThresholdValues = array( 0, 50, 100, 500, 1000, 2000, 5000, 10000 );
 380+ $stubThresholdOptions = array();
 381+ foreach( $stubThresholdValues as $value ) {
 382+ $stubThresholdOptions[$value] = wfMsg( 'size-bytes', $value );
 383+ }
 384+
 385+ $defaultPreferences['stubthreshold'] =
 386+ array(
 387+ 'type' => 'selectorother',
 388+ 'section' => 'rendering',
 389+ 'options' => $stubThresholdOptions,
 390+ 'label' => wfMsg('stub-threshold'), // Raw HTML message. Yay?
 391+ );
378392 $defaultPreferences['highlightbroken'] =
379393 array(
380394 'type' => 'toggle',
381395 'section' => 'rendering',
382396 'label' => wfMsg('tog-highlightbroken'), // Raw HTML
383397 );
384 - $defaultPreferences['stubthreshold'] =
385 - array(
386 - 'type' => 'int',
387 - 'section' => 'rendering',
388 - 'label' => wfMsg('stub-threshold'), // Raw HTML message. Yay?
389 - );
390398 $defaultPreferences['showtoc'] =
391399 array(
392400 'type' => 'toggle',
@@ -514,12 +522,6 @@
515523 );
516524
517525 ## RecentChanges #####################################
518 - $defaultPreferences['usenewrc'] =
519 - array(
520 - 'type' => 'toggle',
521 - 'label-message' => 'tog-usenewrc',
522 - 'section' => 'rc',
523 - );
524526 $defaultPreferences['rcdays'] =
525527 array(
526528 'type' => 'int',
@@ -534,6 +536,12 @@
535537 'label-message' => 'recentchangescount',
536538 'section' => 'rc',
537539 );
 540+ $defaultPreferences['usenewrc'] =
 541+ array(
 542+ 'type' => 'toggle',
 543+ 'label-message' => 'tog-usenewrc',
 544+ 'section' => 'rc',
 545+ );
538546 $defaultPreferences['hideminor'] =
539547 array(
540548 'type' => 'toggle',
Index: branches/preferences-work/phase3/languages/messages/MessagesEn.php
@@ -492,14 +492,14 @@
493493 * LANGUAGES', # do not translate or duplicate this message to other languages
494494
495495 # User preference toggles
496 -'tog-underline' => 'Underline links:',
 496+'tog-underline' => 'Link underlining:',
497497 'tog-highlightbroken' => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>)',
498498 'tog-justify' => 'Justify paragraphs',
499499 'tog-hideminor' => 'Hide minor edits in recent changes',
500500 'tog-hidepatrolled' => 'Hide patrolled edits in recent changes',
501501 'tog-newpageshidepatrolled' => 'Hide patrolled pages from new page list',
502502 'tog-extendwatchlist' => 'Expand watchlist to show all changes, not just the most recent',
503 -'tog-usenewrc' => 'Enhanced recent changes (requires JavaScript)',
 503+'tog-usenewrc' => 'Use enhanced recent changes (requires JavaScript)',
504504 'tog-numberheadings' => 'Auto-number headings',
505505 'tog-showtoolbar' => 'Show edit toolbar (requires JavaScript)',
506506 'tog-editondblclick' => 'Edit pages on double click (requires JavaScript)',
@@ -507,7 +507,7 @@
508508 'tog-editsectiononrightclick' => 'Enable section editing by right clicking on section titles (requires JavaScript)',
509509 'tog-showtoc' => 'Show table of contents (for pages with more than 3 headings)',
510510 'tog-rememberpassword' => 'Remember my login on this computer',
511 -'tog-editwidth' => 'Edit box has full width',
 511+'tog-editwidth' => 'Widen the edit box to fill the entire screen',
512512 'tog-watchcreations' => 'Add pages I create to my watchlist',
513513 'tog-watchdefault' => 'Add pages I edit to my watchlist',
514514 'tog-watchmoves' => 'Add pages I move to my watchlist',
@@ -521,7 +521,7 @@
522522 'tog-enotifminoredits' => 'E-mail me also for minor edits of pages',
523523 'tog-enotifrevealaddr' => 'Reveal my e-mail address in notification e-mails',
524524 'tog-shownumberswatching' => 'Show the number of watching users',
525 -'tog-fancysig' => 'Raw signatures (without automatic link)',
 525+'tog-fancysig' => 'Do not automatically link my signature to my userpage',
526526 'tog-externaleditor' => 'Use external editor by default (for experts only, needs special settings on your computer)',
527527 'tog-externaldiff' => 'Use external diff by default (for experts only, needs special settings on your computer)',
528528 'tog-showjumplinks' => 'Enable "jump to" accessibility links',
@@ -1579,10 +1579,11 @@
15801580 'prefs-misc' => 'Misc',
15811581 'prefs-resetpass' => 'Change password',
15821582 'prefs-email' => 'Email options',
 1583+'prefs-rendering' => 'Page Rendering',
15831584 'saveprefs' => 'Save',
15841585 'resetprefs' => 'Clear unsaved changes',
15851586 'restoreprefs' => 'Restore all default settings',
1586 -'prefs-editing' => 'Editing',
 1587+'prefs-editing' => 'Editing',
15871588 'prefs-edit-boxsize' => 'Size of the edit window.',
15881589 'rows' => 'Rows:',
15891590 'columns' => 'Columns:',
@@ -3146,7 +3147,7 @@
31473148
31483149 # Media information
31493150 'mediawarning' => "'''Warning''': This file may contain malicious code, by executing it your system may be compromised.<hr />",
3150 -'imagemaxsize' => 'Limit images on file description pages to:',
 3151+'imagemaxsize' => "Image size limit:<br/>''(for file description pages)''",
31513152 'thumbsize' => 'Thumbnail size:',
31523153 'widthheight' => '$1×$2', # only translate this message to other languages if you have to change it
31533154 'widthheightpage' => '$1×$2, $3 {{PLURAL:$3|page|pages}}',
@@ -3889,4 +3890,5 @@
38903891 'htmlform-int-toohigh' => 'The value you specified is above the maximum of $1',
38913892 'htmlform-submit' => 'Submit',
38923893 'htmlform-reset' => 'Undo changes',
 3894+'htmlform-selectorother-other' => 'Other',
38933895 );

Status & tagging log