<commit_before>/*
	By <NAME>, www.osvaldas.info
	Available for use under the MIT License
*/
;( function( $, window, document, undefined )
{
    'use strict';

    var cssTransitionSupport = function()
        {
            var s = document.body || document.documentElement;
            s = s.style;
            if( s.WebkitTransition === '' ) { return '-webkit-'; }
            if( s.MozTransition === '' ) { return '-moz-'; }
            if( s.OTransition === '' ) { return '-o-'; }
            if( s.transition === '' ) { return ''; }
            return false;
        },

        isCssTransitionSupport = cssTransitionSupport() !== false,

        cssTransitionTranslateX = function( element, positionX, speed )
        {
            var options = {}, prefix = cssTransitionSupport();
            options[ prefix + 'transform' ]	 = 'translateX(' + positionX + ')';
            options[ prefix + 'transition' ] = prefix + 'transform ' + speed + 's linear';
            element.css( options );
        },

        hasTouch	= ( 'ontouchstart' in window ),
        hasPointers = window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
        wasTouched	= function( event )
        {
            if( hasTouch ) { return true; }

            if( !hasPointers || typeof event === 'undefined' || typeof event.pointerType === 'undefined' ) { return false; }

            if( typeof event.MSPOINTER_TYPE_MOUSE !== 'undefined' )
            {
                if( event.MSPOINTER_TYPE_MOUSE !== event.pointerType ) { return true; }
            }
            else if( event.pointerType !== 'mouse' ) {
                return true;
            }

            return false;
        };

    $.fn.imageLightbox = function( opts )
    {
        var options = $.extend(
            {
                selector:		'id="imagelightbox"',
                allowedTypes:	'png|jpg|jpeg|gif',
                animationSpeed:	250,
                preloadNext:	true,
                enableKeyboard:	true,
                quitOnEnd:		false,
                quitOnImgClick: false,
                quitOnDocClick: true,
                onStart:		false,
                onEnd:			false,
                onLoadStart:	false,
                onLoadEnd:		false
            },
            opts ),

            targets		= $([]),
            target		= $(),
            image		= $(),
            imageWidth	= 0,
            imageHeight = 0,
            swipeDiff	= 0,
            inProgress	= false,

            isTargetValid = function( element )
            {
                var classic =  $( element ).prop( 'tagName' ).toLowerCase() === 'a' && ( new RegExp( '.(' + options.allowedTypes + ')$', 'i' ) ).test( $( element ).attr( 'href' ) );
                var html5 = $( element ).prop( 'data-lightbox' ) !== undefined;
                return classic || html5;
            },

            setImage = function()
            {
                if( !image.length ) { return false; }

                var screenWidth	 = $( window ).width() * 0.8,
                    screenHeight = $( window ).height() * 0.9,
                    tmpImage 	 = new Image();

                tmpImage.src	= image.attr( 'src' );<commit_msg>fixing a HTML5 data-lightbox attribute handling bug in isTargetValid<commit_after>/*
	By <NAME>, www.osvaldas.info
	Available for use under the MIT License
*/
;( function( $, window, document, undefined )
{
    'use strict';

    var cssTransitionSupport = function()
        {
            var s = document.body || document.documentElement;
            s = s.style;
            if( s.WebkitTransition === '' ) { return '-webkit-'; }
            if( s.MozTransition === '' ) { return '-moz-'; }
            if( s.OTransition === '' ) { return '-o-'; }
            if( s.transition === '' ) { return ''; }
            return false;
        },

        isCssTransitionSupport = cssTransitionSupport() !== false,

        cssTransitionTranslateX = function( element, positionX, speed )
        {
            var options = {}, prefix = cssTransitionSupport();
            options[ prefix + 'transform' ]	 = 'translateX(' + positionX + ')';
            options[ prefix + 'transition' ] = prefix + 'transform ' + speed + 's linear';
            element.css( options );
        },

        hasTouch	= ( 'ontouchstart' in window ),
        hasPointers = window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
        wasTouched	= function( event )
        {
            if( hasTouch ) { return true; }

            if( !hasPointers || typeof event === 'undefined' || typeof event.pointerType === 'undefined' ) { return false; }

            if( typeof event.MSPOINTER_TYPE_MOUSE !== 'undefined' )
            {
                if( event.MSPOINTER_TYPE_MOUSE !== event.pointerType ) { return true; }
            }
            else if( event.pointerType !== 'mouse' ) {
                return true;
            }

            return false;
        };

    $.fn.imageLightbox = function( opts )
    {
        var options = $.extend(
            {
                selector:		'id="imagelightbox"',
                allowedTypes:	'png|jpg|jpeg|gif',
                animationSpeed:	250,
                preloadNext:	true,
                enableKeyboard:	true,
                quitOnEnd:		false,
                quitOnImgClick: false,
                quitOnDocClick: true,
                onStart:		false,
                onEnd:			false,
                onLoadStart:	false,
                onLoadEnd:		false
            },
            opts ),

            targets		= $([]),
            target		= $(),
            image		= $(),
            imageWidth	= 0,
            imageHeight = 0,
            swipeDiff	= 0,
            inProgress	= false,

            isTargetValid = function( element )
            {
                var classic =  $( element ).prop( 'tagName' ).toLowerCase() === 'a' && ( new RegExp( '.(' + options.allowedTypes + ')$', 'i' ) ).test( $( element ).attr( 'href' ) );
                var html5 = $( element ).attr( 'data-lightbox' ) !== undefined;
                return classic || html5;
            },

            setImage = function()
            {
                if( !image.length ) { return false; }

                var screenWidth	 = $( window ).width() * 0.8,
                    screenHeight = $( window ).height() * 0.9,
                    tmpImage 	 = new Image();

                tmpImage.src	= image.attr( 'src' );
{'fraction_non_alphanumeric': 0.13083967096073257, 'fraction_numerical': 0.0038801800403538726, 'mean_word_length': 1.4822804314329738, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6295682', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1699, 'n_words': 410}