PageSourceSearch

https://www.battlefields.org/themes/client/abt/js/accordions.js?tltzxl

js battlefields.org collected 2026-09-24 08:37:42 UTC 1,022 bytes, 36 lines download raw bytes

1(function ($, Drupal) {
2  // 'use strict';
3
4  function addListeners(elem) {
5    elem.off('click keypress').on('click keypress', function(e) {
6      var fireEvent = e.type === 'click' || (e.type === 'keypress' && e.key === 'Enter'),
7          parent = $(this).parent();
8
9      if (fireEvent === true) {
10        parent.toggleClass('open');
11
12        if (elem.attr('data-text-open') && elem.attr('data-text-closed')) {
13          if (parent.hasClass('open')) {
14            elem.empty().append(elem.attr('data-text-open'));
15          } else {
16            elem.empty().append(elem.attr('data-text-closed'));
17          }
18        }
19      }
20    });
21  }
22
23
24  Drupal.behaviors.abtAccordions = {
25    attach: function (context, settings) {
26      $('.accordion-opener').each(function() {
27        addListeners($(this));
28      });
29
30      $('.map-database-video__video').off('click keypress', '.accordion-opener').on('click keypress', '.accordion-opener', function() {
31        addListeners($(this));
32      });
33    }
34  }
35 
36})(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.