Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74652


Change subject: Hygiene: Break the handshake
......................................................................

Hygiene: Break the handshake

Kill it with fire. Long live SUL

Change-Id: I75f378cf5f49bd4dd8ef17a67a09b243ddcceb7a
---
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
M includes/Resources.php
D includes/specials/SpecialLoginHandshake.php
D javascripts/specials/userlogin.js
M less/specials/userlogin.less
M stylesheets/specials/userlogin.css
7 files changed, 2 insertions(+), 141 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/52/74652/1

diff --git a/MobileFrontend.php b/MobileFrontend.php
index ee10e3f..919d6f3 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -63,7 +63,6 @@
        'SpecialMobileWatchlist' => 'specials/SpecialMobileWatchlist',
        'SpecialNearby' => 'specials/SpecialNearby',
        'UnlistedSpecialMobilePage' => 'specials/UnlistedSpecialMobilePage',
-       'SpecialLoginHandshake' => 'specials/SpecialLoginHandshake',
 
        'MinervaTemplate' => 'skins/MinervaTemplate',
        'MobileTemplate' => 'skins/MobileTemplate',
@@ -120,16 +119,12 @@
 $wgSpecialPages['MobileMenu'] = 'SpecialMobileMenu';
 
 function efMobileFrontend_Setup() {
-       global $wgExtMobileFrontend, $wgMFNearby, $wgSpecialPages, 
$wgMFLoginHandshakeUrl;
+       global $wgExtMobileFrontend, $wgMFNearby, $wgSpecialPages;
 
        $wgExtMobileFrontend = new ExtMobileFrontend( RequestContext::getMain() 
);
 
        if ( $wgMFNearby ) {
                $wgSpecialPages['Nearby'] = 'SpecialNearby';
-       }
-
-       if ( $wgMFLoginHandshakeUrl ) {
-               $wgSpecialPages['LoginHandshake'] = 'SpecialLoginHandshake';
        }
 }
 
@@ -313,13 +308,6 @@
  * The range in meters that should be searched to find nearby pages on 
Special:Nearby (defaults to 10km)
  */
 $wgMFNearbyRange = 10000;
-
-/**
- * Whether the login form should redirect to another URL on the first login 
attempt.
- *
- * Defaults to false.
- */
-$wgMFLoginHandshakeUrl = false;
 
 /**
  * Pages with smaller parsed HTML size are not cached
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 8df0fb5..4059c96 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -311,7 +311,7 @@
         * @return bool
         */
        public static function onSpecialPageBeforeExecute( SpecialPage 
$special, $subpage ) {
-               global $wgMFForceSecureLogin, $wgMFLoginHandshakeUrl;
+               global $wgMFForceSecureLogin;
                $mobileContext = MobileContext::singleton();
                if ( $special->getName() != 'Userlogin' || 
!$mobileContext->shouldDisplayMobileView() ) {
                        // no further processing necessary
@@ -319,11 +319,7 @@
                }
 
                $out = $special->getContext()->getOutput();
-               $out->addModules( 'mobile.userlogin.scripts' );
                $out->addModuleStyles( 'mobile.userlogin.styles' );
-               if ( $wgMFLoginHandshakeUrl ) {
-                       $out->addJsConfigVars( 'wgMFLoginHandshakeUrl', 
$wgMFLoginHandshakeUrl );
-               }
 
                // make sure we're on https if we're supposed to be and 
currently aren't.
                // most of this is lifted from https redirect code in 
SpecialUserlogin::execute()
diff --git a/includes/Resources.php b/includes/Resources.php
index 836a0d0..e111278 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -655,12 +655,6 @@
                        'stylesheets/specials/userlogin.css',
                ),
        ),
-       'mobile.userlogin.scripts' => $wgMFMobileSpecialPageResourceBoilerplate 
+ array(
-               'scripts' => array(
-                       'javascripts/specials/userlogin.js',
-               ),
-               'position' => 'top',
-       ),
 
        // Special:Uploads
        'mobile.uploads.plumbing' => $wgMFMobileResourceTemplateBoilerplate + 
