<commit_before><?php
defined('C5_EXECUTE') or die("Access Denied.");

/* @var Concrete\Core\Form\Service\Form $form */
$image = date('Ymd') . '.jpg';
$imagePath = Config::get('concrete.urls.background_feed') . '/' . $image;

$install_config = Config::get('install_overrides');
$uh = Core::make('helper/concrete/urls');
if ($install_config) {
    $_POST = $install_config;
}
?>
    <script type="text/javascript" src="<?= ASSETS_URL_JAVASCRIPT ?>/bootstrap/tooltip.js"></script>
    <script type="text/javascript" src="<?= ASSETS_URL_JAVASCRIPT ?>/jquery-cookie.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".launch-tooltip").tooltip({
                placement: 'bottom'
            });
        });
    </script>

    <div class="ccm-install-version">
        <span class="label label-info"><?= t('Version %s', Config::get('concrete.version')) ?></span>
    </div>

    <style type="text/css">
        body {
            background-image: url("<?=$imagePath?>");
        }
    </style>

<?php

if (isset($successMessage)) {
    ?>
    <script type="text/javascript">
        $(function () {
            NProgress.configure({ showSpinner: false });
            <?php
            for ($i = 1; $i <= count($installRoutines); ++$i) {
            $routine = $installRoutines[$i - 1];
            ?>
            ccm_installRoutine<?=$i?> = function () {
                <?php
                if ($routine->getText() != '') {
                ?>
                $("#install-progress-summary").html('<?=addslashes($routine->getText())?>');
                <?php
                }
                ?>
                $.ajax(
                    '<?=$view->url("/install", "run_routine", $installPackage, $routine->getMethod())?>',
                    {
                        dataType: 'json'
                    }
                )
                .fail(function (r) {
                    $("#install-progress-errors").append('<div class="alert alert-danger">' + r.responseText + '</div>');
                    $("#interstitial-message").addClass('animated fadeOut');
                    $("#install-progress-error-wrapper").addClass('animated fadeIn');
                })
                .done(function (r) {
                    if (r.error) {
                        $("#install-progress-errors").append('<div class="alert alert-danger">' + r.message + '</div>');
                        $("#interstitial-message").addClass('animated fadeOut');
                        $("#install-progress-error-wrapper").addClass('animated fadeIn');
                    } else {
                        NProgress.set(<?=$routine->getProgress()/100?>);
                        <?php
                        if ($i < count($installRoutines)) {
                        ?>
                        ccm_installRoutine<?=$i + 1?>();
                        <?php
                        } else {
                        ?>
                        $("#install-progress-summary").html('<?=t('All Done.')?>');
                        NProgress.done();
                        $('button[data-button=installation-complete]').prop('disabled', false).html('Edit Your Site <i class="fa fa-thumbs-up"></i>');

                        setTimeout(function() {
                            $("#interstitial-message").hide();
                            $("#success-message").show().addClass('animated fadeInDown');
                        },500);
                        <?php
                        }
                        ?>
                    }
                });
            }
            <?php
            }
            ?>
            ccm_installRoutine1();
        });
    </script>

    <div class="ccm-install-title">
        <ul class="breadcrumb">
            <li><?= t('Install concrete5') ?></li>
            <li class="active"><?= t('Installing...') ?></li>
        </ul>
    </div>

    <div id="ccm-install-intro">

        <div id="interstitial-message">
            <div class="panel panel-info">
                <div class="panel-heading"><?=t('While You Wait')?></div>
                <div class="panel-body">

                    <div class="media">
                        <div class="media-left" style="padding-right: 1em">
                            <i class="fa fa-comments-o fa-2x"></i><commit_msg>Invite users to not close the page during the install process<commit_after><?php
defined('C5_EXECUTE') or die("Access Denied.");

/* @var Concrete\Core\Form\Service\Form $form */
$image = date('Ymd') . '.jpg';
$imagePath = Config::get('concrete.urls.background_feed') . '/' . $image;

$install_config = Config::get('install_overrides');
$uh = Core::make('helper/concrete/urls');
if ($install_config) {
    $_POST = $install_config;
}
?>
    <script type="text/javascript" src="<?= ASSETS_URL_JAVASCRIPT ?>/bootstrap/tooltip.js"></script>
    <script type="text/javascript" src="<?= ASSETS_URL_JAVASCRIPT ?>/jquery-cookie.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".launch-tooltip").tooltip({
                placement: 'bottom'
            });
        });
    </script>

    <div class="ccm-install-version">
        <span class="label label-info"><?= t('Version %s', Config::get('concrete.version')) ?></span>
    </div>

    <style type="text/css">
        body {
            background-image: url("<?=$imagePath?>");
        }
    </style>

