mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 22:25:27 +00:00
Remove broken remains of &campaign=leftNavSignup handling
This code could never be used under normal circumstances since a crucial bit of it was removed from MobileFrontend in 2015: (I65e943b6dad8bfea994020f9f555bd095da1a171) // Allow us to distinguish sign ups from the left nav to logins. // This allows us to show them an edit tutorial when they return to the page. if ( $query['returntoquery'] === 'welcome=yes' ) { $query['returntoquery'] = 'campaign=leftNavSignup'; } …and honestly, that's for good, because it fails horribly when triggered by adding &campaign=leftNavSignup to the URL manually: clicking "Start editing" in the callout navigates you to an article called "Undefined/leftNavSignup". Bug: T205325 Change-Id: I0e385488be5b2eaa7d489029b91e18b336c0d133
This commit is contained in:
parent
786ec45c30
commit
992630c705
|
@ -696,8 +696,6 @@ class SkinMinerva extends SkinTemplate {
|
|||
[ 'data-event-name' => 'logout' ]
|
||||
);
|
||||
} else {
|
||||
// note welcome=yes in returnto allows us to detect accounts created from the left nav
|
||||
$returntoquery[ 'welcome' ] = 'yes';
|
||||
// unset campaign on login link so as not to interfere with A/B tests
|
||||
unset( $returntoquery['campaign'] );
|
||||
$query[ 'returntoquery' ] = wfArrayToCgi( $returntoquery );
|
||||
|
@ -1309,7 +1307,6 @@ class SkinMinerva extends SkinTemplate {
|
|||
$user = $this->getUser();
|
||||
$req = $this->getRequest();
|
||||
$action = $req->getVal( 'article_action' );
|
||||
$campaign = $req->getVal( 'campaign' );
|
||||
$title = $this->getTitle();
|
||||
|
||||
if ( !$title->isSpecialPage() ) {
|
||||
|
@ -1328,7 +1325,7 @@ class SkinMinerva extends SkinTemplate {
|
|||
}
|
||||
|
||||
if ( $this->isCurrentPageEditableByUser() ) {
|
||||
if ( $action === 'signup-edit' || $campaign === 'leftNavSignup' ) {
|
||||
if ( $action === 'signup-edit' ) {
|
||||
$modules[] = 'skins.minerva.newusers';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
/* This code currently handles two different editing tutorials/CTAs:
|
||||
/* This code handles the editing tutorial/CTA:
|
||||
|
||||
EditTutorial - When an editor registers via the edit page action, upon returning to the
|
||||
page, show a blue guider prompting them to continue editing. You can replicate this by
|
||||
appending article_action=signup-edit to the URL of an editable page whilst logged in.
|
||||
|
||||
LeftNavEditTutorial - When an editor registers via the left navigation menu, upon
|
||||
returning to the page, show a blue tutorial in 50% of cases prompting them to try
|
||||
editing. You can replicate this by appending campaign=leftNavSignup to the URL of an
|
||||
editable page whilst logged in, although you must be in test group A to see the CTA.
|
||||
*/
|
||||
( function ( M, $ ) {
|
||||
var PointerOverlay = M.require( 'skins.minerva.newusers/PointerOverlay' ),
|
||||
|
@ -17,17 +12,7 @@ editable page whilst logged in, although you must be in test group A to see the
|
|||
escapeHash = util.escapeHash,
|
||||
inEditor = window.location.hash.indexOf( '#editor/' ) > -1,
|
||||
hash = window.location.hash,
|
||||
editOverlay, target, $target, href;
|
||||
|
||||
/**
|
||||
* Whether or not the user should see the leftNav guider
|
||||
* @ignore
|
||||
* @return {boolean}
|
||||
*/
|
||||
function shouldShowLeftNavEditTutorial() {
|
||||
return mw.util.getParamValue( 'campaign' ) === 'leftNavSignup' &&
|
||||
mw.config.get( 'wgNamespaceNumber' ) === 0 && !inEditor;
|
||||
}
|
||||
editOverlay, target;
|
||||
|
||||
/**
|
||||
* If the user came from an edit button signup, show guider.
|
||||
|
@ -36,7 +21,7 @@ editable page whilst logged in, although you must be in test group A to see the
|
|||
*/
|
||||
function shouldShowTutorial() {
|
||||
var shouldShowEditTutorial = mw.util.getParamValue( 'article_action' ) === 'signup-edit' && !inEditor;
|
||||
return shouldShowEditTutorial || shouldShowLeftNavEditTutorial();
|
||||
return shouldShowEditTutorial;
|
||||
}
|
||||
|
||||
if ( hash && hash.indexOf( '/' ) === -1 ) {
|
||||
|
@ -47,14 +32,6 @@ editable page whilst logged in, although you must be in test group A to see the
|
|||
|
||||
// Note the element might have a new ID if the wikitext was changed so check it exists
|
||||
if ( $( target ).length > 0 && shouldShowTutorial() ) {
|
||||
|
||||
if ( shouldShowLeftNavEditTutorial() ) {
|
||||
// Append the funnel name to the edit link's url
|
||||
$target = $( target );
|
||||
href = $target.attr( 'href' );
|
||||
$target.attr( 'href', href + '/leftNavSignup' );
|
||||
}
|
||||
|
||||
editOverlay = new PointerOverlay( {
|
||||
target: target,
|
||||
skin: skin,
|
||||
|
|
Loading…
Reference in a new issue