array(
diff --git a/includes/specials/SpecialLoginHandshake.php 
b/includes/specials/SpecialLoginHandshake.php
deleted file mode 100644
index ae54cfc..0000000
--- a/includes/specials/SpecialLoginHandshake.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-class SpecialLoginHandshake extends UnlistedSpecialPage {
-       public function __construct() {
-               parent::__construct( 'LoginHandshake' );
-       }
-
-       public function execute( $par = '' ) {
-               $this->setHeaders();
-
-               $output = $this->getOutput();
-               $output->addModules( 'mobile.loginhandshake.scripts' );
-               $output->setPageTitle( wfMessage( 
'mobile-frontend-handshake-title' )->escaped() );
-
-               $html = Html::element(
-                       'p',
-                       array( 'class' => 'loading content' ),
-                       wfMessage( 'mobile-frontend-handshake-wait' )->escaped()
-               );
-
-               $output->addHTML( $html );
-       }
-}
diff --git a/javascripts/specials/userlogin.js 
b/javascripts/specials/userlogin.js
deleted file mode 100644
index f1ba16b..0000000
--- a/javascripts/specials/userlogin.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// FIXME: temporary hack to make sure we log into Commons
-( function( $ ) {
-       var loginHandshakeUrl = mw.config.get( 'wgMFLoginHandshakeUrl' );
-
-       // using feature detection used by 
http://diveintohtml5.info/storage.html
-       try {
-               // redirect to Commons Special:LoginHandshake if it's the first 
visit
-               if (
-                       loginHandshakeUrl && 'localStorage' in window && 
window.localStorage !== null &&
-                       !localStorage.getItem( 'loginHandshaked' )
-               ) {
-                       if ( document.referrer !== loginHandshakeUrl ) {
-                               // only do the handshake if we haven't done it 
already on this device/browser
-                               localStorage.setItem( 'loginHandshaked', '1' );
-                               document.location = loginHandshakeUrl;
-                       }
-               }
-       } catch ( e ) {}
-
-       $( function() {
-               var $commonsImage = $( 'img[title="commons.wikimedia.org"]' );
-
-               function done() {
-                       $( '#mw-returnto' ).addClass( 'loaded' );
-               }
-
-               // make sure Commons image is loaded after login
-               if ( $commonsImage.length ) {
-                       // http://stackoverflow.com/a/3877079/365238
-                       $commonsImage.
-                               one( 'load', done ).
-                               // show the return to link anyway even if image 
fails to load
-                               one( 'error', done ).
-                               each( function() {
-                                       if ( this.complete ) {
-                                               // 
http://stackoverflow.com/a/1977898/365238
-                                               done();
-                                       }
-                               } );
-               } else {
-                       done();
-               }
-       } );
-
-}( jQuery ) );
diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less
index 013a2d2..77a65aa 100644
--- a/less/specials/userlogin.less
+++ b/less/specials/userlogin.less
@@ -86,30 +86,3 @@
                text-align: center;
        }
 }
-
-// FIXME: temporary hack to make CentralNotice a bit less confusing.
-#mw-returnto {
-       padding-top: 2em;
-       height: 100%;
-       z-index: 2;
-       position: absolute;
-       top: 0;
-       left: 0;
-       right: 0;
-       bottom: 0;
-       background-color: white;
-       text-align: center;
-}
-
-// FIXME: temporary hack to make sure we log into Commons
-.client-js #mw-returnto {
-       text-indent: -9999px;
-       background-image: url(../common/images/ajax-loader.gif);
-       background-repeat: no-repeat;
-       background-position: 50% 30%;
-
-       &.loaded {
-               text-indent: 0;
-               background: #fff;
-       }
-}
diff --git a/stylesheets/specials/userlogin.css 
b/stylesheets/specials/userlogin.css
index f9b84bb..b1cd9db 100644
--- a/stylesheets/specials/userlogin.css
+++ b/stylesheets/specials/userlogin.css
@@ -77,25 +77,3 @@
   display: block;
   text-align: center;
 }
-#mw-returnto {
-  padding-top: 2em;
-  height: 100%;
-  z-index: 2;
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background-color: white;
-  text-align: center;
-}
-.client-js #mw-returnto {
-  text-indent: -9999px;
-  background-image: url(../common/images/ajax-loader.gif);
-  background-repeat: no-repeat;
-  background-position: 50% 30%;
-}
-.client-js #mw-returnto.loaded {
-  text-indent: 0;
-  background: #fff;
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75f378cf5f49bd4dd8ef17a67a09b243ddcceb7a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to