templates/components/cookie-js.html.twig line 1

Open in your IDE?
  1. <script type="text/javascript" src="{{ asset('js/jquery.ihavecookies.js') }}?v={{ random() }}"></script>
  2. <script type="text/javascript">
  3.     var options = {
  4.         title: '&#x1F36A; I mi koristimo kolačiće &#128526;',
  5.         message: 'Koristimo kolačiće u svrhu pružanja boljeg korisničkog iskustva na stranici. Ukoliko nastavite s pregledavanjem ove stranice pretpostavit ćemo da se slažete s tim. Pročitajte više na sljedećem linku:',
  6.         delay: 600,
  7.         expires: 1,
  8.         link: '{{ path('web_info', {'slug': 'pravila-o-kolacicima'}) }}',
  9.         onAccept: function(){
  10.             var myPreferences = $.fn.ihavecookies.cookie();
  11.             console.log('Yay! The following preferences were saved...');
  12.             console.log(myPreferences);
  13.         },
  14.         uncheckBoxes: true,
  15.         acceptBtnLabel: 'Prihvati',
  16.         moreInfoLabel: 'Više o kolačićima',
  17.         cookieTypesTitle: 'Odaberite kolačiće koje želite prihvatiti',
  18.         fixedCookieTypeLabel: 'Nužni',
  19.         fixedCookieTypeDesc: 'These are essential for the website to work correctly.'
  20.     }
  21.     $(document).ready(function() {
  22.         $('body').ihavecookies(options);
  23.         if ($.fn.ihavecookies.preference('marketing') === true) {
  24.             console.log('This should run because marketing is accepted.');
  25.         }
  26.         $('#ihavecookiesBtn').on('click', function(){
  27.             $('body').ihavecookies(options, 'reinit');
  28.         });
  29.     });
  30. </script>