templates/Theme/base.html.twig line 1

Open in your IDE?
  1. {# Used to pass value of heading to both current page and to included nav for responsive needs #}
  2. {% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
  3. {% set heading %}
  4.     {% block heading %}{% endblock %}
  5. {% endset %}
  6. <!DOCTYPE html>
  7. <html lang="fr">
  8. <head>
  9.     <title>
  10.         {% block title %}Libérez-vous des contraintes et simplifiez vous les démarches
  11.         {% endblock %}
  12.         - Riposte Système
  13.     </title>
  14.     <!-- Required meta tags -->
  15.     <meta charset="utf-8">
  16.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  17.     <meta name="description"
  18.           content="Libérez-vous des contraintes et simplifiez vous les démarches. Nous vous assistons pour tout régler en quelques clics, sans vous déplacer !"/> {% block metas %}{% endblock %}
  19.     {#    <script #}
  20.     {#            src="https://code.jquebry.com/jquery-3.6.0.min.js" #}
  21.     {#            integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" #}
  22.     {#            crossorigin="anonymous"></script> #}
  23.     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
  24.             integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  25.     <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"
  26.             integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E=" crossorigin="anonymous"></script>
  27.     <!-- Bootstrap CSS -->
  28.     {# <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> #}
  29.     {{ encore_entry_link_tags('app') }}
  30.     {# START: OLD STYLESHEETS #}
  31.     <link rel="icon" href="{{ asset('assets/img/icone.png') }}"/>
  32.     <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet">
  33.     <link
  34.             rel="stylesheet" href="{{ asset('assets/lib/bootstrap-select/css/bootstrap-select.min.css') }}"/>
  35.     {#    <link rel="stylesheet" href="{{ asset('assets/lib/bootstrap-tokenfield/bootstrap-tokenfield.min.css') }}"/> #}
  36.     <link rel="stylesheet"
  37.           href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/css/bootstrap-tokenfield.min.css"/>
  38.     <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.4.5/css/fileinput.min.css" media="all"
  39.           rel="stylesheet" type="text/css"/>
  40.     <link rel="stylesheet" href="{{ asset('assets/css/commons/calendar.css') }}"/>
  41.     <link rel="stylesheet" href="{{ asset('assets/lib/jquery/prettydropdowns.css') }}">
  42.     <link rel="stylesheet" href="{{ asset('assets/lib/jquery/nice-select.css') }}">
  43.     <link rel="stylesheet" href="{{ asset('assets/lib/timepicki/timepicki.css') }}">
  44.     <link rel="stylesheet" href="{{ asset('assets/css/commons/footer.css') }}"/>
  45.     <link rel="stylesheet" href="{{ asset('assets/css/commons/custom.css') }}"/>
  46.     <link rel="stylesheet" href="{{ asset('assets/css/commons/buttons.css') }}"/>
  47.     <link rel="stylesheet" href="{{ asset('assets/css/user/homeMobile.css') }}"/>
  48.     <link href="//rawgithub.com/indrimuska/jquery-editable-select/master/dist/jquery-editable-select.min.css"
  49.           rel="stylesheet">
  50.     <link rel="stylesheet" href="{{ asset('assets/lib/bootstrap-toogle/css/bootstrap-toggle.min.css') }}"/>
  51.     <link rel="stylesheet" href="https://printjs-4de6.kxcdn.com/print.min.css"/>
  52.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css"/>
  53.     <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css">
  54.     {# END: OLD STYLESHEETS #}
  55.     {# START: OLD SCRIPTS #}
  56.     {% if app.environment != 'dev' %}
  57.         <script async src="https://www.googletagmanager.com/gtag/js?id=UA-115905831-1"></script>
  58.         <script>
  59.             window.dataLayer = window.dataLayer || [];
  60.             function gtag() {
  61.                 dataLayer.push(arguments);
  62.             }
  63.             gtag('js', new Date());
  64.             gtag('config', 'UA-115905831-1');
  65.         </script>
  66.     {% endif %}
  67.     {# END: OLD SCRIPTS #}
  68.     {% block stylesheets %}{% endblock %}
  69. </head>
  70. <body>
  71. {% if is_granted('ROLE_USER') %}
  72.     {% include "Theme/sidebar.html.twig" %}
  73. {% endif %}
  74. <section class="main">
  75.     {% include "Theme/navbar.html.twig" with { heading: heading} %}
  76.     {% if breadcrumbExpress is defined %}
  77.         {% include 'Theme/breadcrumbExpressDisaster.html.twig' %}
  78.     {% endif %}
  79.     {# {% if breadcrumbComplaintExpress is defined and not(currentPath starts with '/express/') %}
  80.         {% include 'Theme/breadcrumbExpressComplaint.html.twig' %}
  81.     {% endif %} #}
  82.     {% for label, messages in app.flashes %}
  83.         {% for key, message in messages %}
  84.             <div class="modal modalAlert show" style="display:block;">
  85.                 <div class="modal-dialog modal-{{ label }}">
  86.                     <div class="modal-content">
  87.                         {# <div class="modal-header">
  88.                             <div class="icon-box">
  89.                                 {% if label == "success" %}
  90.                                     <i class="fa fa-check"></i>
  91.                                 {% else %}
  92.                                     <i class="fa fa-times"></i>
  93.                                 {% endif %}
  94.                             </div>
  95.                             {% if label == "success" %}
  96.                                 <h4 class="modal-title">Félicitations</h4>
  97.                             {% else %}
  98.                                 <h4 class="modal-title">Attention</h4>
  99.                             {% endif %}
  100.                         </div> #}
  101.                         <div class="modal-body pt-0">
  102.                             <h4 class="text-start blue fw-bold">
  103.                                 {% if label == "success" %}
  104.                                     Félicitations
  105.                                 {% elseif label == "success_delete" %}
  106.                                     Clôture de compte
  107.                                 {% else %}
  108.                                     Attention
  109.                                 {% endif %}
  110.                             </h4>
  111.                             <br/>
  112.                             
  113.                             <p class="text-start mt-5">{{message}}</p>
  114.                             <div class="row">
  115.                                 <div class="col-md-12 text-left position-static">
  116.                                     <button data-bs-dismiss="modal" class="btn btn-outline-danger" style="top:5px"
  117.                                         onclick="$(this).parent().parent().parent().parent().parent().parent().hide()">
  118.                                         <i class="fas fa-times"></i>
  119.                                     </button>
  120.                                 </div>
  121.                             </div>
  122.                         </div>
  123.                     </div>
  124.                 </div>
  125.             </div>
  126.             {# <p class='alert alertLayout alert-{{label}}'>{{message}}</p> #}
  127.         {% endfor %}
  128.     {% endfor %}
  129.     <main class="content main_content card {{ 'user_' in app.request.get('_route') or app.request.get('_route') == 'page_display' ? 'mt-0 mx-md-5' : '' }} {{ app.request.query.get('complaint') == 1 or (currentPath starts with '/express/') ? 'express_complaint_steps' : '' }} {{ breadcrumbComplaintExpress is not defined ? 'p-0': '' }}">
  130.         {% if not (currentPath starts with '/express/') and not (currentPath starts with '/login') and ((heading ~ '')|trim) != '' %}
  131.             <div class="card-header bg-primary text-white text-center col-12 d-none d-sm-none d-md-none d-lg-block d-xl-block d-xxl-block">
  132.                 <h2 class="fw-bold">
  133.                     {{ heading }}
  134.                 </h2>
  135.             </div>
  136.         {% endif %}
  137.         {% if app.request.query.get('complaint') == 1 or  (breadcrumbComplaintExpress is defined and currentPath starts with '/express/') %}
  138.             {% include 'Theme/breadcrumbExpressComplaint.html.twig' %}
  139.         {% endif %}
  140.         <div class="container {{ 'user_' in app.request.get('_route') or app.request.get('_route') == 'page_display' ? 'px-0' : 'px-4' }} {{ breadcrumbComplaintExpress is defined ? '' : '' }}">
  141.             <div class="card-body {{ currentPath starts with '/express/' and app.request.get('_route') != 'express_complaint_register' ? 'pb-0 pb-5  pt-0' : '' }} {{ 'user_' in app.request.get('_route') or app.request.get('_route') == 'page_display' ? 'w-100 mt-0 mb-5 ms-0 p-0 pb-4 px-4' : '' }} {{ 'user_homepage' == app.request.get('_route') ? 'card-cancel' : '' }}{{ app.request.get('_route') == 'express_complaint_x_identity' and expressStep == 3 ? 'mx-3 w-100' : '' }}"> {% block body %}{% endblock %}</div>
  142.         </div>
  143.     </main>
  144.     {% include "Theme/footer.html.twig" %}
  145. </section>
  146.     <!-- Optional JavaScript; choose one of the two! -->
  147.     {{ encore_entry_script_tags('app') }}{# {% block javascripts %}{% endblock %} #}
  148.     <!-- Option 1: Bootstrap Bundle with Popper -->
  149.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"
  150.             integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ"
  151.             crossorigin="anonymous"></script>
  152.     <!-- Option 2: Separate Popper and Bootstrap JS -->
  153.     <!--
  154.                                                                                                                                                                                                                 <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js" integrity="sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN" crossorigin="anonymous"></script>
  155.                                                                                                                                                                                                             <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/" crossorigin="anonymous"></script>
  156.                                                                                                                                                                                                             -->
  157.     {# START: OLD SCRIPTS #}
  158.     <script type="text/javascript" src="{{ asset('assets/lib/bootstrap/js/bootstrap.js') }}"></script>
  159.     <script type="text/javascript" src="{{ asset('assets/lib/bootstrap-select/js/bootstrap-select.min.js') }}"></script>
  160.     <script type="text/javascript" src="{{ asset('assets/lib/bootstrap-select/js/i18n/defaults-fr_FR.min.js') }}"></script>
  161.     <script type="text/javascript" src="{{ asset('assets/lib/bootstrap-toogle/js/bootstrap-toggle.min.js') }}"></script>
  162.     {# <script type="text/javascript" src="{{ asset('assets/lib/bootstrap-tokenfield/bootstrap-tokenfield.min.js') }}"></script> #}
  163.     <script type="text/javascript"
  164.             src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tokenfield/0.12.0/bootstrap-tokenfield.min.js"></script>
  165.     <script type="text/javascript"
  166.             src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.14/jquery.datetimepicker.full.min.js"></script>
  167.     <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.4.5/js/fileinput.min.js"></script>
  168.     <script type="text/javascript" src="{{ asset('assets/lib/jquery/jquery.matchHeight.js') }}"></script>
  169.     <script type="text/javascript" src="{{ asset('assets/lib/jquery/jquery.autoresize.js') }}"></script>
  170.     <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.4.5/js/locales/fr.js"></script>
  171.     <script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
  172.     <script src="{{ asset('assets/lib/jquery/jquery.nice-select.js') }}"></script>
  173.     <script src="{{ asset('assets/lib/jquery/jquery.prettydropdowns.js') }}"></script>
  174.     <script src="{{ asset('assets/lib/jquery/jquery.editable-select.js') }}"></script>
  175.     <script type="text/javascript" src="{{ asset('assets/js/user/home.js') }}"></script>
  176.     <script type="text/javascript" src="{{ asset('assets/lib/jquery/jquery.validate.min.js') }}"></script>
  177.     <script type="text/javascript" src="{{ asset('assets/lib/jquery/messages_fr.js') }}"></script>
  178.     <script type="text/javascript" src="{{ asset('assets/lib/timepicki/timepicki.js') }}"></script>
  179.     <script type="text/javascript">
  180.         // (function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
  181.         //     w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
  182.         //         m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
  183.         // })(window,document,'script','http://127.0.0.1:8000/index.php/mtc.js','mt');
  184.         //
  185.         // mt('send', 'pageview');
  186.         $("input[type='file']").fileinput({
  187.             shareIn: "popup",
  188.             language: "fr",
  189.             showRemove: false,
  190.             showUpload: false,
  191.             initialPreviewConfig: [
  192.                 {
  193.                     caption: "false",
  194.                     size: false
  195.                 },
  196.             ],
  197.             layoutTemplates: {
  198.                 btnBrowse: '<div tabindex="500" class="{css}"{status}>{icon}</div>'
  199.             }
  200.         });
  201.         /**
  202.         * This function override original history.back() function and handle custom redirects
  203.         * depending on which page visitor is
  204.         */
  205.         function customHistoryBack() {
  206.             if (window.location.pathname === '{{ path('express_disaster_declaration_params') }}') {
  207.                 window.location.href = '{{ path('homepage') }}';
  208.             } else {
  209.                 history.back();
  210.             }
  211.         }
  212.     </script>
  213.     <script type="text/javascript">
  214.         $(document).ready(function () {
  215.             $(document).on("keydown", ":input:not(textarea)", function (event) {
  216.                 return event.key != "Enter";
  217.             });
  218.             var formHasChanged = false;
  219.             var submitted = false;
  220.             $(document).on('change', 'form input, form select, form textarea', function (e) {
  221.                 formHasChanged = true;
  222.             });
  223.     // form change validation on page change
  224.     // window.onbeforeunload = function (e) {
  225.     //     if (formHasChanged && !submitted && !$(document.activeElement).hasClass('allowedLeave')) {
  226.     //         var message = "You have not saved your changes.", e = e || window.event;
  227.     //         if (e) {
  228.     //             e.returnValue = message;
  229.     //         }
  230.     //         return message;
  231.     //     }
  232.     // };
  233.         $("form").submit(function () {
  234.             submitted = true;
  235.         });
  236.         $.validator.addMethod('currency', function (value, element, regexp) {
  237.             var re = /^\d{1,9}(\.\d{1,2})?$/;
  238.             return this.optional(element) || re.test(value);
  239.         }, '');
  240.         $.validator.messages.currency = 'Veuillez entrer un montant en chiffre';
  241.         $.validator.addMethod('imei', function (value, element, regexp) {
  242.             var re = /^\d{1,17}(\.\d{1,2})?$/;
  243.             return this.optional(element) || re.test(value);
  244.         }, '');
  245.         $.validator.messages.imei = 'Veuillez entrer une suite de chiffres';
  246.         $('form').validate({
  247.             ignoreTitle: true,
  248.             errorPlacement: function (error, element) {
  249.                 error.appendTo(element.closest('.form-group'));
  250.             },
  251.             rules: {
  252.                 "App_complaintx[prejudiceEstimate]": {
  253.                     "required": true,
  254.                     "currency": true
  255.                 },
  256.                 "App_item[estimateValue]": {
  257.                     "required": false,
  258.                     "currency": true
  259.                 },
  260.                 "App_item[imeiNumber]": {
  261.                     "imei": true,
  262.                     "minlength": 15,
  263.                     "maxlength": 17
  264.                 }
  265.             }
  266.         });
  267. // $.each($('.rowForm select.niceSelect'), function(index, input){
  268. // if(!$(input).val()){
  269. //    $(input).append('<option selected disabled hidden>'+$(input).attr('placeholder')+'</option>');
  270. // }
  271. // });
  272.         $(".timepickiinput").timepicki({
  273.             show_meridian: false,
  274.             validate: true,
  275.             min_hour_value: 0,
  276.             max_hour_value: 23,
  277.             step_size_minutes: 5,
  278.             increase_direction: 'up',
  279.             disable_keyboard_mobile: true,
  280.             start_time: ["12", "00"]
  281.         });
  282.         {% if app.user %}{% if app.user.isBeginner %}Init.initToolTip($('input,textarea,.tooltipHelper'));
  283.         {% endif %}$.each($('input.tokenfield'), function (index, input) {
  284.             Init.initTokenField(input);
  285.             Init.tokenTitle(input, {{ (app.user.isBeginner) ? "true" : "false" }});
  286.         });
  287.         {% endif %}$(".editableSelect").editableSelect({'startWith': true});
  288. // $(".niceSelect").niceSelect();
  289.         $.each($('.placeholding').prev('input'), function (index, input) {
  290.             $(input).focus(function () {
  291.                 $(input).next('label').addClass('label-valid');
  292.             });
  293.             $(input).blur(function () {
  294.                 if (!$(input).val()) {
  295.                     $(input).next('label').removeClass('label-valid');
  296.                 }
  297.             });
  298.         });
  299.         $.each($('.placeholding').prev('textarea'), function (index, input) {
  300.             $(input).focus(function () {
  301.                 $(input).next('label').addClass('label-valid');
  302.             });
  303.             $(input).blur(function () {
  304.                 if (!$(input).val()) {
  305.                     $(input).next('label').removeClass('label-valid');
  306.                 }
  307.             });
  308.         });
  309.         $.each($('label').prev('.tokenfield'), function (index, block) {
  310.             Init.tokenLabel(block);
  311.         });
  312.         $.each($('select.niceSelect'), function (index, select) {
  313.             var $label = $(select).siblings('label');
  314.             if (!$(select).val() || $.isEmptyObject($(select).val())) {
  315.                 $label.removeClass("label-valid");
  316.             } else {
  317.                 $label.addClass("label-valid");
  318.             }
  319.         });
  320.         $('.containerForm, .containerMobile').on('change', 'select', function () {
  321.             var $label = $(this).next('label');
  322.             if (!$(this).val() || $.isEmptyObject($(this).val())) {
  323.                 $label.removeClass("label-valid");
  324.             } else {
  325.                 $label.addClass("label-valid");
  326.             }
  327.         });
  328.         $('.containerForm, .containerMobile').on('focus', '.editableSelect', function () {
  329.             var $label = $(this).next('label');
  330.             $label.addClass("label-valid");
  331.         });
  332.         $('.containerForm, .containerMobile').on('blur', '.editableSelect', function () {
  333.             if (!$(this).val()) {
  334.                 $(this).next('label').removeClass('label-valid');
  335.             }
  336.         });
  337.         setTimeout(function () {
  338.             if ($('.modalAlert').length > 0) {
  339.                 $('.modalAlert').remove();
  340.             }
  341.         }, 10000);
  342.         const modalCloses = document.querySelectorAll('.modal-close');
  343.         modalCloses.forEach((modalClose) => {
  344.             modalClose.addEventListener('click', () => {
  345.                 modalClose.parentElement.parentElement.parentElement.parentElement.remove();
  346.             })
  347.         });
  348.     });
  349. </script>
  350.     {# <script type="text/javascript" src="{{asset('assets/lib/carousel/jquery.waterwheelCarousel.js')}}" ></script> #}
  351.     {#    <script src="https://unpkg.com/simplebar@latest/dist/simplebar.js"></script> #}
  352.     {% block javascripts %}{% endblock %}
  353.     {# <!--Start of Tawk.to Script-->
  354.     <script type="text/javascript">
  355.     {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
  356.         var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
  357.         (function () {
  358.             var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
  359.             s1.async = true;
  360.             s1.src = 'https://embed.tawk.to/5a8eed9cd7591465c707eb55/default';
  361.             s1.charset = 'UTF-8';
  362.             s1.setAttribute('crossorigin', '*');
  363.             s0.parentNode.insertBefore(s1, s0);
  364.         })();
  365.         Tawk_API = Tawk_API || {};
  366.         Tawk_API.visitor = {
  367.             name: '{{app.user.firstname~" "~app.user.lastname}}',
  368.             email: '{{app.user.email}}'
  369.         };
  370.     {% endif %}
  371.     </script> #}
  372.     <link rel="stylesheet" type="text/css"
  373.         href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css"/>
  374.     <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
  375.     {# <script src="https://maps.googleapis.com/maps/api/js?key={{ googleApiKey }}&libraries=places"></script> #}
  376.     {#      <script type="text/javascript" src="{{ asset('assets/js/gmaps.js')}}" ></script> #}
  377.     <script type="text/javascript">
  378.         window.addEventListener("load", function () {
  379.             $('.choice img').on('mouseenter', function () {
  380.                 $(this).attr('src', $(this).attr('src').replace('info.svg', 'info_hover.svg'));
  381.             }).on('mouseleave', function () {
  382.                 $(this).attr('src', $(this).attr('src').replace('info_hover.svg', 'info.svg'));
  383.             });
  384.             if(window.cookieconsent.initialise ) {
  385.                 
  386.                 window.cookieconsent.initialise({
  387.                     "palette": {
  388.                         "popup": {
  389.                             "background": "#051a45"
  390.                         },
  391.                         "button": {
  392.                             "background": "#ffff",
  393.                             "text": "#051a45"
  394.                         }
  395.                     },
  396.                     "content": {
  397.                         "message": "En poursuivant votre navigation sur ce site, vous acceptez l’utilisation des cookies pour vous proposer la meilleure expérience utilisateur.",
  398.                         "dismiss": "ACCEPTER",
  399.                         "link": "En savoir plus"
  400.                     }
  401.                 });
  402.             }
  403.         });
  404.         const tokens = document.querySelectorAll('.textarea-tokens');
  405.         for(const token of tokens) {
  406.             const div = document.createElement('div');
  407.             div.classList.add('textarea-tokens-close')
  408.             token.parentNode.append(div);
  409.         }
  410.         function updateToken(token) {
  411.             token.nextElementSibling.innerHTML = '';
  412.             values = token.value.split('\n');
  413.             for( const index in values ) {
  414.                 const span = document.createElement('span');
  415.                 span.dataset.index = index;
  416.                 span.innerHTML = 'x';
  417.                 token.nextElementSibling.append(span);
  418.                 span.addEventListener('click', () => {
  419.                     if( values.length === 1 ) {
  420.                         token.value = '';
  421.                         token.nextElementSibling.innerHTML = '';
  422.                     } else {
  423.                         values.splice(span.dataset.index, 1);
  424.                         token.value = values.join('\n');
  425.                         updateToken(token);
  426.                     }
  427.                 })
  428.             }
  429.             token.style.height = calcTokenHeight(token.value) + "px"
  430.         }
  431.         function calcTokenHeight(value) {
  432.             let numberOfLineBreaks = (value.match(/\n/g) || []).length;
  433.             return 20 + numberOfLineBreaks * 20 + 16 + 2;
  434.         }
  435.     </script>
  436.     <script>
  437.         const previews = document.querySelectorAll('.previewImgVich');
  438.         function verifyImage( preview, attempt = 1 ) {
  439.             if( attempt > 5 ) {
  440.                 return;
  441.             }
  442.             if( preview.dataset.error == 1) {
  443.                 const item = preview.parentNode.parentNode.parentNode.parentNode.parentNode;
  444.                 const parent = item.parentNode.removeChild(item)
  445.                 return;
  446.             }
  447.             setTimeout( () => { verifyImage(preview, attempt + 1) }, 1000 );
  448.         }
  449.         if( typeof doNotVerifyImage === 'undefined' || !doNotVerifyImage ) {
  450.             for(const preview of previews) {
  451.                 verifyImage(preview);
  452.             }
  453.         }
  454.         $('.item .btn-group .btn').hover(function() {
  455.             $(this).prev().addClass('hover')
  456.         }, function() {
  457.             $(this).prev().removeClass('hover')
  458.         });
  459.     </script>
  460.     <script>
  461.         if( document.querySelectorAll('.input_icon:not(.no-resize)').length > 0 ) {
  462.             window.onresize = () => {
  463.                 resetIconCardSquare();
  464.                 makeIconCardSquare();
  465.             };
  466.             function resetIconCardSquare() {
  467.                 for( const inputIcon of document.querySelectorAll('.input_icon:not(.no-resize)') ) {
  468.                     inputIcon.style.height = null;
  469.                     inputIcon.style.width = null;
  470.                 }
  471.             }
  472.             function makeIconCardSquare() {
  473.                 let minWidth = 1000;
  474.                 for( const inputIcon of document.querySelectorAll('.input_icon:not(.no-resize)') ) {
  475.                     minWidth = Math.min(minWidth, inputIcon.clientWidth);
  476.                 }
  477.                 if( minWidth === 0 ) {
  478.                     setTimeout(makeIconCardSquare, 200);
  479.                     return
  480.                 }
  481.                 if( typeof fixWith !== 'undefined' )
  482.                     minWidth = 100;
  483.                 if (minWidth < 100) {
  484.                     minWidth = 100;
  485.                 }
  486.                 for( const inputIcon of document.querySelectorAll('.input_icon:not(.no-resize)') ) {
  487.                     inputIcon.style.height = `${minWidth}px`;
  488.                     inputIcon.style.width = `${minWidth}px`;
  489.                     inputIcon.style.minWidth = `${minWidth}px`;
  490.                     //inputIcon.parentNode.style.width = `${minWidth}px`;
  491.                 }
  492.             }
  493.             makeIconCardSquare();
  494.         }
  495.     </script>
  496. <!--End of Tawk.to Script-->
  497. </body>
  498. </html>