-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extractor for exams supervision #106
Conversation
959212f
to
6a64bde
Compare
Preparing work before seperating event extractors from generic extractors
This extractor is a more specialised version of the extractor supporting specific features that do not make sense in generic extractors. For instance, an event extractor has customisable fields for the title and description (aka format-strings) which may be plaintext or HTML.
title/description in 'use strict' mode
A new class to be used in extractors and other modules that represent calendar events. It also supports recurring events and automatically calculates start/end datetimes accordingly with the recurrence period (see #110)
...) from event instances Addresses #111 as well
A flag that indicates wether the title and description are HTML or plaintext. This is necessary to properly encode the strings when generating the URLs to add events in google/microsoft/yahoo calendars
The new approach creates all the necessary DOM and adds event listeners automatically. It also supports the new CalEvent class to represent calendar events and generate the inline dropdowns from them
URL generation onclick The need for URL generation is because the recurrence period can be customised via the Modal interface. Therefore, the previous approach for static inline URLs does not suit
1248424
to
689022d
Compare
CalEvent class With this approach, it is possible to change the recurrence rules for 'one-click' events as well, as the URLs for dropdowns are generated dynamically. Whenever the date changes, the events recurrence period is updated accordingly
cefe0ee
to
e8339a1
Compare
startTime: new Date(`${date} ${startTime}`), | ||
endTime: new Date(`${date} ${endTime}`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool hack
src/js/utils/dropdown.js
Outdated
// add click action for the ICS download button | ||
$dropdown.querySelector(".donwloadSingleIcs").addEventListener("click", (e) => { | ||
const cal = ics("sigtools"); //creat ics instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const cal = ics("sigtools"); //creat ics instance | |
const cal = ics("sigtools"); //create ics instance |
src/js/utils/modal.js
Outdated
for (const event of events) | ||
event.setRecur(from, to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const event of events) | |
event.setRecur(from, to); | |
for (const event of events) { | |
event.setRecur(from, to); | |
} |
I do like one-liner ifs/fors but I think they make code harder to maintain, so this is more of a suggestion, I've seen a few other ifs/fors, and I also accept if you prefer them. feel free to ignore this suggestion
Changes
CalEvent
(Extend the 'Extractor' class for calendar event extracts #107).EventExtractor
, to distinguish between generic extractors and extractors that create calendar events.EventExtractor
supports the format-strings for title and description, customisable via options UI (Extend the 'Extractor' class for calendar event extracts #107).CalEvent
with the formatted strings to separate the semantics of extractors and events. Generating UI only needs the events objects with this approachcalendar.js
CalEvent
classCalEvent
classPreview