1(function(){ 2 var lightboxes = document.querySelectorAll( '.temslbx-lightbox' ); 3 if ( 0 == lightboxes.length ) { return; } 4 5 var lightboxCount = lightboxes.length; 6 7 for ( var i = 0; i != lightboxCount; ++i ) { 8 var lightbox = lightboxes[ i ]; 9 if ( !lightbox.dataset[ 'id' ] ) { continue; } 10 11 /* Lightbox triggers */ 12 var triggers = document.querySelectorAll( '[data-temslbx-id="' + lightbox.dataset[ 'id' ] + '"]' ); 13 if ( 0 == triggers.length ) { continue; } 14 15 var triggerCount = triggers.length; 16 17 /* Lightbox closing */ 18 lightbox.addEventListener( 'click', function( e ) { 19 if ( e.currentTarget == e.target || ~e.target.className.indexOf( 'lightbox-close-button' )) { 20 this.className = this.className.replace( ' on', '' ); 21 var l = this; 22 setTimeout( function() { 23 l.className = l.className.replace( ' active', '' ); 24 }, 250 ); 25 } 26 }); 27 28 /* Lightbox triggers' events */ 29 for ( var j = 0; j != triggerCount; ++j ) { 30 var trigger = triggers[ j ]; 31 trigger.addEventListener( 'click', function( e ) { 32 e.preventDefault(); 33 34 var targetLightboxID = this.dataset[ 'temslbxId' ]; 35 if ( !targetLightboxID ) { return; } 36 37 var targetLightbox; 38 39 /* Toggle lightboxes' states */ 40 for ( var i = 0; i != lightboxCount; ++i ) { 41 var l = lightboxes[ i ]; 42 var id = l.dataset[ 'id' ] ? l.dataset[ 'id' ] : false; 43 44 l.className = l.className.replace( ' active', '' ); 45 l.className = l.className.replace( ' on', '' ); 46 47 if ( targetLightboxID == id ) { 48 targetLightbox = l; 49 l.className += ' active'; 50 setTimeout( function() { 51 targetLightbox.className += ' on'; 52 }, 1 ); 53 } 54 } 55 }); 56 } 57 } 58})();
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.