<commit_before>var React    = require('react');
var ReactDOM = require('react-dom');
var Lightbox = require('react-image-lightbox');

var images = [
    '//placekitten.com/1500/500',
    '//placekitten.com/4000/3000',
    '//placekitten.com/800/1200',
    // '//placekitten.com/300/400',
    '//placekitten.com/1500/1500'
];

var App = React.createClass({
    getInitialState: function() {
        return {
            index: 0,
            isOpen: false
        };
    },
    openLightbox: function() {
        this.setState({ isOpen: true });
    },
    closeLightbox: function() {
        this.setState({ isOpen: false });
    },
    moveNext: function() {
        this.setState({ index: (this.state.index + 1) % images.length });
    },
    movePrev: function() {
        this.setState({ index: (this.state.index + images.length - 1) % images.length });
    },
    render: function() {
        var lightbox = '';
        if (this.state.isOpen) {
            lightbox = (
                <Lightbox
                    mainSrc={images[this.state.index]}
                    nextSrc={images[(this.state.index + 1) % images.length]}
                    prevSrc={images[(this.state.index + images.length - 1) % images.length]}

                    onCloseRequest={this.closeLightbox}
                    onMovePrevRequest={this.movePrev}
                    onMoveNextRequest={this.moveNext}
                />
            );
        }

        return (
            <div>
                <button type="button" onClick={this.openLightbox}>Open Lightbox</button>
                {lightbox}
            </div>
        );
    }
});

ReactDOM.render(<App/>, document.getElementById('app'));
<commit_msg>Add attribution to the example page<commit_after>var React    = require('react');
var ReactDOM = require('react-dom');
var Lightbox = require('react-image-lightbox');

var images = [
    '//placekitten.com/1500/500?image=3',
    '//placekitten.com/2000/1500?image=8',
    '//placekitten.com/800/1200?image=5',
    // '//placekitten.com/300/400',
    '//placekitten.com/1500/1500?image=13',
];

var titles = [
    "<b>heyhey</b>",
    (
        <span>
            by&nbsp;
            <a href="http://flickr.com/photos/titrans/">
                quatre mains
            </a>
            &nbsp;(<a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License">
                Some rights reserved
            </a>)
        </span>
    ),
    (
        <span>
            by&nbsp;
            <a href="http://flickr.com/photos/lachlanrogers/">latch.r</a>
            &nbsp;(<a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License">
                Some rights reserved
            </a>)
        </span>
    ),
    (
        <span>
            by&nbsp;
            <a href="http://flickr.com/photos/fazen/">
                fazen
            </a>
            &nbsp;(<a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License">
                Some rights reserved
            </a>)
        </span>
    ),
];
var App = React.createClass({
    getInitialState: function() {
        return {
            index: 0,
            isOpen: false
        };
    },
    openLightbox: function() {
        this.setState({ isOpen: true });
    },
    closeLightbox: function() {
        this.setState({ isOpen: false });
    },
    moveNext: function() {
        this.setState({ index: (this.state.index + 1) % images.length });
    },
    movePrev: function() {
        this.setState({ index: (this.state.index + images.length - 1) % images.length });
    },
    render: function() {
        var lightbox = '';
        if (this.state.isOpen) {
            lightbox = (
                <Lightbox
                    mainSrc={images[this.state.index]}
                    nextSrc={images[(this.state.index + 1) % images.length]}
                    prevSrc={images[(this.state.index + images.length - 1) % images.length]}

                    onCloseRequest={this.closeLightbox}
                    onMovePrevRequest={this.movePrev}
                    onMoveNextRequest={this.moveNext}

                    imageTitle={titles[this.state.index]}
                />
            );
        }

        return (
            <div>
                <button type="button" onClick={this.openLightbox}>Open Lightbox</button>
                {lightbox}
            </div>
        );
    }
});

ReactDOM.render(<App/>, document.getElementById('app'));

{'fraction_non_alphanumeric': 0.1542565014447655, 'fraction_numerical': 0.020671260280062238, 'mean_word_length': 1.6642984014209592, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5729374', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1310, 'n_words': 213}