PageSourceSearch

https://www.jcdecaux-cityscape.hk/modules/custom/jcdecaux_block/js/jcdecaux_block_cookie_banner.js?v=10.4.5

js jcdecaux-cityscape.hk collected 2026-09-29 09:00:28 UTC 1,133 bytes, 36 lines download raw bytes

1/**
2 * @file
3 * Contains js logic for cookie banner.
4 */
5
6(function ($, Drupal, drupalSettings, Cookies) {
7  'use strict';
8
9  Drupal.behaviors.jcdecauxBlockCookieBanner = {
10    attach: function (context, settings) {
11
12      $(once('jcdecauxBlockCookieBanner', '#cookie-banner-wrapper .cookie-banner')).each(function () {
13        var $this = $(this);
14
15        if (Cookies.get('cookies_enabled') == null) {
16          $this.removeClass('disabled');
17        }
18        if (typeof drupalSettings.JCDecaux !== 'undefined'
19          && typeof drupalSettings.JCDecaux.cookieLifeTime !== 'undefined') {
20          $('#cookie-banner-wrapper .btn-ok').click(function () {
21            var date = new Date();
22            var cookieLife = 86400 * 30 * 1000;
23            var lifeTime = drupalSettings.JCDecaux.cookieLifeTime;
24            date.setTime(date.getTime() + (cookieLife * parseInt(lifeTime)));
25            Cookies.set('cookies_enabled', 'true', {
26              path: '/', expires: date
27            });
28            $this.addClass('disabled');
29          });
30        }
31
32      });
33    }
34  };
35
36}(jQuery, Drupal, drupalSettings, window.Cookies));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.