微件:Donation:修订间差异
舰R百科,玩家自由编辑的战舰少女R百科
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第4行: | 第4行: | ||
<strong>Donation Banner Widget</strong><br> | <strong>Donation Banner Widget</strong><br> | ||
Use this code in <i>MediaWiki:Sitenotice</i> to display the banner:<br> | Use this code in <i>MediaWiki:Sitenotice</i> to display the banner:<br> | ||
<b>{{#widget: | <b>{{#widget:DonationBanner}}</b> | ||
</div> | </div> | ||
</noinclude> | </noinclude> | ||
| 第134行: | 第134行: | ||
<!-- IMPORTANT: Change 'DonationQR.png' to your actual file name --> | <!-- IMPORTANT: Change 'DonationQR.png' to your actual file name --> | ||
<!-- We use Special:FilePath to get the raw image URL dynamically --> | <!-- We use Special:FilePath to get the raw image URL dynamically --> | ||
<img src=" | <img src="/wiki/Special:FilePath/DonationQR.png" alt="Donation QR Code"> | ||
<div class="jr-qr-caption">扫码支持</div> | <div class="jr-qr-caption">扫码支持</div> | ||
</div> | </div> | ||
| 第152行: | 第152行: | ||
if (!isClosed) { | if (!isClosed) { | ||
// Show the banner | // Show the banner using vanilla JS | ||
if (banner) { | |||
banner.style.display = 'block'; | |||
} | |||
} | } | ||
// 2. Handle Close Click | // 2. Handle Close Click | ||
closeBtn.addEventListener('click', function() { | if (closeBtn) { | ||
closeBtn.addEventListener('click', function() { | |||
// Hide visually using vanilla JS | |||
if (banner) { | |||
banner.style.display = 'none'; | |||
} | |||
// Save to storage | |||
localStorage.setItem(storageKey, 'true'); | |||
}); | |||
} | |||
})(); | })(); | ||
</script> | </script> | ||
</includeonly> | </includeonly> | ||