Template:Optin/Default: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
moved styles to Template:Styles/2016 oojs ui.css
trying focus method instead
 
(4 intermediate revisions by the same user not shown)
Line 16: Line 16:
<div class="optin-no-prompt__yes"></html>{{Translated|Template:OptinText/PromptYes}}<html></div>
<div class="optin-no-prompt__yes"></html>{{Translated|Template:OptinText/PromptYes}}<html></div>
</div>
</div>
<span id="error-optin" class="lp-error" style="display: none;">
<div id="error-optin" class="lp-error" style="display: none;" tabindex="-1"><!-- tabindex="-1" allows focus with js so it can be announced -->
</html>{{Translated|Template:OptinText/PleaseSelect}}<html>
</html>{{Translated|Template:OptinText/PleaseSelect}}<html>
</span>
</div>
<div class="optin-smallprint links-in-new-tab">
<div class="optin-smallprint links-in-new-tab">
</html>{{Translated|Template:OptinText/Smallprint}}<html>
</html>{{Translated|Template:OptinText/Smallprint}}<html>
</div>
</div>
</fieldset>
</fieldset>
<script>
/* Called by Common.js */
function initOptin() {
$('.optin-options').on('change', function(e) {
$('#error-optin').hide();

// Only do all this if we have translated prompts
if ( $('.optin-no-prompt').data('is-translated') === 'yes' ) {
if ( e.target.id === 'optin-no' ) {
$('.optin-no-prompt').removeClass('is-positive');
if ( !$('.optin-no-prompt').is(':visible') ) {
$('.optin-no-prompt').slideDown();
}
} else {
$('.optin-no-prompt').addClass('is-positive');
}
}
});
}
</script>
</html>
</html>

Latest revision as of 19:12, 20 November 2024

Can we stay in touch?
Sorry to hear that. We don't email often; would you consider changing your mind?
Thanks for changing your mind! We'll respect your inbox.