jenkins-bot has submitted this change and it was merged.

Change subject: Refactor Watchlist code so mobile can be more consistent
......................................................................


Refactor Watchlist code so mobile can be more consistent

There are various bugs around the mobile watchlist that are caused by
mobile reimplementing the watchlist due to the core code's inflexibility

This slight change makes it possible for the A-Z mode on mobile to use the
same code as desktop
See: 56817

Change-Id: Id04c8b1f41894c724ca8ea403078b3389666ebc9
---
M includes/specials/SpecialEditWatchlist.php
1 file changed, 29 insertions(+), 13 deletions(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialEditWatchlist.php 
b/includes/specials/SpecialEditWatchlist.php
index 355726a..3515a57 100644
--- a/includes/specials/SpecialEditWatchlist.php
+++ b/includes/specials/SpecialEditWatchlist.php
@@ -70,9 +70,7 @@
                $this->checkReadOnly();
 
                $this->outputHeader();
-
-               $out->addSubtitle( $this->msg( 'watchlistfor2', 
$this->getUser()->getName() )
-                       ->rawParams( SpecialEditWatchlist::buildTools( null ) ) 
);
+               $this->outputSubtitle();
 
                # B/C: $mode used to be waaay down the parameter list, and the 
first parameter
                # was $wgUser
@@ -104,16 +102,34 @@
 
                        case self::EDIT_NORMAL:
                        default:
-                               $out->setPageTitle( $this->msg( 
'watchlistedit-normal-title' ) );
-                               $form = $this->getNormalForm();
-                               if ( $form->show() ) {
-                                       $out->addHTML( $this->successMessage );
-                                       $out->addReturnTo( 
SpecialPage::getTitleFor( 'Watchlist' ) );
-                               } elseif ( $this->toc !== false ) {
-                                       $out->prependHTML( $this->toc );
-                                       $out->addModules( 'mediawiki.toc' );
-                               }
+                       $this->executeViewEditWatchlist();
                                break;
+               }
+       }
+
+       /**
+        * Renders a subheader on the watchlist page.
+        */
+       protected function outputSubtitle() {
+               $out = $this->getOutput();
+               $out->addSubtitle( $this->msg( 'watchlistfor2', 
$this->getUser()->getName() )
+                       ->rawParams( SpecialEditWatchlist::buildTools( null ) ) 
);
+       }
+
+       /**
+        * Executes an edit mode for the watchlist view, from which you can 
manage your watchlist
+        *
+        */
+       protected function executeViewEditWatchlist() {
+               $out = $this->getOutput();
+               $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) 
);
+               $form = $this->getNormalForm();
+               if ( $form->show() ) {
+                       $out->addHTML( $this->successMessage );
+                       $out->addReturnTo( SpecialPage::getTitleFor( 
'Watchlist' ) );
+               } elseif ( $this->toc !== false ) {
+                       $out->prependHTML( $this->toc );
+                       $out->addModules( 'mediawiki.toc' );
                }
        }
 
@@ -331,7 +347,7 @@
         *
         * @return array
         */
-       private function getWatchlistInfo() {
+       protected function getWatchlistInfo() {
                $titles = array();
                $dbr = wfGetDB( DB_MASTER );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/148556
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id04c8b1f41894c724ca8ea403078b3389666ebc9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to