<commit_before>function anError(error, showHTML) {
    var errorMsg = document.createElement('div');
    errorMsg.className = 'pnlm-info-box';
    var p = document.createElement('p');
    if (showHTML)
        p.innerHTML = error;
    else
        p.textContent = error;
    errorMsg.appendChild(p);
    document.getElementById('container').appendChild(errorMsg);
}

var viewer;
function parseURLParameters() {
    var URL;
    if (window.location.hash.length > 0) {
        // Prefered method since parameters aren't sent to server
        URL = window.location.hash.slice(1);
    } else {
        URL = window.location.search.slice(1);
    }
    if (!URL) {
        // Display error if no configuration parameters are specified
        anError('No configuration options were specified.');
        return;
    }
    URL = URL.split('&');
    var configFromURL = {};
    for (var i = 0; i < URL.length; i++) {
        var option = URL[i].split('=')[0];
        var value = URL[i].split('=')[1];
        if (value == '')
            continue; // Skip options with empty values in URL config
        switch(option) {
            case 'hfov': case 'pitch': case 'yaw': case 'haov': case 'vaov':
            case 'minHfov': case 'maxHfov': case 'minPitch': case 'maxPitch':
            case 'minYaw': case 'maxYaw': case 'vOffset': case 'autoRotate':
                configFromURL[option] = Number(value);
                break;
            case 'autoLoad': case 'ignoreGPanoXMP':
                configFromURL[option] = JSON.parse(value);
                break;
            case 'author': case 'title': case 'firstScene': case 'fallback':
            case 'preview': case 'panorama': case 'config':
                configFromURL[option] = decodeURIComponent(value);
                break;
            default:
                anError('An invalid configuration parameter was specified: ' + option);
                return;
        }
    }

    var request;

    // Check for JSON configuration file
    if (configFromURL.config) {
        // Get JSON configuration file
        request = new XMLHttpRequest();
        request.onload = function() {
            if (request.status != 200) {
                // Display error if JSON can't be loaded
                var a = document.createElement('a');
                a.href = configFromURL.config;<commit_msg>Adding to available features within configFromUrl keys for standalone iframe<commit_after>function anError(error, showHTML) {
    var errorMsg = document.createElement('div');
    errorMsg.className = 'pnlm-info-box';
    var p = document.createElement('p');
    if (showHTML)
        p.innerHTML = error;
    else
        p.textContent = error;
    errorMsg.appendChild(p);
    document.getElementById('container').appendChild(errorMsg);
}

var viewer;
function parseURLParameters() {
    var URL;
    if (window.location.hash.length > 0) {
        // Prefered method since parameters aren't sent to server
        URL = window.location.hash.slice(1);
    } else {
        URL = window.location.search.slice(1);
    }
    if (!URL) {
        // Display error if no configuration parameters are specified
        anError('No configuration options were specified.');
        return;
    }
    URL = URL.split('&');
    var configFromURL = {};
    for (var i = 0; i < URL.length; i++) {
        var option = URL[i].split('=')[0];
        var value = URL[i].split('=')[1];
        if (value == '')
            continue; // Skip options with empty values in URL config
        switch(option) {
            case 'hfov':
            case 'pitch':
            case 'yaw':
            case 'haov':
            case 'vaov':
            case 'minHfov':
            case 'maxHfov':
            case 'minPitch':
            case 'maxPitch':
            case 'minYaw':
            case 'maxYaw':
            case 'vOffset':
            case 'autoRotate':
                configFromURL[option] = Number(value);
                break;
            case 'autoLoad': 
            case 'ignoreGPanoXMP': 
            case 'compass':
            case 'showFullscreenCtrl':
            case 'showZoomCtrl':
            case 'keyboardZoom':
            case 'mouseZoom':
            case 'draggable':
            case 'showControls':
                configFromURL[option] = JSON.parse(value);
                break;
            case 'type':
            case 'author':
            case 'title':
            case 'firstScene':
            case 'fallback':
            case 'preview':
            case 'panorama':
            case 'config':
                configFromURL[option] = decodeURIComponent(value);
                break;
            default:
                anError('An invalid configuration parameter was specified: ' + option);
                return;
        }
    }

    var request;

    // Check for JSON configuration file
    if (configFromURL.config) {
        // Get JSON configuration file
        request = new XMLHttpRequest();
        request.onload = function() {
            if (request.status != 200) {
                // Display error if JSON can't be loaded
                var a = document.createElement('a');
                a.href = configFromURL.config;
{'fraction_non_alphanumeric': 0.11622554660529344, 'fraction_numerical': 0.0034522439585730723, 'mean_word_length': 1.8158747300215983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1527398', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1366, 'n_words': 388}