1/** 2 * Handles dismissible notices from the Notice block. 3 */ 4 5document.addEventListener( 'DOMContentLoaded', function() { 6 7 var notices = document.querySelectorAll( '.ab-block-notice.ab-dismissable[data-id]' ); 8 9 notices.forEach( function( element ) { 10 11 var uid = element.getAttribute( 'data-id' ); 12 13 var dismissible = element.querySelector( '.ab-notice-dismiss' ); 14 15 if ( ! localStorage.getItem( 'notice-' + uid ) ) { 16 element.style.display = 'block'; 17 } 18 19 if ( dismissible ) { 20 dismissible.addEventListener( 'click', function( event ) { 21 event.preventDefault(); 22 localStorage.setItem( 'notice-' + uid, '1' ); 23 element.style.display = ''; 24 }); 25 } 26 }); 27});
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.