<commit_before>var YoutubeDelayed = {
    initPlayer: function(node){
        //initialise the player in specified node
        var videoId = node.getAttribute('data-videoid');
        node.style.backgroundImage = "url(http://img.youtube.com/vi/" + videoId + "/0.jpg)";
        node.innerHTML = '<a class="YoutubeDelayedPlay" href="http://www.youtube.com/watch?v=' + videoId +'" target="_blank"></a>'
        node.firstChild.onclick = YoutubeDelayed.loadPlayer;
    },
    init: function(){
        //initialise the players
        var players = document.getElementsByClassName("YoutubeDelayed");
        for (var i = 0; i < players.length; i++){
            YoutubeDelayed.initPlayer(players[i]);
        }
    },
    loadPlayer: function(e){
        //load player when user clicked play button
        e.preventDefault();
        this.parentNode.innerHTML = '<iframe class="YoutubeDelayedPlayer" src="http://www.youtube.com/embed/' + this.parentNode.getAttribute('data-videoid') + '?autoplay=1" frameborder="0" allowfullscreen></iframe>';
        //console.log('<iframe class="YoutubeDelayedPlayer" src="http://www.youtube.com/embed/' + this.parentNode.getAttribute('data-videoid') + '?autoplay=1" frameborder="0" allowfullscreen></iframe>')
    }
};
//set cross-browser onload event
window[addEventListener ? 'addEventListener' : 'attachEvent'](addEventListener ? 'load' : 'onload', YoutubeDelayed.init);<commit_msg>add youtubedelayed.js<commit_after>var YoutubeDelayed={initPlayer:function(a){var b=a.getAttribute("data-videoid");a.style.backgroundImage="url(http://img.youtube.com/vi/"+b+"/0.jpg)";a.innerHTML='<a class="YoutubeDelayedPlay" href="http://www.youtube.com/watch?v='+b+'" target="_blank"></a>';a.firstChild.onclick=YoutubeDelayed.loadPlayer},init:function(){for(var a=document.getElementsByClassName("YoutubeDelayed"),b=0;b<a.length;b++)YoutubeDelayed.initPlayer(a[b])},loadPlayer:function(a){a.preventDefault();this.parentNode.innerHTML='<iframe class="YoutubeDelayedPlayer" src="http://www.youtube.com/embed/'+this.parentNode.getAttribute("data-videoid")+'?autoplay=1" frameborder="0" allowfullscreen></iframe>'}};window[addEventListener?"addEventListener":"attachEvent"](addEventListener?"load":"onload",YoutubeDelayed.init);
{'fraction_non_alphanumeric': 0.1767586821015138, 'fraction_numerical': 0.004452359750667854, 'mean_word_length': 5.329577464788732, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, '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': '6677552', 'n_tokens_mistral': 698, 'n_tokens_neox': 681, 'n_words': 87}