<commit_before>{% extends 'NfqWeDriveBundle:Base:base.html.twig' %}
{% block  my_trip_list %} {% endblock %}
{% block  my_route_list %} {% endblock %}
{% block  my_notifications %} {% endblock %}

{% block panel_title %} Available trips {% endblock %}
{% block panel_body %}
    {% set show_join_column = 'false' %}
    {#{% include 'NfqWeDriveBundle:Trip:availableTripList.html.twig' with {'tripList' : availableTripList, 'show_join_column':'true' } only %}#}
    <script>
        $(document).ready(function () {
            var interval = 500;   //number of mili seconds between each call
            var lastPickedRoute;
            var refresh = function() {
                $.ajax({
                    url: "{{ path('nfq_wedrive_ajax_availableTrip_observer_list') }}",
                    cache: false,
                    success: function(html) {
                        $("#observer-trip-list").html(html);
                        $(".tripRow").each(function () {
                            $(this).click(function () {
                                var tripId = $(this).attr('id');
                                if (tripId != lastPickedRoute) {
                                    var coords = tripPoints[tripId];
                                    displayRoute(coords);
                                    lastPickedRoute = tripId;
                                    console.log("click");
                                }
                            })
                        });
                        setTimeout(function() {
                            refresh();
                        }, interval);
                    }
                });
            };
            refresh();
        });

    </script>
    <div id="observer-trip-list"></div>
{% endblock %}<commit_msg>Observer view scripts<commit_after>{% extends 'NfqWeDriveBundle:Base:base.html.twig' %}
{% block  my_trip_list %} {% endblock %}
{% block  my_route_list %} {% endblock %}
{% block  my_notifications %} {% endblock %}

{% block panel_title %} Available trips {% endblock %}
{% block panel_body %}
    {% set show_join_column = 'false' %}
    {#{% include 'NfqWeDriveBundle:Trip:availableTripList.html.twig' with {'tripList' : availableTripList, 'show_join_column':'true' } only %}#}
    <script>
            var routeInterval = 4000;
            var currentShownRoute = 0;
            var switching = false;

            var startSwitching = function () {
                var tripList = $("#AvailableTrips").children('tr');
                $(tripList[currentShownRoute]).addClass('bg-info');
                var tripId = $(tripList[currentShownRoute]).attr('id');
                var coords = tripPoints[tripId];
                displayRoute(coords);

                setInterval(function () {
                    var tripList = $("#AvailableTrips").children('tr');
                    $(tripList[currentShownRoute]).removeClass('bg-info');
                    if (tripList.length - 1 > currentShownRoute) {
                        currentShownRoute++;
                    } else {
                        currentShownRoute = 0;
                    }
                    $(tripList[currentShownRoute]).addClass('bg-info');
                    var tripId = $(tripList[currentShownRoute]).attr('id');
                    var coords = tripPoints[tripId];
                    displayRoute(coords);
                }, routeInterval);
                switching = true;
            };

        $(document).ready(function () {
            var interval = 10000;   //number of mili seconds between each call
            var lastPickedRoute;

            var refresh = function () {
                $.ajax({
                    url: "{{ path('nfq_wedrive_ajax_availableTrip_observer_list') }}",
                    cache: false,
                    success: function (html) {
                        $("#observer-trip-list").html(html);
                        $(".tripRow").each(function () {
                            $(this).click(function () {
                                var tripId = $(this).attr('id');
                                if (tripId != lastPickedRoute) {
                                    var coords = tripPoints[tripId];
                                    displayRoute(coords);
                                    lastPickedRoute = tripId;
                                }
                            });
                            if (!switching) {
                                startSwitching();
                            }
                        });
                        setTimeout(function () {
                            refresh();
                        }, interval);
                    }
                });
            };
            refresh();
        });

    </script>
    <div id="observer-trip-list"></div>
{% endblock %}
{'fraction_non_alphanumeric': 0.12283950617283951, 'fraction_numerical': 0.0030864197530864196, 'mean_word_length': 1.2277726856095326, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '257324', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1125, 'n_words': 206}