PageSourceSearch

https://www.stanleyworks.se/modules/custom/sbd_site_studio/js/announcements.js?tl1pmg

js stanleyworks.se collected 2026-09-26 16:29:30 UTC 927 bytes, 29 lines download raw bytes

1(function($, Drupal) {
2  // Get session data if available.
3  var dismissed = sessionStorage.getItem('sbd_announcement');
4  if (!dismissed) {
5    dismissed = [];
6  }
7
8  Drupal.behaviors.sbdAnnouncements = {
9    attach: function(context, settings) {
10      $('.announcement-banner-wrapper', context).once('sbd-announcement')
11        .each(function() {
12          var $wrapper = $(this),
13            $close = $wrapper.find('button.banner-close-btn'),
14            nid = parseInt($wrapper.attr('data-nid'));
15
16          // Update session storage when close button is clicked.
17          $close.click(function() {
18            dismissed.push(nid);
19            sessionStorage.setItem('sbd_announcement', dismissed);
20          });
21
22          // Announcements are hidden by default and shown if not dismissed.
23          if (dismissed.indexOf(nid) === -1) {
24            $wrapper.show();
25          }
26        });
27    }
28  };
29})(jQuery, Drupal);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.