<?php

if (isset($successMessage)) {
    ?>
    <script type="text/javascript">
        $(function () {
            var inviteToStayHere = false;
            window.onbeforeunload = function() {
                if (inviteToStayHere) {
                    return <?=json_encode(t("concrete5 installation is still in progress: you shouldn't close this page at the moment"))?>;
                }
            };
            NProgress.configure({ showSpinner: false });
            <?php
            for ($i = 1; $i <= count($installRoutines); ++$i) {
            $routine = $installRoutines[$i - 1];
            ?>
            ccm_installRoutine<?=$i?> = function () {
                <?php
                if ($routine->getText() != '') {
                ?>
                $("#install-progress-summary").html('<?=addslashes($routine->getText())?>');
                <?php
                }
                ?>
                $.ajax(
                    '<?=$view->url("/install", "run_routine", $installPackage, $routine->getMethod())?>',
                    {
                        dataType: 'json'
                    }
                )
                .fail(function (r) {
                	inviteToStayHere = false;
                    $("#install-progress-errors").append('<div class="alert alert-danger">' + r.responseText + '</div>');
                    $("#interstitial-message").addClass('animated fadeOut');
                    $("#install-progress-error-wrapper").addClass('animated fadeIn');
                })
                .done(function (r) {
                    if (r.error) {
                    	inviteToStayHere = false;
                        $("#install-progress-errors").append('<div class="alert alert-danger">' + r.message + '</div>');
                        $("#interstitial-message").addClass('animated fadeOut');
                        $("#install-progress-error-wrapper").addClass('animated fadeIn');
                    } else {
                        NProgress.set(<?=$routine->getProgress()/100?>);
                        <?php
                        if ($i < count($installRoutines)) {
                        ?>
                        ccm_installRoutine<?=$i + 1?>();
                        <?php
                        } else {
                        ?>
                        inviteToStayHere = false;
                        $("#install-progress-summary").html('<?=t('All Done.')?>');
                        NProgress.done();
                        $('button[data-button=installation-complete]').prop('disabled', false).html('Edit Your Site <i class="fa fa-thumbs-up"></i>');

                        setTimeout(function() {
                            $("#interstitial-message").hide();
                            $("#success-message").show().addClass('animated fadeInDown');
                        },500);
                        <?php
                        }
                        ?>
                    }
                });
            }
            <?php
            }
            ?>
            inviteToStayHere = true;
            ccm_installRoutine1();
        });
    </script>

    <div class="ccm-install-title">
        <ul class="breadcrumb">
            <li><?= t('Install concrete5') ?></li>
            <li class="active"><?= t('Installing...') ?></li>
        </ul>
    </div>

    <div id="ccm-install-intro">

        <div id="interstitial-message">
            <div class="panel panel-info">
                <div class="panel-heading"><?=t('While You Wait')?></div>
                <div class="panel-body">

                    <div class="media">
                        <div class="media-left" style="padding-right: 1em">
                            <i class="fa fa-comments-o fa-2x"></i>
{'fraction_non_alphanumeric': 0.1737947545978888, 'fraction_numerical': 0.003155947328327348, 'mean_word_length': 1.451974386339381, 'pattern_counts': {'":': 0, '<': 128, '<?xml version=': 0, '>': 134, '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': '7539120', 'n_tokens_mistral': 2506, 'n_tokens_neox': 2381, 'n_words': 395}