diff --git a/fullcalendar/examples/LitGrade.js b/fullcalendar/examples/LitGrade.js index f7f5eab..60b1148 100644 --- a/fullcalendar/examples/LitGrade.js +++ b/fullcalendar/examples/LitGrade.js @@ -22,8 +22,7 @@ class LitGrade { return LitGrade.values.includes( value ); }; static strWTags = ( value ) => { - let grade, - tags; + let tags; switch( value ) { case LitGrade.WEEKDAY: tags = ['','']; @@ -55,3 +54,5 @@ class LitGrade { return { "strVal": LitGrade.valueToString[value], "tags": tags }; } } + +export default LitGrade; diff --git a/fullcalendar/examples/la.js b/fullcalendar/examples/la.js index 017f44a..c20010c 100644 --- a/fullcalendar/examples/la.js +++ b/fullcalendar/examples/la.js @@ -1,30 +1,24 @@ -FullCalendar.globalLocales.push(function () { - 'use strict'; - - var la = { - code: "la", - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: "Prior", - next: "Prox", - today: "Hodie", - month: "Mensis", - week: "Hebdomada", - day: "Dies", - list: "Agenda" - }, - weekText: "Hb", - allDayText: "Tota die", - moreLinkText: function(n) { - return "+alii " + n; - }, - noEventsText: "Rei gestae non sunt" - }; - - return la; - - }()); - \ No newline at end of file +var la = { + code: "la", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Prior", + next: "Prox", + today: "Hodie", + year: "Annum", + month: "Mensis", + week: "Hebdomada", + day: "Dies", + list: "Agenda" + }, + weekText: "Hb", + allDayText: "Tota die", + moreLinkText(n) { + return "+alii " + n; + }, + noEventsText: "Rei gestae non sunt" +}; +export default la; diff --git a/fullcalendar/examples/locales/de.json b/fullcalendar/examples/locales/de.json deleted file mode 100644 index 4da529e..0000000 --- a/fullcalendar/examples/locales/de.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Eigen", - "Dedication of a Church": "Kirchweihe", - "Blessed Virgin Mary": "Selige Jungfrau Maria", - "Martyrs": "Märtyrer", - "Pastors": "Hirten", - "Doctors": "Doktoren", - "Virgins": "Jungfrauen", - "Holy Men and Women": "Heilige Männer und Frauen", - "For One Martyr": "Für einen Märtyrer", - "For Several Martyrs": "Für mehrere Märtyrer", - "For Missionary Martyrs": "Für missionarische Märtyrer", - "For One Missionary Martyr": "Für einen missionarischen Märtyrer", - "For Several Missionary Martyrs": "Für mehrere missionarische Märtyrer", - "For a Virgin Martyr": "Für eine jungfräuliche Märtyrerin", - "For a Holy Woman Martyr": "Für eine heilige Märtyrerin", - "For a Pope": "Für einen Papst", - "For a Bishop": "Für einen Bischof", - "For One Pastor": "Für einen Pfarrer", - "For Several Pastors": "Für mehrere Hirten", - "For Founders of a Church": "Für Gründer einer Kirche", - "For One Founder": "Für einen Gründer", - "For Several Founders": "Für mehrere Gründer", - "For Missionaries": "Für Missionare", - "For One Virgin": "Für eine Jungfrau", - "For Several Virgins": "Für mehrere Jungfrauen", - "For Several Saints": "Für mehrere Heilige", - "For One Saint": "Für einen Heiligen", - "For an Abbot": "Für einen Abt", - "For a Monk": "Für einen Mönch", - "For a Nun": "Für eine Nonne", - "For Religious": "Für Ordensleute", - "For Those Who Practiced Works of Mercy": "Für diejenigen, die Werke der Barmherzigkeit praktizierten", - "For Educators": "Für Erzieher", - "For Holy Women": "Für heilige Frauen", - "From the Common": "Aus dem Gemeinsamen", - "of (SING_MASC)": "des", - "of (SING_FEMM)": "des", - "of (PLUR_MASC)": "Für einen Bischof", - "of (PLUR_MASC_ALT)": "Für einen Bischof", - "of (PLUR_FEMM)": "Für einen Bischof", - "or": "oder", - "green": "grün", - "purple": "lila", - "white": "weiß", - "red": "rot", - "pink": "rosa", - "Customize options for generating the Roman Calendar": "Optionen zur Anpassung des Römischen Kalenders", - "Generate Roman Calendar": "Römischen Kalender generieren", - "Liturgical Calendar Calculation for a Given Year": "Berechnung des liturgischen Kalenders für ein bestimmtes Jahr", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "HTML-Präsentation, die von JAVASCRIPT unter Verwendung einer AJAX-Anfrage an ein %s elaboriert wurde", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Sie fordern ein Jahr vor 1970 an: Es ist nicht möglich, Jahre vor 1970 anzufordern.", - "Configurations being used to generate this calendar": "Konfigurationen, die zur Erstellung dieses Kalenders verwendet werden", - "Date in Gregorian Calendar": "Datum im Gregorianischen Kalender", - "General Roman Calendar Festivity": "Fest im Allgemeinen Römischen Kalender", - "Grade of the Festivity": "Grad des Festes", - "YEAR": "JAHR", - "EPIPHANY": "EPIPHANIE", - "ASCENSION": "HIMMELFAHRT", - "Month": "Monat", - "Information about the current calculation of the Liturgical Year": "Informationen zur aktuellen Berechnung des Liturgischen Jahres", - "LOCALE": "LOKAL", - "NATIONAL PRESET": "NATIONALE VOREINSTELLUNG", - "DIOCESAN PRESET": "DIOZESANER VORGESETZTER", - "Sunday": "Sonntag", - "Thursday": "Donnerstag", - "January 6": "6. Januar", - "Sunday Jan 2↔Jan 8": "Sonntag 2. Jan↔8. Jan", - "Italy": "Italien", - "Vatican": "Vatikan", - "weekday": "Wochentag", - "Commemoration": "Gedenktag", - "Optional memorial": "Nichtgebotener Gedenktag", - "Memorial": "Gedenktag", - "FEAST": "FEST", - "FEAST OF THE LORD": "FEST DES HERRN", - "SOLEMNITY": "HOCHFEST", - "celebration with precedence over solemnities": "Feier mit Vorrang vor Hochfesten" -} diff --git a/fullcalendar/examples/locales/en.json b/fullcalendar/examples/locales/en.json deleted file mode 100644 index 4cdfb50..0000000 --- a/fullcalendar/examples/locales/en.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Proper", - "Dedication of a Church": "Dedication of a Church", - "Blessed Virgin Mary": "Blessed Virgin Mary", - "Martyrs": "Martyrs", - "Pastors": "Pastors", - "Doctors": "Doctors", - "Virgins": "Virgins", - "Holy Men and Women": "Holy Men and Women", - "For One Martyr": "For One Martyr", - "For Several Martyrs": "For Several Martyrs", - "For Missionary Martyrs": "For Missionary Martyrs", - "For One Missionary Martyr": "For One Missionary Martyr", - "For Several Missionary Martyrs": "For Several Missionary Martyrs", - "For a Virgin Martyr": "For a Virgin Martyr", - "For a Holy Woman Martyr": "For a Holy Woman Martyr", - "For a Pope": "For a Pope", - "For a Bishop": "For a Bishop", - "For One Pastor": "For One Pastor", - "For Several Pastors": "For Several Pastors", - "For Founders of a Church": "For Founders of a Church", - "For One Founder": "For One Founder", - "For Several Founders": "For Several Founders", - "For Missionaries": "For Missionaries", - "For One Virgin": "For One Virgin", - "For Several Virgins": "For Several Virgins", - "For Several Saints": "For Several Saints", - "For One Saint": "For One Saint", - "For an Abbot": "For an Abbot", - "For a Monk": "For a Monk", - "For a Nun": "For a Nun", - "For Religious": "For Religious", - "For Those Who Practiced Works of Mercy": "For Those Who Practiced Works of Mercy", - "For Educators": "For Educators", - "For Holy Women": "For Holy Women", - "From the Common": "From the Common", - "of (SING_MASC)": "of the", - "of (SING_FEMM)": "of the", - "of (PLUR_MASC)": "of", - "of (PLUR_MASC_ALT)": "of", - "of (PLUR_FEMM)": "of", - "or": "or", - "green": "green", - "purple": "purple", - "white": "white", - "red": "red", - "pink": "pink", - "Customize options for generating the Roman Calendar": "Customize options for generating the Roman Calendar", - "Generate Roman Calendar": "Generate Roman Calendar", - "Liturgical Calendar Calculation for a Given Year": "Liturgical Calendar Calculation for a Given Year", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.", - "Configurations being used to generate this calendar": "Configurations being used to generate this calendar", - "Date in Gregorian Calendar": "Date in Gregorian Calendar", - "General Roman Calendar Festivity": "General Roman Calendar Festivity", - "Grade of the Festivity": "Grade of the Festivity", - "YEAR": "YEAR", - "EPIPHANY": "EPIPHANY", - "ASCENSION": "ASCENSION", - "Month": "Month", - "Information about the current calculation of the Liturgical Year": "Information about the current calculation of the Liturgical Year", - "LOCALE": "LOCALE", - "NATIONAL PRESET": "NATIONAL PRESET", - "DIOCESAN PRESET": "DIOCESAN PRESET", - "Sunday": "Sunday", - "Thursday": "Thursday", - "January 6": "January 6", - "Sunday Jan 2↔Jan 8": "Sunday Jan 2↔Jan 8", - "Italy": "Italy", - "Vatican": "Vatican", - "weekday": "weekday", - "Commemoration": "Commemoration", - "Optional memorial": "Optional memorial", - "Memorial": "Memorial", - "FEAST": "FEAST", - "FEAST OF THE LORD": "FEAST OF THE LORD", - "SOLEMNITY": "SOLEMNITY", - "celebration with precedence over solemnities": "celebration with precedence over solemnities" -} \ No newline at end of file diff --git a/fullcalendar/examples/locales/es.json b/fullcalendar/examples/locales/es.json deleted file mode 100644 index cdeffbf..0000000 --- a/fullcalendar/examples/locales/es.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Propio", - "Dedication of a Church": "Dedicación de una Iglesia", - "Blessed Virgin Mary": "Santísima Virgen María", - "Martyrs": "Mártires", - "Pastors": "Pastores", - "Doctors": "Doctores", - "Virgins": "Vírgenes", - "Holy Men and Women": "Hombres y Mujeres Santos", - "For One Martyr": "Para un Mártir", - "For Several Martyrs": "Para varios mártires", - "For Missionary Martyrs": "Para mártires misioneros", - "For One Missionary Martyr": "Por Un Misionero Mártir", - "For Several Missionary Martyrs": "Para Varios Misioneros Mártires", - "For a Virgin Martyr": "Para una Virgen Mártir", - "For a Holy Woman Martyr": "Para una Santa Mujer Mártir", - "For a Pope": "Por Un Papa", - "For a Bishop": "Para un Obispo", - "For One Pastor": "Por Un Pastor", - "For Several Pastors": "Para Varios Pastores", - "For Founders of a Church": "Por Fundadores de una Iglesia", - "For One Founder": "Para un Fundador", - "For Several Founders": "Para Varios Fundadores", - "For Missionaries": "Por Misioneros", - "For One Virgin": "Para Una Virgen", - "For Several Virgins": "Para Varias Vírgenes", - "For Several Saints": "Para Varios Santos", - "For One Saint": "Para un Santo", - "For an Abbot": "Para un Abad", - "For a Monk": "Para un monje", - "For a Nun": "Por una monja", - "For Religious": "Para religiosos", - "For Those Who Practiced Works of Mercy": "Por Quienes Practicaron Obras de Misericordia", - "For Educators": "Para Educadores", - "For Holy Women": "Para Mujeres Santas", - "From the Common": "Del Común", - "of (SING_MASC)": "del", - "of (SING_FEMM)": "del", - "of (PLUR_MASC)": "de", - "of (PLUR_MASC_ALT)": "de", - "of (PLUR_FEMM)": "de", - "or": "o", - "green": "verde", - "purple": "morado", - "white": "blanco", - "red": "rojo", - "pink": "rosa", - "Customize options for generating the Roman Calendar": "Personalizar opciones para generar el Calendario Romano", - "Generate Roman Calendar": "Generar Calendario Romano", - "Liturgical Calendar Calculation for a Given Year": "Cálculo del Calendario Litúrgico para un año dado", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "Presentación HTML elaborada por JAVASCRIPT usando una solicitud AJAX a un %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Estás solicitando un año anterior a 1970: no es posible solicitar años anteriores a 1970.", - "Configurations being used to generate this calendar": "Configuraciones utilizadas para generar este calendario", - "Date in Gregorian Calendar": "Fecha en el calendario gregoriano", - "General Roman Calendar Festivity": "Festividad del Calendario Romano General", - "Grade of the Festivity": "Grado de la Festividad", - "YEAR": "AÑO", - "EPIPHANY": "EPIFANÍA", - "ASCENSION": "ASCENSIÓN", - "Month": "Mes", - "Information about the current calculation of the Liturgical Year": "Información sobre el cálculo actual del Año Litúrgico", - "LOCALE": "LOCALIDAD", - "NATIONAL PRESET": "PREDETERMINADO NACIONAL", - "DIOCESAN PRESET": "PRESBÍTERO DIOCESANO", - "Sunday": "Domingo", - "Thursday": "jueves", - "January 6": "6 de enero", - "Sunday Jan 2↔Jan 8": "Domingo 2 Ene↔8 Ene", - "Italy": "Italia", - "Vatican": "Vaticano", - "weekday": "día de la semana", - "Commemoration": "Conmemoración", - "Optional memorial": "Memoria facultativa", - "Memorial": "Memoria obligatoria", - "FEAST": "FIESTA", - "FEAST OF THE LORD": "FIESTA DEL SEÑOR", - "SOLEMNITY": "SOLEMNIDAD", - "celebration with precedence over solemnities": "celebración con precedencia sobre solemnidades" -} diff --git a/fullcalendar/examples/locales/fr.json b/fullcalendar/examples/locales/fr.json deleted file mode 100644 index de12b56..0000000 --- a/fullcalendar/examples/locales/fr.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Propre", - "Dedication of a Church": "Dédicace d'une église", - "Blessed Virgin Mary": "Bienheureuse Vierge Marie", - "Martyrs": "Martyrs", - "Pastors": "Pasteurs", - "Doctors": "Docteurs", - "Virgins": "Vierges", - "Holy Men and Women": "Hommes et femmes saints", - "For One Martyr": "Pour un martyr", - "For Several Martyrs": "Pour plusieurs martyrs", - "For Missionary Martyrs": "Pour les martyrs missionnaires", - "For One Missionary Martyr": "Pour un martyr missionnaire", - "For Several Missionary Martyrs": "Pour plusieurs missionnaires martyrs", - "For a Virgin Martyr": "Pour une vierge martyre", - "For a Holy Woman Martyr": "Pour une sainte femme martyre", - "For a Pope": "Pour un pape", - "For a Bishop": "Pour un évêque", - "For One Pastor": "Pour un pasteur", - "For Several Pastors": "Pour plusieurs pasteurs", - "For Founders of a Church": "Pour les fondateurs d'une église", - "For One Founder": "Pour un fondateur", - "For Several Founders": "Pour plusieurs fondateurs", - "For Missionaries": "Pour ceux qui ont pratiqué des œuvres de miséricorde", - "For One Virgin": "Pour une Vierge", - "For Several Virgins": "Pour plusieurs vierges", - "For Several Saints": "Pour plusieurs saints", - "For One Saint": "Pour un saint", - "For an Abbot": "Pour un abbé", - "For a Monk": "Pour un moine", - "For a Nun": "Pour une religieuse", - "For Religious": "Pour les religieux", - "For Those Who Practiced Works of Mercy": "Pour ceux qui ont pratiqué des œuvres de miséricorde", - "For Educators": "Pour les éducateurs", - "For Holy Women": "Pour les saintes femmes", - "From the Common": "Du commun", - "of (SING_MASC)": "du", - "of (SING_FEMM)": "du", - "of (PLUR_MASC)": "de", - "of (PLUR_MASC_ALT)": "de", - "of (PLUR_FEMM)": "de", - "or": "ou", - "green": "vert", - "purple": "violet", - "white": "blanc", - "red": "rouge", - "pink": "rose", - "Customize options for generating the Roman Calendar": "Personnaliser les options pour générer le calendrier romain", - "Generate Roman Calendar": "Générer le calendrier romain", - "Liturgical Calendar Calculation for a Given Year": "Calcul du calendrier liturgique pour une année donnée", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "Présentation HTML élaborée par JAVASCRIPT utilisant une requête AJAX vers un %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Vous demandez une année antérieure à 1970 : il n'est pas possible de demander des années antérieures à 1970.", - "Configurations being used to generate this calendar": "Configurations utilisées pour générer ce calendrier", - "Date in Gregorian Calendar": "Date dans le Calendrier Grégorien", - "General Roman Calendar Festivity": "Fête du calendrier romain général", - "Grade of the Festivity": "Grade de la Fête", - "YEAR": "ANNÉE", - "EPIPHANY": "ÉPIPHANIE", - "ASCENSION": "ASCENSION", - "Month": "Mois", - "Information about the current calculation of the Liturgical Year": "Informations sur le calcul actuel de l'année liturgique", - "LOCALE": "LOCALE", - "NATIONAL PRESET": "PRÉRÉGLAGE NATIONAL", - "DIOCESAN PRESET": "PRÉRÉGLAGE DIOCÉSAIN", - "Sunday": "Dimanche", - "Thursday": "Jeudi", - "January 6": "6 janvier", - "Sunday Jan 2↔Jan 8": "Dimanche 2 janv.↔8 janv.", - "Italy": "Italie", - "Vatican": "Vatican", - "weekday": "jour de semaine", - "Commemoration": "Commémoration", - "Optional memorial": "Mémoire optionnelle", - "Memorial": "Mémoire", - "FEAST": "FÊTE", - "FEAST OF THE LORD": "FÊTE DU SEIGNEUR", - "SOLEMNITY": "SOLENNITÉ", - "celebration with precedence over solemnities": "célébration qui prime sur les solennités" -} diff --git a/fullcalendar/examples/locales/it.json b/fullcalendar/examples/locales/it.json deleted file mode 100644 index 8eeacff..0000000 --- a/fullcalendar/examples/locales/it.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Proprio", - "Dedication of a Church": "Dedicazione di una Chiesa", - "Blessed Virgin Mary": "Beata Vergine Maria", - "Martyrs": "Martiri", - "Pastors": "Pastori", - "Doctors": "Dottori della Chiesa", - "Virgins": "Vergini", - "Holy Men and Women": "Santi e delle Sante", - "For One Martyr": "Per un martire", - "For Several Martyrs": "Per più martiri", - "For Missionary Martyrs": "Per i martiri missionari", - "For One Missionary Martyr": "Per un martire missionario", - "For Several Missionary Martyrs": "Per più martiri missionari", - "For a Virgin Martyr": "Per una vergine martire", - "For a Holy Woman Martyr": "Per una santa martire", - "For a Pope": "Per un papa", - "For a Bishop": "Per un vescovo", - "For One Pastor": "Per un pastore", - "For Several Pastors": "Per più pastori", - "For Founders of a Church": "Per i fondatori delle chiese", - "For One Founder": "Per un fondatore", - "For Several Founders": "Per più fondatori", - "For Missionaries": "Per i missionari", - "For One Virgin": "Per una vergine", - "For Several Virgins": "Per più vergini", - "For Several Saints": "Per più santi", - "For One Saint": "Per un santo", - "For an Abbot": "Per un abate", - "For a Monk": "Per un monaco", - "For a Nun": "Per una monaca", - "For Religious": "Per i religiosi", - "For Those Who Practiced Works of Mercy": "Per gli operatori di misericordia", - "For Educators": "Per gli educatori", - "For Holy Women": "Per le sante", - "From the Common": "Dal Comune", - "of (SING_MASC)": "del", - "of (SING_FEMM)": "della", - "of (PLUR_MASC)": "dei", - "of (PLUR_MASC_ALT)": "degli", - "of (PLUR_FEMM)": "delle", - "or": "oppure", - "green": "verde", - "purple": "viola", - "white": "bianco", - "red": "rosso", - "pink": "rosa", - "Customize options for generating the Roman Calendar": "Configurare le impostazioni per la generazione del Calendario Romano", - "Generate Roman Calendar": "Genera il Calendario Romano", - "Liturgical Calendar Calculation for a Given Year": "Calcolo del Calendario Liturgico per un dato anno", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "Presentazione in HTML elaborata da JAVASCRIPT utilizzando una richiesta AJAX ad un %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Hai richiesto un anno precedente al 1970: non è possibile richiedere anni prima del 1970.", - "Configurations being used to generate this calendar": "Le impostazioni utilizzate per generare questo calendario", - "Date in Gregorian Calendar": "Data nel Calendario Gregoriano", - "General Roman Calendar Festivity": "Festività del Calendario Romano Universale", - "Grade of the Festivity": "Grado della Festività", - "YEAR": "ANNO", - "EPIPHANY": "EPIFANIA", - "ASCENSION": "ASCENSIONE", - "Month": "Mese", - "Information about the current calculation of the Liturgical Year": "Informazioni sull'attuale calcolo dell'Anno Liturgico", - "LOCALE": "LINGUA", - "NATIONAL PRESET": "Calendario nazionale", - "DIOCESAN PRESET": "Calendario diocesano", - "Sunday": "Domenica", - "Thursday": "Giovedì", - "January 6": "6 Gennaio", - "Sunday Jan 2↔Jan 8": "Domenica 2 Gennaio↔8 Gennaio", - "Italy": "Italia", - "Vatican": "Vaticano", - "weekday": "feria", - "Commemoration": "Commemorazione", - "Optional memorial": "Memoria facoltativa", - "Memorial": "Memoria", - "FEAST": "FESTA", - "FEAST OF THE LORD": "FESTA DEL SIGNORE", - "SOLEMNITY": "SOLENNITÀ", - "celebration with precedence over solemnities": "celebrazione con precedenza sulle solennità" -} diff --git a/fullcalendar/examples/locales/la.json b/fullcalendar/examples/locales/la.json deleted file mode 100644 index 4ab9a48..0000000 --- a/fullcalendar/examples/locales/la.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Proprium", - "Dedication of a Church": "Dedicationis ecclesiæ", - "Blessed Virgin Mary": "Beatæ Mariæ Virginis", - "Martyrs": "Martyrum", - "Pastors": "Pastorum", - "Doctors": "Doctorum Ecclesiæ", - "Virgins": "Virginum", - "Holy Men and Women": "Sanctorum et Sanctarum", - "For One Martyr": "Pro uno martyre", - "For Several Martyrs": "Pro pluribus martyribus", - "For Missionary Martyrs": "Pro missionariis martyribus", - "For One Missionary Martyr": "Pro uno missionario martyre", - "For Several Missionary Martyrs": "Pro pluribus missionariis martyribus", - "For a Virgin Martyr": "Pro virgine martyre", - "For a Holy Woman Martyr": "Pro sancta muliere martyre", - "For a Pope": "Pro papa", - "For a Bishop": "Pro episcopo", - "For One Pastor": "Pro uno pastore", - "For Several Pastors": "Pro pluribus pastoribus", - "For Founders of a Church": "Pro fundatoribus ecclesiarum", - "For One Founder": "Pro uno fundatore", - "For Several Founders": "Pro pluribus fundatoribus", - "For Missionaries": "Pro missionariis", - "For One Virgin": "Pro una virgine", - "For Several Virgins": "Pro pluribus virginibus", - "For Several Saints": "Pro pluribus sanctis", - "For One Saint": "Pro uno sancto", - "For an Abbot": "Pro abbate", - "For a Monk": "Pro monacho", - "For a Nun": "Pro moniali", - "For Religious": "Pro religiosis", - "For Those Who Practiced Works of Mercy": "Pro iis qui opera misericordiæ exercuerunt", - "For Educators": "Pro educatoribus", - "For Holy Women": "Pro sanctis mulieribus", - "From the Common": "De Commune", - "of (SING_MASC)": "", - "of (SING_FEMM)": "", - "of (PLUR_MASC)": "", - "of (PLUR_MASC_ALT)": "", - "of (PLUR_FEMM)": "", - "or": "vel", - "green": "viridis", - "purple": "purpura", - "white": "albus", - "red": "ruber", - "pink": "rosea", - "Customize options for generating the Roman Calendar": "Eligere optiones per generationem Calendarii Romani", - "Generate Roman Calendar": "Calendarium Romanum Generare", - "Liturgical Calendar Calculation for a Given Year": "Computus Calendarii Liturgici pro anno dedi", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "Repraesentatio HTML elaborata cum JAVASCRIPT utendo petitionem AJAX ad machinam PHP %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Rogavisti annum ante 1970: non potest rogare annos ante annum 1970.", - "Configurations being used to generate this calendar": "Optiones electuus ut generare hic calendarium", - "Date in Gregorian Calendar": "Dies in Calendario Gregoriano", - "General Roman Calendar Festivity": "Festivitas in Calendario Romano Generale", - "Grade of the Festivity": "Gradum Festivitatis", - "YEAR": "ANNUM", - "EPIPHANY": "EPIPHANIA", - "ASCENSION": "ASCENSIO", - "Month": "Mensis", - "Information about the current calculation of the Liturgical Year": "Notitiæ de computatione præsente Anni Liturgici", - "LOCALE": "LINGUA", - "NATIONAL PRESET": "PATRIA", - "DIOCESAN PRESET": "DIOECESIS", - "Sunday": "Dominica", - "Thursday": "Feria V", - "January 6": "6 Ianuarii", - "Sunday Jan 2↔Jan 8": "Dominica 2 Ian↔8 Ian", - "Italy": "Italia", - "Vatican": "Vaticanum", - "weekday": "feria", - "Commemoration": "Commemoratio", - "Optional memorial": "Memoria ad libitum", - "Memorial": "Memoria obligatoria", - "FEAST": "FESTUM", - "FEAST OF THE LORD": "FESTUM DOMINI", - "SOLEMNITY": "SOLLEMNITAS", - "celebration with precedence over solemnities": "celebratio altioris ordinis quam sollemnitatis" -} diff --git a/fullcalendar/examples/locales/nl.json b/fullcalendar/examples/locales/nl.json deleted file mode 100644 index 209aa4f..0000000 --- a/fullcalendar/examples/locales/nl.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Eigen", - "Dedication of a Church": "Kerkwijding", - "Blessed Virgin Mary": "H. Maagd Maria", - "Martyrs": "Martelaren", - "Pastors": "Herders", - "Doctors": "Kerkleraren", - "Virgins": "Maagden", - "Holy Men and Women": "Heilige mannen en vrouwen", - "For One Martyr": "Voor een martelaar", - "For Several Martyrs": "Voor meer martelaren", - "For Missionary Martyrs": "Voor missionarissen-martelaren", - "For One Missionary Martyr": "Voor een missionaire martelaar", - "For Several Missionary Martyrs": "Voor meer missionarissen-martelaren", - "For a Virgin Martyr": "Voor een maagd-martelares", - "For a Holy Woman Martyr": "Voor een heilige martelares", - "For a Pope": "Voor een Paus", - "For a Bishop": "Voor een bisschop", - "For One Pastor": "Voor één priester", - "For Several Pastors": "Voor meerdere priesters", - "For Founders of a Church": "Voor stichters van een plaatselijke kerk", - "For One Founder": "Voor één stichter", - "For Several Founders": "Voor meerdere stichters", - "For Missionaries": "Voor missionarissen", - "For One Virgin": "Voor één maagd", - "For Several Virgins": "Voor meerdere maagden", - "For Several Saints": "Voor meerdere heiligen", - "For One Saint": "Voor één heilige", - "For an Abbot": "Voor een abt", - "For a Monk": "Voor een monnik", - "For a Nun": "Voor een non", - "For Religious": "Voor kloosterlingen", - "For Those Who Practiced Works of Mercy": "Voor hen die werken van barmhartigheid hebben verricht", - "For Educators": "Voor opvoeders", - "For Holy Women": "Voor heilige vrouwen", - "From the Common": "Gemeenschappelijke", - "of (SING_MASC)": "voor", - "of (SING_FEMM)": "voor de", - "of (PLUR_MASC)": "voor", - "of (PLUR_MASC_ALT)": "voor", - "of (PLUR_FEMM)": "voor", - "or": "of", - "green": "groen", - "purple": "paars", - "white": "wit", - "red": "rood", - "pink": "roze", - "Customize options for generating the Roman Calendar": "Configureer de instellingen voor het genereren van de Romeinse kalender", - "Generate Roman Calendar": "Genereer de Romeinse kalender", - "Liturgical Calendar Calculation for a Given Year": "Berekening van de liturgische kalender voor een bepaald jaar", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "HTML-presentatie verwerkt door JAVASCRIPT met behulp van een AJAX-verzoek naar een %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "U hebt een jaar vóór 1970 aangevraagd: U kunt geen jaren vóór 1970 aanvragen.", - "Configurations being used to generate this calendar": "De instellingen die zijn gebruikt om deze agenda te genereren", - "Date in Gregorian Calendar": "Datum in de Gregoriaanse kalender", - "General Roman Calendar Festivity": "Feestdagen van de universele Romeinse kalender", - "Grade of the Festivity": "Graad van de Viering", - "YEAR": "JAAR", - "EPIPHANY": "OPENBARING", - "ASCENSION": "HEMELVAART", - "Month": "Maand", - "Information about the current calculation of the Liturgical Year": "Informatie over de huidige berekening van het liturgisch jaar", - "LOCALE": "TAAL", - "NATIONAL PRESET": "Nazionale kalender", - "DIOCESAN PRESET": "Diocesane kalender", - "Sunday": "Zondag", - "Thursday": "Donderdag", - "January 6": "6 januari", - "Sunday Jan 2↔Jan 8": "zondag 2 januari↔8 januari", - "Italy": "Italië", - "Vatican": "Vaticaan", - "weekday": "weekdag", - "Commemoration": "Vrije gedachtenis", - "Optional memorial": "Vrije gedachtenis", - "Memorial": "Gedachtenis", - "FEAST": "FEEST", - "FEAST OF THE LORD": "FEEST VAN DE HEER", - "SOLEMNITY": "HOOGFEEST", - "celebration with precedence over solemnities": "viering met voorrang op hoogfesten" -} diff --git a/fullcalendar/examples/locales/pt.json b/fullcalendar/examples/locales/pt.json deleted file mode 100644 index 3c774f5..0000000 --- a/fullcalendar/examples/locales/pt.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Próprio", - "Dedication of a Church": "Dedicação de uma Igreja", - "Blessed Virgin Mary": "Bem-Aventurada Virgem Maria", - "Martyrs": "Mártires", - "Pastors": "Pastores", - "Doctors": "Doutores", - "Virgins": "Virgens", - "Holy Men and Women": "Santos e Santas", - "For One Martyr": "Para Um Mártir", - "For Several Martyrs": "Para Vários Mártires", - "For Missionary Martyrs": "Para Mártires Missionários", - "For One Missionary Martyr": "Para Um Missionário Mártir", - "For Several Missionary Martyrs": "Para Vários Mártires Missionários", - "For a Virgin Martyr": "Para uma Virgem Mártir", - "For a Holy Woman Martyr": "Para uma Santa Mártir", - "For a Pope": "Para um Papa", - "For a Bishop": "Para um Bispo", - "For One Pastor": "Para Um Pastor", - "For Several Pastors": "Para Vários Pastores", - "For Founders of a Church": "Para Fundadores de uma Igreja", - "For One Founder": "Para Um Fundador", - "For Several Founders": "Para Vários Fundadores", - "For Missionaries": "Para Missionários", - "For One Virgin": "Para Uma Virgem", - "For Several Virgins": "Para Várias Virgens", - "For Several Saints": "Para Vários Santos", - "For One Saint": "Para Um Santo", - "For an Abbot": "Para um Abade", - "For a Monk": "Para um Monge", - "For a Nun": "Para uma Freira", - "For Religious": "Para Religiosos", - "For Those Who Practiced Works of Mercy": "Para Aqueles que Praticaram Obras de Misericórdia", - "For Educators": "Para Educadores", - "For Holy Women": "Para Santas Mulheres", - "From the Common": "Do Comum", - "of (SING_MASC)": "do", - "of (SING_FEMM)": "do", - "of (PLUR_MASC)": "de", - "of (PLUR_MASC_ALT)": "de", - "of (PLUR_FEMM)": "de", - "or": "ou", - "green": "verde", - "purple": "roxo", - "white": "branco", - "red": "vermelho", - "pink": "rosa", - "Customize options for generating the Roman Calendar": "Personalizar opções para gerar o Calendário Romano", - "Generate Roman Calendar": "Gerar Calendário Romano", - "Liturgical Calendar Calculation for a Given Year": "Cálculo do calendário litúrgico para um determinado ano", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "Apresentação HTML elaborada por JAVASCRIPT usando uma solicitação AJAX para um %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Você está solicitando um ano anterior a 1970: não é possível solicitar anos anteriores a 1970.", - "Configurations being used to generate this calendar": "Configurações usadas para gerar este calendário", - "Date in Gregorian Calendar": "Data no Calendário Gregoriano", - "General Roman Calendar Festivity": "Festividade do Calendário Romano Geral", - "Grade of the Festivity": "Grau da Festividade", - "YEAR": "ANO", - "EPIPHANY": "EPIFANIA", - "ASCENSION": "ASCENSÃO", - "Month": "Mês", - "Information about the current calculation of the Liturgical Year": "Informações sobre o cálculo atual do Ano Litúrgico", - "LOCALE": "LOCAL", - "NATIONAL PRESET": "PREDEFINIÇÃO NACIONAL", - "DIOCESAN PRESET": "PREDEFINIÇÃO DIOCESANA", - "Sunday": "Domingo", - "Thursday": "Quinta-feira", - "January 6": "6 de janeiro", - "Sunday Jan 2↔Jan 8": "Domingo 2 Jan↔8 Jan", - "Italy": "Itália", - "Vatican": "Vaticano", - "weekday": "dia da semana", - "Commemoration": "Comemoração", - "Optional memorial": "Memória opcional", - "Memorial": "Memória", - "FEAST": "FESTA", - "FEAST OF THE LORD": "FESTA DO SENHOR", - "SOLEMNITY": "SOLENIDADE", - "celebration with precedence over solemnities": "celebração com precedência sobre solenidades" -} diff --git a/fullcalendar/examples/locales/sk.json b/fullcalendar/examples/locales/sk.json deleted file mode 100644 index 388856e..0000000 --- a/fullcalendar/examples/locales/sk.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Proper": "Správne", - "Dedication of a Church": "Posviacka kostola", - "Blessed Virgin Mary": "Blahoslavená Panna Mária", - "Martyrs": "Mučeníci", - "Pastors": "Pastori", - "Doctors": "Lekári", - "Virgins": "Panny", - "Holy Men and Women": "Svätí muži a ženy", - "For One Martyr": "Pre jedného mučeníka", - "For Several Martyrs": "Pre niekoľkých mučeníkov", - "For Missionary Martyrs": "Za misionárskych mučeníkov", - "For One Missionary Martyr": "Za jedného misionárskeho mučeníka", - "For Several Missionary Martyrs": "Za niekoľkých misionárskych mučeníkov", - "For a Virgin Martyr": "Pre Pannu Martýrku", - "For a Holy Woman Martyr": "Pre svätú ženu mučeníčku", - "For a Pope": "Pre pápeža", - "For a Bishop": "Pre biskupa", - "For One Pastor": "Pre jedného pastora", - "For Several Pastors": "Pre niekoľkých pastierov", - "For Founders of a Church": "Pre zakladateľov Cirkvi", - "For One Founder": "Pre jedného zakladateľa", - "For Several Founders": "Za viacerých zakladateľov", - "For Missionaries": "Pre misionárov", - "For One Virgin": "Pre jednu Pannu", - "For Several Virgins": "Pre niekoľko panien", - "For Several Saints": "Pre niekoľkých svätých", - "For One Saint": "Pre jedného svätého", - "For an Abbot": "Za opáta", - "For a Monk": "Pre mnícha", - "For a Nun": "Pre mníšku", - "For Religious": "Pre náboženské účely", - "For Those Who Practiced Works of Mercy": "Pre tých, ktorí vykonávali skutky milosrdenstva", - "For Educators": "Pre pedagógov", - "For Holy Women": "Za sväté ženy", - "From the Common": "Z bežného", - "of (SING_MASC)": "z", - "of (SING_FEMM)": "z", - "of (PLUR_MASC)": "z", - "of (PLUR_MASC_ALT)": "z", - "of (PLUR_FEMM)": "z", - "or": "alebo", - "green": "zelená", - "purple": "fialová", - "white": "biela", - "red": "červená", - "pink": "ružová", - "Customize options for generating the Roman Calendar": "Prispôsobte možnosti na vytvorenie Rímskeho kalendára", - "Generate Roman Calendar": "Generovať rímsky kalendár", - "Liturgical Calendar Calculation for a Given Year": "Výpočet liturgického kalendára pre daný rok", - "HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s": "HTML prezentácia vypracovaná pomocou JAVASCRIPT-u pomocou AJAX požiadavky na %s", - "You are requesting a year prior to 1970: it is not possible to request years prior to 1970.": "Žiadate rok pred rokom 1970: nie je možné žiadať roky pred rokom 1970.", - "Configurations being used to generate this calendar": "Konfigurácie používané na vytvorenie tohto kalendára", - "Date in Gregorian Calendar": "Dátum v gregoriánskom kalendári", - "General Roman Calendar Festivity": "Všeobecný rímsky kalendár Sviatok", - "Grade of the Festivity": "Stupeň slávnosti", - "YEAR": "ROK", - "EPIPHANY": "Zjavenie Pána", - "ASCENSION": "Nanebovstúpenie", - "Month": "Mesiac", - "Information about the current calculation of the Liturgical Year": "Informácie o aktuálnom výpočte liturgického roka", - "LOCALE": "MIESTO", - "NATIONAL PRESET": "NÁRODNÁ PREZENTÁCIA", - "DIOCESAN PRESET": "DIECÉZNY KŇAZ", - "Sunday": "Nedeľa", - "Thursday": "Štvrtok", - "January 6": "6. januára", - "Sunday Jan 2↔Jan 8": "Nedeľa 2. januára ↔ 8. januára", - "Italy": "Taliansko", - "Vatican": "Vatikán", - "weekday": "pracovný deň", - "Commemoration": "Spomienka", - "Optional memorial": "Ľubovoľná spomienka", - "Memorial": "Pamätník", - "FEAST": "SVIATOK", - "FEAST OF THE LORD": "SVIATOK PÁNA", - "SOLEMNITY": "SLÁVNOSŤ", - "celebration with precedence over solemnities": "slávenie s prednosťou pred slávnosťami" -} diff --git a/fullcalendar/examples/messages.html b/fullcalendar/examples/messages.html index 6fab368..6d8e354 100644 --- a/fullcalendar/examples/messages.html +++ b/fullcalendar/examples/messages.html @@ -15,9 +15,8 @@ - - - + + @@ -34,9 +33,9 @@
-
↩ Go back ↩
- settings +
+
@@ -46,16 +45,23 @@
- - - + - - - + + - - + diff --git a/fullcalendar/examples/month-view.html b/fullcalendar/examples/month-view.html index 35d6350..db48542 100644 --- a/fullcalendar/examples/month-view.html +++ b/fullcalendar/examples/month-view.html @@ -2,61 +2,68 @@ - - {TITLE PLACEHOLDER} - - - - - - - - - - - - - - - + + {TITLE PLACEHOLDER} + + + + + + + + + + + + + + -
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
↩ Go back ↩
- settings -
- -
- - - -
- - -
- - - - - - - - - - - +
+
+
+ +
+ + + + + + +
+ + + + + + + + diff --git a/fullcalendar/examples/script.js b/fullcalendar/examples/script.js index 0b575e2..e032e3d 100644 --- a/fullcalendar/examples/script.js +++ b/fullcalendar/examples/script.js @@ -1,40 +1,31 @@ -"use strict"; - -Object.filter = (obj, predicate) => +import LitGrade from './LitGrade.js'; +import { ApiClient, CalendarSelect, ApiOptions, Input } from '@liturgical-calendar/components-js'; +import { Calendar } from '@fullcalendar/core'; +import allLocales from '@fullcalendar/core/locales-all'; +import dayGridPlugin from '@fullcalendar/daygrid'; +import listPlugin from '@fullcalendar/list'; +import bootstrap5Plugin from '@fullcalendar/bootstrap5'; +import la from './la.js'; + +Object.filter = (obj, predicate) => Object.keys(obj) .filter( key => predicate(obj[key]) ) .reduce( (res, key) => (res[key] = obj[key], res), {} ); -const thirdLevelDomain = window.location.hostname.split('.')[0]; -const isStaging = ( thirdLevelDomain.includes( '-staging' ) || window.location.pathname.includes( '-staging' ) ); -const stagingURL = isStaging ? '-staging' : ''; -const endpointV = isStaging ? 'dev' : 'v3'; -const endpointURL = `https://litcal.johnromanodorazio.com/api/${endpointV}/`; -const metadataURL = `https://litcal.johnromanodorazio.com/api/${endpointV}/metadata/`; -const supportedUILocales = [ 'de', 'en', 'es', 'fr', 'it', 'la', 'pt', 'nl' ]; +Input.setGlobalInputClass('form-select'); +Input.setGlobalLabelClass('form-label d-block mb-1'); +Input.setGlobalWrapper('div'); +Input.setGlobalWrapperClass('form-group col col-md-3'); -let messages = null, - loadMessages = (locale,callback) => { - console.log('retrieving messages with locale = ' + locale); - if( supportedUILocales.includes(locale.split('_')[0]) === false ) { - locale = 'en'; - } - $.getJSON( `locales/${locale.split('_')[0]}.json`, data => { - messages = data; - callback(); - }).fail(() => { console.log("there was an error retrieving local messages..."); }); - }, - today = new Date(), - $Settings = { - "year": today.getFullYear(), - "epiphany": "JAN6", - "ascension": "SUNDAY", - "corpuschristi": "SUNDAY", - "locale": "la", - "returntype": "JSON" - }, - pad = n => n < 10 ? '0' + n : n, +const currentLocale = Cookies.get('currentLocale') ?? 'en'; + +let today = new Date(), + currentYear = today.getFullYear(), fullCalendarSettings = { + locales: allLocales, + locale: 'en', + plugins: [ dayGridPlugin, listPlugin, bootstrap5Plugin ], + initialView: 'dayGridMonth', headerToolbar: { left: 'prev,next today', center: 'title', @@ -44,1101 +35,112 @@ let messages = null, firstDay: 0, eventOrder: 'idx', eventDidMount: info => { - new Tooltip(info.el, { - title: info.event.extendedProps.description, - placement: 'top', - trigger: 'hover', - container: 'body', - html: true - }); - } + info.el.title = info.event.extendedProps.description; + info.el.setAttribute('data-bs-toggle', "tooltip"); + info.el.setAttribute('data-bs-html', "true"); + info.el.setAttribute('data-bs-container', "body"); + info.el.setAttribute('data-bs-custom-class', "custom-tooltip") + new bootstrap.Tooltip(info.el); + // Add black outline to white dots when in listMonth view + const dotEl = info.el.getElementsByClassName('fc-list-event-dot')[0]; + if (dotEl && dotEl.style.borderColor === 'white') { + dotEl.style.outline = '1px solid black'; + } + }, + themeSystem: 'bootstrap5' }, + pad = n => n < 10 ? '0' + n : n, litCalDataToEvents = LitCal => { - let LitCalKeys = Object.keys(LitCal); - let events = []; - for (let keyindex = 0; keyindex < LitCalKeys.length; keyindex++) { - let keyname = LitCalKeys[keyindex]; - let festivity = LitCal[keyname]; - let dy = (festivity.date.getDay() === 0 ? 7 : festivity.date.getDay()); // get the day of the week - let possibleColors = festivity.color; //.split(",") - let CSScolor = possibleColors[0]; - let textColor = (CSScolor === 'white' || CSScolor === 'pink' ? 'black' : 'white'); + return LitCal.map( (Festivity, index) => { + Festivity.date = new Date(Festivity.date * 1000); + const DayOfTheWeek = (Festivity.date.getDay() === 0 ? 7 : Festivity.date.getDay()); // get the day of the week + const CSScolor = Festivity.color[0]; + const textColor = (CSScolor === 'white' || CSScolor === 'pink' ? 'black' : 'white'); let festivityGrade = ''; - if (festivity.hasOwnProperty('displayGrade') && festivity.displayGrade !== '') { - festivityGrade = festivity.displayGrade + ', '; + if (Festivity.hasOwnProperty('grade_display') && Festivity.grade_display !== null) { + festivityGrade = Festivity.grade_display === '' ? '' : Festivity.grade_display + ', '; } - else if (dy !== 7 || festivity.grade > 3) { - //festivityGrade = _G(festivity.grade) + ', '; - let { strVal, tags } = LitGrade.strWTags( festivity.grade ); - festivityGrade = tags[0] + __( strVal ) + tags[1] + ', '; + else if (DayOfTheWeek !== 7 || Festivity.grade > 3) { + const { tags } = LitGrade.strWTags( Festivity.grade ); + festivityGrade = tags[0] + Festivity.grade_lcl + tags[1] + ', '; } - - let description = '' + festivity.name + '
' + festivityGrade + '' + _CC(festivity.color, true) + '
' + _C(festivity.common) + '' + (festivity.hasOwnProperty('liturgicalYear') ? '
' + festivity.liturgicalYear : ''); - events[keyindex] = { - title: festivity.name, - start: festivity.date.getUTCFullYear() + '-' + pad(festivity.date.getUTCMonth() + 1) + '-' + pad(festivity.date.getUTCDate()), + let description = '' + Festivity.name + '
' + festivityGrade + '' + Festivity.color_lcl + '
' + Festivity.common_lcl + '' + (Festivity.hasOwnProperty('liturgical_year') ? '
' + Festivity.liturgical_year : ''); + return { + title: Festivity.name, + start: Festivity.date.getUTCFullYear() + '-' + pad(Festivity.date.getUTCMonth() + 1) + '-' + pad(Festivity.date.getUTCDate()), backgroundColor: CSScolor, textColor: textColor, description: description, - idx: festivity.eventIdx + idx: Festivity.event_idx }; - - if (keyindex === LitCalKeys.length - 1) { - $('#spinnerWrapper').fadeOut('slow'); - } - } - return events; + }); }, updateFCSettings = events => { - if ($Settings.locale !== 'en') { - fullCalendarSettings.locale = $Settings.locale.split('_')[0]; + if (currentLocale !== 'en') { + const locale = currentLocale.replaceAll('_', '-'); + let baseLocale = locale.split('-')[0]; + if (baseLocale === 'lat') { + fullCalendarSettings.locale = la; + } else { + fullCalendarSettings.locale = baseLocale; + } } - if (parseInt($Settings.year) !== today.getFullYear()) { - fullCalendarSettings.initialDate = $Settings.year + '-01-01'; + if (parseInt(currentYear) !== today.getFullYear()) { + fullCalendarSettings.initialDate = currentYear + '-01-01'; } fullCalendarSettings.events = events; - }, - genLitCal = () => { - console.log('generating liturgical calendar... data of request = '); - console.log( $Settings ); - $.ajax({ - method: 'POST', - data: $Settings, - url: endpointURL, - success: LitCalData => { - //console.log(LitCalData); - if (LitCalData.hasOwnProperty("LitCal")) { - createHeader(); - let { LitCal } = LitCalData; - for (let key in LitCal) { - LitCal[key].date = new Date(LitCal[key].date * 1000); //transform PHP timestamp to javascript date object - } - - let events = litCalDataToEvents( LitCal ); - updateFCSettings( events ); - let calendar = new FullCalendar.Calendar(document.getElementById('calendar'), fullCalendarSettings); - - calendar.render(); - - //even though the following code works for Latin, the Latin however is not removed for successive renders - //in other locales. Must have something to do with how the renders are working, like an append or something? - /*if ($Settings.locale === 'la') { - console.log('locale is Latin, now fixing days of the week'); - $('.fc-day').each((idx, el) => { - $(el).find('a.fc-col-header-cell-cushion').text(dayNamesShort[idx]); - console.log($(el).find('a.fc-col-header-cell-cushion').text()); - }); - } - */ + }; - } - if (LitCalData.hasOwnProperty('Messages')) { - $('#LitCalMessages tbody').empty(); - LitCalData.Messages.forEach((message, idx) => { - $('#LitCalMessages tbody').append(`${idx}${message}`); +ApiClient.init().then( apiClient => { + if (false === apiClient || false === apiClient instanceof ApiClient) { + alert('Error initializing the Liturgical Calendar API Client'); + } else { + const calendarSelect = new CalendarSelect( currentLocale ); + calendarSelect.allowNull() + .label({ + class: 'form-label d-block mb-1' + }).wrapper({ + class: 'form-group col col-md-3' + }).class('form-select') + .appendTo( '#calendarOptions'); + + const apiOptions = new ApiOptions( currentLocale ); + apiOptions._acceptHeaderInput.hide() + apiOptions._yearInput.class( 'form-control' ); + apiOptions.linkToCalendarSelect( calendarSelect ).appendTo( '#calendarOptions' ); + + apiClient.listenTo( calendarSelect ).listenTo( apiOptions ); + apiClient._eventBus.on( 'calendarFetched', LitCalData => { + currentYear = apiOptions._yearInput._domElement.value; + console.log(`currentYear is ${currentYear}`); + if (LitCalData.hasOwnProperty("litcal")) { + const events = litCalDataToEvents( LitCalData.litcal ); + updateFCSettings( events ); + const calendar = new Calendar(document.getElementById('calendar'), fullCalendarSettings); + calendar.render(); + document.querySelector('#spinnerWrapper').style.display = 'none'; + //even though the following code works for Latin, the Latin however is not removed for successive renders + //in other locales. Must have something to do with how the renders are working, like an append or something? + /*if (currentLocale === 'la') { + console.log('locale is Latin, now fixing days of the week'); + $('.fc-day').each((idx, el) => { + $(el).find('a.fc-col-header-cell-cushion').text(dayNamesShort[idx]); + console.log($(el).find('a.fc-col-header-cell-cushion').text()); }); } + */ - }, - error: (jqXHR, textStatus, errorThrown) => { - console.log('(' + textStatus + ') ' + errorThrown); - console.log(jqXHR.getAllResponseHeaders); - console.log(jqXHR.responseText); } - }); - }, - createHeader = () => { - document.title = __("Generate Roman Calendar"); - $('#settingsWrapper').dialog("destroy").remove(); - $('header').empty(); - let templateStr = __('HTML presentation elaborated by JAVASCRIPT using an AJAX request to a %s'); - templateStr = templateStr.replace('%s', `PHP engine`); - let $header = ` -

${__('Liturgical Calendar Calculation for a Given Year')} (${$Settings.year})

-

${templateStr}

-
-

${__('Configurations being used to generate this calendar')}:

- ${__('YEAR')} = ${$Settings.year}, ${__('EPIPHANY')} = ${$Settings.epiphany}, ${__('ASCENSION')} = ${$Settings.ascension}, CORPUS CHRISTI = ${$Settings.corpuschristi}, LOCALE = ${$Settings.locale}, NATIONALCALENDAR = ${$Settings.nationalcalendar}, DIOCESANCALENDAR = ${$Settings.diocesancalendar} -
`, - $tbheader = `${__("Month")}${__("Date in Gregorian Calendar")}${__("General Roman Calendar Festivity")}${__("Grade of the Festivity")}`, - $nationalCalendarSelect = ``; - const $localesSelect = ``; - let $settingsDialog = `
- - - - - - -
${$localesSelect}${__('NATIONAL PRESET')}: ${$nationalCalendarSelect}
${__('DIOCESAN PRESET')}:
`; - $('header').html($header); - $('#LitCalTable thead').html($tbheader); - $('#LitCalMessages thead').html(`${__("Information about the current calculation of the Liturgical Year")}`); - $('#generateLitCal').button(); - - $($settingsDialog).dialog({ - title: __('Customize options for generating the Roman Calendar'), - modal: true, - width: '80%', - show: { - effect: 'fade', - duration: 500 - }, - hide: { - effect: 'fade', - duration: 500 - }, - open: () => { - $('#locale').val( $Settings.locale ); - if( $Settings.nationalcalendar === '' ) { - $('#calSettingsForm :input').prop('disabled', false); - } else { - $('#calSettingsForm :input').not('#nationalcalendar').not('#year').not('#generateLitCal').prop('disabled', true); - } - handleDiocesesList( $Settings.nationalcalendar ); - }, - autoOpen: false - }); - - }, - __ = key => { - if ( messages !== null && typeof messages === 'object') { - if ( messages.hasOwnProperty(key) ) { - return messages[key]; - } - } - return key; - }, - _C = $commons => { - let $common = ''; - if ($commons.length && !$commons.includes( "Proper" ) ) { - $commons = $commons.map($txt => { - let $commonArr = $txt.split(":"); - let $commonGeneral = __($commonArr[0]); - let $commonSpecific = $commonArr.length > 1 && $commonArr[1] != "" ? __($commonArr[1]) : ""; - let $commonKey = ''; - //$txt = str_replace(":", ": ", $txt); - switch ($commonGeneral) { - case __("Dedication of a Church"): - $commonKey = "of (SING_FEMM)"; - break; - case __("Blessed Virgin Mary"): - $commonKey = "of (SING_FEMM)"; - break; - case __("Virgins"): - $commonKey = "of (PLUR_FEMM)"; - break; - case __("Martyrs"): - case __("Pastors"): - case __("Doctors"): - case __("Holy Men and Women"): - $commonKey = "of (PLUR_MASC)"; - break; - default: - $commonKey = "of (SING_MASC)"; - } - return __("From the Common") + " " + __($commonKey) + " " + $commonGeneral + ($commonSpecific != "" ? ": " + $commonSpecific : ""); - }); - $common = $commons.join("; " + __("or") + " "); - } else if ($commons.length && $commons.includes( "Proper" ) ) { - $common = __("Proper"); - } - return $common; - }, - _CC = ($colors, html) => { - if (html === true) { - let $highlightColor = $colors.includes( 'pink' ) ? 'text-shadow: 0 0 2px #000;' : ''; - if( $colors.length > 1 ) { - let $colorstr = $colors.map($txt => { - let $clr = $txt === 'white' ? 'gray' : $txt; - return '' + __($txt) + ''; + if (LitCalData.hasOwnProperty('messages')) { + const messagesHtml = LitCalData.messages.map((message, idx) => { + const tr = document.createElement('tr'); + tr.innerHTML = `${idx}${message}`; + return tr; }); - return $colorstr.join(" " + __("or") + " "); + document.querySelector('#LitCalMessages tbody').replaceChildren(...messagesHtml); } - else { - return '' + __($colors[0]) + ''; - } - - } - else { - if( $colors.length > 1 ) { - let $colorstr = $colors.map( $txt => __($txt) ); - return $colorstr.join(" " + __("or") + " "); - } - else { - return __($colors[0]); - } - } - }, - //dayNames = ['Dies Solis', 'Dies Lunae', 'Dies Martis', 'Dies Mercurii', 'Dies Iovis', 'Dies Veneris', 'Dies Saturni'], - //dayNamesShort = ['Sol', 'Lun', 'Mart', 'Merc', 'Iov', 'Ven', 'Sat'], - $index = {}, - handleDiocesesList = val => { - $('#diocesancalendar').empty(); - if( val === "VATICAN" || val === "" ) { - $('#diocesancalendar').prop('disabled', true); - } else { - let $DiocesesList; - if(Object.keys($index.DiocesanCalendars).length > 0){ - $DiocesesList = Object.filter($index.DiocesanCalendars, key => key.nation === val); - } - if(Object.keys($DiocesesList).length > 0) { - $('#diocesancalendar').prop('disabled', false); - $('#diocesancalendar').append(''); - for(const [key, value] of Object.entries($DiocesesList)){ - $('#diocesancalendar').append(``); - } - } else { - $('#diocesancalendar').prop('disabled', true); - } - } - }; - -let metadataAjaxRequest = jQuery.ajax({ - url: metadataURL, - dataType: 'json', - statusCode: { - 404: () => { console.log('The JSON definition "nations/index.json" does not exist yet.'); } - }, - success: data => { - console.log('retrieved data from index file:'); - console.log(data); - $index = data.LitCalMetadata; - } -}); - -$(document).on('click', '#openSettings', () => { - $('#settingsWrapper').dialog("open"); -}); - -$(document).on("submit", '#calSettingsForm', event => { - event.preventDefault(); - let formValues = $(event.currentTarget).serializeArray(); - for (let obj of formValues) { - $Settings[obj.name] = obj.value; - } - console.log('$Settings = '); - console.log($Settings); - $('#settingsWrapper').dialog("close"); - Cookies.set( 'litCalSettings', JSON.stringify($Settings), { secure: true } ); - if( $Settings.locale !== 'en' ){ - loadMessages( $Settings.locale, genLitCal); - } else { - messages = null; - genLitCal(); - } - return false; -}); - - -$(document).on('change', '#nationalcalendar', ev => { - const currentSelectedNation = $(ev.currentTarget).val(); - $Settings.nationalcalendar = currentSelectedNation; - let nationalCalSettingLocale = $index.NationalCalendarsMetadata.hasOwnProperty(currentSelectedNation) ? $index.NationalCalendarsMetadata[currentSelectedNation].settings.Locale : 'la'; - switch( currentSelectedNation ) { - case "VATICAN": - $Settings.locale = 'la'; - $Settings.epiphany = 'JAN6'; - $Settings.ascension = 'THURSDAY'; - $Settings.corpuschristi = 'THURSDAY'; - $Settings.diocesancalendar = ''; - $('#locale').val($Settings.locale); - $('#epiphany').val($Settings.epiphany); - $('#ascension').val($Settings.ascension); - $('#corpuschristi').val($Settings.corpuschristi); - $('#diocesancalendar').val($Settings.diocesancalendar); - - $('#calSettingsForm :input').not('#nationalcalendar').not('#year').not('#generateLitCal').prop('disabled', true); - break; - case "": - $('#calSettingsForm :input').prop('disabled', false); - break; - default: - $Settings.locale = nationalCalSettingLocale.includes('_') ? nationalCalSettingLocale : nationalCalSettingLocale.toLowerCase(); - $Settings.epiphany = $index.NationalCalendarsMetadata[currentSelectedNation].settings.Epiphany; - $Settings.ascension = $index.NationalCalendarsMetadata[currentSelectedNation].settings.Ascension; - $Settings.corpuschristi = $index.NationalCalendarsMetadata[currentSelectedNation].settings.CorpusChristi; - $('#locale').val($Settings.locale); - $('#epiphany').val($Settings.epiphany); - $('#ascension').val($Settings.ascension); - $('#corpuschristi').val($Settings.corpuschristi); - $('#calSettingsForm :input').not('#nationalcalendar').not('#year').not('#generateLitCal').prop('disabled', true); - } - handleDiocesesList( currentSelectedNation ); -}); - -$(document).on('change', '#diocesancalendar', ev => { $Settings.diocesancalendar = $(ev.currentTarget).val(); }); - - -$(document).ready(() => { - console.log('document is ready'); - if( typeof Cookies.get( 'litCalSettings' ) !== 'undefined' ) { - $Settings = JSON.parse( Cookies.get( 'litCalSettings' ) ); - } else { - Cookies.set( 'litCalSettings', JSON.stringify($Settings), { secure: true } ); + }); + // fetch a default calendar here + apiClient.fetchNationalCalendar(calendarSelect._domElement.value); } - - loadMessages( $Settings.locale, genLitCal); - - $('.backNav').attr('href',`https://litcal${stagingURL}.johnromanodorazio.com/usage.php`); - }); diff --git a/fullcalendar/examples/styles.css b/fullcalendar/examples/styles.css index f708f34..40d7452 100644 --- a/fullcalendar/examples/styles.css +++ b/fullcalendar/examples/styles.css @@ -8,64 +8,15 @@ body { #calendar { max-width: 1200px; margin: 40px auto; - background-color: beige; + background-color: whitesmoke; padding: 24px; border-radius: 16px; border: 5px solid gray; } - -.backNav { - background-color: yellow; - font-size: 1.1em; - text-align: center; - cursor: pointer; - text-decoration: none; - width: 95%; - margin: 0 auto; - border-bottom: 2px outset LightBlue; - display: block; - padding: 12px 24px; - font-weight: bold; -} - -.backNav:hover { - background-color: gold; - color: DarkBlue; -} - -#LitCalTable { - width: 75%; - margin: 30px auto; - border: 1px solid Blue; - border-radius: 6px; - padding: 10px; - background: LightBlue; -} - -#LitCalTable td { - padding: 8px 6px; -} - -td.rotate { - width: 1.5em; - white-space: nowrap; - text-align: center; - vertical-align: middle; -} - -td.rotate div { - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - font-size: 1.8em; - font-weight: bold; - writing-mode: vertical-rl; - transform: rotate(180.0deg); -} - -.dateEntry { - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - font-size: .7em; - font-weight: bold; +.custom-tooltip { + --bs-tooltip-bg: var(--bs-secondary); + --bs-tooltip-zindex: 9999; } .lds-roller { @@ -187,50 +138,6 @@ td.rotate div { height: 100%; } -#calSettings { - width: 70%; - margin: 0 auto; - border-collapse: collapse; -} - -#calSettings tr:first-child { - border-bottom: 1px groove White; -} - -#calSettings tr:last-child { - border-top: 1px groove White; -} - -#calSettings tr td { - padding: 12px; -} - -#calSettings tr td:first-child { - text-align: right; - padding-right: 18px; -} -#calSettings tr td:nth-child(3) { - border-left: 1px groove white; - padding-left: 18px; - text-align: right; -} - -#openSettings { - position: absolute; - display: block; - top: 70px; - right: 24px; - color: steelblue; - cursor: pointer; - background-color: palegoldenrod; - padding: 6px; - border: 1px groove white; -} - -#openSettings:hover { - color: darkslategray; - background-color: lightyellow; -} #LitCalMessages { width: 75%; @@ -254,94 +161,3 @@ td.rotate div { border-right: 1px groove White; } -.popper, -.tooltip { - position: absolute; - z-index: 9999; - background: #fff9e5; - color: black; - width: 150px; - border-radius: 3px; - box-shadow: 0 0 6px rgba(0,0,0,0.5); - padding: 10px; - text-align: center; -} - -.popper .popper__arrow, -.tooltip .tooltip-arrow { - width: 0; - height: 0; - border-style: solid; - position: absolute; - margin: 5px; - box-shadow: -1 0 6px rgba(0,0,0,0.5); - border-color: #fff9e5; -} - -.popper[x-placement^="top"], -.tooltip[x-placement^="top"] { - margin-bottom: 5px; -} - -.popper[x-placement^="top"] .popper__arrow, -.tooltip[x-placement^="top"] .tooltip-arrow { - border-width: 5px 5px 0; - border-left-color: transparent; - border-right-color: transparent; - border-bottom-color: transparent; - bottom: -5px; - left: calc(50% - 5px); - margin-top: 0; - margin-bottom: 0; -} - -.popper[x-placement^="bottom"], -.tooltip[x-placement^="bottom"] { - margin-top: 5px; -} - -.tooltip[x-placement^="bottom"] .tooltip-arrow, -.popper[x-placement^="bottom"] .popper__arrow { - border-width: 0 5px 5px; - border-left-color: transparent; - border-right-color: transparent; - border-top-color: transparent; - top: -5px; - left: calc(50% - 5px); - margin-top: 0; - margin-bottom: 0; -} - -.tooltip[x-placement^="right"], -.popper[x-placement^="right"] { - margin-left: 5px; -} - -.popper[x-placement^="right"] .popper__arrow, -.tooltip[x-placement^="right"] .tooltip-arrow { - border-width: 5px 5px 5px 0; - border-left-color: transparent; - border-top-color: transparent; - border-bottom-color: transparent; - left: -5px; - top: calc(50% - 5px); - margin-left: 0; - margin-right: 0; -} - -.popper[x-placement^="left"], -.tooltip[x-placement^="left"] { - margin-right: 5px; -} - -.popper[x-placement^="left"] .popper__arrow, -.tooltip[x-placement^="left"] .tooltip-arrow { - border-width: 5px 0 5px 5px; - border-top-color: transparent; - border-right-color: transparent; - border-bottom-color: transparent; - right: -5px; - top: calc(50% - 5px); - margin-left: 0; - margin-right: 0; -} diff --git a/javascript/main.js b/javascript/main.js index 3a68e35..edc2369 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -16,7 +16,7 @@ ApiClient.init().then( (apiClient) => { .appendTo( '#calendarOptions'); const apiOptions = new ApiOptions( document.documentElement.lang || 'en-US' ); - apiOptions._localeInput.defaultValue( 'en' ); + apiOptions._localeInput.defaultValue( document.documentElement.lang || 'en' ); apiOptions._acceptHeaderInput.hide(); apiOptions._yearInput.class( 'form-control' ); // override the global input class apiOptions.linkToCalendarSelect( calendarSelect ).appendTo( '#calendarOptions' );