Index: branches/preferences-work/phase3/skins/common/prefs.js |
— | — | @@ -98,12 +98,7 @@ |
99 | 99 | addHandler( tzSelect, 'change', function(e) { updateTimezoneSelection(false); } ); |
100 | 100 | addHandler( tzTextbox, 'blur', function(e) { updateTimezoneSelection(true); } ); |
101 | 101 | } |
102 | | - |
103 | | - var tzb = document.getElementById('mw-prefs-guesstimezone'); |
104 | | - if (tzb) { |
105 | | - tzb.style.display = 'inline'; |
106 | | - addHandler( tzb, 'click', guessTimezone ); |
107 | | - } |
| 102 | + |
108 | 103 | updateTimezoneSelection(false); |
109 | 104 | } |
110 | 105 | |
— | — | @@ -121,7 +116,7 @@ |
122 | 117 | return tzString; |
123 | 118 | } |
124 | 119 | |
125 | | -function guessTimezone(box) { |
| 120 | +function guessTimezone() { |
126 | 121 | var textbox = document.getElementById("mw-input-timecorrection-other"); |
127 | 122 | var selector = document.getElementById( 'mw-input-timecorrection' ); |
128 | 123 | |
— | — | @@ -133,6 +128,11 @@ |
134 | 129 | |
135 | 130 | function updateTimezoneSelection(force_offset) { |
136 | 131 | var selector = document.getElementById("mw-input-timecorrection"); |
| 132 | + |
| 133 | + if (selector.value == 'guess') { |
| 134 | + return guessTimezone(); |
| 135 | + } |
| 136 | + |
137 | 137 | var textbox = document.getElementById( 'mw-input-timecorrection-other' ); |
138 | 138 | var localtimeHolder = document.getElementById("wpLocalTime"); |
139 | 139 | var servertime = document.getElementsByName("wpServerTime")[0].value; |
Index: branches/preferences-work/phase3/includes/Preferences.php |
— | — | @@ -207,6 +207,13 @@ |
208 | 208 | 'label-message' => 'tog-fancysig', |
209 | 209 | 'section' => 'personal' |
210 | 210 | ); |
| 211 | + |
| 212 | + $defaultPreferences['rememberpassword'] = |
| 213 | + array( |
| 214 | + 'type' => 'toggle', |
| 215 | + 'label-message' => 'tog-rememberpassword', |
| 216 | + 'section' => 'personal', |
| 217 | + ); |
211 | 218 | |
212 | 219 | |
213 | 220 | ## Email ####################################### |
— | — | @@ -354,24 +361,67 @@ |
355 | 362 | 'default' => $tzSetting, |
356 | 363 | 'section' => 'datetime', |
357 | 364 | ); |
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'] = |
369 | 368 | array( |
370 | | - 'type' => 'info', |
371 | | - 'raw' => true, |
372 | | - 'label' => ' ', |
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', |
375 | 377 | ); |
| 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 | + ); |
376 | 426 | |
377 | 427 | ## Editing ##################################### |
378 | 428 | $defaultPreferences['cols'] = |
— | — | @@ -459,7 +509,7 @@ |
460 | 510 | $defaultPreferences['uselivepreview'] = |
461 | 511 | array( |
462 | 512 | 'type' => 'toggle', |
463 | | - 'section' => 'misc', |
| 513 | + 'section' => 'editing', |
464 | 514 | 'label-message' => 'tog-uselivepreview', |
465 | 515 | ); |
466 | 516 | |
— | — | @@ -512,7 +562,7 @@ |
513 | 563 | $defaultPreferences['shownumberswatching'] = |
514 | 564 | array( |
515 | 565 | 'type' => 'toggle', |
516 | | - 'section' => 'misc', |
| 566 | + 'section' => 'rc', |
517 | 567 | 'label-message' => 'tog-shownumberswatching', |
518 | 568 | ); |
519 | 569 | } |
— | — | @@ -663,84 +713,18 @@ |
664 | 714 | } |
665 | 715 | |
666 | 716 | ## 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 | | - ); |
709 | 717 | $defaultPreferences['diffonly'] = |
710 | 718 | array( |
711 | 719 | 'type' => 'toggle', |
712 | 720 | 'section' => 'misc', |
713 | 721 | 'label-message' => 'tog-diffonly', |
714 | 722 | ); |
715 | | - $defaultPreferences['showhiddencats'] = |
716 | | - array( |
717 | | - 'type' => 'toggle', |
718 | | - 'section' => 'misc', |
719 | | - 'label-message' => 'tog-showhiddencats' |
720 | | - ); |
721 | 723 | $defaultPreferences['norollbackdiff'] = |
722 | 724 | array( |
723 | 725 | 'type' => 'toggle', |
724 | 726 | 'section' => 'misc', |
725 | 727 | 'label-message' => 'tog-norollbackdiff', |
726 | 728 | ); |
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 | | - ); |
745 | 729 | |
746 | 730 | wfRunHooks( 'GetPreferences', array( $user, &$defaultPreferences ) ); |
747 | 731 | |
— | — | @@ -921,6 +905,7 @@ |
922 | 906 | |
923 | 907 | $opt["System|$wgLocalTZoffset"] = wfMsg( 'timezoneuseserverdefault' ); |
924 | 908 | $opt['other'] = wfMsg( 'timezoneuseoffset' ); |
| 909 | + $opt['guess'] = wfMsg( 'guesstimezone' ); |
925 | 910 | |
926 | 911 | if ( function_exists( 'timezone_identifiers_list' ) ) { |
927 | 912 | # Read timezone list |