PageSourceSearch

https://www.ulju.ulsan.kr/common/js/common/layerPopupzoneHelper.js

js ulju.ulsan.kr collected 2026-09-24 10:00:42 UTC 2,027 bytes, 65 lines download raw bytes

1/**
2 * 레이어 팝업존 관련 스크립트
3 *
4 * @author J.Ryeon Lee
5 * @since 2020. 04. 21. *
6 */
7
8var today = new Date();
9
10$(document).ready(function() {
11	clearExpiredLocalStorage();
12	showLayerpopupzone();
13
14	$("[type=checkbox][name^=nomoretoday]").click(function () {
15		var $container = $(this).closest("[data-layer-index]");
16		var index = $container.data("layer-index");
17		var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo");
18		if (hiddenLayersInfo) {
19			hiddenLayersInfo = JSON.parse(hiddenLayersInfo);
20			hiddenLayersInfo.push({ layerIdx: index, day: getDayKey(today) });
21			localStorage.setItem("hiddenLayersInfo", JSON.stringify(hiddenLayersInfo));
22		} else {
23			localStorage.setItem("hiddenLayersInfo", JSON.stringify([{ layerIdx: index, day: getDayKey(today) }]));
24		}
25	});
26});
27
28function clearExpiredLocalStorage() {
29	var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo");
30	if (hiddenLayersInfo) {
31		hiddenLayersInfo = JSON.parse(hiddenLayersInfo);
32
33		var notExpired = hiddenLayersInfo.filter(function (e, i) { return e.day == getDayKey(today) });
34		if (notExpired != undefined && notExpired != null && notExpired.length > 0) {
35			localStorage.setItem("hiddenLayersInfo", JSON.stringify(notExpired));
36		} else {
37			localStorage.removeItem("hiddenLayersInfo");
38		}
39	}
40}
41
42function showLayerpopupzone() {
43	var hiddenLayersInfo = localStorage.getItem("hiddenLayersInfo");
44	if (hiddenLayersInfo) {
45		hiddenLayersInfo = JSON.parse(hiddenLayersInfo);
46		if (hiddenLayersInfo) {
47			var hiddenLayerIdxs = $(hiddenLayersInfo)
48				.map(function () { return this.layerIdx; })
49				.get();
50			$("[id^=layerpopupzoneContainer]")
51				.filter(function () {
52					return hiddenLayerIdxs.indexOf($(this).data("layer-index")) == -1;
53				})
54				.show();
55		} else {
56			$("[id^=layerpopupzoneContainer]").show();
57		}
58	} else {
59		$("[id^=layerpopupzoneContainer]").show();
60	}
61}
62
63function getDayKey(day) {
64	return day.getMonth() + "/" + day.getDate();
65}

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.