PageSourceSearch

https://mediatheque-uzerche.fr/core/misc/jquery.cookie.shim.js?v=8.9.0

js mediatheque-uzerche.fr collected 2026-10-07 15:40:03 UTC 2,684 bytes, 88 lines download raw bytes

1/**
2* DO NOT EDIT THIS FILE.
3* See the following change record for more information,
4* https://www.drupal.org/node/2815083
5* @preserve
6**/
7
8(function ($, Drupal, cookies) {
9  var isFunction = function isFunction(obj) {
10    return Object.prototype.toString.call(obj) === '[object Function]';
11  };
12
13  var parseCookieValue = function parseCookieValue(value, parseJson) {
14    if (value.indexOf('"') === 0) {
15      value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
16    }
17
18    try {
19      value = decodeURIComponent(value.replace(/\+/g, ' '));
20      return parseJson ? JSON.parse(value) : value;
21    } catch (e) {}
22  };
23
24  var reader = function reader(cookieValue, cookieName, converter, readUnsanitized, parseJson) {
25    var value = readUnsanitized ? cookieValue : parseCookieValue(cookieValue, parseJson);
26
27    if (converter !== undefined && isFunction(converter)) {
28      return converter(value, cookieName);
29    }
30
31    return value;
32  };
33
34  $.cookie = function (key) {
35    var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
36    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
37
38    key = key && !$.cookie.raw ? encodeURIComponent(key) : key;
39    if (value !== undefined && !isFunction(value)) {
40      var attributes = Object.assign({}, $.cookie.defaults, options);
41
42      if (typeof attributes.expires === 'string' && attributes.expires !== '') {
43        attributes.expires = new Date(attributes.expires);
44      }
45
46      var cookieSetter = cookies.withConverter({
47        write: function write(cookieValue) {
48          return encodeURIComponent(cookieValue);
49        }
50      });
51
52      value = $.cookie.json && !$.cookie.raw ? JSON.stringify(value) : String(value);
53
54      return cookieSetter.set(key, value, attributes);
55    }
56
57    var userProvidedConverter = value;
58    var cookiesShim = cookies.withConverter({
59      read: function read(cookieValue, cookieName) {
60        return reader(cookieValue, cookieName, userProvidedConverter, $.cookie.raw, $.cookie.json);
61      }
62    });
63
64    if (key !== undefined) {
65      return cookiesShim.get(key);
66    }
67
68    var results = cookiesShim.get();
69    Object.keys(results).forEach(function (resultKey) {
70      if (results[resultKey] === undefined) {
71        delete results[resultKey];
72      }
73    });
74
75    return results;
76  };
77
78  $.cookie.defaults = Object.assign({ path: '' }, cookies.defaults);
79
80  $.cookie.json = false;
81
82  $.cookie.raw = false;
83
84  $.removeCookie = function (key, options) {
85    cookies.remove(key, Object.assign({}, $.cookie.defaults, options));
86    return !cookies.get(key);
87  };
88})(jQuery, Drupal, 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.