diff --git a/fet2020/static/js/alpine-csp.js b/fet2020/static/js/alpine-csp.js index 34ba9d46..d939b807 100644 --- a/fet2020/static/js/alpine-csp.js +++ b/fet2020/static/js/alpine-csp.js @@ -1605,6 +1605,45 @@ } var module_default = src_default; + // packages/persist/dist/module.esm.js + function src_default2(Alpine2) { + let persist = () => { + let alias; + let storage = localStorage; + return Alpine2.interceptor((initialValue, getter, setter, path, key) => { + let lookup = alias || `_x_${path}`; + let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue; + setter(initial); + Alpine2.effect(() => { + let value = getter(); + storageSet(lookup, value, storage); + setter(value); + }); + return initial; + }, (func) => { + func.as = (key) => { + alias = key; + return func; + }, func.using = (target) => { + storage = target; + return func; + }; + }); + }; + Object.defineProperty(Alpine2, "$persist", {get: () => persist()}); + Alpine2.magic("persist", persist); + } + function storageHas(key, storage) { + return storage.getItem(key) !== null; + } + function storageGet(key, storage) { + return JSON.parse(storage.getItem(key, storage)); + } + function storageSet(key, value, storage) { + storage.setItem(key, JSON.stringify(value)); + } + var module_default2 = src_default2; + // node_modules/@vue/shared/dist/shared.esm-bundler.js function makeMap(str, expectsLowerCase) { const map = Object.create(null); @@ -3068,8 +3107,9 @@ }; return tryCatch.bind(null, el, expression, evaluator); } - var src_default2 = alpine_default; + var src_default3 = alpine_default; alpine_default.plugin(module_default); + alpine_default.plugin(module_default2); alpine_default.data("counter", () => ({ count: 0, increment() { @@ -3097,78 +3137,85 @@ } } })); - alpine_default.data("modal", () => ({ - showModal: false, - selectedYear: "", - getShowModal() { - if (screen.width >= 640) { - this.$refs.overflow.classList.add("overflow-y-hidden"); - this.$refs.overflow.classList.add("sm:overflow-y-auto"); - return true; + document.addEventListener("alpine:init", () => { + alpine_default.data("modal", () => ({ + showModal: false, + selectedYear: "", + getShowModal() { + if (screen.width >= 640) { + this.$refs.overflow.classList.add("overflow-y-hidden"); + this.$refs.overflow.classList.add("sm:overflow-y-auto"); + return true; + } + return this.showModal; + }, + getNotShowModal() { + return !this.showModal; + }, + toggle() { + this.showModal = !this.showModal; + this.setClass(); + }, + openModal() { + this.showModal = true; + this.setClass(); + }, + closeModal() { + this.showModal = false; + this.setClass(); + }, + setClass() { + if (this.getShowModal() == false) { + this.$refs.overflow.classList.remove("overflow-y-hidden"); + this.$refs.overflow.classList.remove("sm:overflow-y-auto"); + } else { + this.$refs.overflow.classList.add("overflow-y-hidden"); + this.$refs.overflow.classList.add("sm:overflow-y-auto"); + } + }, + setSelectedYear(year) { + this.selectedYear = year; + }, + getSelectedYear() { + if (this.selectedYear != "") { + return true; + } + return false; + }, + getYear() { + return this.selectedYear; } - return this.showModal; - }, - getNotShowModal() { - return !this.showModal; - }, - toggle() { - this.showModal = !this.showModal; - this.setClass(); - }, - openModal() { - this.showModal = true; - this.setClass(); - }, - closeModal() { - this.showModal = false; - this.setClass(); - }, - setClass() { - if (this.getShowModal() == false) { - this.$refs.overflow.classList.remove("overflow-y-hidden"); - this.$refs.overflow.classList.remove("sm:overflow-y-auto"); - } else { - this.$refs.overflow.classList.add("overflow-y-hidden"); - this.$refs.overflow.classList.add("sm:overflow-y-auto"); - } - }, - setSelectedYear(year) { - this.selectedYear = year; - }, - getSelectedYear() { - if (this.selectedYear != "") { - return true; - } - return false; - } - })); + })); + }); alpine_default.data("infoBox", () => ({ consent: true, closeBox() { this.consent = false; } })); - alpine_default.data("myNavBar", () => ({ - showNavBar: false, - toggleShowNavBar() { - this.showNavBar = !this.showNavBar; - }, - closeShowNavBar() { - this.showNavBar = false; - }, - getShowNavBarMd() { - if (screen.width >= 766) { - this.showNavBar = true; + document.addEventListener("alpine:init", () => { + alpine_default.data("myNavBar", () => ({ + showNavBar: false, + toggleShowNavBar() { + this.showNavBar = !this.showNavBar; + }, + closeShowNavBar() { + this.showNavBar = false; + }, + getShowNavBarMd() { + if (screen.width >= 766) { + this.showNavBar = true; + } + return this.showNavBar; + }, + getShowNavBarLg() { + if (screen.width >= 1024) { + return this.showNavBar = true; + } + return this.showNavBar; } - return this.showNavBar; - }, - getShowNavBarLg() { - if (screen.width >= 1024) { - return this.showNavBar = true; - } - return this.showNavBar; - } - })); + })); + }); alpine_default.data("popupNav", () => ({ showPopupNav: false, toggleShowPopupNav() { @@ -3268,6 +3315,36 @@ } } })); + document.addEventListener("alpine:init", () => { + alpine_default.data("internExpandList", () => ({ + expandList: false, + toggleExpandList() { + this.expandList = !this.expandList; + this.setClass(); + }, + openExpandList() { + this.expandList = true; + this.setClass(); + }, + closeExpandList() { + this.expandList = false; + this.setClass(); + }, + getExpandList() { + return this.expandList; + }, + getNotExpandList() { + return !this.expandList; + }, + setClass() { + if (this.getExpandList() == false) { + this.$refs.rotate.classList.remove("rotate-90"); + } else { + this.$refs.rotate.classList.add("rotate-90"); + } + } + })); + }); alpine_default.data("pin", () => ({ showPin: true, openShowPin() { @@ -3282,9 +3359,9 @@ })); // packages/csp/builds/cdn.js - window.Alpine = src_default2; + window.Alpine = src_default3; queueMicrotask(() => { - src_default2.start(); + src_default3.start(); }); })(); \ No newline at end of file diff --git a/fet2020/templates/intern/index.html b/fet2020/templates/intern/index.html index abfe3f28..758a8504 100644 --- a/fet2020/templates/intern/index.html +++ b/fet2020/templates/intern/index.html @@ -9,16 +9,16 @@
{% regroup topic by topic_group as topic_group_list %} {% for topic_group in topic_group_list %} -
+
-

+

{{ topic_group.grouper.title }}

-