PageSourceSearch

https://drink.irish/js/classes/SessionData.js?v=6cZEeQxOZ3FQVAQusiHsFfmSMbPpLpOowp65KvQAcOY

js drink.irish collected 2026-10-04 08:19:37 UTC 1,778 bytes, 66 lines download raw bytes

1class SessionData {
2	constructor() {
3		this.venueFiltersKey = 'VenueFilters';
4		this.producerFiltersKey = 'ProducerFilters';
5		this.lastSelectedProducerIdKey = 'LastSelectedProducerId';
6		this.lastSelectedVenueIdKey = 'LastSelectedVenueId';
7	}
8
9	removeItemFromSession(key) {
10		return window.localStorage.removeItem(key);
11	}
12
13	getItemFromSession(key) {
14		return window.localStorage.getItem(key);
15	}
16	
17	getIntItemFromSession(key) {
18		const rawItem = this.getItemFromSession(key);
19		return !isNaN(rawItem) ? parseInt(rawItem) : null;
20	}
21
22	setSessionItem(key, item) {
23		if (item === null)
24			this.removeItemFromSession(key);
25		else
26			window.localStorage.setItem(key, item);
27	}
28
29	get venueFilters() {
30		return JSON.parse(this.getItemFromSession(this.venueFiltersKey));
31	}
32
33	set venueFilters(filters) {
34		if (filters === null || filters === undefined)
35			this.removeItemFromSession(this.venueFiltersKey);
36		else
37			this.setSessionItem(this.venueFiltersKey, JSON.stringify(filters));
38	}
39
40	get producerFilters() {
41		return JSON.parse(this.getItemFromSession(this.producerFiltersKey));
42	}
43
44	set producerFilters(filters) {
45		if (filters === null || filters === undefined)
46			this.removeItemFromSession(this.producerFiltersKey);
47		else
48			this.setSessionItem(this.producerFiltersKey, JSON.stringify(filters));
49	}
50
51	get lastSelectedProducerId() {
52		return this.getIntItemFromSession(this.lastSelectedProducerIdKey);
53	}
54
55	set lastSelectedProducerId(id) {
56		return this.setSessionItem(this.lastSelectedProducerIdKey, id);
57	}
58
59	get lastSelectedVenueId() {
60		return this.getIntItemFromSession(this.lastSelectedVenueIdKey);
61	}
62
63	set lastSelectedVenueId(id) {
64		return this.setSessionItem(this.lastSelectedVenueIdKey, id);
65	}
66}

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.