Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2199,13 +2199,16 @@ |
2200 | 2200 | $this->addInlineScript( $wgRequest->getText( 'wpTextbox1' ) ); |
2201 | 2201 | } else { |
2202 | 2202 | $userpage = $wgUser->getUserPage(); |
2203 | | - $scriptpage = Title::makeTitleSafe( |
2204 | | - NS_USER, |
2205 | | - $userpage->getDBkey() . '/' . $sk->getSkinName() . '.js' |
2206 | | - ); |
2207 | | - if ( $scriptpage && $scriptpage->exists() ) { |
2208 | | - $userjs = Skin::makeUrl( $scriptpage->getPrefixedText(), 'action=raw&ctype=' . $wgJsMimeType ); |
2209 | | - $this->addScriptFile( $userjs ); |
| 2203 | + $names = array( 'common', $sk->getSkinName() ); |
| 2204 | + foreach( $names as $name ) { |
| 2205 | + $scriptpage = Title::makeTitleSafe( |
| 2206 | + NS_USER, |
| 2207 | + $userpage->getDBkey() . '/' . $name . '.js' |
| 2208 | + ); |
| 2209 | + if ( $scriptpage && $scriptpage->exists() ) { |
| 2210 | + $userjs = $scriptpage->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType ); |
| 2211 | + $this->addScriptFile( $userjs ); |
| 2212 | + } |
2210 | 2213 | } |
2211 | 2214 | } |
2212 | 2215 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1709,8 +1709,10 @@ |
1710 | 1710 | */ |
1711 | 1711 | public function isValidCssJsSubpage() { |
1712 | 1712 | if ( $this->isCssJsSubpage() ) { |
| 1713 | + $name = $this->getSkinFromCssJsSubpage(); |
| 1714 | + if ( $name == 'common' ) return true; |
1713 | 1715 | $skinNames = Skin::getSkinNames(); |
1714 | | - return array_key_exists( $this->getSkinFromCssJsSubpage(), $skinNames ); |
| 1716 | + return array_key_exists( $name, $skinNames ); |
1715 | 1717 | } else { |
1716 | 1718 | return false; |
1717 | 1719 | } |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -650,10 +650,13 @@ |
651 | 651 | // @FIXME: properly escape the cdata! |
652 | 652 | $out->addInlineStyle( $wgRequest->getText( 'wpTextbox1' ) ); |
653 | 653 | } else { |
654 | | - $out->addStyle( self::makeUrl( |
655 | | - $this->userpage . '/' . $this->getSkinName() . '.css', |
656 | | - 'action=raw&ctype=text/css' ) |
657 | | - ); |
| 654 | + $names = array( 'common', $this->getSkinName() ); |
| 655 | + foreach( $names as $name ) { |
| 656 | + $out->addStyle( self::makeUrl( |
| 657 | + $this->userpage . '/' . $name . '.css', |
| 658 | + 'action=raw&ctype=text/css' ) |
| 659 | + ); |
| 660 | + } |
658 | 661 | } |
659 | 662 | } |
660 | 663 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -23,6 +23,8 @@ |
24 | 24 | has been removed. |
25 | 25 | |
26 | 26 | === New features in 1.17 === |
| 27 | +* (bug 10183) Users can now add personal styles and scripts to all skins via |
| 28 | + User:<name>/common.css and /common.js (if user css/js is enabled) |
27 | 29 | |
28 | 30 | === Bug fixes in 1.17 === |
29 | 31 | * (bug 17560) Half-broken deletion moved image files to deletion archive without |