1// Allow other JavaScript libraries to use $. 2if (window.jQuery) { 3 jQuery.noConflict(); 4} 5 6// Class indicating that JS is enabled; used for styling purpose. 7document.documentElement.className += ' js'; 8 9// JavaScript should be made compatible with libraries other than jQuery by 10// wrapping it in an anonymous closure. 11(function (Drupal, drupalSettings) { 12 /** 13 * Calls callback when document ready. 14 * 15 * @param {function} callback 16 * The function to be called on document ready. 17 */ 18 const domReady = (callback) => { 19 const listener = () => { 20 callback(); 21 document.removeEventListener('DOMContentLoaded', listener); 22 }; 23 if (document.readyState !== 'loading') { 24 setTimeout(callback, 0); 25 } else { 26 document.addEventListener('DOMContentLoaded', listener); 27 } 28 }; 29 30 // Attach all behaviors. 31 domReady(() => { 32 Drupal.attachBehaviors(document, drupalSettings); 33 }); 34})(Drupal, window.drupalSettings);
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.