templates/layout/js/app.js.twig line 1

Open in your IDE?
  1. {{ include('layout/js/cookies.js.twig') }}
  2. axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  3. axios.defaults.headers.common['Accept'] = 'application/json';
  4. axios.defaults.headers.common['Content-Type'] = 'application/json';
  5. jQuery(document).ready(function ($) {
  6.     $('input[type="file"]').next(".custom-file-label").text('{{ 'meta.file_browse'|trans({}, 'forms') }}');
  7.     $(document).on('change', 'input[type="file"]', function (e) {
  8.         var files = e.target.files;
  9.         var fileNames = '';
  10.         $.each(files, function(key, file) {
  11.             fileNames += file.name+' ';
  12.         });
  13.         if (fileNames != undefined || fileNames != "") {
  14.             $(this).next(".custom-file-label").attr('data-content', fileNames);
  15.             $(this).next(".custom-file-label").text(fileNames);
  16.         }
  17.     });
  18.     $(".confirmDelete").click(function () {
  19.         $text = $(this).data('delete-text') !== undefined ? $(this).data('delete-text') : "{{ 'meta.confirm_delete'|trans|raw }}";
  20.         return confirm($text);
  21.     });
  22.     $('#remoteModal').on('show.bs.modal', function (e) {
  23.         $(this).find('.modal-remote-data').html('<div class="alert alert-info" role="alert">\n' +
  24.             '{{ 'loading'|trans }}' +
  25.             '</div>');
  26.         $(this).find('.modal-title').text(e.relatedTarget.getAttribute('data-title'));
  27.         $(this).find('.modal-remote-data').load(e.relatedTarget.href);
  28.     });
  29.     // adult warning popup
  30.     $('#warningcontainer .accept-popup').click(function (event) {
  31.         createCookie('adult_warning_accepted', '1', 365);
  32.     });
  33.     $('#warningcontainer .close-popup').click(function (event) {
  34.         event.preventDefault();
  35.         $('#warningcontainer').hide();
  36.     });
  37. });