File: /home/thuexe247c/public_html/wp-content/plugins/daily-readings/demo.html
<!DOCTYPE html>
<html>
<head>
<style>
body, select {
font-family: "Trebuchet MS";
font-size: smaller;
color: #333333;
}
label.control-label {
float: left;
min-width: 25vw;
}
.daily-readings-datepicker img.ui-datepicker-trigger {
max-height: 50px;
cursor: pointer;
}
select.form-control {
width: 98%;
}
.divTableCell p i {
font-size: xx-small;
color: #737272;
}
.divTableCell p {
margin-block-end: 0;
margin-block-start: 0.25em;
}
.daily-readings-wrapper p.daily-readings-date {
text-transform: capitalize;
font-weight: bold;
}
.daily-readings-wrapper h4.daily-readings-reading-heading {
margin-top: 30px;
}
/* DivTable.com */
.divTable{
display: table;
width: 100%;
}
.divTableRow {
display: table-row;
}
.divTableCell, .divTableHead {
display: table-cell;
vertical-align: middle;
padding: 8px 20px 8px 0;
}
.divTableCell {
border-bottom: 1px solid #e0dddd;
}
.divTableCell.no-border {
border-bottom: 0px;
}
.divTableBody {
display: table-row-group;
}
#daily-readings-form {
padding: 10px;
padding-right: 20px;
padding-left: 20px;
margin-bottom: 50px;
background-color: #ffffff;
color: #333333;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
-webkit-box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
border: 1px solid #cccccc;
}
.show-on-mobile {
display: none;
}
#timezone-offset {
max-width: 60vw;
}
@media screen and (max-width: 800px) {
.show-on-mobile {
display: block;
}
#daily-readings-form {
max-width: 90vw;
}
}
</style>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function () {
$('#datepicker').datepicker({
dateFormat: 'yymmdd',
showOn: "button",
buttonImage: "https://bible-assets.s3.us-east-2.amazonaws.com/assets/calendar_icon.svg",
buttonImageOnly: true,
buttonText: "Select date"
});
});
jQuery(document).ready(function ($) {
const DICTIONARY = {
'en': {
'riteLabel': 'Rite',
'colorLabel': 'Color',
'hideReadingsLabel': 'Readings to hide',
'timeZoneLabel': 'Time zone',
'hideNumbersLabel': 'Hide verse numbers?',
'selectDateLabel': 'Select date',
'firstLecture': 'First Reading',
'psalm': 'Psalm',
'secondLecture': 'Second Reading',
'gospel': 'Gospel',
'noReadings': 'No readings available for this date',
'ambrosianOption': 'Ambrosian (Italian)',
'romanItOption': 'Roman (Italian)',
'romanEnOption': 'Roman (English)',
'romanFrOption': 'Roman (French)',
'romanEsOption': 'Roman (Spanish)',
'infoColor': 'Choose the color of the reading heading',
'infoHideReadings': 'Tick the checkbox if you don\'t want to render a daily reading',
'infoTimezone': 'The plugin auto-detects your server time-zone, but you can select a different one if you need',
'infoHideNumbers': 'Tick the checkbox if you don\'t want to not render the number of verses.<br>e.g. ≪<sup>1</sup>Some text≫ becomes ≪Some text≫'
},
'it': {
'riteLabel': 'Rito',
'colorLabel': 'Colore',
'hideReadingsLabel': 'Letture da rimuovere',
'timeZoneLabel': 'Fuso',
'hideNumbersLabel': 'Nascondere i numeri dei versetti?',
'selectDateLabel': 'Seleziona una data',
'firstLecture': 'Prima Lettura',
'psalm': 'Salmo',
'secondLecture': 'Seconda Lettura',
'gospel': 'Vangelo',
'noReadings': 'Non ci sono letture disponibili per questa data',
'ambrosianOption': 'Ambrosiano (Italiano)',
'romanItOption': 'Romano (Italiano)',
'romanEnOption': 'Romano (Inglese)',
'romanFrOption': 'Romano (Francese)',
'romanEsOption': 'Romano (Spagnolo)',
'infoColor': 'Scegli il colore per le intestazioni delle letture',
'infoHideReadings': 'Spunta queste caselle se non vuoi mostrare una lettura del giorno',
'infoTimezone': 'Il plugin rileva automaticamente il fuso orario del tuo server, ma puoi selezionarne uno diverso se necessario',
'infoHideNumbers': 'Spunta questa casella se non vuoi mostrare i numeri dei versetti<br>es. ≪<sup>1</sup>Testo≫ diventa ≪Testo≫'
},
'es': {
'riteLabel': 'Rito',
'colorLabel': 'Color',
'hideReadingsLabel': 'Lecturas para ocultar',
'timeZoneLabel': 'Zona horaria',
'hideNumbersLabel': '¿Ocultar números de versículo?',
'selectDateLabel': 'Seleccionar un día',
'firstLecture': 'Primera lectura',
'psalm': 'Salmo',
'secondLecture': 'Segunda lectura',
'gospel': 'Evangelio',
'noReadings': 'Aún no hay lecturas disponibles',
'ambrosianOption': 'Ambrosiano (Italiano)',
'romanItOption': 'Romano (Italiano)',
'romanEnOption': 'Romano (Inglés)',
'romanFrOption': 'Romano (Francés)',
'romanEsOption': 'Romano (Español)',
'infoColor': 'Elija el color del título de lectura',
'infoHideReadings': 'Marque la casilla de verificación si no desea renderizar una lectura del día',
'infoTimezone': 'El plugin detecta automáticamente la zona horaria de su servidor, pero puede seleccionar una diferente si lo necesita',
'infoHideNumbers': 'Marque la casilla de verificación si no desea no representar el número de versos.<br>p. Ej. ≪<sup>1</sup>Algo de texto≫ se convierte en ≪Algo de texto≫'
},
'fr': {
'riteLabel': 'Rite',
'colorLabel': 'Couleur',
'hideReadingsLabel': 'Lectures à cacher',
'timeZoneLabel': 'Fuseau horaire',
'hideNumbersLabel': 'Cacher les numéros de vers?',
'selectDateLabel': 'Sélectionnez une date',
'firstLecture': 'Première lecture',
'psalm': 'Psaume',
'secondLecture': 'Deuxième lecture',
'gospel': 'Evangile',
'noReadings': 'Aucune lecture disponible pour le moment',
'ambrosianOption': 'Ambrosian (Italien)',
'romanItOption': 'Romain (Italien)',
'romanEnOption': 'Romain (Anglais)',
'romanFrOption': 'Romain (Français)',
'romanEsOption': 'Romain (Espagnol)',
'infoColor': 'Choisissez la couleur de l\'en-tête de lecture',
'infoHideReadings': 'Cochez la case si vous ne souhaitez pas visualiser une lecture du jour',
'infoTimezone': 'Le plugin détecte automatiquement le fuseau horaire de votre serveur, mais vous pouvez en sélectionner un autre si vous avez besoin',
'infoHideNumbers': 'Cochez la case si vous ne souhaitez pas rendre le nombre de versets.<br>par ex. ≪<sup>1</sup>Du texte≫ devient ≪Du texte≫'
}
}
loadLabels();
retrieveReadings(buildDate());
function retrieveReadings(targetDate) {
var lang = $('#rite').val();
$('.daily-readings-wrapper').attr('dir', getDir(lang));
targetDate = setTimezone(targetDate);
var urlLiturgy = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=liturgic_t';
var urlTitleEpistleReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading_lt&content=EP';
var urlEpistleReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading&content=EP';
var urlTitleFirstReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading_lt&content=FR';
var urlFirstReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading&content=FR';
var urlTitlePsalm = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading_lt&content=PS';
var urlPsalm = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading&content=PS';
var urlTitleSecondReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading_lt&content=SR';
var urlSecondReading = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading&content=SR';
var urlTitleGospel = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading_lt&content=GSP';
var urlGospel = 'https://feed.evangelizo.org/v2/reader.php?date=' + targetDate + '&lang=' + lang + '&type=reading&content=GSP';
$('.daily-readings-reading-heading').remove();
$('.daily-readings-reading').remove();
$('#no-readings-message').remove();
$('.reading-wrapper').empty();
fetchLiturgy(urlLiturgy);
fetchReading('#epistleReading', '#hide-readings-0', urlTitleEpistleReading, urlEpistleReading, true);
fetchReading('#firstReading', '#hide-readings-0', urlTitleFirstReading, urlFirstReading, true);
fetchReading('#psalmReading', '#hide-readings-1', urlTitlePsalm, urlPsalm, true);
fetchReading('#secondReading', '#hide-readings-2', urlTitleSecondReading, urlSecondReading, true);
fetchReading('#gospelReading', '#hide-readings-3', urlTitleGospel, urlGospel, false);
}
function loadLabels() {
var lang = retrieveLanguage();
$('#riteLabel').text(DICTIONARY[lang].riteLabel);
$('#colorLabel').text(DICTIONARY[lang].colorLabel);
$('#hideReadingsLabel').text(DICTIONARY[lang].hideReadingsLabel);
$('#timeZoneLabel').text(DICTIONARY[lang].timeZoneLabel);
$('#hideNumbersLabel').text(DICTIONARY[lang].hideNumbersLabel);
$('#selectDateLabel').text(DICTIONARY[lang].selectDateLabel);
$('#firstReadingOption').text(DICTIONARY[lang].firstLecture);
$('#psalmOption').text(DICTIONARY[lang].psalm);
$('#secondReadingOption').text(DICTIONARY[lang].secondLecture);
$('#gospelOption').text(DICTIONARY[lang].gospel);
$('#ambrosianOption').text(DICTIONARY[lang].ambrosianOption);
$('#romanItOption').text(DICTIONARY[lang].romanItOption);
$('#romanEnOption').text(DICTIONARY[lang].romanEnOption);
$('#romanFrOption').text(DICTIONARY[lang].romanFrOption);
$('#romanEsOption').text(DICTIONARY[lang].romanEsOption);
$('#info-color').text(DICTIONARY[lang].infoColor);
$('#info-hideReadings').text(DICTIONARY[lang].infoHideReadings);
$('#info-timezone').text(DICTIONARY[lang].infoTimezone);
$('#info-hideNumbers').html(DICTIONARY[lang].infoHideNumbers);
}
$('#color').change(function (e) {
setColor();
});
function setTimezone(targetDate) {
var timezone = $('#timezone-offset').val();
let utcDate = Date.UTC(parseInt(targetDate.substr(0,4)), parseInt(targetDate.substr(4,2)) -1, parseInt(targetDate.substr(6)));
var offset = timezone != 'default' ? parseFloat(timezone) * 60 * 60 * 1000 : 0;
targetDate = new Date(utcDate + offset);
return targetDate.getFullYear() + '' + padding(targetDate.getMonth() + 1) + '' + padding(targetDate.getDate());
}
function padding(number) {
return number < 10 ? '0' + number : number;
}
function fetchLiturgy(urlLiturgy) {
$.get(urlLiturgy,
function(liturgy) {
if (liturgy) {
$('.daily-readings-date').text(liturgy);
}
}
);
}
$('#rite, #timezone-offset, #hide-numbers, #hide-readings-0, #hide-readings-1, #hide-readings-2, #hide-readings-3').change(function (e) {
loadLabels();
retrieveReadings($('#datepicker').val());
});
function getDir(lang) {
return (lang == 'AR' || lang == 'BYA' || lang == 'CHA' || lang == 'COA' || lang == 'MAA' || lang == 'SYA') ? 'rtl' : 'ltr' ;
}
function setColor() {
var color = $('#color').val();
$('.daily-readings-wrapper h4.daily-readings-reading-heading').css('color', color);
}
function retrieveLanguage() {
var selection = $('#rite').val().split('-');
if (selection[1]) {
return selection[1];
}
return 'en';
}
function buildDate() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
return yyyy +'' + (parseInt(mm) < 10 ? '0' + mm : mm) + '' + (parseInt(dd) < 10 ? '0' + dd : dd);
}
$('#datepicker').change(function (e) {
retrieveReadings($(this).val());
});
function buildReading(wrapper, heading, reading, remove) {
var content = '<h4 class="daily-readings-reading-heading">' + heading + '</h4>' +
'<div class="daily-readings-reading">' + removeCopyRight(reading, remove) + '</div>'
$(wrapper).html(content);
setColor();
return true;
}
function removeCopyRight(reading, remove) {
if (!remove){
return reading;
}
for (var i = 0; i < 2; i++) {
reading = reading.substr(0, reading.lastIndexOf("<br />") - 1);
}
return reading;
}
function isError(text) {
if (text.includes('Error : wrong')){
return true;
}
return false;
}
function fetchReading(wrapper, hideController, urlTitleReading, urlReading, remove) {
$.get(urlTitleReading,
function (titleReading) {
if(isError(titleReading)){
return;
}
if (!$(hideController).is(':checked') && titleReading) {
$.get(urlReading,
function (reading) {
buildReading(wrapper, titleReading, reading, remove);
setColor();
}
);
}
}
);
}
});
</script>
</head>
<body>
<form id="daily-readings-form">
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell"><span id="riteLabel"></span></div>
<div class="divTableCell">
<select id="rite" name="rite" class="form-control">
<option value="AR">Latin calendar (Arabic) - التقويم اللاتيني</option>
<option value="BYA">Melkite Roman Catholic calendar (Arabic) - تقويم الروم الملكيّين الكاثوليك</option>
<option value="CHA">Chaldean calendar (Arabic) - التقويم الكلدانيّ</option>
<option value="COA">Coptic Catholic calendar (G) (Arabic) - التقويم القبطيّ الكاثوليكيّ (غ)</option>
<option value="MAA">Maronite calendar (Arabic) - التقويم المارونيّ</option>
<option value="SYA">Syriac Catholic calendar (Arabic) - التقويم السريانيّ الكاثوليكيّ</option>
<option value="DE">Römischer gewöhnlicher kalender (German)</option>
<option value="TRD">Außerordentlicher kalender (German)</option>
<option value="GR">Ελληνικό ημερολόγιο (Greek)</option>
<option value="AM" selected="selected">Roman Ordinary calendar (English)</option>
<option value="MAE">Maronite calendar (English)</option>
<option value="TRA">Extraordinary calendar (English)</option>
<option value="SP">Calendario ordinario (Spanish)</option>
<option value="TRS">Calendario extraordinario (Spanish)</option>
<option value="GA">Féilire gnáth Rómhánach (Gaelic)</option>
<option value="ARM">Armenian calendar (Armenian) - հայերեն օրացույցը</option>
<option value="FR">Calendrier ordinaire (French)</option>
<option value="MAF">Calendrier Maronite (French)</option>
<option value="TRF">Calendrier extraordinaire (French)</option>
<option value="IT">Calendario Romano (Italian)</option>
<option value="MI">Calendario Ambrosiano (Italian)</option>
<option value="KR">로마의 보통 달력 (Korean) - Roman regular calendar</option>
<option value="MG">Tetiandro tsotra (Malagasy) - Simple calendar</option>
<option value="NL">Gewone kalender (Dutch)</option>
<option value="PL">Kalendarz rzymski (Polish)</option>
<option value="PT">Calendário ordinário (Portuguese)</option>
<option value="RU">Roman Обычный календарь (Russian) - Roman Regular calendar</option>
<option value="TR">Türk versiyonu (Turkish) - Turkish version</option>
<option value="CN">罗马普通日历 (Chinese) - General Roman Calendar</option>
</select>
</div>
</div>
<div class="divTableRow">
<div class="divTableCell"><span id="colorLabel"></span></div>
<div class="divTableCell">
<input type="color" id="color" name="color" value="#7E1046">
<p>
<i id="info-color"></i>
</p>
</div>
</div>
<div class="divTableRow">
<div class="divTableCell"><span id="hideReadingsLabel"></span></div>
<div class="divTableCell">
<label class="checkbox-inline" for="hide-readings-0">
<input type="checkbox" name="hide-readings" id="hide-readings-0" value="hide-first-reading">
<span id="firstReadingOption"></span>
</label>
<label class="checkbox-inline" for="hide-readings-1">
<input type="checkbox" name="hide-readings" id="hide-readings-1" value="hide-psalm">
<span id="psalmOption"></span>
</label>
<br class="show-on-mobile">
<label class="checkbox-inline" for="hide-readings-2">
<input type="checkbox" name="hide-readings" id="hide-readings-2" value="hide-second-reading">
<span id="secondReadingOption"></span>
</label>
<label class="checkbox-inline" for="hide-readings-3">
<input type="checkbox" name="hide-readings" id="hide-readings-3" value="hide-gospel">
<span id="gospelOption"></span>
</label>
<p>
<i id="info-hideReadings"></i>
</p>
</div>
</div>
<div class="divTableRow">
<div class="divTableCell"><span id="timeZoneLabel"></span></div>
<div class="divTableCell">
<select name="timezone-offset" id="timezone-offset" class="form-control">
<option value="default" selected="selected">default</option>
<option value="-12.00">(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11.00">(GMT -11:00) Midway Island, Samoa</option>
<option value="-10.00">(GMT -10:00) Hawaii</option>
<option value="-09.50">(GMT -9:30) Taiohae</option>
<option value="-09.00">(GMT -9:00) Alaska</option>
<option value="-08.00">(GMT -8:00) Pacific Time (US & Canada)</option>
<option value="-07.00">(GMT -7:00) Mountain Time (US & Canada)</option>
<option value="-06.00">(GMT -6:00) Central Time (US & Canada), Mexico City</option>
<option value="-05.00">(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option>
<option value="-04.50">(GMT -4:30) Caracas</option>
<option value="-04.00">(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
<option value="-03.50">(GMT -3:30) Newfoundland</option>
<option value="-03.00">(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
<option value="-02.00">(GMT -2:00) Mid-Atlantic</option>
<option value="-01.00">(GMT -1:00) Azores, Cape Verde Islands</option>
<option value="+00.00">(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
<option value="+01.00">(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
<option value="+02.00">(GMT +2:00) Kaliningrad, South Africa</option>
<option value="+03.00">(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
<option value="+03.50">(GMT +3:30) Tehran</option>
<option value="+04.00">(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
<option value="+04.50">(GMT +4:30) Kabul</option>
<option value="+05.00">(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
<option value="+05.50">(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
<option value="+05.75">(GMT +5:45) Kathmandu, Pokhara</option>
<option value="+06.00">(GMT +6:00) Almaty, Dhaka, Colombo</option>
<option value="+06.50">(GMT +6:30) Yangon, Mandalay</option>
<option value="+07.00">(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
<option value="+08.00">(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option>
<option value="+08.75">(GMT +8:45) Eucla</option>
<option value="+09.00">(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
<option value="+09.50">(GMT +9:30) Adelaide, Darwin</option>
<option value="+10.00">(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
<option value="+10.50">(GMT +10:30) Lord Howe Island</option>
<option value="+11.00">(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
<option value="+11.50">(GMT +11:30) Norfolk Island</option>
<option value="+12.00">(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
<option value="+12.75">(GMT +12:45) Chatham Islands</option>
<option value="+13.00">(GMT +13:00) Apia, Nukualofa</option>
<option value="+14.00">(GMT +14:00) Line Islands, Tokelau</option>
</select>
<p>
<i id="info-timezone"></i>
</p>
</div>
</div>
<div class="divTableRow daily-readings-datepicker">
<div class="divTableCell no-border"><span id="selectDateLabel"></span></div>
<div class="divTableCell no-border">
<input type="hidden" id="datepicker">
</div>
</div>
</div>
</div>
</form>
<div class="daily-readings-wrapper" dir="">
<p class="daily-readings-date"></p>
<div id='epistleReading' class="reading-wrapper"></div>
<div id='firstReading' class="reading-wrapper"></div>
<div id='psalmReading' class="reading-wrapper"></div>
<div id='secondReading' class="reading-wrapper"></div>
<div id='gospelReading' class="reading-wrapper"></div>
</div>
</body>
</html>