Still cleaning things up. Also session times can now show and hide in the menu.

This commit is contained in:
Scott Idem
2020-03-06 17:23:42 -05:00
parent 666b1fc422
commit 382e98baf1
3 changed files with 42 additions and 44 deletions

View File

@@ -79,6 +79,11 @@ mynewcolor:#77cccc;
*/
}
.menu_session_time {
font-weight: bold;
}
.menu_session_code, .detail_session_code {
margin-left: .1rem;
padding-left: .1rem;

View File

@@ -176,29 +176,6 @@
window.addEventListener('online', app.currently_online);
window.addEventListener('offline', app.currently_offline);
/*
let update_event_ui = false;
let update_event_location_ui = false;
let update_event_session_ui = false;
let update_event_presentation_ui = false;
let update_event_presenter_ui = false;
let update_event_file_ui = false;
*/
if (navigator.onLine) {
app.currently_online();
} else {
app.currently_offline();
/*
console.log('Using cached IDB data.');
update_event_ui = true;
update_event_location_ui = true;
update_event_session_ui = true;
update_event_presentation_ui = true;
update_event_presenter_ui = true;
update_event_file_ui = true;
*/
}
var api_token_loop = setInterval(async function() {
//console.log('****************** LOOP: API Token Loop ******************');
@@ -235,6 +212,14 @@
}, api_token_loop_interval);
// Placing this online status check after the api_token_loop just in case?
if (navigator.onLine) {
app.currently_online();
} else {
app.currently_offline();
}
// END: API section
/* ***** **** *** ** * ### * ** *** **** ***** */
@@ -487,7 +472,7 @@
const check_file_cache_loop_interval = app_config.check_file_cache_loop_interval; // loop forever; only run after the event_file table has updated
const update_render_loop_interval = app_config.update_render_loop_interval; // loop forever
//const update_render_loop_interval = app_config.update_render_loop_interval; // loop forever
const host_file_cache_path = app_config.host_file_cache_path; // 'file_cache/'
var check_file_cache_loop = setInterval(async function() {
@@ -514,28 +499,20 @@
// BEGIN: Check online status section
// NOTE: This might be needed because the navigator.onLine status is not always correct.
var check_initial_online_status = setInterval(async function() {
//console.log('****************** LOOP: Check Online Status ******************');
console.log('check_initial_online_status online check?');
console.log(navigator.onLine);
//console.log('Secondary online status check?');
//console.log(navigator.onLine);
//clearInterval(check_initial_online_status);
/*
if (navigator.onLine) {
app.currently_online();
//app.currently_online();
} else {
app.currently_offline();
console.log('Using cached IDB data.');
update_event_ui = true;
update_event_location_ui = true;
update_event_session_ui = true;
update_event_presentation_ui = true;
update_event_presenter_ui = true;
update_event_file_ui = true;
//app.currently_offline();
}
clearInterval(check_initial_online_status);
}, 500);
*/
}, 3000);
// END: Check online status section
@@ -555,9 +532,10 @@
// END: Status clock section
</script>
<!-- <script src="js/launcher.js"></script>-->
<!-- <script src="js/test.js"></script>-->
<!-- JavaScript (JS) end -->
</body>

View File

@@ -18,6 +18,8 @@ async function render_event_session_records() {
if (value.event_id == event_id && value.event_location_id == event_location_id) {
console.log('*** Event session id ('+value.id+') is part of this event location.');
let session_startdatetime = new Date(value.start_datetime);
// *** ** * Checking if the session is already in the launcher menu * ** ***
if (document.getElementById('menu_event_session_'+value.id)) {
// Update the session menu list item
@@ -46,9 +48,21 @@ async function render_event_session_records() {
let li_span_name_text_node = document.createTextNode(value.name);
li_span_name_node.appendChild(li_span_name_text_node);
// Create the session time span
let span_session_time_string = dateFns.format(session_startdatetime, 'h:mm A');
let li_span_time_node = document.createElement('SPAN');
if ( display_menu_session_times && span_session_time_string ) {
li_span_time_node.className = 'd-inline menu_session_time';
} else {
li_span_time_node.className = 'd-none';
}
let li_span_time_text_node = document.createTextNode(span_session_time_string+': ');
li_span_time_node.appendChild(li_span_time_text_node);
// Create the session code span
let li_span_badge_node = document.createElement('SPAN');
if ( display_session_codes && value.code && value.code.length) {
if ( display_session_codes && value.code && value.code.length ) {
li_span_badge_node.className = 'd-inline menu_session_code';
} else {
li_span_badge_node.className = 'd-none';
@@ -58,13 +72,14 @@ async function render_event_session_records() {
li_span_badge_node.appendChild(li_span_badge_text_node);
li_session_node.appendChild(li_span_time_node);
li_session_node.appendChild(li_span_name_node);
li_session_node.appendChild(li_span_badge_node);
document.getElementById('sessions_menu').getElementsByTagName('ul')[0].appendChild(li_session_node);
}
let session_startdatetime = new Date(value.start_datetime);
// *** ** * Checking if the session is already in the launcher sessions detail * ** ***
if (document.getElementById('detail_session_'+value.id)) {