Presentations are sort of showing up correctly now. Need to get rid of duplicates and other things still.
This commit is contained in:
@@ -236,8 +236,8 @@
|
|||||||
const open_tables_loop_interval = 10; // only runs on start up
|
const open_tables_loop_interval = 10; // only runs on start up
|
||||||
|
|
||||||
const update_idb_loop_interval = 500; // loop forever; update when check datetime has passed
|
const update_idb_loop_interval = 500; // loop forever; update when check datetime has passed
|
||||||
const idb_to_launcher_loop_interval = 1000; // loop forever; only run when one or more tables are updated
|
const idb_to_launcher_loop_interval = 5000; // loop forever; only run when one or more tables are updated
|
||||||
const update_render_loop_interval = 1000; // loop forever; only run when the launcher object is safe
|
const update_render_loop_interval = 10000; // loop forever; only run when the launcher object is safe
|
||||||
const check_file_cache_loop_interval = 250; // loop forever; only run after the event_file table has updated
|
const check_file_cache_loop_interval = 250; // loop forever; only run after the event_file table has updated
|
||||||
|
|
||||||
// Axios needs to authenticate first
|
// Axios needs to authenticate first
|
||||||
@@ -390,7 +390,6 @@
|
|||||||
safe_to_render_launcher = false; // Set to false so that the launcher render only starts after the launcher object has updated
|
safe_to_render_launcher = false; // Set to false so that the launcher render only starts after the launcher object has updated
|
||||||
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
||||||
let render_event_session_records_result = uiv2.render_event_session_records(); // NOTE: v2 idb to ui
|
let render_event_session_records_result = uiv2.render_event_session_records(); // NOTE: v2 idb to ui
|
||||||
//ui.index_launcher_sessions('btn_view_session'); // NOTE: This should probably go in module_app_ui_v2.js
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idb_event_presentation_check_datetime < Date.now()) {
|
if (idb_event_presentation_check_datetime < Date.now()) {
|
||||||
@@ -402,6 +401,7 @@
|
|||||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||||
safe_to_render_launcher = false; // Set to false so that the launcher render only starts after the launcher object has updated
|
safe_to_render_launcher = false; // Set to false so that the launcher render only starts after the launcher object has updated
|
||||||
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
||||||
|
let render_event_presentation_records_result = uiv2.render_event_presentation_records(); // NOTE: v2 idb to ui
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idb_event_presenter_check_datetime < Date.now()) {
|
if (idb_event_presenter_check_datetime < Date.now()) {
|
||||||
|
|||||||
Binary file not shown.
@@ -136,6 +136,54 @@ exports.render_event_session_records = function () {
|
|||||||
|
|
||||||
div_node.appendChild(h2_node);
|
div_node.appendChild(h2_node);
|
||||||
|
|
||||||
|
// Add placeholder cards for session files and session presentations
|
||||||
|
// Files
|
||||||
|
let files_div_node = document.createElement('DIV');
|
||||||
|
files_div_node.className = 'card session_files';
|
||||||
|
|
||||||
|
let files_header_div_node = document.createElement('DIV');
|
||||||
|
files_header_div_node.className = 'card-header';
|
||||||
|
|
||||||
|
let files_header_text_node = document.createTextNode('Sessions Files:');
|
||||||
|
files_header_div_node.appendChild(files_header_text_node);
|
||||||
|
|
||||||
|
let files_body_div_node = document.createElement('DIV');
|
||||||
|
files_body_div_node.className = 'card-body';
|
||||||
|
|
||||||
|
let files_body_ul_node = document.createElement('UL');
|
||||||
|
files_body_ul_node.className = 'list-group list-group-flush';
|
||||||
|
|
||||||
|
files_body_div_node.appendChild(files_body_ul_node);
|
||||||
|
|
||||||
|
files_div_node.appendChild(files_header_div_node);
|
||||||
|
files_div_node.appendChild(files_body_div_node);
|
||||||
|
|
||||||
|
div_node.appendChild(files_div_node);
|
||||||
|
|
||||||
|
// Presentations
|
||||||
|
let presentations_div_node = document.createElement('DIV');
|
||||||
|
presentations_div_node.className = 'card session_presentations';
|
||||||
|
|
||||||
|
let presentations_header_div_node = document.createElement('DIV');
|
||||||
|
presentations_header_div_node.className = 'card-header';
|
||||||
|
|
||||||
|
let presentations_header_text_node = document.createTextNode('Presentations:');
|
||||||
|
presentations_header_div_node.appendChild(presentations_header_text_node);
|
||||||
|
|
||||||
|
let presentations_body_div_node = document.createElement('DIV');
|
||||||
|
presentations_body_div_node.className = 'card-body';
|
||||||
|
|
||||||
|
let presentations_body_ul_node = document.createElement('UL');
|
||||||
|
presentations_body_ul_node.className = 'list-group list-group-flush';
|
||||||
|
|
||||||
|
presentations_body_div_node.appendChild(presentations_body_ul_node);
|
||||||
|
|
||||||
|
presentations_div_node.appendChild(presentations_header_div_node);
|
||||||
|
presentations_div_node.appendChild(presentations_body_div_node);
|
||||||
|
|
||||||
|
div_node.appendChild(presentations_div_node);
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('launcher_sessions').appendChild(div_node);
|
document.getElementById('launcher_sessions').appendChild(div_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +210,7 @@ exports.render_event_session_records = function () {
|
|||||||
let session_valid = false;
|
let session_valid = false;
|
||||||
|
|
||||||
tbl_event_session.iterate(function(value, key, iteration) {
|
tbl_event_session.iterate(function(value, key, iteration) {
|
||||||
console.log(value.event_id+' ?= '+event_id+' : '+value.event_location_id+' ?= '+event_location_id+' : '+value.id+' ?= '+session_id);
|
//console.log(value.event_id+' ?= '+event_id+' : '+value.event_location_id+' ?= '+event_location_id+' : '+value.id+' ?= '+session_id);
|
||||||
if (value.event_id == event_id && value.event_location_id == event_location_id && value.id == session_id) {
|
if (value.event_id == event_id && value.event_location_id == event_location_id && value.id == session_id) {
|
||||||
// The session is still part of the event and the location
|
// The session is still part of the event and the location
|
||||||
session_valid = true;
|
session_valid = true;
|
||||||
@@ -176,7 +224,6 @@ exports.render_event_session_records = function () {
|
|||||||
console.log('Keep session id '+session_id);
|
console.log('Keep session id '+session_id);
|
||||||
} else {
|
} else {
|
||||||
console.log('Remove session id '+session_id);
|
console.log('Remove session id '+session_id);
|
||||||
//session_list_items[i].remove();
|
|
||||||
document.getElementById('menu_event_session_'+session_id).remove(); // Remove the node from the launcher sessions menu list
|
document.getElementById('menu_event_session_'+session_id).remove(); // Remove the node from the launcher sessions menu list
|
||||||
document.getElementById('detail_session_'+session_id).remove(); // Remove the node from the launcher sessions list
|
document.getElementById('detail_session_'+session_id).remove(); // Remove the node from the launcher sessions list
|
||||||
}
|
}
|
||||||
@@ -199,7 +246,103 @@ exports.render_event_session_file_records = function (events) {
|
|||||||
|
|
||||||
|
|
||||||
exports.render_event_presentation_records = function (events) {
|
exports.render_event_presentation_records = function (events) {
|
||||||
|
console.log('********** ********* ****** ** * ** ****** ********* *********');
|
||||||
console.log('Rendering event presentation records...');
|
console.log('Rendering event presentation records...');
|
||||||
|
|
||||||
|
let launcher_sessions = document.getElementById('launcher_sessions').childNodes; //_list_items
|
||||||
|
console.log(launcher_sessions);
|
||||||
|
|
||||||
|
for (var i in launcher_sessions) {
|
||||||
|
console.log(launcher_sessions[i].getAttribute('data-session_id'));
|
||||||
|
let session_id = launcher_sessions[i].getAttribute('data-session_id');
|
||||||
|
|
||||||
|
console.log(launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul').childElementCount);
|
||||||
|
let new_i = i;
|
||||||
|
if (launcher_sessions[new_i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul').childElementCount) {
|
||||||
|
console.log('Presentations listed under this session');
|
||||||
|
console.log(launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul'));
|
||||||
|
} else {
|
||||||
|
console.log('No presentations listed under this session. Time to iterate through presentations table.');
|
||||||
|
|
||||||
|
console.log(new_i);
|
||||||
|
|
||||||
|
|
||||||
|
tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||||
|
console.log('here 1??? '+new_i);
|
||||||
|
if (value.event_session_id == session_id) {
|
||||||
|
console.log('*** Presentation id ('+value.id+') is part of this session.');
|
||||||
|
|
||||||
|
// Add the new session to the launcher sessions list
|
||||||
|
let presentation_li_node = document.createElement('LI');
|
||||||
|
presentation_li_node.id = 'event_presentation_'+value.id;
|
||||||
|
presentation_li_node.className = 'list-group-item';
|
||||||
|
presentation_li_node.setAttribute('data-presentation_id', value.id);
|
||||||
|
|
||||||
|
let presentation_li_heading_div_node = document.createElement('DIV');
|
||||||
|
presentation_li_heading_div_node.className = 'list-group-item-heading d-flex justify-content-between align-items-center';
|
||||||
|
|
||||||
|
let presentation_name_strong_node = document.createElement('STRONG');
|
||||||
|
|
||||||
|
let presentation_name_text_node= document.createTextNode(value.name);
|
||||||
|
presentation_name_strong_node.appendChild(presentation_name_text_node);
|
||||||
|
|
||||||
|
let presentation_heading_span_node = document.createElement('SPAN');
|
||||||
|
presentation_heading_span_node.className = 'badge badge-pill badge-info';
|
||||||
|
|
||||||
|
let presentation_startdatetime = new Date(value.start_datetime);
|
||||||
|
let presentation_heading_span_text_node = document.createTextNode(dateFns.format(presentation_startdatetime, 'h:mm A'));
|
||||||
|
presentation_heading_span_node.appendChild(presentation_heading_span_text_node);
|
||||||
|
|
||||||
|
presentation_li_heading_div_node.appendChild(presentation_name_strong_node);
|
||||||
|
presentation_li_heading_div_node.appendChild(presentation_heading_span_node);
|
||||||
|
|
||||||
|
presentation_li_node.appendChild(presentation_li_heading_div_node);
|
||||||
|
|
||||||
|
console.log('************ ISSUE ************');
|
||||||
|
console.log('here 2??? '+new_i);
|
||||||
|
console.log(launcher_sessions[new_i].getElementsByClassName('session_presentations'));
|
||||||
|
launcher_sessions[new_i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||||
|
} else {
|
||||||
|
console.log('*** Presentation id ('+value.id+') is NOT part of this session.');
|
||||||
|
}
|
||||||
|
}).then(function() {
|
||||||
|
console.log('idb_to_ui: Iterate tbl_event_presentation looking for presentations to update or add is complete')
|
||||||
|
/*
|
||||||
|
if (session_valid) {
|
||||||
|
console.log('Keep session id '+session_id);
|
||||||
|
} else {
|
||||||
|
console.log('Remove session id '+session_id);
|
||||||
|
document.getElementById('menu_event_session_'+session_id).remove(); // Remove the node from the launcher sessions menu list
|
||||||
|
document.getElementById('detail_session_'+session_id).remove(); // Remove the node from the launcher sessions list
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
<div class="card session_presentations">
|
||||||
|
<div class="card-header">Presentations:</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<ul class="list-group list-group-flush"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//.getElementsByTagName('ul')[0].childNodes;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Loop through session divs
|
||||||
|
Look for presentations to update in each session. Update
|
||||||
|
Look for presentations to add in each session. Append presentations into the div
|
||||||
|
Look for presentations to remove from each session. Remove
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user