Show Commons link to logged out users

Change-Id: I899cb36a5d25342325266b68a3fd8058f3129e78
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/429
This commit is contained in:
Gergő Tisza 2014-06-09 06:56:52 +00:00
parent 46aaa55dc1
commit 92e68e4013
2 changed files with 8 additions and 13 deletions

View file

@ -47,9 +47,7 @@
this.initFeedbackButton();
}
this.initReuseButton();
if ( !mw.user.isAnon() ) {
this.initDescriptionPageButton();
}
this.initDescriptionPageButton();
}
oo.inheritClass( StripeButtons, mw.mmv.ui.Element );
SBP = StripeButtons.prototype;
@ -316,9 +314,7 @@
$button.removeClass( 'empty' );
} );
if ( !mw.user.isAnon() ) {
this.setDescriptionPageButton( imageInfo, repoInfo );
}
this.setDescriptionPageButton( imageInfo, repoInfo );
if ( this.shouldShowFeedbackSurvey() ) {
this.maybeDisplayTooltip();
@ -369,12 +365,11 @@
} );
this.buttons.$reuse.removeClass( 'open' );
if ( !mw.user.isAnon() ) {
this.buttons.$descriptionPage.attr( { href: null, title: null, 'original-title': null } )
.removeClass( 'mw-mmv-stripe-button-dynamic mw-mmv-stripe-button-commons' );
$( '.mw-mmv-stripe-button-dynamic-before' ).remove();
this.setInlineStyle( 'stripe-button-description-page', null );
}
this.buttons.$descriptionPage.attr( { href: null, title: null, 'original-title': null } )
.removeClass( 'mw-mmv-stripe-button-dynamic mw-mmv-stripe-button-commons' );
$( '.mw-mmv-stripe-button-dynamic-before' ).remove();
this.setInlineStyle( 'stripe-button-description-page', null );
};
/**

View file

@ -48,7 +48,7 @@
assert.ok( buttons, 'UI element is created.' );
assert.strictEqual( buttons.buttons.$reuse.length, 1, 'Reuse button created.' );
assert.ok( !buttons.buttons.$descriptionPage, 'File page button not created for anon.' );
assert.ok( buttons.buttons.$descriptionPage, 'File page button created for anon.' );
// now pretend we are logged in
mw.user.isAnon = function () { return false; };