Template:Optin/Default: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 16: Line 16:
</ul>
</ul>
<div class="optin-no-prompt" data-is-translated="</html>{{IsTranslated|Template:OptinText/PromptNo|{{int:lang}}}}<html>">
<div class="optin-no-prompt" data-is-translated="</html>{{IsTranslated|Template:OptinText/PromptNo|{{int:lang}}}}<html>">
<div class="optin-no-prompt__no"></div>
<div class="optin-no-prompt__no">{{Translated|Template:OptinText/PromptNo}}</div>
<div class="optin-no-prompt__yes"></div>
<div class="optin-no-prompt__yes">{{Translated|Template:OptinText/PromptYes}}</div>
</div>
</div>
<div class="optin-smallprint links-in-new-tab">
<div class="optin-smallprint links-in-new-tab">
Line 109: Line 109:
/* Called by Common.js */
/* Called by Common.js */
function initOptin() {
function initOptin() {
var language = mw.config.get('wgUserLanguage');
var optinNoPrompts = {
'en' : {
'no' : "😔 Sorry to hear that. We don't email often; would you consider changing your mind?",
'yes' : "😍 Thanks for changing your mind! We'll respect your inbox."
},
'it' : {
'no' : "😔 È un vero peccato. Non inviamo e-mail frequentemente; prenderesti in considerazione la possibilità di cambiare idea?",
'yes' : "😍 Grazie per aver cambiato idea! Avremo molto rispetto della tua casella di posta."
}
};
optinNoPrompts['en-gb'] = optinNoPrompts['en'];

// Only do all this if we have translated prompts
// Only do all this if we have translated prompts
if ( $('.optin-no-prompt').data('is-translated') === 'yes' ) {
if ( optinNoPrompts[language] ) {
$('.optin-no-prompt__no').text( optinNoPrompts[language].no );
$('.optin-no-prompt__yes').text( optinNoPrompts[language].yes );

$('.optin-options').on('click', function(){
$('.optin-options').on('click', function(){
if ( $('#optin-no').is(':checked') ) {
if ( $('#optin-no').is(':checked') ) {

Revision as of 01:23, 1 February 2019

Can we stay in touch?
{{Translated|Template:OptinText/PromptNo}}
{{Translated|Template:OptinText/PromptYes}}