r49552 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49551‎ | r49552 | r49553 >
Date:02:54, 16 April 2009
Author:werdna
Status:deferred
Tags:
Comment:
* Move 'fill in timezone from browser' to be a <select> option, at Parul's suggestion.
* Split out most of the 'misc' tab into a brand new 'Page Rendering' section.
Modified paths:
  • /branches/preferences-work/phase3/includes/Preferences.php (modified) (history)
  • /branches/preferences-work/phase3/skins/common/prefs.js (modified) (history)

Diff [purge]

Index: branches/preferences-work/phase3/skins/common/prefs.js
@@ -98,12 +98,7 @@
9999 addHandler( tzSelect, 'change', function(e) { updateTimezoneSelection(false); } );
100100 addHandler( tzTextbox, 'blur', function(e) { updateTimezoneSelection(true); } );
101101 }
102 -
103 - var tzb = document.getElementById('mw-prefs-guesstimezone');
104 - if (tzb) {
105 - tzb.style.display = 'inline';
106 - addHandler( tzb, 'click', guessTimezone );
107 - }
 102+
108103 updateTimezoneSelection(false);
109104 }
110105
@@ -121,7 +116,7 @@
122117 return tzString;
123118 }
124119
125 -function guessTimezone(box) {
 120+function guessTimezone() {
126121 var textbox = document.getElementById("mw-input-timecorrection-other");
127122 var selector = document.getElementById( 'mw-input-timecorrection' );
128123
@@ -133,6 +128,11 @@
134129
135130 function updateTimezoneSelection(force_offset) {
136131 var selector = document.getElementById("mw-input-timecorrection");
 132+
 133+ if (selector.value == 'guess') {
 134+ return guessTimezone();
 135+ }
 136+
137137 var textbox = document.getElementById( 'mw-input-timecorrection-other' );
138138 var localtimeHolder = document.getElementById("wpLocalTime");
139139 var servertime = document.getElementsByName("wpServerTime")[0].value;
Index: branches/preferences-work/phase3/includes/Preferences.php
@@ -207,6 +207,13 @@
208208 'label-message' => 'tog-fancysig',
209209 'section' => 'personal'
210210 );
 211+
 212+ $defaultPreferences['rememberpassword'] =
 213+ array(
 214+ 'type' => 'toggle',
 215+ 'label-message' => 'tog-rememberpassword',
 216+ 'section' => 'personal',
 217+ );
211218
212219
213220 ## Email #######################################
@@ -354,24 +361,67 @@
355362 'default' => $tzSetting,
356363 'section' => 'datetime',
357364 );
358 -
359 - // Add auto-select button
360 -
361 - $button = Xml::element( 'input',
362 - array( 'type' => 'button',
363 - 'id' => 'mw-prefs-guesstimezone',
364 - 'style' => 'display: none;', // Graceful degradation.
365 - 'value' => wfMsg( 'guesstimezone' ),
366 - ) );
367 -
368 - $defaultPreferences['guesstimezone'] =
 365+
 366+ ## Page Rendering ##############################
 367+ $defaultPreferences['underline'] =
369368 array(
370 - 'type' => 'info',
371 - 'raw' => true,
372 - 'label' => '&nbsp;',
373 - 'default' => $button,
374 - 'section' => 'datetime',
 369+ 'type' => 'select',
 370+ 'options' => array(
 371+ 0 => wfMsg( 'underline-never' ),
 372+ 1 => wfMsg( 'underline-always' ),
 373+ 2 => wfMsg( 'underline-default' ),
 374+ ),
 375+ 'label-message' => 'tog-underline',
 376+ 'section' => 'rendering',
375377 );
 378+ $defaultPreferences['highlightbroken'] =
 379+ array(
 380+ 'type' => 'toggle',
 381+ 'section' => 'rendering',
 382+ 'label' => wfMsg('tog-highlightbroken'), // Raw HTML
 383+ );
 384+ $defaultPreferences['stubthreshold'] =
 385+ array(
 386+ 'type' => 'int',
 387+ 'section' => 'rendering',
 388+ 'label' => wfMsg('stub-threshold'), // Raw HTML message. Yay?
 389+ );
 390+ $defaultPreferences['showtoc'] =
 391+ array(
 392+ 'type' => 'toggle',
 393+ 'section' => 'rendering',
 394+ 'label-message' => 'tog-showtoc',
 395+ );
 396+ $defaultPreferences['nocache'] =
 397+ array(
 398+ 'type' => 'toggle',
 399+ 'label-message' => 'tog-nocache',
 400+ 'section' => 'rendering',
 401+ );
 402+ $defaultPreferences['showhiddencats'] =
 403+ array(
 404+ 'type' => 'toggle',
 405+ 'section' => 'rendering',
 406+ 'label-message' => 'tog-showhiddencats'
 407+ );
 408+ $defaultPreferences['showjumplinks'] =
 409+ array(
 410+ 'type' => 'toggle',
 411+ 'section' => 'rendering',
 412+ 'label-message' => 'tog-showjumplinks',
 413+ );
 414+ $defaultPreferences['justify'] =
 415+ array(
 416+ 'type' => 'toggle',
 417+ 'section' => 'rendering',
 418+ 'label-message' => 'tog-justify',
 419+ );
 420+ $defaultPreferences['numberheadings'] =
 421+ array(
 422+ 'type' => 'toggle',
 423+ 'section' => 'rendering',
 424+ 'label-message' => 'tog-numberheadings',
 425+ );
376426
377427 ## Editing #####################################
378428 $defaultPreferences['cols'] =
@@ -459,7 +509,7 @@
460510 $defaultPreferences['uselivepreview'] =
461511 array(
462512 'type' => 'toggle',
463 - 'section' => 'misc',
 513+ 'section' => 'editing',
464514 'label-message' => 'tog-uselivepreview',
465515 );
466516
@@ -512,7 +562,7 @@
513563 $defaultPreferences['shownumberswatching'] =
514564 array(
515565 'type' => 'toggle',
516 - 'section' => 'misc',
 566+ 'section' => 'rc',
517567 'label-message' => 'tog-shownumberswatching',
518568 );
519569 }
@@ -663,84 +713,18 @@
664714 }
665715
666716 ## Misc #####################################
667 -
668 - $defaultPreferences['underline'] =
669 - array(
670 - 'type' => 'select',
671 - 'options' => array(
672 - 0 => wfMsg( 'underline-never' ),
673 - 1 => wfMsg( 'underline-always' ),
674 - 2 => wfMsg( 'underline-default' ),
675 - ),
676 - 'label-message' => 'tog-underline',
677 - 'section' => 'misc',
678 - );
679 - $defaultPreferences['highlightbroken'] =
680 - array(
681 - 'type' => 'toggle',
682 - 'section' => 'misc',
683 - 'label' => wfMsg('tog-highlightbroken'), // Raw HTML
684 - );
685 - $defaultPreferences['stubthreshold'] =
686 - array(
687 - 'type' => 'int',
688 - 'section' => 'misc',
689 - 'label' => wfMsg('stub-threshold'), // Raw HTML message. Yay?
690 - );
691 - $defaultPreferences['showtoc'] =
692 - array(
693 - 'type' => 'toggle',
694 - 'section' => 'misc',
695 - 'label-message' => 'tog-showtoc',
696 - );
697 - $defaultPreferences['rememberpassword'] =
698 - array(
699 - 'type' => 'toggle',
700 - 'label-message' => 'tog-rememberpassword',
701 - 'section' => 'misc',
702 - );
703 - $defaultPreferences['nocache'] =
704 - array(
705 - 'type' => 'toggle',
706 - 'label-message' => 'tog-nocache',
707 - 'section' => 'misc',
708 - );
709717 $defaultPreferences['diffonly'] =
710718 array(
711719 'type' => 'toggle',
712720 'section' => 'misc',
713721 'label-message' => 'tog-diffonly',
714722 );
715 - $defaultPreferences['showhiddencats'] =
716 - array(
717 - 'type' => 'toggle',
718 - 'section' => 'misc',
719 - 'label-message' => 'tog-showhiddencats'
720 - );
721723 $defaultPreferences['norollbackdiff'] =
722724 array(
723725 'type' => 'toggle',
724726 'section' => 'misc',
725727 'label-message' => 'tog-norollbackdiff',
726728 );
727 - $defaultPreferences['showjumplinks'] =
728 - array(
729 - 'type' => 'toggle',
730 - 'section' => 'misc',
731 - 'label-message' => 'tog-showjumplinks',
732 - );
733 - $defaultPreferences['justify'] =
734 - array(
735 - 'type' => 'toggle',
736 - 'section' => 'misc',
737 - 'label-message' => 'tog-justify',
738 - );
739 - $defaultPreferences['numberheadings'] =
740 - array(
741 - 'type' => 'toggle',
742 - 'section' => 'misc',
743 - 'label-message' => 'tog-numberheadings',
744 - );
745729
746730 wfRunHooks( 'GetPreferences', array( $user, &$defaultPreferences ) );
747731
@@ -921,6 +905,7 @@
922906
923907 $opt["System|$wgLocalTZoffset"] = wfMsg( 'timezoneuseserverdefault' );
924908 $opt['other'] = wfMsg( 'timezoneuseoffset' );
 909+ $opt['guess'] = wfMsg( 'guesstimezone' );
925910
926911 if ( function_exists( 'timezone_identifiers_list' ) ) {
927912 # Read timezone list

Status & tagging log