jenkins-bot has submitted this change and it was merged.
Change subject: Hygiene: Break the handshake
......................................................................
Hygiene: Break the handshake
Kill it with fire. Long live SUL.
* Also removes loginhandshake.js, userlogout RL modules
and handshake messages
Change-Id: I75f378cf5f49bd4dd8ef17a67a09b243ddcceb7a
---
M MobileFrontend.i18n.php
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
M includes/Resources.php
D includes/specials/SpecialLoginHandshake.php
D javascripts/specials/loginhandshake.js
D javascripts/specials/userlogin.js
M less/specials/userlogin.less
M stylesheets/specials/userlogin.css
9 files changed, 2 insertions(+), 173 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 81ade0d..da67cdc 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -20,8 +20,6 @@
'mobile-frontend-logged-out' => 'Not logged in',
'mobile-frontend-logged-in-homepage-notification' => 'Welcome, $1!',
'mobile-frontend-logged-in-toast-notification' => 'Logged in as $1.',
- 'mobile-frontend-handshake-title' => 'Redirecting...',
- 'mobile-frontend-handshake-wait' => 'Please wait while we redirect you
to the login form.',
/** log-in page **/
'mobile-frontend-sign-up-heading' => 'Sign up',
@@ -326,8 +324,6 @@
'mobile-frontend-logged-in-homepage-notification' => 'Heading at top of
homepage telling user they are logged in',
'mobile-frontend-logged-in-toast-notification' => 'Message telling user
that they are logged in. Shows as a notification at bottom of page
*$1 - username',
- 'mobile-frontend-handshake-title' => 'Title for the page redirecting
the user to the login form.',
- 'mobile-frontend-handshake-wait' => 'Text asking the user to wait while
he is redirected to the login form.',
'mobile-frontend-sign-up-heading' => 'Header for sign up page.
{{Identical|Sign up}}',
'mobile-frontend-sign-in-heading' => 'Header for login page.
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..df24248 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(
@@ -719,26 +713,5 @@
'javascripts/externals/jsdiff.js',
'javascripts/specials/mobilediff.js',
),
- ),
-
- // FIXME: temporary hack to get round CentralAuth logout screen
- 'mobile.userlogout.scripts' =>
$wgMFMobileSpecialPageResourceScriptBoilerplate + array(
- 'scripts' => array(
- 'javascripts/specials/userlogin.js',
- ),
- ),
- 'mobile.userlogout.styles' => $wgMFMobileSpecialPageResourceBoilerplate
+ array(
- 'styles' => array(
- 'stylesheets/specials/userlogin.css',
- ),
- ),
- 'mobile.loginhandshake.scripts' =>
$wgMFMobileSpecialPageResourceBoilerplate + array(
- 'dependencies' => array(
- 'jquery.cookie',
- ),
- 'scripts' => array(
- 'javascripts/specials/loginhandshake.js',
- ),
- 'position' => 'top',
),
) );
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/loginhandshake.js
b/javascripts/specials/loginhandshake.js
deleted file mode 100644
index 0a60964..0000000
--- a/javascripts/specials/loginhandshake.js
+++ /dev/null
@@ -1,7 +0,0 @@
-( function( $ ) {
- $.cookie( 'loginHandshake', '1' );
-
- if ( document.referrer ) {
- document.location = document.referrer;
- }
-}( jQuery ) );
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: merged
Gerrit-Change-Id: I75f378cf5f49bd4dd8ef17a67a09b243ddcceb7a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits