From 8ba44c472fd3f5ffddef2ffe7ec79e9f2fee1d27 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Wed, 27 Jul 2022 01:23:21 +0200 Subject: [PATCH 01/43] Fix share link --- src/Share.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Share.svelte b/src/Share.svelte index d746673..73a99ad 100644 --- a/src/Share.svelte +++ b/src/Share.svelte @@ -43,7 +43,7 @@ share = `${loc.origin}${loc.pathname}?b64=${b64}`; } else { - share = `${loc.origin}${loc.pathname}${search.toString()}`; + share = `${loc.origin}${loc.pathname}?${search.toString()}`; } }; -- 2.47.1 From c7cc8dcd84ee6290a831e951f863fff3b91122a1 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Wed, 27 Jul 2022 17:37:34 +0200 Subject: [PATCH 02/43] Add a loading indication --- package-lock.json | 13 +++++++++++++ package.json | 3 ++- src/App.svelte | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 85014fd..161ee3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "rollup-plugin-terser": "^7.0.0", "svelte": "^3.0.0", "svelte-fullcalendar": "^1.1.1", + "svelte-loading-spinners": "^0.1.7", "svelte-reactive-preprocessor": "^0.8.0", "sveltestrap": "^5.9.0" } @@ -3771,6 +3772,12 @@ "@fullcalendar/interaction": "^5.0.0" } }, + "node_modules/svelte-loading-spinners": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/svelte-loading-spinners/-/svelte-loading-spinners-0.1.7.tgz", + "integrity": "sha512-EKCId1DjVL2RSUVJJsvtNcqQHox03XIgh4xh/4p7r6ST7d8mut6INY9/LqK4A17PFU64+3quZmqiSfOlf480CA==", + "dev": true + }, "node_modules/svelte-reactive-preprocessor": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/svelte-reactive-preprocessor/-/svelte-reactive-preprocessor-0.8.2.tgz", @@ -6840,6 +6847,12 @@ "@fullcalendar/interaction": "^5.0.0" } }, + "svelte-loading-spinners": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/svelte-loading-spinners/-/svelte-loading-spinners-0.1.7.tgz", + "integrity": "sha512-EKCId1DjVL2RSUVJJsvtNcqQHox03XIgh4xh/4p7r6ST7d8mut6INY9/LqK4A17PFU64+3quZmqiSfOlf480CA==", + "dev": true + }, "svelte-reactive-preprocessor": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/svelte-reactive-preprocessor/-/svelte-reactive-preprocessor-0.8.2.tgz", diff --git a/package.json b/package.json index 0d0ef67..eeaaf12 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "rollup-plugin-terser": "^7.0.0", "svelte": "^3.0.0", "svelte-fullcalendar": "^1.1.1", + "svelte-loading-spinners": "^0.1.7", "svelte-reactive-preprocessor": "^0.8.0", "sveltestrap": "^5.9.0" }, @@ -37,8 +38,8 @@ "@fullcalendar/list": "^5.10.1", "@fullcalendar/resource-timeline": "^5.10.1", "@fullcalendar/rrule": "^5.10.1", - "@rollup/plugin-replace": "^4.0.0", "@nextcloud/cdav-library": "^1.0.0", + "@rollup/plugin-replace": "^4.0.0", "bootstrap": "^5.1.3", "bootstrap-icons": "^1.8.1", "ical.js": "^1.5.0", diff --git a/src/App.svelte b/src/App.svelte index 8b31922..cba1a8a 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,6 +2,7 @@ import { onMount } from 'svelte'; import { writable } from 'svelte/store'; import FullCalendar from 'svelte-fullcalendar'; + import { Circle2 } from 'svelte-loading-spinners'; import timeGridPlugin from '@fullcalendar/timegrid'; import adaptivePlugin from '@fullcalendar/adaptive'; import rrulePlugin from '@fullcalendar/rrule'; @@ -37,6 +38,8 @@ return time.toLocaleTimeString(); })(); + let isLoading = true; + const allowedViews = [ 'resourceTimelineDay', 'dayGridMonth', @@ -115,6 +118,7 @@ month: mobile ? 'numeric' : 'long', day: 'numeric' }, + loading: b => (isLoading = b), eventSources: [], themeSystem: 'bootstrap5', nextDayThreshold: '05:00:00', @@ -161,6 +165,14 @@ $: updateEvents(selectedCalendars); +{#if isLoading} +
+
+ +
+
+{/if} +

Calendrier de la vie étudiante à l'ENS

@@ -175,6 +187,16 @@
-- 2.47.1 From 9bc5e860ea0d54855c3929cfe049c5c55ef289f3 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 28 Jul 2022 14:39:51 +0200 Subject: [PATCH 06/43] Update share modal --- src/Share.svelte | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Share.svelte b/src/Share.svelte index 73a99ad..db8dd30 100644 --- a/src/Share.svelte +++ b/src/Share.svelte @@ -1,5 +1,13 @@ - + diff --git a/src/Share.svelte b/src/Share.svelte index db8dd30..c6f2b7e 100644 --- a/src/Share.svelte +++ b/src/Share.svelte @@ -69,7 +69,12 @@ - - {#if event.allDay} + {#if event.extendedProps.simAllDay} + + {dateFormat(event.start)} ({timeFormat(event.extendedProps.realStart)}) - {dateFormat(event.end)} ({timeFormat(event.extendedProps.realEnd)}) + {:else if event.allDay} {dateFormat(event.start)} - {dateFormat(event.end)} {:else} diff --git a/src/calendar.js b/src/calendar.js index e3c0b36..ca9d2d6 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -132,13 +132,29 @@ function fcEventFromjCalEvent(cal) { return function (evt) { const start = new Date(evt.dtstart) const end = new Date(evt.dtend) + + const duration = end - start // in ms + const dayMs = 24 * 3600 * 1000 + const fcEvent = { title: `${cal.short_name ?? cal.name} : ${evt.summary}`, - start: evt.dtstart, - end: evt.dtend, + start: start, + end: end, color: cal.color, textColor: invertColor(cal.color), - duration: end - start // in ms + duration: duration + } + + if (duration > dayMs - 1) { + fcEvent.allDay = true + fcEvent.simAllDay = true + + fcEvent.realStart = new Date(start) + fcEvent.realEnd = new Date(end) + + fcEvent.start.setUTCHours(0, 0, 0) + fcEvent.end.setUTCHours(23, 59, 59) + fcEvent.duration = end - start // Update the duration } fcEvent.calendar = cal.name -- 2.47.1 From 32d9b4d60c601ef23df4444320aabfb94efb12a0 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 25 Oct 2022 10:38:09 +0200 Subject: [PATCH 41/43] Fix display or real allDay events --- src/calendar.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calendar.js b/src/calendar.js index ca9d2d6..c8ef67a 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -133,27 +133,29 @@ function fcEventFromjCalEvent(cal) { const start = new Date(evt.dtstart) const end = new Date(evt.dtend) + const allDay = !evt.dtstart.endsWith('Z') + const duration = end - start // in ms const dayMs = 24 * 3600 * 1000 const fcEvent = { title: `${cal.short_name ?? cal.name} : ${evt.summary}`, - start: start, - end: end, + start: evt.dtstart, + end: evt.dtend, color: cal.color, textColor: invertColor(cal.color), duration: duration } - if (duration > dayMs - 1) { + if (!allDay && (duration > dayMs - 1)) { fcEvent.allDay = true fcEvent.simAllDay = true fcEvent.realStart = new Date(start) fcEvent.realEnd = new Date(end) - fcEvent.start.setUTCHours(0, 0, 0) - fcEvent.end.setUTCHours(23, 59, 59) + fcEvent.start = start.setUTCHours(0, 0, 0) + fcEvent.end = end.setUTCHours(23, 59, 59) fcEvent.duration = end - start // Update the duration } -- 2.47.1 From 7c5df4e7904eb6c55a6578d4b5c47cb87c3a812f Mon Sep 17 00:00:00 2001 From: sinavir Date: Sun, 23 Jul 2023 13:27:12 +0200 Subject: [PATCH 42/43] =?UTF-8?q?Add=20rentr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/calendars.json | 50 +++++++++++++++++++++++++++++++++++++++++++-- data/locations.json | 4 +++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/data/calendars.json b/data/calendars.json index 5986545..0ef8aa9 100644 --- a/data/calendars.json +++ b/data/calendars.json @@ -1,6 +1,15 @@ { "tree": { + "Rentrée": { + "Amphis de rentrée": {}, + "Départements": {}, + "Visites de bibliothèque": {}, + "Masters": {}, + "Étudiants internationaux": {}, + "Conférences de recherche": {} + }, "COF": { + "Rentrée du COF": {}, "Évènements (COF)": {}, "Assemblées Générales (COF)": {}, "BdA": { @@ -24,7 +33,10 @@ "Ulmity": {}, "Club Inutile ☔": {} }, - "BDS": {}, + "BDS": { + "Évènements (BDS)": {}, + "Rentrée du BDS": {} + }, "Clubs BDS": { "Créneaux encadrés": {} }, @@ -123,7 +135,7 @@ "short_name": "Banda" }, "dSYCtdC6bgyWpKyt": { - "name": "BDS" + "name": "Évènements (BDS)" }, "goXLq2dQ8LgFAjkM": { "name": "Club Bouffe" @@ -144,6 +156,40 @@ }, "AYNpoC674yAjEmRy": { "name": "L'Hômonerie" + }, + "TcwNdrs6iyBRxFzk": { + "name": "Divers" + }, + "G5ZRyTkMifXC2iHj": { + "name": "Amphis de rentrée", + "short_name": "Amphis" + }, + "dJofECeczaGgNiKs": { + "name": "Rentrée du BDS", + "short_name": "BDS" + }, + "7Rwd8JERwBsso7XG": { + "name": "Rentrée du COF", + "short_name": "COF" + }, + "tiMsNcncqBxR4nL2": { + "name": "Départements", + "short_name": "Dpt" + }, + "RpP773D6e2ReLfcY": { + "name": "Visites de bibliothèque", + "short_name": "Bibli" + }, + "YRZ4A8imEEf8jnDE": { + "name": "Masters" + }, + "8EDHX6kiPYcSrXXL": { + "name": "Étudiants internationaux", + "short_name": "Internationaux" + }, + "TWgNxdri7zQSoiRf": { + "name": "Conférences de recherche", + "short_name": "Conf" } } } diff --git a/data/locations.json b/data/locations.json index 5e705d8..a90d540 100644 --- a/data/locations.json +++ b/data/locations.json @@ -1,10 +1,12 @@ { "nameMap": { "Amphi Jourdan": "Amphithéâtre Jourdan", + "Cour aux Ernest": "Cour aux Ernests", "R2-21 (Jourdan)": "R2-21", "Salle Jean Ibanes (Jourdan, R1-07)": "Salle Jean Ibanes (R1-07)", "Salle Madeleine Rebérioux (Jourdan, R2-02)": "Salle Madeleine Rebérioux (R2-02)", - "Salle Marcel Roncayolo (Jourdan, R2-05)": "Salle Marcel Roncayolo (R2-05)" + "Salle Marcel Roncayolo (Jourdan, R2-05)": "Salle Marcel Roncayolo (R2-05)", + "Cour des bibliothèques": "Cour du NIR" }, "rooms": { -- 2.47.1 From 85570af7afa4b618ee59b194191d9198b88e9627 Mon Sep 17 00:00:00 2001 From: sinavir Date: Wed, 20 Sep 2023 15:37:55 +0200 Subject: [PATCH 43/43] Add arts-pla' --- data/calendars.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/calendars.json b/data/calendars.json index 0ef8aa9..d4847ea 100644 --- a/data/calendars.json +++ b/data/calendars.json @@ -31,6 +31,7 @@ "BandarrêtdurgENS": {}, "L'Hômonerie": {}, "Ulmity": {}, + "Arts pla'": {}, "Club Inutile ☔": {} }, "BDS": { @@ -190,6 +191,10 @@ "TWgNxdri7zQSoiRf": { "name": "Conférences de recherche", "short_name": "Conf" + }, + "MJf2wnQafbLc2arS": { + "name": "Arts pla'", + "color": "#ffb969" } } } -- 2.47.1