PageSourceSearch

https://agnesfrijlink.nl/assets/js/jquery.cookie.js

js agnesfrijlink.nl collected 2026-10-02 23:22:32 UTC 1,828 bytes, 71 lines download raw bytes

1/*!
2 * jQuery Cookie Plugin v1.3
3 * https://github.com/carhartl/jquery-cookie
4 *
5 * Copyright 2011, Klaus Hartl
6 * Dual licensed under the MIT or GPL Version 2 licenses.
7 * http://www.opensource.org/licenses/mit-license.php
8 * http://www.opensource.org/licenses/GPL-2.0
9 */
10(function ($, document, undefined) {
11
12	var pluses = /\+/g;
13
14	function raw(s) {
15		return s;
16	}
17
18	function decoded(s) {
19		return decodeURIComponent(s.replace(pluses, ' '));
20	}
21
22	var config = $.cookie = function (key, value, options) {
23
24		// write
25		if (value !== undefined) {
26			options = $.extend({}, config.defaults, options);
27
28			if (value === null) {
29				options.expires = -1;
30			}
31
32			if (typeof options.expires === 'number') {
33				var days = options.expires, t = options.expires = new Date();
34				t.setDate(t.getDate() + days);
35			}
36
37			value = config.json ? JSON.stringify(value) : String(value);
38
39			return (document.cookie = [
40				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
41				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
42				options.path    ? '; path=' + options.path : '',
43				options.domain  ? '; domain=' + options.domain : '',
44				options.secure  ? '; secure' : ''
45			].join(''));
46		}
47
48		// read
49		var decode = config.raw ? raw : decoded;
50		var cookies = document.cookie.split('; ');
51		for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) {
52			if (decode(parts.shift()) === key) {
53				var cookie = decode(parts.join('='));
54				return config.json ? JSON.parse(cookie) : cookie;
55			}
56		}
57
58		return null;
59	};
60
61	config.defaults = {};
62
63	$.removeCookie = function (key, options) {
64		if ($.cookie(key) !== null) {
65			$.cookie(key, null, options);
66			return true;
67		}
68		return false;
69	};
70
71})(jQuery, document);

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.