r49580 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49579‎ | r49580 | r49581 >
Date:22:30, 16 April 2009
Author:dale
Status:deferred
Tags:
Comment:
corrected order of includes to match default skin (monobook)
Modified paths:
  • /branches/script-loader/includes/Skin.php (modified) (history)
  • /branches/script-loader/mvwScriptLoader.php (modified) (history)
  • /branches/script-loader/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: branches/script-loader/skins/MonoBook.php
@@ -59,9 +59,15 @@
6060 parent::setupSkinUserJs( $out );
6161 $out->addScriptFile( 'wikibits.js' );
6262
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
6464 if( $this->jsvarurl )
6565 $out->addScriptFile( $this->jsvarurl );
 66+
 67+ if( $this->userjs )
 68+ $out->addScriptFile( $this->userjs );
 69+
 70+ if( $this->userjsprev )
 71+ $out->addInlineScript( $this->userjsprev );
6672 }
6773 }
6874
Index: branches/script-loader/includes/Skin.php
@@ -655,23 +655,20 @@
656656 function setupUserJs( OutputPage $out) {
657657 global $wgRequest, $wgJsMimeType, $wgUseSiteJs;
658658
659 - wfProfileIn( __METHOD__ );
660 - //call the skin JS setup
661 - $this->setupSkinUserJs( $out );
 659+ wfProfileIn( __METHOD__ );
662660
663661 $action = $wgRequest->getVal( 'action', 'view' );
664662 if( $out->isUserJsAllowed() && $this->loggedin ) {
665663 if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) {
666664 # XXX: additional security check/prompt (userCanPreview checks for html token before doing this js output)
667665 $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 );
674668 }
675669 }
 670+ //call the skin JS setup
 671+ $this->setupSkinUserJs( $out );
 672+
676673 wfProfileOut( __METHOD__ );
677674 }
678675 /**
Index: branches/script-loader/mvwScriptLoader.php
@@ -172,7 +172,7 @@
173173 if( substr( $reqClass, 0, 3) == 'WT:' ){
174174 $this->jsFileList[ $reqClass ] = true;
175175 $this->rKey .= $reqClass;
176 - $this->jsvarurl = true;
 176+ $this->jsvarurl = true;
177177 continue;
178178 }
179179

Status & tagging log