Tags: Reverted Mobile edit Mobile web edit |
Tags: Manual revert Mobile edit Mobile web edit |
| (2 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| /* Any JavaScript here will be loaded for all users on every page load. */ | | /* Any JavaScript here will be loaded for all users on every page load. */ |
|
| |
|
| |
| // Add dismiss button to sitenotice
| |
| $(function() {
| |
| if ($('#siteNotice').length) {
| |
| var cookieName = 'dismissSiteNotice';
| |
| var cookieValue = $('#siteNotice').attr('data-notice-id') || 'sitenotice';
| |
|
| |
| // Check if already dismissed
| |
| if ($.cookie(cookieName) === cookieValue) {
| |
| $('#siteNotice').hide();
| |
| return;
| |
| }
| |
|
| |
| // Add dismiss button
| |
| var dismissBtn = $('<span class="sitenotice-dismiss">[dismiss]</span>');
| |
| dismissBtn.css({
| |
| 'cursor': 'pointer',
| |
| 'float': 'right',
| |
| 'font-size': '90%',
| |
| 'margin-left': '1em'
| |
| });
| |
|
| |
| dismissBtn.click(function() {
| |
| $('#siteNotice').slideUp();
| |
| $.cookie(cookieName, cookieValue, { expires: 30, path: '/' });
| |
| });
| |
|
| |
| $('#siteNotice').prepend(dismissBtn);
| |
| }
| |
| });
| |
Latest revision as of 12:23, 6 December 2025
/* Any JavaScript here will be loaded for all users on every page load. */