Further improve load order of RC and watchlist styling
[lhc/web/wiklou.git] / includes / ChangesList.php
index f2b5286..57c8f0b 100644 (file)
@@ -194,7 +194,7 @@ class ChangesList extends ContextSource {
                $this->rcCacheIndex = 0;
                $this->lastdate = '';
                $this->rclistOpen = false;
-               $this->getOutput()->addModules( 'mediawiki.special.changeslist' );
+               $this->getOutput()->addModuleStyles( 'mediawiki.special.changeslist' );
                return '';
        }
 
@@ -362,8 +362,8 @@ class ChangesList extends ContextSource {
         * @param $watched
         */
        public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
-               # If it's a new article, there is no diff link, but if it hasn't been
-               # patrolled yet, we need to give users a way to do so
+               global $wgUseRCPatrol;
+
                $params = array();
 
                $articlelink = Linker::linkKnown(
@@ -524,7 +524,7 @@ class ChangesList extends ContextSource {
         * @param $rc RecentChange
         */
        public function insertRollback( &$s, &$rc ) {
-               if ( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
+               if ( $rc->mAttribs['rc_type'] == RC_EDIT && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) {
                        $page = $rc->getTitle();
                        /** Check for rollback and edit permissions, disallow special pages, and only
                          * show a link on the top-most revision */
@@ -703,7 +703,14 @@ class EnhancedChangesList extends ChangesList {
                $this->rcCacheIndex = 0;
                $this->lastdate = '';
                $this->rclistOpen = false;
-               $this->getOutput()->addModules( 'mediawiki.special.changeslist' );
+               $this->getOutput()->addModuleStyles( array(
+                       'mediawiki.special.changeslist',
+                       'mediawiki.special.changeslist.enhanced',
+               ) );
+               $this->getOutput()->addModules( array(
+                       'jquery.makeCollapsible',
+                       'mediawiki.icon',
+               ) );
                return '';
        }
        /**