$(document).ready(function() { doAJAX('daily-challenges', 'GET').promise.then((res) => { if(res.success) { const uploadReceiptChallenge = res.data.list.find(ch => ch.id === 6); if(uploadReceiptChallenge) { skaleChallenges.showChallengeItem(uploadReceiptChallenge); } else { console.error('Upload receipt challenge not found in the list.'); } } else { console.error('Failed to fetch the list of challenges.'); } }).catch((err) => { console.error('An error occurred while fetching the list of challenges:', err); }); // UPDATE LANGUAGE $('#use_voucher-modal-submit').text('Klik untuk Menebus Baucar'); $('#title').remove(); $('#voucher_usage').append('
');
$('.voucher-card').find('.btn-use-reward').each(function() {
if ($(this).text().tcrim() === 'Redeem') {
$(this).text('Tebus');
}
});
});
// use_voucher-modal
$('#use_voucher-modal').on('shown.bs.modal', function() {
$('#use_voucher-modal-finish').text('Teruskan');
});
// receipt submission modal
$('#popup_upload_receipt').on('shown.bs.modal', function(){
$('.add-img.init-add-more').text('Resit terlalu panjang? Muat naik bahagian seterusnya');
$('#popup_upload_receipt-submit').text('Hantar');
$('#popup_upload_receipt-cancel').text('Kembali');
$('.challenge_item_description').text('Beli barangan Subi bernilai RM40 dan dapatkan pulangan tunai segera!');
$('.receipt-eg span:contains("Examples")').text('Contoh Resit');
});
// CONTEST UPDATE TEXT
$('#cropper-preview h5').text('Sila semak imej anda sebelum hantar');
if (window.location.pathname === '/register' || window.location.pathname === '/login') {
$('h4.text-center').text('');
$('#btn-login').text('Log Masuk');
}
// win modal
// $(this).find('.image_url').remove();
// $(this).find('.subtitle').remove();
$('#popup_custom').on('shown.bs.modal', function(){
// $(this).find('.image_url').remove();
// $(this).find('.subtitle').remove();
});
// $('.btn.btn-sm.btn-primary.mb-3.challenge-shortcut-btn')
// $('button[data-type="upload_receipt"]').text("Spin");
$('label[for="accept_tou"] span').html(function(_, html) {
return html.replace(' serta goldenfreshMY', '');
});
});
$(window).on('load',function(){
function initCountryCodes(dropdown_el, default_country) {
$(dropdown_el).val('60').trigger('change');
}
$(async function () {
initCountryCodes('#signup-countrycode', 'MY');
initCountryCodes('#login-countrycode', 'MY');
autoPopulateForm();
});
})