Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | color: #772233; |
88 | 88 | } |
89 | 89 | a.new, #p-personal a.new { |
90 | | - color: #ba0000; |
| 90 | + color: #cc2200; |
91 | 91 | } |
92 | 92 | a.new:visited, #p-personal a.new:visited { |
93 | 93 | color: #a55858; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2905,6 +2905,13 @@ |
2906 | 2906 | */ |
2907 | 2907 | $wgAllowUserCss = false; |
2908 | 2908 | |
| 2909 | +/** |
| 2910 | + * Allow user-preferences implemented in CSS? |
| 2911 | + * This allows users to customise the site appearance to a greater |
| 2912 | + * degree; disabling it will improve page load times. |
| 2913 | + */ |
| 2914 | +$wgAllowUserCssPrefs = true; |
| 2915 | + |
2909 | 2916 | /** Use the site's Javascript page? */ |
2910 | 2917 | $wgUseSiteJs = true; |
2911 | 2918 | |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -593,17 +593,20 @@ |
594 | 594 | |
595 | 595 | static function renderingPreferences( $user, &$defaultPreferences ) { |
596 | 596 | ## Page Rendering ############################## |
597 | | - $defaultPreferences['underline'] = |
598 | | - array( |
599 | | - 'type' => 'select', |
600 | | - 'options' => array( |
601 | | - wfMsg( 'underline-never' ) => 0, |
602 | | - wfMsg( 'underline-always' ) => 1, |
603 | | - wfMsg( 'underline-default' ) => 2, |
604 | | - ), |
605 | | - 'label-message' => 'tog-underline', |
606 | | - 'section' => 'rendering/advancedrendering', |
607 | | - ); |
| 597 | + global $wgAllowUserCssPrefs; |
| 598 | + if( $wgAllowUserCssPrefs ){ |
| 599 | + $defaultPreferences['underline'] = |
| 600 | + array( |
| 601 | + 'type' => 'select', |
| 602 | + 'options' => array( |
| 603 | + wfMsg( 'underline-never' ) => 0, |
| 604 | + wfMsg( 'underline-always' ) => 1, |
| 605 | + wfMsg( 'underline-default' ) => 2, |
| 606 | + ), |
| 607 | + 'label-message' => 'tog-underline', |
| 608 | + 'section' => 'rendering/advancedrendering', |
| 609 | + ); |
| 610 | + } |
608 | 611 | |
609 | 612 | $stubThresholdValues = array( 0, 50, 100, 500, 1000, 2000, 5000, 10000 ); |
610 | 613 | $stubThresholdOptions = array(); |
— | — | @@ -619,18 +622,20 @@ |
620 | 623 | 'size' => 20, |
621 | 624 | 'label' => wfMsg( 'stub-threshold' ), // Raw HTML message. Yay? |
622 | 625 | ); |
623 | | - $defaultPreferences['highlightbroken'] = |
624 | | - array( |
625 | | - 'type' => 'toggle', |
626 | | - 'section' => 'rendering/advancedrendering', |
627 | | - 'label' => wfMsg( 'tog-highlightbroken' ), // Raw HTML |
628 | | - ); |
629 | | - $defaultPreferences['showtoc'] = |
630 | | - array( |
631 | | - 'type' => 'toggle', |
632 | | - 'section' => 'rendering/advancedrendering', |
633 | | - 'label-message' => 'tog-showtoc', |
634 | | - ); |
| 626 | + if( $wgAllowUserCssPrefs ){ |
| 627 | + $defaultPreferences['highlightbroken'] = |
| 628 | + array( |
| 629 | + 'type' => 'toggle', |
| 630 | + 'section' => 'rendering/advancedrendering', |
| 631 | + 'label' => wfMsg( 'tog-highlightbroken' ), // Raw HTML |
| 632 | + ); |
| 633 | + $defaultPreferences['showtoc'] = |
| 634 | + array( |
| 635 | + 'type' => 'toggle', |
| 636 | + 'section' => 'rendering/advancedrendering', |
| 637 | + 'label-message' => 'tog-showtoc', |
| 638 | + ); |
| 639 | + } |
635 | 640 | $defaultPreferences['nocache'] = |
636 | 641 | array( |
637 | 642 | 'type' => 'toggle', |
— | — | @@ -649,12 +654,14 @@ |
650 | 655 | 'section' => 'rendering/advancedrendering', |
651 | 656 | 'label-message' => 'tog-showjumplinks', |
652 | 657 | ); |
653 | | - $defaultPreferences['justify'] = |
654 | | - array( |
655 | | - 'type' => 'toggle', |
656 | | - 'section' => 'rendering/advancedrendering', |
657 | | - 'label-message' => 'tog-justify', |
658 | | - ); |
| 658 | + if( $wgAllowUserCssPrefs ){ |
| 659 | + $defaultPreferences['justify'] = |
| 660 | + array( |
| 661 | + 'type' => 'toggle', |
| 662 | + 'section' => 'rendering/advancedrendering', |
| 663 | + 'label-message' => 'tog-justify', |
| 664 | + ); |
| 665 | + } |
659 | 666 | $defaultPreferences['numberheadings'] = |
660 | 667 | array( |
661 | 668 | 'type' => 'toggle', |
— | — | @@ -664,7 +671,7 @@ |
665 | 672 | } |
666 | 673 | |
667 | 674 | static function editingPreferences( $user, &$defaultPreferences ) { |
668 | | - global $wgUseExternalEditor, $wgLivePreview; |
| 675 | + global $wgUseExternalEditor, $wgLivePreview, $wgAllowUserCssPrefs; |
669 | 676 | |
670 | 677 | ## Editing ##################################### |
671 | 678 | $defaultPreferences['cols'] = |
— | — | @@ -683,19 +690,20 @@ |
684 | 691 | 'min' => 4, |
685 | 692 | 'max' => 1000, |
686 | 693 | ); |
687 | | - |
688 | | - $defaultPreferences['editfont'] = |
689 | | - array( |
690 | | - 'type' => 'select', |
691 | | - 'section' => 'editing/advancedediting', |
692 | | - 'label-message' => 'editfont-style', |
693 | | - 'options' => array( |
694 | | - wfMsg( 'editfont-default' ) => 'default', |
695 | | - wfMsg( 'editfont-monospace' ) => 'monospace', |
696 | | - wfMsg( 'editfont-sansserif' ) => 'sans-serif', |
697 | | - wfMsg( 'editfont-serif' ) => 'serif', |
698 | | - ) |
699 | | - ); |
| 694 | + if( $wgAllowUserCssPrefs ){ |
| 695 | + $defaultPreferences['editfont'] = |
| 696 | + array( |
| 697 | + 'type' => 'select', |
| 698 | + 'section' => 'editing/advancedediting', |
| 699 | + 'label-message' => 'editfont-style', |
| 700 | + 'options' => array( |
| 701 | + wfMsg( 'editfont-default' ) => 'default', |
| 702 | + wfMsg( 'editfont-monospace' ) => 'monospace', |
| 703 | + wfMsg( 'editfont-sansserif' ) => 'sans-serif', |
| 704 | + wfMsg( 'editfont-serif' ) => 'serif', |
| 705 | + ) |
| 706 | + ); |
| 707 | + } |
700 | 708 | $defaultPreferences['previewontop'] = |
701 | 709 | array( |
702 | 710 | 'type' => 'toggle', |
— | — | @@ -708,12 +716,14 @@ |
709 | 717 | 'section' => 'editing/advancedediting', |
710 | 718 | 'label-message' => 'tog-previewonfirst', |
711 | 719 | ); |
712 | | - $defaultPreferences['editsection'] = |
713 | | - array( |
714 | | - 'type' => 'toggle', |
715 | | - 'section' => 'editing/advancedediting', |
716 | | - 'label-message' => 'tog-editsection', |
717 | | - ); |
| 720 | + if( $wgAllowUserCssPrefs ){ |
| 721 | + $defaultPreferences['editsection'] = |
| 722 | + array( |
| 723 | + 'type' => 'toggle', |
| 724 | + 'section' => 'editing/advancedediting', |
| 725 | + 'label-message' => 'tog-editsection', |
| 726 | + ); |
| 727 | + } |
718 | 728 | $defaultPreferences['editsectiononrightclick'] = |
719 | 729 | array( |
720 | 730 | 'type' => 'toggle', |
— | — | @@ -1116,7 +1126,7 @@ |
1117 | 1127 | $ret = array(); |
1118 | 1128 | |
1119 | 1129 | foreach ( $wgImageLimits as $index => $limits ) { |
1120 | | - $display = "{$limits[0]}×{$limits[1]}" . wfMsg( 'unit-pixel' ); |
| 1130 | + $display = "{$limits[0]}×{$limits[1]}" . wfMsg( 'unit-pixel' ); |
1121 | 1131 | $ret[$display] = $index; |
1122 | 1132 | } |
1123 | 1133 | |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -548,6 +548,7 @@ |
549 | 549 | |
550 | 550 | /** |
551 | 551 | * Split for easier subclassing in SkinSimple, SkinStandard and SkinCologneBlue |
| 552 | + * Anything in here won't be generated if $wgAllowUserCssPrefs is false. |
552 | 553 | */ |
553 | 554 | protected function reallyGenerateUserStylesheet() { |
554 | 555 | global $wgUser; |
— | — | @@ -629,18 +630,21 @@ |
630 | 631 | $out->addStyle( self::makeNSUrl( $this->getSkinName() . '.css', $query, NS_MEDIAWIKI ) ); |
631 | 632 | } |
632 | 633 | |
633 | | - if( $wgUser->isLoggedIn() ) { |
634 | | - // Ensure that logged-in users' generated CSS isn't clobbered |
635 | | - // by anons' publicly cacheable generated CSS. |
636 | | - $siteargs['smaxage'] = '0'; |
637 | | - $siteargs['ts'] = $wgUser->mTouched; |
| 634 | + global $wgAllowUserCssPrefs; |
| 635 | + if( $wgAllowUserCssPrefs ){ |
| 636 | + if( $wgUser->isLoggedIn() ) { |
| 637 | + // Ensure that logged-in users' generated CSS isn't clobbered |
| 638 | + // by anons' publicly cacheable generated CSS. |
| 639 | + $siteargs['smaxage'] = '0'; |
| 640 | + $siteargs['ts'] = $wgUser->mTouched; |
| 641 | + } |
| 642 | + // Per-user styles based on preferences |
| 643 | + $siteargs['gen'] = 'css'; |
| 644 | + if( ( $us = $wgRequest->getVal( 'useskin', '' ) ) !== '' ) { |
| 645 | + $siteargs['useskin'] = $us; |
| 646 | + } |
| 647 | + $out->addStyle( self::makeUrl( '-', wfArrayToCGI( $siteargs ) ) ); |
638 | 648 | } |
639 | | - // Per-user styles based on preferences |
640 | | - $siteargs['gen'] = 'css'; |
641 | | - if( ( $us = $wgRequest->getVal( 'useskin', '' ) ) !== '' ) { |
642 | | - $siteargs['useskin'] = $us; |
643 | | - } |
644 | | - $out->addStyle( self::makeUrl( '-', wfArrayToCGI( $siteargs ) ) ); |
645 | 649 | |
646 | 650 | // Per-user custom style pages |
647 | 651 | if( $wgAllowUserCss && $wgUser->isLoggedIn() ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -30,6 +30,8 @@ |
31 | 31 | the names of the individual files within the gallery |
32 | 32 | * (bug 12797) Add $wgGalleryOptions for adjusting of default gallery display |
33 | 33 | options |
| 34 | +* $wgAllowUserCssPrefs option allows disabling CSS-based preferences; which can |
| 35 | + improve page loading speed. |
34 | 36 | |
35 | 37 | === Bug fixes in 1.17 === |
36 | 38 | * (bug 17560) Half-broken deletion moved image files to deletion archive without |