Template:Optin/ConfirmNo: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Β 
Line 15: Line 15:
</ul>
</ul>
<div class="optin-no-prompt">
<div class="optin-no-prompt">
<div class="optin-no-prompt__no">πŸ˜” Are you sure? We don't email often. You can change your mind anytime.</div>
<div class="optin-no-prompt__no"></div>
<div class="optin-no-prompt__yes">😍 Thanks for changing your mind! We'll respect your inbox.</div>
<div class="optin-no-prompt__yes"></div>
</div>
</div>
<div class="optin-smallprint links-in-new-tab">
<div class="optin-smallprint links-in-new-tab">
Line 24: Line 24:
<style>
<style>
/* --- Opt-in --- */
/* --- Opt-in --- */

.optin-options ul {
.optin-options ul {
list-style: none;
list-style: none;
Line 100: Line 99:
</style>
</style>
<script>
<script>
/* Called by Common.js */
function initOptin() {
function initOptin() {
var language = mw.config.get('wgUserLanguage');
var language = mw.config.get('wgUserLanguage');
Line 110: Line 110:
optinNoPrompts['en-gb'] = optinNoPrompts['en'];
optinNoPrompts['en-gb'] = optinNoPrompts['en'];


// Only do all this if we have translated prompts
if ( optinNoPrompts[language] ) {
if ( optinNoPrompts[language] ) {
$('.optin-no-prompt__no').text( optinNoPrompts[language].no );
$('.optin-no-prompt__no').text( optinNoPrompts[language].no );
Line 116: Line 117:
$('.optin-options').on('click', function(){
$('.optin-options').on('click', function(){
if ( $('#optin-no').is(':checked') ) {
if ( $('#optin-no').is(':checked') ) {
$('.optin-no-prompt').removeClass('is-positive');
$('.optin-no-prompt').removeClass('is-positive');
if ( !$('.optin-no-prompt').is(':visible') ) {
if ( !$('.optin-no-prompt').is(':visible') ) {
$('.optin-no-prompt').slideDown();
$('.optin-no-prompt').slideDown();
}
}
} else {
} else {
$('.optin-no-prompt').addClass('is-positive');
$('.optin-no-prompt').addClass('is-positive');
}
}
});
});

Latest revision as of 16:48, 11 October 2018