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.