<commit_before>extends layout

style
    #remoteVideo video
        height: 150px

    #localVideo
        height: 150px


block mainContent
    div.container

        form#createRoom
            input#sessionInput
            button(type=submit, class=btn) Submit

        video#localVideo
        div#remoteVideo

        script(src="http://simplewebrtc.com/latest.js")

        script.
            var peer = location.search && location.search.split('?')[1];

            var webrtc = new SimpleWebRTC({
                localVideoEl: 'localVideo',
                remoteVideoEl: 'remoteVideo',
                autoRequestMedia: true,
                debug: true
            });

            webrtc.on('readyToCall', function() {
                if (room) webrtc.joinRoom(room);
            });

            webrtc.on('videoAdded', function(video, peer) {
                console.log('video added', peer);
                var remotes = document.getElementById('remoteVideo');
                var d = document.createElement('div');
                d.className = 'videoContainer';
                d.id = 'container_' + webrtc.getDomId(peer);
                d.appendChild(video);
                video.onclick = function() {
                    video.style.width = video.videWidth + 'px';
                    video.style.height = video.videoHeight + 'px';
                };
                remotes.appendChild(d);
            });

            webrtc.on('videoRemoved', function(video, peer) {
                console.log('video removed', peer);
                var remotes = document.getElementById('remoteVideo');
                var el = document.getElementById('container_' + webrtc.getDomId(peer));
                if (remotes && el) {
                    remotes.removeChild(el);
                }
            });

            $('form').submit(function() {
                var val = $('#sessionInput').val().toLowerCase().replace(/\s\g, '-')
                            .replace(/[^A-Za-z0-9_\-]/g, '');
                webrtc.createRoom(val, function(err, name) {
                    console.log('create roomcb', arguments);

                    var newUrl = location.pathname + '?' + name;
                    if (!err) {
                        history.replaceState({foo: 'bar'}, null, newUrl);
                    } else {
                        console.error(err);
                    }
                })
                return false;
            });
            }<commit_msg>fixed typos in p2p.jade<commit_after>extends layout

style
    #remoteVideo video
        height: 150px

    #localVideo
        height: 150px


block mainContent
    div.container

        form#createRoom
            input#sessionInput
            button.btn(type=submit) Submit

        video#localVideo
        div#remoteVideo

        script(src="http://simplewebrtc.com/latest.js")

        script.
            var room = location.search && location.search.split('?')[1];
            console.log(room);

            var webrtc = new SimpleWebRTC({
                localVideoEl: 'localVideo',
                remoteVideoEl: 'remoteVideo',
                autoRequestMedia: true,
                debug: true
            });

            webrtc.on('readyToCall', function() {
                if (room) webrtc.joinRoom(room);
            });

            webrtc.on('videoAdded', function(video, peer) {
                console.log('video added', peer);
                var remotes = document.getElementById('remoteVideo');
                var d = document.createElement('div');
                d.className = 'remoteVideo';
                d.id = 'container_' + webrtc.getDomId(peer);
                d.appendChild(video);
                video.onclick = function() {
                    video.style.width = video.videWidth + 'px';
                    video.style.height = video.videoHeight + 'px';
                };
                remotes.appendChild(d);
            });

            webrtc.on('videoRemoved', function(video, peer) {
                console.log('video removed', peer);
                var remotes = document.getElementById('remoteVideo');
                var el = document.getElementById('container_' + webrtc.getDomId(peer));
                if (remotes && el) {
                    remotes.removeChild(el);
                }
            });

            $('form').submit(function() {
                var val = $('#sessionInput').val().toLowerCase();
                webrtc.createRoom(val, function(err, name) {
                    console.log('create roomcb', arguments);

                    var newUrl = location.pathname + '?' + name;
                    if (!err) {
                        history.replaceState({foo: 'bar'}, null, newUrl);
                    } else {
                        console.error(err);
                    }
                });
                return false;
            });
{'fraction_non_alphanumeric': 0.11881993896236012, 'fraction_numerical': 0.0034587995930824007, 'mean_word_length': 1.352153110047847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4352102', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1196, 'n_words': 226}