<commit_before>'use strict';
/*jshint browser: true */

var io = require('socket.io-client');
var _ = require('lodash');
var $ = require('jquery');

var TextMediaObject = require('./utils/media-object/text-media-object');
var VideoMediaObject = require('./utils/media-object/video-media-object');
var ImageMediaObject = require('./utils/media-object/image-media-object');
var AudioMediaObject = require('./utils/media-object/audio-media-object');
var MediaObjectQueue = require('./utils/media-object/media-object-queue');
var RandomAudioPlayer = require('./utils/random-audio-player');
var RandomVisualPlayer = require('./utils/random-visual-player');
var transitionEventName = require('./utils/transition-event')();

var form = document.getElementById('login-form'),
    login = document.getElementById('login'),
    errors = document.getElementById('errors'),
    playerElem = document.getElementById('player'),
    sceneNameElem = document.getElementById('scene-name'),
    mediaObjectQueue = new MediaObjectQueue(
        [TextMediaObject, AudioMediaObject, VideoMediaObject, ImageMediaObject],
        {image: 3, text: 1, video: 1, audio: 1}
    ),
    randomVisualPlayer = new RandomVisualPlayer(playerElem, mediaObjectQueue),
    randomAudioPlayer = new RandomAudioPlayer(mediaObjectQueue),
    sceneDisplayTimeout,
    sceneList,
    currentSceneIndex;

var socket;


function showError (message) {
    var msg = document.createElement('li');
    msg.classList.add('error');
    msg.innerText = message.toString();
    errors.appendChild(msg);
    msg.style.opacity = 1;
    setTimeout(function() {
        msg.addEventListener(transitionEventName, function() {
            errors.removeChild(msg);
        });
        msg.style.opacity = 0;
    }, 40 * message.length);
}

function nextScene () {
    var delay,
        sceneToLoad = 'GUI' + sceneList[currentSceneIndex].name;

    socket.emit('loadSceneByName', sceneToLoad, handleError(function(scene) {
        if (! scene) {
            showError('Attempted to load scene "' + sceneToLoad + '" but it could not be found.');
            delay = 1000;
        } else {
            console.log('showing scene ' + scene.name);<commit_msg>remove prepended GUI from the name<commit_after>'use strict';
/*jshint browser: true */

var io = require('socket.io-client');
var _ = require('lodash');
var $ = require('jquery');

var TextMediaObject = require('./utils/media-object/text-media-object');
var VideoMediaObject = require('./utils/media-object/video-media-object');
var ImageMediaObject = require('./utils/media-object/image-media-object');
var AudioMediaObject = require('./utils/media-object/audio-media-object');
var MediaObjectQueue = require('./utils/media-object/media-object-queue');
var RandomAudioPlayer = require('./utils/random-audio-player');
var RandomVisualPlayer = require('./utils/random-visual-player');
var transitionEventName = require('./utils/transition-event')();

var form = document.getElementById('login-form'),
    login = document.getElementById('login'),
    errors = document.getElementById('errors'),
    playerElem = document.getElementById('player'),
    sceneNameElem = document.getElementById('scene-name'),
    mediaObjectQueue = new MediaObjectQueue(
        [TextMediaObject, AudioMediaObject, VideoMediaObject, ImageMediaObject],
        {image: 3, text: 1, video: 1, audio: 1}
    ),
    randomVisualPlayer = new RandomVisualPlayer(playerElem, mediaObjectQueue),
    randomAudioPlayer = new RandomAudioPlayer(mediaObjectQueue),
    sceneDisplayTimeout,
    sceneList,
    currentSceneIndex;

var socket;


function showError (message) {
    var msg = document.createElement('li');
    msg.classList.add('error');
    msg.innerText = message.toString();
    errors.appendChild(msg);
    msg.style.opacity = 1;
    setTimeout(function() {
        msg.addEventListener(transitionEventName, function() {
            errors.removeChild(msg);
        });
        msg.style.opacity = 0;
    }, 40 * message.length);
}

function nextScene () {
    var delay,
        sceneToLoad = sceneList[currentSceneIndex].name;

    socket.emit('loadSceneByName', sceneToLoad, handleError(function(scene) {
        if (! scene) {
            showError('Attempted to load scene "' + sceneToLoad + '" but it could not be found.');
            delay = 1000;
        } else {
            console.log('showing scene ' + scene.name);
{'fraction_non_alphanumeric': 0.13955071477195372, 'fraction_numerical': 0.005445881552076242, 'mean_word_length': 3.8761061946902653, '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': '2606069', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1180, 'n_words': 249}