/*
JS enhancements, events etc for Widget:Sitenotice
See detailed documentation in Dev/mediawiki
*/
(function () {
// =============================
// A : All Banners Functionality
// -----
// Setup
// Check if there is an active banner that is not blocked by the user, if so append Close-Button
if( $('#siteNotice .banner').length > 0 ) {
$('#siteNotice .sitenotice-body').prepend( $( `
`));
$('#siteNotice .sitenotice-body .sitenotice-close').hide().fadeIn();
}
// ------
// Events
$('#siteNotice .sitenotice-close').on( 'click', function() {
if( $('#siteNotice .banner').length > 0 ) {
Cookies.set( 'ctbc_hide-sitenotice-' + $('#siteNotice .sitenotice-body').attr( 'data-sitenotice-id' ), 'true', { expires: 30, sameSite: 'strict' } );
$('#siteNotice').hide();
}
});
// ================================
// B : Custom Banners Functionality
})();
/*
[[Category:MultiWiki]]
*/