Index: branches/script-loader/skins/MonoBook.php |
— | — | @@ -59,9 +59,15 @@ |
60 | 60 | parent::setupSkinUserJs( $out ); |
61 | 61 | $out->addScriptFile( 'wikibits.js' ); |
62 | 62 | |
63 | | - //@@todo can move to parent once we update all skins |
| 63 | + //@@todo can move to parent once we update all skins (to not include things twice |
64 | 64 | if( $this->jsvarurl ) |
65 | 65 | $out->addScriptFile( $this->jsvarurl ); |
| 66 | + |
| 67 | + if( $this->userjs ) |
| 68 | + $out->addScriptFile( $this->userjs ); |
| 69 | + |
| 70 | + if( $this->userjsprev ) |
| 71 | + $out->addInlineScript( $this->userjsprev ); |
66 | 72 | } |
67 | 73 | } |
68 | 74 | |
Index: branches/script-loader/includes/Skin.php |
— | — | @@ -655,23 +655,20 @@ |
656 | 656 | function setupUserJs( OutputPage $out) { |
657 | 657 | global $wgRequest, $wgJsMimeType, $wgUseSiteJs; |
658 | 658 | |
659 | | - wfProfileIn( __METHOD__ ); |
660 | | - //call the skin JS setup |
661 | | - $this->setupSkinUserJs( $out ); |
| 659 | + wfProfileIn( __METHOD__ ); |
662 | 660 | |
663 | 661 | $action = $wgRequest->getVal( 'action', 'view' ); |
664 | 662 | if( $out->isUserJsAllowed() && $this->loggedin ) { |
665 | 663 | if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) { |
666 | 664 | # XXX: additional security check/prompt (userCanPreview checks for html token before doing this js output) |
667 | 665 | $this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText( 'wpTextbox1' ) . ' /*]]>*/'; |
668 | | - } else { |
669 | | - $userjsPath = self::makeUrl( $this->userpage . '/' . $this->skinname . '.js', 'action=raw&ctype=' . $wgJsMimeType ); |
670 | | - $out->addScriptFile($userjsPath); |
671 | | - |
672 | | - /*@@deprecated userjs is deprecated should update skins*/ |
673 | | - $this->userjs = $userjsPath; |
| 666 | + } else { |
| 667 | + $this->userjs = self::makeUrl( $this->userpage . '/' . $this->skinname . '.js', 'action=raw&ctype=' . $wgJsMimeType ); |
674 | 668 | } |
675 | 669 | } |
| 670 | + //call the skin JS setup |
| 671 | + $this->setupSkinUserJs( $out ); |
| 672 | + |
676 | 673 | wfProfileOut( __METHOD__ ); |
677 | 674 | } |
678 | 675 | /** |
Index: branches/script-loader/mvwScriptLoader.php |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | if( substr( $reqClass, 0, 3) == 'WT:' ){ |
174 | 174 | $this->jsFileList[ $reqClass ] = true; |
175 | 175 | $this->rKey .= $reqClass; |
176 | | - $this->jsvarurl = true; |
| 176 | + $this->jsvarurl = true; |
177 | 177 | continue; |
178 | 178 | } |
179 | 179 | |