[F.END] Patch: forgot to push child. Reoreded childs
This commit is contained in:
parent
ad715d301a
commit
d7db0952d3
|
@ -26,41 +26,8 @@ function zerocalcareDisplay() {
|
||||||
titleElement.appendChild(document.createTextNode(decodeURI(json_obj[i]['NAME'])));
|
titleElement.appendChild(document.createTextNode(decodeURI(json_obj[i]['NAME'])));
|
||||||
titleElement.style.fontStyle = 'italic';
|
titleElement.style.fontStyle = 'italic';
|
||||||
titleElement.classList.add('widget-title');
|
titleElement.classList.add('widget-title');
|
||||||
|
|
||||||
var dateElement = document.createElement('div');
|
|
||||||
var dateText = document.createElement('span');
|
|
||||||
dateText.appendChild(document.createTextNode(m.format('dddd D MMMM YYYY')));
|
|
||||||
dateElement.appendChild(document.createTextNode('📅 '));
|
|
||||||
dateElement.appendChild(dateText);
|
|
||||||
|
|
||||||
var timeElement = document.createElement('div');
|
|
||||||
var timeText = document.createElement('span');
|
|
||||||
var timeString = (json_obj[i]['ALLDAY'] == true) ? 'Tutto il giorno' : ('ore ' + m.format('HH:mm'));
|
|
||||||
timeText.appendChild(document.createTextNode(timeString));
|
|
||||||
timeElement.appendChild(document.createTextNode('⏰ '));
|
|
||||||
timeElement.appendChild(timeText);
|
|
||||||
|
|
||||||
// add if location is not empty -- default location should be selected by backend
|
|
||||||
var locationElement = document.createElement('div');
|
|
||||||
var locationText = document.createElement('span');
|
|
||||||
if (typeof json_obj[i]['LOCATION'] !== undefined && json_obj[i]['LOCATION'] != '') {
|
|
||||||
locationText.appendChild(document.createTextNode(json_obj[i]['LOCATION']));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
locationText.appendChild(document.createTextNode('Officina Informatica'));
|
|
||||||
}
|
|
||||||
locationElement.appendChild(document.createTextNode('📍 '));
|
|
||||||
locationElement.appendChild(locationText);
|
|
||||||
|
|
||||||
if (json_obj[i]['DESCRIPTION'] !== undefined && json_obj[i]['DESCRIPTION'] != '') {
|
|
||||||
var descriptionElement = document.createElement('div');
|
|
||||||
var descriptionText = document.createElement('span');
|
|
||||||
descriptionText.appendChild(document.createTextNode(json_obj[i]['DESCRIPTION']));
|
|
||||||
descriptionElement.appendChild(document.createTextNode('📝 '));
|
|
||||||
descriptionElement.appendChild(descriptionText);
|
|
||||||
}
|
|
||||||
|
|
||||||
eventElement.appendChild(titleElement);
|
eventElement.appendChild(titleElement);
|
||||||
|
|
||||||
// Check if event is not confirmed
|
// Check if event is not confirmed
|
||||||
if (typeof json_obj[i]['STATUS'] === 'string') {
|
if (typeof json_obj[i]['STATUS'] === 'string') {
|
||||||
if (json_obj[i]['STATUS'] == 'TENTATIVE') {
|
if (json_obj[i]['STATUS'] == 'TENTATIVE') {
|
||||||
|
@ -89,9 +56,44 @@ function zerocalcareDisplay() {
|
||||||
eventElement.appendChild(unconfirmedElement);
|
eventElement.appendChild(unconfirmedElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dateElement = document.createElement('div');
|
||||||
|
var dateText = document.createElement('span');
|
||||||
|
dateText.appendChild(document.createTextNode(m.format('dddd D MMMM YYYY')));
|
||||||
|
dateElement.appendChild(document.createTextNode('📅 '));
|
||||||
|
dateElement.appendChild(dateText);
|
||||||
eventElement.appendChild(dateElement);
|
eventElement.appendChild(dateElement);
|
||||||
|
|
||||||
|
var timeElement = document.createElement('div');
|
||||||
|
var timeText = document.createElement('span');
|
||||||
|
var timeString = (json_obj[i]['ALLDAY'] == true) ? 'Tutto il giorno' : ('ore ' + m.format('HH:mm'));
|
||||||
|
timeText.appendChild(document.createTextNode(timeString));
|
||||||
|
timeElement.appendChild(document.createTextNode('⏰ '));
|
||||||
|
timeElement.appendChild(timeText);
|
||||||
eventElement.appendChild(timeElement);
|
eventElement.appendChild(timeElement);
|
||||||
|
|
||||||
|
// add if location is not empty -- default location should be selected by backend
|
||||||
|
var locationElement = document.createElement('div');
|
||||||
|
var locationText = document.createElement('span');
|
||||||
|
if (typeof json_obj[i]['LOCATION'] !== undefined && json_obj[i]['LOCATION'] != '') {
|
||||||
|
locationText.appendChild(document.createTextNode(json_obj[i]['LOCATION']));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
locationText.appendChild(document.createTextNode('Officina Informatica'));
|
||||||
|
}
|
||||||
|
locationElement.appendChild(document.createTextNode('📍 '));
|
||||||
|
locationElement.appendChild(locationText);
|
||||||
eventElement.appendChild(locationElement);
|
eventElement.appendChild(locationElement);
|
||||||
|
|
||||||
|
if (json_obj[i]['DESCRIPTION'] !== undefined && json_obj[i]['DESCRIPTION'] != '') {
|
||||||
|
var descriptionElement = document.createElement('div');
|
||||||
|
var descriptionText = document.createElement('span');
|
||||||
|
descriptionText.appendChild(document.createTextNode(json_obj[i]['DESCRIPTION']));
|
||||||
|
descriptionElement.appendChild(document.createTextNode('📝 '));
|
||||||
|
descriptionElement.appendChild(descriptionText);
|
||||||
|
eventElement.appendChild(descriptionElement);
|
||||||
|
}
|
||||||
|
|
||||||
zerocalcareOutput.appendChild(eventElement);
|
zerocalcareOutput.appendChild(eventElement);
|
||||||
atLeastOne = true;
|
atLeastOne = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue