General clean up, updates, and prep for new version of launcher using Svelte.
This commit is contained in:
8
aether_app_native.code-workspace
Normal file
8
aether_app_native.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
114
app/css/aether_modules_core.css
Normal file
114
app/css/aether_modules_core.css
Normal file
@@ -0,0 +1,114 @@
|
||||
/* Aether Modules: Core */
|
||||
|
||||
.mod__order_cart .obj__order_cart_line.purp__li_item.prop__message .purp__label {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.mod__order_cart .obj__order_cart_line.purp__li_item.prop__message .purp__value {
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.mod__order .obj__order_line.purp__li_item.prop__message .purp__label {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.mod__order .obj__order_line.purp__li_item.prop__message .purp__value {
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
}
|
||||
/* *** END *** System Objects *** All Objects *** */
|
||||
|
||||
|
||||
|
||||
/* Svelte QR code element */
|
||||
.qr_scanner {
|
||||
/* outline: solid thin pink; */
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: wrap; */
|
||||
|
||||
justify-content: flex-start;
|
||||
align-items: center; /* center */
|
||||
align-content: stretch;
|
||||
|
||||
/* flex-grow: 1;
|
||||
* flex-shrink: 1;
|
||||
* flex-basis: 50%; */
|
||||
|
||||
/* min-width: 100%;
|
||||
* width: 100%;
|
||||
* max-width: 100%; */
|
||||
}
|
||||
|
||||
.qr_reader {
|
||||
min-width: 400px;
|
||||
/* width: 100%; */
|
||||
max-width: 100%;
|
||||
/* outline: solid thin red; */
|
||||
}
|
||||
|
||||
.qr_scanner .not_scanning {
|
||||
/*background: gray;*/
|
||||
}
|
||||
|
||||
.qr_scanner .scanning {
|
||||
background: lightgreen;
|
||||
}
|
||||
|
||||
.container.qr_scan_result {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: wrap; */
|
||||
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: stretch;
|
||||
}
|
||||
|
||||
img.qr_code {
|
||||
outline: solid thin orange;
|
||||
width: 1.50in;
|
||||
}
|
||||
|
||||
img.qr_code:hover {
|
||||
outline: solid thin green;
|
||||
width: 2.50in;
|
||||
}
|
||||
|
||||
img.qr_code:focus {
|
||||
outline: solid thin red;
|
||||
width: 2.50in;
|
||||
}
|
||||
|
||||
@media (max-width: 575px) {
|
||||
.qr_reader {
|
||||
min-width: 95vw;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.qr_reader {
|
||||
min-width: 90vw;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
img.qr_code {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Svelte QR code scanner test page */
|
||||
.qr_scanner_main .options {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center; /* center */
|
||||
align-content: stretch;
|
||||
}
|
||||
150
app/css/aether_modules_other.css
Normal file
150
app/css/aether_modules_other.css
Normal file
@@ -0,0 +1,150 @@
|
||||
/* Aether Modules: Other */
|
||||
|
||||
/* *** BEGIN *** System Modules *** Event *** */
|
||||
/* *** BEGIN *** System Modules *** Event: Meeting *** */
|
||||
/* Event: Meeting */
|
||||
.meeting_view {
|
||||
background: pink;
|
||||
border: dashed thin deeppink;
|
||||
height: 5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.meeting_view:hover {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.meetings_overview {
|
||||
font-size: smaller;
|
||||
}
|
||||
/* *** END *** System Modules *** Event: Meeting *** */
|
||||
|
||||
/* *** BEGIN *** Other Modules *** Event: Badge search *** */
|
||||
.event_badge_main .event_badge_options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.event_badge.search_and_results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: wrap; */
|
||||
|
||||
justify-content: flex-start;
|
||||
align-items: stretch;
|
||||
align-content: stretch;
|
||||
|
||||
/* max-width: 100vw; */
|
||||
}
|
||||
|
||||
.event_badge .search_options {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
justify-content: stretch; /* space-evenly stretch */
|
||||
align-items: flex-start;
|
||||
align-content: stretch;
|
||||
}
|
||||
|
||||
.event_badge .search_results {
|
||||
|
||||
}
|
||||
|
||||
.event_badge .qr_scanner_form {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
flex-basis: 45%;
|
||||
}
|
||||
.event_badge .search_form {
|
||||
/*outline: solid thin red;*/
|
||||
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
flex-basis: 45%;
|
||||
}
|
||||
|
||||
.event_badge .search_form legend {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.event_badge .search_fields {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
justify-content: space-evenly;
|
||||
align-items: stretch;
|
||||
align-content: stretch;
|
||||
}
|
||||
/* *** END *** Other Modules *** Event: Badge search *** */
|
||||
|
||||
/* *** BEGIN *** Other Modules *** Event: Badge view *** */
|
||||
.event_badge_wrapper {
|
||||
/* outline: solid thin pink; */
|
||||
}
|
||||
|
||||
.event_badge_options {
|
||||
/*position: fixed;
|
||||
top: 1rem;
|
||||
left: 1rem;
|
||||
margin: 3rem;*/
|
||||
}
|
||||
/* *** END *** Other Modules *** Event: Badge view *** */
|
||||
|
||||
/* x-Small devices (portrait phones, less than 576px) */
|
||||
@media (max-width: 575px) {
|
||||
|
||||
}
|
||||
|
||||
/* Small devices (landscape phones, less than 768px) */
|
||||
@media (max-width: 767px) {
|
||||
.event_badge .search_results {
|
||||
font-size: smaller;
|
||||
}
|
||||
}
|
||||
|
||||
/* *** END *** System Modules *** Event *** */
|
||||
|
||||
|
||||
|
||||
/* Aether System Objects Styles */
|
||||
|
||||
/* *** BEGIN *** System Objects *** All Objects *** */
|
||||
.mod__event_registration .purp__obj_li header {
|
||||
border-bottom: solid medium hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
.mod__event_registration .purp__view.obj__product {
|
||||
margin: 1rem 0rem;
|
||||
padding: 1rem 0rem;
|
||||
/*border-top: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-darkest));*/
|
||||
border-bottom: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
|
||||
.mod__fundraising .purp__obj_li header {
|
||||
border-bottom: solid medium hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
.mod__fundraising .purp__view.obj__product {
|
||||
margin: 1rem 0rem;
|
||||
padding: 1rem 0rem;
|
||||
/*border-top: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-darkest));*/
|
||||
border-bottom: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
.mod__membership .purp__obj_li header {
|
||||
border-bottom: solid medium hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
.mod__membership .purp__view.obj__product {
|
||||
margin: 1rem 0rem;
|
||||
padding: 1rem 0rem;
|
||||
/*border-top: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-darkest));*/
|
||||
border-bottom: solid thin hsl(var(--hue-default),var(--saturation-least),var(--lum-light));
|
||||
}
|
||||
|
||||
309
app/css/aether_system.css
Normal file
309
app/css/aether_system.css
Normal file
@@ -0,0 +1,309 @@
|
||||
/* System: Anything that is related to core system functions and should not be changed per client or per user. */
|
||||
|
||||
/* *** BEGIN *** System *** General *** */
|
||||
html {
|
||||
/* Parent Layout */
|
||||
/* Box Model */
|
||||
/* Positioning */
|
||||
/* Display */
|
||||
}
|
||||
|
||||
body {
|
||||
/* Parent Layout */
|
||||
/* Box Model */
|
||||
/* Positioning */
|
||||
/* Display */
|
||||
/* Center and scale the image nicely */
|
||||
background-color: steelblue;
|
||||
background-image: url('/static/images/site_background.webp'); /* "/static/images/site_background.webp" */
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
nav {
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-d5);
|
||||
}
|
||||
a:hover {
|
||||
color: var(--color-d2);
|
||||
}
|
||||
|
||||
label {
|
||||
color: #824240; /*#880000*/ /* Dark red for labels */
|
||||
color: var(--info-color-darkest);
|
||||
}
|
||||
|
||||
fieldset {
|
||||
/*border: solid thin #eee;*/
|
||||
/*border-top: solid thin #eee;*/
|
||||
/*border-bottom: solid thin #eee;*/
|
||||
}
|
||||
|
||||
input:required, select:required {
|
||||
/*background-color: red;*/
|
||||
background-color: var(--danger-color-lighter);
|
||||
border-color: var(--danger-color-mid);
|
||||
/*border-bottom: dashed medium;
|
||||
* border-bottom: dashed thin;*/
|
||||
}
|
||||
|
||||
input:required:valid {
|
||||
/*color: red;*/
|
||||
/*border: solid thin green;*/
|
||||
}
|
||||
|
||||
input:required:invalid {
|
||||
/*color: red;*/
|
||||
/*border: solid thin red;*/
|
||||
}
|
||||
/* *** END *** System *** General *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Global *** Font Family, Size, and Weight *** */
|
||||
pre, code, kbd, samp, var {
|
||||
font-family: 'Roboto Mono', 'Noto Sans Mono', 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: 500; /* 700 looks too heavy */
|
||||
}
|
||||
|
||||
.h1, h1 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
.h2, h2 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.h3, h3 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
/* *** END *** Global *** Set Font Family *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Global *** Permission Checks and Roles *** */
|
||||
section.administrator_check {
|
||||
/*color: var(--warning-fg-color);*/
|
||||
/*background-color: var(--warning-bg-color);*/
|
||||
/*background-image: linear-gradient(to right, rgba(207,179,60,.5) 0%, rgba(207,179,60,.25) 5%, rgba(207,179,60,.25) 95%, rgba(207,179,60,.5) 100%);*/
|
||||
border-color: var(--warning-border-color);
|
||||
box-shadow: 0rem 0rem .5rem 0rem var(--warning-bg-color);
|
||||
}
|
||||
|
||||
section.manager_check {
|
||||
border-color: var(--danger-border-color);
|
||||
box-shadow: 0rem 0rem .5rem 0rem var(--danger-bg-color);
|
||||
}
|
||||
/* *** END *** Global *** Permission Checks and Roles *** */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.navbar {
|
||||
/*color: var(--default-fg-color);
|
||||
* background-color: var(--default-bg-color);
|
||||
* border-color: var(--default-border-color);*/
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
/*color: var(--default-fg-color);
|
||||
* background-color: none;*/
|
||||
/*background-color: var(--default-bg-color);
|
||||
* border-color: var(--default-border-color);*/
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
color: var(--default-fg-color);
|
||||
/*background-color: var(--default-bg-color);
|
||||
* border-color: var(--default-border-color);*/
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
/*color: var(--default-fg-color);*/
|
||||
/*background-color: var(--default-bg-color);
|
||||
* border-color: var(--default-border-color);*/
|
||||
}
|
||||
|
||||
.nav-pills .nav-link.active {
|
||||
color: var(--default-fg-color);
|
||||
background-color: var(--default-bg-color);
|
||||
border-color: var(--default-border-color);
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** Global *** Group List Menu *** */
|
||||
/* Works together with toggle_group_list_item({element_id:'the_id_to_show', class_name:'name_of_group'}) */
|
||||
.group_list_item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.group_list_item_show {
|
||||
}
|
||||
|
||||
.group_list_menu {
|
||||
position: sticky;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
float: right;
|
||||
|
||||
width: 15rem;
|
||||
|
||||
background-color: hsla(0, 0%, 100%, .8);
|
||||
|
||||
z-index: 99;
|
||||
border: solid thin hsla(0, 0%, 75%, .8);
|
||||
|
||||
padding: .5rem 0rem;
|
||||
}
|
||||
|
||||
.group_list_menu ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.group_list_menu button {
|
||||
margin: .1rem 0;
|
||||
padding: .1rem;
|
||||
|
||||
border: solid thin hsla(0, 0%, 75%, .2);
|
||||
background-color: unset;
|
||||
width: 100%;
|
||||
|
||||
font-weight: bold;
|
||||
|
||||
/* border-radius: .4rem; */
|
||||
}
|
||||
|
||||
.group_list_menu button:hover {
|
||||
border: solid thin hsla(0, 0%, 60%, 1);
|
||||
background-color: hsla(0, 0%, 75%, 1);
|
||||
}
|
||||
/* *** END *** Global *** Group List Menu *** */
|
||||
|
||||
|
||||
|
||||
|
||||
.form-floating>.form-control:focus~label, .form-floating>.form-control:not(:placeholder-shown)~label, .form-floating>.form-select~label {
|
||||
opacity: .85;
|
||||
transform: scale(.85) translateY(-.5rem) translateX(.15rem);
|
||||
}
|
||||
|
||||
/* .btn-link /*, .page-link, .page-item, .paginate_button, .active, .page-item.active*/ { */
|
||||
color: var(--link-fg-color);
|
||||
background-color: var(--link-bg-color);
|
||||
}
|
||||
|
||||
|
||||
/* This is for the datatables. */
|
||||
.page-item.active .page-link {
|
||||
color: var(--link-fg-color);
|
||||
background-color: var(--link-bg-color);
|
||||
}
|
||||
|
||||
/* *** END *** Global *** Navigation, Links, and Buttons *** */
|
||||
|
||||
|
||||
|
||||
.page_help {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.page_links {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
.results_message {
|
||||
font-size: 1.6em;
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.results_table td {
|
||||
background-color: lightyellow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.obj {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.obj_edit_abs {
|
||||
/*border: solid thin pink;*/
|
||||
position: absolute;
|
||||
top: 0rem;
|
||||
right: 0rem;
|
||||
margin: .1rem .8rem;
|
||||
padding: .2rem;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.obj_edit_abs:hover {
|
||||
border: solid thin gray;
|
||||
border-radius: .25em;
|
||||
position: absolute;
|
||||
top: 0em;
|
||||
right: 0;
|
||||
margin: .1rem .8rem;
|
||||
padding: .2rem;
|
||||
background: rgba(255,255,255,.8);
|
||||
color: orange;
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
|
||||
.obj_edit_abs:hover::after {
|
||||
content: "edit";
|
||||
}
|
||||
|
||||
|
||||
#edit_object_field_value {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background: white;
|
||||
border: solid thin black;
|
||||
margin: .25rem;
|
||||
padding: .5rem;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* *** BEGIN *** Global *** Svelte specific that needs to be merged in *** */
|
||||
.svelte_target section.obj {
|
||||
margin: 1rem 0rem;
|
||||
padding: .5rem .5rem;
|
||||
/* border: solid thin hsla(0,0%,90%,1); */
|
||||
}
|
||||
|
||||
.svelte_target .input_container {
|
||||
margin: .25rem 0rem;
|
||||
}
|
||||
|
||||
.svelte_target label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.svelte_target .label_select_value {
|
||||
font-size: smaller;
|
||||
color: hsla(0,0%,50%,1);
|
||||
}
|
||||
|
||||
.svelte_target .obj_type_main {
|
||||
border: solid thin hsla(0,0%,90%,1);
|
||||
}
|
||||
/* *** BEGIN *** Global *** Svelte specific that needs to be merged in *** */
|
||||
778
app/css/aether_utilities.css
Normal file
778
app/css/aether_utilities.css
Normal file
@@ -0,0 +1,778 @@
|
||||
/* Aether Utility Styles */
|
||||
|
||||
/* *** BEGIN *** Utility *** Hide or Visually Elements *** */
|
||||
.d_none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.visually_hidden {
|
||||
clip: rect(0 0 0 0);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.visually_hidden:not(:focus):not(:active) {
|
||||
/* ... */
|
||||
}
|
||||
/* *** END *** Utility *** Hide Elements *** */
|
||||
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fs_smaller, .fs-smaller {
|
||||
font-size: smaller;
|
||||
}
|
||||
.fs_larger, .fs-larger {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.debug {
|
||||
background: pink;
|
||||
border: dashed thin deeppink;
|
||||
height: 1.75rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.debug:hover {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
.alert {
|
||||
background: pink;
|
||||
}
|
||||
|
||||
.warning {
|
||||
color: var(--warning-color-lighter);
|
||||
background-color: var(--warning-color-dark);
|
||||
border-color: var(--warning-color-darker);
|
||||
}
|
||||
|
||||
.danger {
|
||||
color: var(--danger-color-lighter);
|
||||
background-color: var(--danger-color-dark);
|
||||
border-color: var(--danger-color-darker);
|
||||
}
|
||||
|
||||
.error {
|
||||
color: var(--danger-color-lighter);
|
||||
background-color: var(--danger-color-dark);
|
||||
border-color: var(--danger-color-darker);
|
||||
}
|
||||
|
||||
.strike {
|
||||
color: var(--danger-color-lighter);
|
||||
background-color: var(--danger-color-dark);
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.attention_glow {
|
||||
text-shadow: 0 0 .25rem rgba(100,0,0,1), 0 0 1rem rgba(200,0,0,1), 0 0 2rem rgba(255,0,0,1);
|
||||
}
|
||||
|
||||
.attention_glow_pulse {
|
||||
animation-name: text_glowing_blue;
|
||||
animation-duration: 3.5s;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
|
||||
@keyframes text_glowing_red {
|
||||
from {
|
||||
text-shadow: 0 0 .25rem transparent, 0 0 1rem transparent, 0 0 2rem transparent;
|
||||
}
|
||||
to {
|
||||
text-shadow: 0 0 .25rem hsla(var(--hue-red), var(--saturation-most), var(--lum-mid),1), 0 0 1rem rgba(200,0,0,1), 0 0 2rem rgba(255,0,0,1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes text_glowing_blue {
|
||||
from {
|
||||
text-shadow: 0 0 .25rem transparent, 0 0 1rem transparent, 0 0 2rem transparent;
|
||||
}
|
||||
to {
|
||||
text-shadow: 0 0 .25rem hsla(var(--hue-blue), var(--saturation-most), var(--lum-mid),1), 0 0 1.5rem hsla(var(--hue-blue), var(--saturation-most), var(--lum-lighter),1);
|
||||
}
|
||||
}
|
||||
|
||||
/* *** BEGIN *** Utility *** Countdown Timer *** */
|
||||
.countdown_banner {
|
||||
width: 100%;
|
||||
/*background-color: rgb(70, 130, 180);*/ /* SteelBlue #4682B4 rgb(70, 130, 180)*/
|
||||
background-color: rgba(70, 130, 180,.1);
|
||||
/*background-image: rgba(70, 130, 180,.1);*/
|
||||
|
||||
/*text-shadow: 0 0 15px rgba(14, 27, 37,1), 0 0 30px rgba(43, 80, 110,1);*/
|
||||
|
||||
text-align: center;
|
||||
font-size: 1.5rem;
|
||||
|
||||
/*animation-name: countdown_animation;
|
||||
* animation-delay: 2s;
|
||||
* animation-duration: 5s;
|
||||
* animation-iteration-count: infinite;
|
||||
* animation-direction: alternate;*/
|
||||
}
|
||||
|
||||
.countdown_number {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
@keyframes countdown_animation {
|
||||
from {
|
||||
background-color: rgba(70, 130, 180,.1);
|
||||
/*background: radial-gradient(circle, rgba(218,26,50,.2) 0%, rgba(218,26,50,.2) 50%, rgba(255,255,255,0) 80%);*/
|
||||
}
|
||||
|
||||
to {
|
||||
/*background-color: rgba(218,26,50,.6);*/
|
||||
background: rgba(70, 130, 180,.5);
|
||||
/*background: radial-gradient(circle, rgba(218,26,50,.4) 0%, rgba(218,26,50,.4) 50%, rgba(255,255,255,0) 80%);*/
|
||||
}
|
||||
}
|
||||
/* *** END *** Utility *** Countdown Timer *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Utility *** Forms Related *** */
|
||||
.append_colon::after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
.input_required::after {
|
||||
/*content: '*';
|
||||
* color: var(--warning-color-darker);*/
|
||||
|
||||
/*position: relative;
|
||||
* top: 5px;
|
||||
* left: 5px;*/
|
||||
}
|
||||
.input_required::before {
|
||||
/*content: '*';
|
||||
* color: var(--warning-color-darker);*/
|
||||
|
||||
/*display: block;
|
||||
* content: 'b*';
|
||||
* background-color: yellow;
|
||||
* color: red;
|
||||
* font-weight: bold;
|
||||
* top: 5px;
|
||||
* left: 5px;*/
|
||||
}
|
||||
|
||||
/* *** END *** Utility *** Forms Related *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Utility *** Tables Related *** */
|
||||
/* *** BEGIN *** Utility *** All Tables *** */
|
||||
thead>tr {
|
||||
background-color: #e6e6e6; /* efefef e6e6e6 d9d9d9 */
|
||||
}
|
||||
/* *** END *** Utility *** All Tables *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Utility *** Table Borders *** */
|
||||
table.table_borders {
|
||||
border: solid thin hsla(0, 0%, 50%, 1);
|
||||
border-collapse: collapse;
|
||||
|
||||
/*max-width: 100%;*/
|
||||
}
|
||||
table.table_borders th, td {
|
||||
border: solid thin hsla(0, 0%, 75%, 1);
|
||||
border-collapse: collapse;
|
||||
/* margin: 0; */
|
||||
|
||||
}
|
||||
/* *** END *** Utility *** Table Borders *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Utility *** Table Alternating Rows (even/odd) *** */
|
||||
table.table_alt_rows tr:nth-child(even) {
|
||||
background-color: hsla(0, 0%, 95%, 1);
|
||||
}
|
||||
table.table_alt_rows tr:nth-child(odd) {
|
||||
background-color: hsla(0, 0%, 85%, 1);
|
||||
}
|
||||
/* *** END *** Utility *** Table Alternating Rows (even/odd) *** */
|
||||
|
||||
|
||||
|
||||
/* *** BEGIN *** Utilities *** Modal Container *** */
|
||||
.modal_container {
|
||||
/* outline: solid thin green; */
|
||||
|
||||
/* display: none; */
|
||||
position: fixed;
|
||||
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
|
||||
margin: 0;
|
||||
padding: 3.5rem 0rem;
|
||||
|
||||
/* object-fit: contain; */
|
||||
/* height: 100vh;
|
||||
* m ax-height: 100vh; */ * *
|
||||
*
|
||||
* height: 100%;
|
||||
* max-height: 100%;
|
||||
* width: 100%;
|
||||
* max-width: 100%;
|
||||
*
|
||||
* /* height: 100vh;
|
||||
* m ax-height: 100vh; * *
|
||||
* width: 100vw;
|
||||
* max-width: 100vw; */
|
||||
|
||||
/* display: flex; */
|
||||
flex-direction: column;
|
||||
/* justify-content: center;
|
||||
* a lign-items: center; * *
|
||||
* align-content: center; */
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
z-index: 1041;
|
||||
background-color: hsla(0, 0%, 50%, .9);
|
||||
}
|
||||
|
||||
.modal_content {
|
||||
/* outline: dashed thin pink; */
|
||||
|
||||
/* margin: auto; */
|
||||
padding: 0;
|
||||
|
||||
/* border: solid .2rem hsla(0, 0%, 50%, .9); */
|
||||
border-radius: 1rem;
|
||||
box-shadow: .5rem .5rem 1.5rem .5rem hsla(0, 0%, 0%, 1);
|
||||
|
||||
background: #eee;
|
||||
|
||||
width: 100vw;
|
||||
|
||||
max-width: calc(1024px - 2rem);
|
||||
max-height: calc(100% - 2rem);
|
||||
|
||||
/* text-align: center; */
|
||||
|
||||
flex-grow: 1;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.modal_header, .modal_footer {
|
||||
/*outline: solid thin orange;*/
|
||||
|
||||
flex-grow: 0;
|
||||
flex-shrink: 1;
|
||||
|
||||
/* width: 100%;
|
||||
* max-width: 100%; */
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.modal_header_begin, .modal_footer_begin {
|
||||
margin: .5rem;
|
||||
}
|
||||
|
||||
.modal_header_end, .modal_footer_end {
|
||||
margin: .5rem;
|
||||
}
|
||||
|
||||
.modal_header {
|
||||
/* outline: solid thin red; */
|
||||
/* border-bottom: solid thin hsla(0, 0%, 50%, .5); */
|
||||
background-image: linear-gradient(to top, hsla(205,78%,80%,.9) 0%, hsla(205,78%,80%,.1) .2rem, hsla(205,78%,80%,.1) 100%);
|
||||
}
|
||||
.modal_body {
|
||||
/* outline: solid thin green; */
|
||||
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
||||
max-width: 100%;
|
||||
|
||||
margin: .5rem;
|
||||
padding: .5rem .1rem;
|
||||
|
||||
/* display: flex;
|
||||
* f lex-direction: column; */ * *
|
||||
* /* justify-content: ; */
|
||||
/* align-items: stretch; */
|
||||
/* align-content: center; */
|
||||
|
||||
object-fit: contain;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.modal_footer {
|
||||
/* outline: solid thin orange; */
|
||||
/* border-top: solid thin hsla(0, 0%, 50%, .5); */
|
||||
background-image: linear-gradient(to bottom, hsla(205,78%,80%,.9) 0%, hsla(205,78%,80%,.1) .2rem, hsla(205,78%,80%,.1) 100%);
|
||||
}
|
||||
|
||||
.modal_close {
|
||||
padding: .25rem .5rem;
|
||||
|
||||
font-size: 1.2rem;
|
||||
/* font-weight: lighter; */
|
||||
|
||||
background-color: hsla(0, 0%, 90%, 1);
|
||||
|
||||
border: solid thin hsla(0, 0%, 70%, 1);
|
||||
border-radius: .5rem;
|
||||
box-shadow: .1rem .1rem .2rem .1rem hsla(0, 0%, 0%, 1);
|
||||
|
||||
color: hsla(0, 0%, 30%, 1);
|
||||
}
|
||||
.modal_close:hover {
|
||||
/* font-weight: bold; */
|
||||
background-color: hsla(0, 0%, 80%, 1);
|
||||
|
||||
border: solid thin hsla(0, 0%, 60%, 1);
|
||||
border-radius: .5rem;
|
||||
box-shadow: .1rem .1rem .2rem .1rem hsla(0, 0%, 50%, 1);
|
||||
|
||||
color: hsla(0, 0%, 10%, 1);
|
||||
}
|
||||
|
||||
.modal_title {
|
||||
/*float: left;*/
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
display: inline;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
/* *** END *** Utilities *** Modal Container *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** Utilities *** Badge *** */
|
||||
.badge {
|
||||
color: var(--default-fg-color);
|
||||
background-color: var(--default-bg-color);
|
||||
border-color: var(--default-border-color);
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** Utilities *** Bootstrap: Buttons, Background, Foreground *** */
|
||||
|
||||
/* *** BEGIN *** Utility *** Bootstrap Tables Striped *** */
|
||||
.table-striped>tbody>tr:nth-child(odd)>td {
|
||||
/*background-color: white;*/
|
||||
/*color: black;*/
|
||||
}
|
||||
.table-striped>tbody>tr:nth-child(even)>td {
|
||||
/*background-color: #efefef;*/
|
||||
/*color: white;*/
|
||||
}
|
||||
/* *** END *** Utility *** Bootstrap Tables Striped *** */
|
||||
|
||||
/* *** BEGIN *** Utility *** Bootstrap Forms *** */
|
||||
.form-horizontal {
|
||||
background-color: white;
|
||||
/*margin: .5em;*/
|
||||
padding: 1em .5em;
|
||||
}
|
||||
/* *** END *** Utility *** Bootstrap Forms *** */
|
||||
|
||||
a.btn, button.btn {
|
||||
/* font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; */
|
||||
|
||||
-webkit-appearance: button;
|
||||
-moz-appearance: button;
|
||||
appearance: button;
|
||||
|
||||
text-decoration: none;
|
||||
color: initial;
|
||||
color: black;
|
||||
background-color: hsl(0, 0%, 95%, 1);
|
||||
/* background-color: -internal-light-dark(rgb(255, 255, 255), rgb(59, 59, 59)); */
|
||||
|
||||
border-width: thin;
|
||||
border-style: outset;
|
||||
border-color: hsla(0,0%,50%,1);
|
||||
border-radius: .25em;
|
||||
|
||||
font: inherit;
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
|
||||
line-height: normal;
|
||||
|
||||
margin: .1em;
|
||||
padding: .1em .2em;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: hsl(0, 0%, 85%, 1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn.btn_sm, .btn.btn-sm {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.btn.btn_lg, .btn.btn-lg {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.btn.btn-wrap-text {
|
||||
white-space: normal;
|
||||
word-wrap: normal; /* break-word */
|
||||
max-width: 50em; /* 55rem */
|
||||
}
|
||||
|
||||
|
||||
/* ### default ### */
|
||||
.btn.bg-default {
|
||||
color: var(--default-fg-color);
|
||||
background-color: var(--default-bg-color) !important;
|
||||
border-color: var(--default-border-color);
|
||||
}
|
||||
.btn.btn-default {
|
||||
color: var(--default-fg-color);
|
||||
background-color: var(--default-bg-color);
|
||||
border-color: var(--default-border-color);
|
||||
}
|
||||
.btn.btn-default:hover {
|
||||
color: var(--default-fg-color-highlight);
|
||||
background-color: var(--default-bg-color-highlight);
|
||||
border-color: var(--default-border-color-highlight);
|
||||
}
|
||||
.btn.btn-outline-default {
|
||||
color: var(--default-fg-color);
|
||||
background-color: var(--default-bg-color);
|
||||
border-color: var(--default-border-color);
|
||||
}
|
||||
.btn.btn-outline-default:hover {
|
||||
color: var(--default-fg-color-highlight);
|
||||
background-color: var(--default-bg-color-highlight);
|
||||
border-color: var(--default-border-color-highlight);
|
||||
}
|
||||
|
||||
/* ### light ### */
|
||||
.bg-light {
|
||||
color: var(--default-color-lightest);
|
||||
background-color: var(--default-color-mid) !important;
|
||||
border-color: var(--default-color-dark);
|
||||
}
|
||||
.btn.btn-light {
|
||||
color: var(--default-color-lightest);
|
||||
background-color: var(--default-color-mid);
|
||||
border-color: var(--default-color-dark);
|
||||
}
|
||||
.btn.btn-light:hover {
|
||||
color: var(--default-color-lightest);
|
||||
background-color: var(--default-color-darker);
|
||||
border-color: var(--default-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-light {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-lighter);
|
||||
border-color: var(--default-color-darker);
|
||||
}
|
||||
.btn.btn-outline-light:hover {
|
||||
color: var(--default-color-lightest);
|
||||
background-color: var(--default-color-darker);
|
||||
border-color: var(--default-color-darkest);
|
||||
}
|
||||
|
||||
/* ### dark ### */
|
||||
.bg-dark {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-mid) !important;
|
||||
border-color: var(--default-color-light);
|
||||
}
|
||||
.btn.btn-dark {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-mid);
|
||||
border-color: var(--default-color-light);
|
||||
}
|
||||
.btn.btn-dark:hover {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-lighter);
|
||||
border-color: var(--default-color-lightest);
|
||||
}
|
||||
.btn.btn-outline-dark {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-lighter);
|
||||
border-color: var(--default-color-lighter);
|
||||
}
|
||||
.btn.btn-outline-dark:hover {
|
||||
color: var(--default-color-darkest);
|
||||
background-color: var(--default-color-lighter);
|
||||
border-color: var(--default-color-lightest);
|
||||
}
|
||||
|
||||
/* ### primary ### */
|
||||
.btn.bg-primary {
|
||||
color: var(--primary-color-lightest);
|
||||
background-color: var(--primary-color-mid) !important;
|
||||
border-color: var(--primary-color-dark);
|
||||
}
|
||||
.btn.btn-primary {
|
||||
color: var(--primary-color-lightest);
|
||||
background-color: var(--primary-color-mid);
|
||||
border-color: var(--primary-color-dark);
|
||||
}
|
||||
.btn.btn-primary:hover {
|
||||
color: var(--primary-color-lightest);
|
||||
background-color: var(--primary-color-darker);
|
||||
border-color: var(--primary-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-primary {
|
||||
color: var(--primary-color-darkest);
|
||||
background-color: var(--primary-color-lighter);
|
||||
border-color: var(--primary-color-darker);
|
||||
}
|
||||
.btn.btn-outline-primary:hover {
|
||||
color: var(--primary-color-lightest);
|
||||
background-color: var(--primary-color-darker);
|
||||
border-color: var(--primary-color-darkest);
|
||||
}
|
||||
|
||||
/* ### secondary ### */
|
||||
.bg-secondary {
|
||||
color: var(--secondary-color-lightest);
|
||||
background-color: var(--secondary-color-mid) !important;
|
||||
border-color: var(--secondary-color-dark);
|
||||
}
|
||||
.btn.btn-secondary {
|
||||
color: var(--secondary-color-lightest);
|
||||
background-color: var(--secondary-color-mid);
|
||||
border-color: var(--secondary-color-dark);
|
||||
}
|
||||
.btn.btn-secondary:hover {
|
||||
color: var(--secondary-color-lightest);
|
||||
background-color: var(--secondary-color-darker);
|
||||
border-color: var(--secondary-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-secondary {
|
||||
color: var(--secondary-color-darkest);
|
||||
background-color: var(--secondary-color-lighter);
|
||||
border-color: var(--secondary-color-darker);
|
||||
}
|
||||
.btn.btn-outline-secondary:hover {
|
||||
color: var(--secondary-color-lightest);
|
||||
background-color: var(--secondary-color-darker);
|
||||
border-color: var(--secondary-color-darkest);
|
||||
}
|
||||
|
||||
/* ### info ### */
|
||||
.bg-info {
|
||||
color: var(--info-color-lightest);
|
||||
background-color: var(--info-color-mid) !important;
|
||||
border-color: var(--info-color-dark);
|
||||
}
|
||||
.btn.btn-info {
|
||||
color: var(--info-color-lightest);
|
||||
background-color: var(--info-color-mid);
|
||||
border-color: var(--info-color-dark);
|
||||
}
|
||||
.btn.btn-info:hover {
|
||||
color: var(--info-color-lightest);
|
||||
background-color: var(--info-color-darker);
|
||||
border-color: var(--info-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-info {
|
||||
color: var(--info-color-darkest);
|
||||
background-color: var(--info-color-lighter);
|
||||
border-color: var(--info-color-darker);
|
||||
}
|
||||
.btn.btn-outline-info:hover {
|
||||
color: var(--info-color-lightest);
|
||||
background-color: var(--info-color-darker);
|
||||
border-color: var(--info-color-darkest);
|
||||
}
|
||||
|
||||
/* ### success ### */
|
||||
.bg-success {
|
||||
color: var(--success-color-lightest);
|
||||
background-color: var(--success-color-mid) !important;
|
||||
border-color: var(--success-color-dark);
|
||||
}
|
||||
.btn.btn-success {
|
||||
color: var(--success-color-lightest);
|
||||
background-color: var(--success-color-mid);
|
||||
border-color: var(--success-color-dark);
|
||||
}
|
||||
.btn.btn-success:hover {
|
||||
color: var(--success-color-lightest);
|
||||
background-color: var(--success-color-darker);
|
||||
border-color: var(--success-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-success {
|
||||
color: var(--success-color-darkest);
|
||||
background-color: var(--success-color-lighter);
|
||||
border-color: var(--success-color-darker);
|
||||
}
|
||||
.btn.btn-outline-success:hover {
|
||||
color: var(--success-color-lightest);
|
||||
background-color: var(--success-color-darker);
|
||||
border-color: var(--success-color-darkest);
|
||||
}
|
||||
|
||||
/* ### warning ### */
|
||||
.bg-warning {
|
||||
color: var(--warning-color-lightest);
|
||||
background-color: var(--warning-color-mid) !important;
|
||||
border-color: var(--warning-color-dark);
|
||||
}
|
||||
.btn.btn-warning {
|
||||
color: var(--warning-color-lightest);
|
||||
background-color: var(--warning-color-mid);
|
||||
border-color: var(--warning-color-dark);
|
||||
}
|
||||
.btn.btn-warning:hover {
|
||||
color: var(--warning-color-lightest);
|
||||
background-color: var(--warning-color-darker);
|
||||
border-color: var(--warning-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-warning {
|
||||
color: var(--warning-color-darkest);
|
||||
background-color: var(--warning-color-lighter);
|
||||
border-color: var(--warning-color-darker);
|
||||
}
|
||||
.btn.btn-outline-warning:hover {
|
||||
color: var(--warning-color-lightest);
|
||||
background-color: var(--warning-color-darker);
|
||||
border-color: var(--warning-color-darkest);
|
||||
}
|
||||
|
||||
/* ### danger ### */
|
||||
.bg-danger {
|
||||
color: var(--danger-color-lightest);
|
||||
background-color: var(--danger-color-mid) !important;
|
||||
border-color: var(--danger-color-dark);
|
||||
}
|
||||
.btn.btn-danger {
|
||||
color: var(--danger-color-lightest);
|
||||
background-color: var(--danger-color-mid);
|
||||
border-color: var(--danger-color-dark);
|
||||
}
|
||||
.btn.btn-danger:hover {
|
||||
color: var(--danger-color-lightest);
|
||||
background-color: var(--danger-color-darker);
|
||||
border-color: var(--danger-color-darkest);
|
||||
}
|
||||
.btn.btn-outline-danger {
|
||||
color: var(--danger-color-darkest);
|
||||
background-color: var(--danger-color-lighter);
|
||||
border-color: var(--danger-color-darker);
|
||||
}
|
||||
.btn.btn-outline-danger:hover {
|
||||
color: var(--danger-color-lightest);
|
||||
background-color: var(--danger-color-darker);
|
||||
border-color: var(--danger-color-darkest);
|
||||
}
|
||||
|
||||
/* *** BEGIN *** Utility *** Bootstrap Overrides *** */
|
||||
@media (min-width: 992px) {
|
||||
.modal-lg {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.modal-lg {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
/* *** END *** Utility *** Bootstrap Overrides *** */
|
||||
|
||||
|
||||
|
||||
.data_field {
|
||||
border: solid thin #eee;
|
||||
}
|
||||
|
||||
.data_field:hover {
|
||||
border: dashed thin #fbb;
|
||||
}
|
||||
|
||||
|
||||
.list_inline {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.list_inline li {
|
||||
display: inline;
|
||||
text-decoration: none;
|
||||
margin-left: .25em;
|
||||
/*margin-right: .25em;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
.name_prefix {
|
||||
|
||||
}
|
||||
.name_informal {
|
||||
|
||||
}
|
||||
.name_given {
|
||||
|
||||
}
|
||||
.name_middle {
|
||||
|
||||
}
|
||||
.name_family {
|
||||
|
||||
}
|
||||
.name_suffix {
|
||||
|
||||
}
|
||||
|
||||
input.name_prefix {
|
||||
/*width: 3.5em;*/
|
||||
}
|
||||
input.name_informal {
|
||||
/*width: 6em;*/
|
||||
}
|
||||
input.name_given {
|
||||
/*width: 6em;*/
|
||||
}
|
||||
input.name_middle {
|
||||
/*width: 6em;*/
|
||||
}
|
||||
input.name_family {
|
||||
/*width: 6em;*/
|
||||
}
|
||||
input.name_suffix {
|
||||
/*width: 3.5em;*/
|
||||
}
|
||||
446
app/css/aether_variables.css
Normal file
446
app/css/aether_variables.css
Normal file
@@ -0,0 +1,446 @@
|
||||
/* Aether Style Variables */
|
||||
|
||||
:root {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
--bs-pink: #d63384;
|
||||
--bs-red: #dc3545;
|
||||
--bs-orange: #fd7e14;
|
||||
--bs-yellow: #ffc107;
|
||||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
--bs-primary-light: #6c9dc6;
|
||||
--bs-primary: #0a8dac; /*#0d6efd;*/
|
||||
--bs-primary-dark: #325d81;
|
||||
--bs-secondary: #484b6e;
|
||||
--bs-success: #32846e;
|
||||
--bs-info: #46b4b4; /*#0dcaf0;*/
|
||||
--bs-warning: #6f7541;
|
||||
--bs-danger: #7b503b;
|
||||
--bs-lighter: #d0e0ed; /*#f8f9fa;*/
|
||||
--bs-light: #72a1c8; /*#f8f9fa;*/
|
||||
--bs-medium: #335f83; /*#212529;*/
|
||||
--bs-dark: #294d6a; /*#212529;*/
|
||||
--bs-darker: #1f3a4f; /*#212529;*/
|
||||
--bs-font-sans-serif: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
}
|
||||
|
||||
:root {
|
||||
/*
|
||||
*
|
||||
* Light navy blue
|
||||
* #335f83 or #335f84, rgb(51, 96, 132), hsl(207, 44%, 36%), cmyk(61, 27, 0, 49)
|
||||
*
|
||||
* hsl(210, 50%, 50%), rgb(64, 128, 191), #4080bf
|
||||
*
|
||||
* purple: #8241bf
|
||||
* green: #41BF7C
|
||||
*
|
||||
* red: hsl(0, 50%, 50%), #BF4640 (close "split" complementary 30deg)
|
||||
* orange: hsl(30, 50%, 50%), #BF8040 (linear by hue 30deg)
|
||||
* yellow: hsl(60, 50%, 50%), #BFB940 (close "split" complementary 30deg)
|
||||
* light green: hsl(90, 50%, 50%), #80BF40 (linear by hue 30deg)
|
||||
* dark green: hsl(150, 50%, 50%), #40BF80 (linear by hue 30deg)
|
||||
* teal: hsl(180, 50%, 50%), #40BF80 (linear by hue 30deg)
|
||||
* blue: hsl(210, 50%, 50%), #4080BF
|
||||
* purple: hsl(270, 50%, 50%), #8040BF (linear by hue 30deg)
|
||||
* pink (dark): hsl(330, 50%, 50%), #BF4080 (linear by hue 30deg)
|
||||
*
|
||||
* primary-hue: 210, #4080BF
|
||||
* accent-hue: 264, #7340BF
|
||||
*
|
||||
* #0080FF
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
--saturation-least: 10%;
|
||||
--saturation-less: 20%;
|
||||
--saturation: 50%;
|
||||
--saturation-more: 80%;
|
||||
--saturation-most: 90%;
|
||||
|
||||
--lum-lightest: calc(50% + 50%);
|
||||
--lum-lighter: calc(50% + 40%);
|
||||
--lum-light: calc(50% + 35%);
|
||||
--lum-mid: 50%;
|
||||
--lum: 50%;
|
||||
--lum-dark: calc(50% - 10%);
|
||||
--lum-darker: calc(50% - 20%);
|
||||
--lum-darkest: calc(50% - 30%);
|
||||
|
||||
/*
|
||||
* https://coolors.co/bfbf40-80bf40-40bf40-40bf80-40bfbf-407fbf-4040bf-7f40bf-bf40bf-bf4080
|
||||
*/
|
||||
--hue-red: 0; /* red bf4141 */
|
||||
--hue-orange: calc(0 + 30); /* brown bf8041 */
|
||||
--hue-yellow: calc(0 + 60); /* yellow-green bfbf40 */
|
||||
--hue-light_green: calc(0 + 90); /* green 80bf40 */
|
||||
--hue-green: calc(0 + 120); /* green 40bf40 */
|
||||
--hue-dark_green: calc(0 + 150); /* green-cyan 40bf80 */
|
||||
--hue-teal: calc(0 + 180); /* cyan 40bfbf */
|
||||
--hue-cyan: calc(0 + 180); /* cyan 40bfbf */
|
||||
--hue-blue: calc(0 + 210); /* cyan-blue 407fbf */
|
||||
--hue-indigo: calc(0 + 240); /* blue-magenta 4040bf */
|
||||
--hue-purple: calc(0 + 270); /* blue-magenta 7f40bf */
|
||||
--hue-pink: calc(0 + 300); /* magenta bf40bf */
|
||||
--hue-dark_pink: calc(0 + 330); /* magenta-pink bf4080 */
|
||||
|
||||
--hue: 210;
|
||||
--hue-base: 210;
|
||||
--hue-complementary: calc(var(--hue) - 180);
|
||||
/*--hue-accent: 264;*/
|
||||
|
||||
--hue-default: 210;
|
||||
--hue-primary: 210;
|
||||
--hue-secondary: 210;
|
||||
--hue-info: 180;
|
||||
--hue-success: 120;
|
||||
--hue-warning: 60;
|
||||
--hue-danger: 0;
|
||||
|
||||
--color-l5: hsl(var(--hue), var(--saturation), calc( 50 + 50)%);
|
||||
--color-l4: hsl(var(--hue), var(--saturation), calc( 50 + 40)%);
|
||||
--color-l3: hsl(var(--hue), var(--saturation), calc( 50 + 30)%);
|
||||
--color-l2: hsl(var(--hue), var(--saturation), calc( 50 + 20)%);
|
||||
--color-l1: hsl(var(--hue), var(--saturation), calc( 50 + 10)%);
|
||||
--color-default: hsl(var(--hue), var(--saturation), calc( 50 + 0)%);
|
||||
--color-d1: hsl(var(--hue), var(--saturation), calc( 50 - 10)%);
|
||||
--color-d2: hsl(var(--hue), var(--saturation), calc( 50 - 20)%);
|
||||
--color-d3: hsl(var(--hue), var(--saturation), calc( 50 - 30)%);
|
||||
--color-d4: hsl(var(--hue), var(--saturation), calc( 50 - 40)%);
|
||||
--color-d5: hsl(var(--hue), var(--saturation), calc( 50 - 50)%);
|
||||
|
||||
--default-fg-color-highlight: hsl(var(--hue-default), var(--saturation-most), var(--lum-darker));
|
||||
--default-fg-color: hsl(var(--hue-default), var(--saturation-most), var(--lum-darkest));
|
||||
|
||||
--default-bg-color-highlight: hsl(var(--hue-default), var(--saturation-least), var(--lum-lighter));
|
||||
--default-bg-color: hsl(var(--hue-default), var(--saturation-least), var(--lum-lightest));
|
||||
|
||||
--default-border-color-highlight: hsl(var(--hue-default), var(--saturation-less), var(--lum-darkest));
|
||||
--default-border-color: hsl(var(--hue-default), var(--saturation-less), var(--lum-darker));
|
||||
|
||||
--default-color-lightest: hsl(var(--hue-blue), var(--saturation-least), var(--lum-lightest));
|
||||
--default-color-lighter: hsl(var(--hue-blue), var(--saturation-least), var(--lum-lighter));
|
||||
--default-color-light: hsl(var(--hue-blue), var(--saturation-least), var(--lum-light));
|
||||
--default-color-mid: hsl(var(--hue-blue), var(--saturation-least), var(--lum-mid));
|
||||
--default-color-dark: hsl(var(--hue-blue), var(--saturation-least), var(--lum-dark));
|
||||
--default-color-darker: hsl(var(--hue-blue), var(--saturation-least), var(--lum-darker));
|
||||
--default-color-darkest: hsl(var(--hue-blue), var(--saturation-least), var(--lum-darkest));
|
||||
|
||||
--light-fg-color: #1a3042;
|
||||
--light-bg-color: #d0e0ed; /*#d0e0ed*/
|
||||
--light-border-color: #a1c1da; /*#a1c1da*/
|
||||
|
||||
--medium-fg-color: #f1f6fa;
|
||||
--medium-bg-color: #335f83;
|
||||
--medium-border-color: #294d6a;
|
||||
|
||||
--dark-fg-color: #f1f6fa;
|
||||
--dark-bg-color: #4682b3;
|
||||
--dark-border-color: #335f83;
|
||||
|
||||
--primary-color-lightest: hsl(var(--hue-primary), var(--saturation), var(--lum-lightest));
|
||||
--primary-color-lighter: hsl(var(--hue-primary), var(--saturation), var(--lum-lighter));
|
||||
--primary-color-light: hsl(var(--hue-primary), var(--saturation), var(--lum-light));
|
||||
--primary-color-mid: hsl(var(--hue-primary), var(--saturation), var(--lum-mid));
|
||||
--primary-color-dark: hsl(var(--hue-primary), var(--saturation), var(--lum-dark));
|
||||
--primary-color-darker: hsl(var(--hue-primary), var(--saturation), var(--lum-darker));
|
||||
--primary-color-darkest: hsl(var(--hue-primary), var(--saturation), var(--lum-darkest));
|
||||
|
||||
--secondary-color-lightest: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-lightest));
|
||||
--secondary-color-lighter: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-lighter));
|
||||
--secondary-color-light: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-light));
|
||||
--secondary-color-mid: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-mid));
|
||||
--secondary-color-dark: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-dark));
|
||||
--secondary-color-darker: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-darker));
|
||||
--secondary-color-darkest: hsl(var(--hue-secondary), var(--saturation-least), var(--lum-darkest));
|
||||
|
||||
--info-color-lightest: hsl(var(--hue-info), var(--saturation-less), var(--lum-lightest));
|
||||
--info-color-lighter: hsl(var(--hue-info), var(--saturation-less), var(--lum-lighter));
|
||||
--info-color-light: hsl(var(--hue-info), var(--saturation-less), var(--lum-light));
|
||||
--info-color-mid: hsl(var(--hue-info), var(--saturation-less), var(--lum-mid));
|
||||
--info-color-dark: hsl(var(--hue-info), var(--saturation-less), var(--lum-dark));
|
||||
--info-color-darker: hsl(var(--hue-info), var(--saturation-less), var(--lum-darker));
|
||||
--info-color-darkest: hsl(var(--hue-info), var(--saturation-less), var(--lum-darkest));
|
||||
|
||||
--success-color-lightest: hsl(var(--hue-success), var(--saturation-less), var(--lum-lightest));
|
||||
--success-color-lighter: hsl(var(--hue-success), var(--saturation-less), var(--lum-lighter));
|
||||
--success-color-light: hsl(var(--hue-success), var(--saturation-less), var(--lum-light));
|
||||
--success-color-mid: hsl(var(--hue-success), var(--saturation-less), var(--lum-mid));
|
||||
--success-color-dark: hsl(var(--hue-success), var(--saturation-less), var(--lum-dark));
|
||||
--success-color-darker: hsl(var(--hue-success), var(--saturation-less), var(--lum-darker));
|
||||
--success-color-darkest: hsl(var(--hue-success), var(--saturation-less), var(--lum-darkest));
|
||||
|
||||
--warning-color-lightest: hsl(var(--hue-warning), var(--saturation-less), var(--lum-lightest));
|
||||
--warning-color-lighter: hsl(var(--hue-warning), var(--saturation-less), var(--lum-lighter));
|
||||
--warning-color-light: hsl(var(--hue-warning), var(--saturation-less), var(--lum-light));
|
||||
--warning-color-mid: hsl(var(--hue-warning), var(--saturation-less), var(--lum-mid));
|
||||
--warning-color-dark: hsl(var(--hue-warning), var(--saturation-less), var(--lum-dark));
|
||||
--warning-color-darker: hsl(var(--hue-warning), var(--saturation-less), var(--lum-darker));
|
||||
--warning-color-darkest: hsl(var(--hue-warning), var(--saturation-less), var(--lum-darkest));
|
||||
|
||||
--danger-color-lightest: hsl(var(--hue-danger), var(--saturation-less), var(--lum-lightest));
|
||||
--danger-color-lighter: hsl(var(--hue-danger), var(--saturation-less), var(--lum-lighter));
|
||||
--danger-color-light: hsl(var(--hue-danger), var(--saturation-less), var(--lum-light));
|
||||
--danger-color-mid: hsl(var(--hue-danger), var(--saturation-less), var(--lum-mid));
|
||||
--danger-color-dark: hsl(var(--hue-danger), var(--saturation-less), var(--lum-dark));
|
||||
--danger-color-darker: hsl(var(--hue-danger), var(--saturation-less), var(--lum-darker));
|
||||
--danger-color-darkest: hsl(var(--hue-danger), var(--saturation-less), var(--lum-darkest));
|
||||
|
||||
--link-fg-color: #f1f6fa;
|
||||
--link-bg-color: #5196CF;
|
||||
--link-border-color: #4682b3;
|
||||
|
||||
--btn_trans_in_delay: 0s;
|
||||
--btn_trans_in_duration: .1s;
|
||||
--btn_trans_out_delay: .15s; /*.25s*/
|
||||
--btn_trans_out_duration: .15s;
|
||||
|
||||
--default_fg_lightness: 5%; /* foreground */
|
||||
--default_bg_lightness: 80%; /* background */
|
||||
--default_bd_lightness: 70%; /* border */
|
||||
|
||||
--outline_fg_lightness: calc(var(--default_fg_lightness) + 25%);
|
||||
--outline_bg_lightness: calc(var(--default_bg_lightness) + 15%);
|
||||
--outline_bd_lightness: calc(var(--default_bd_lightness) - 50%);
|
||||
|
||||
--disabled_fg_lightness: calc(var(--default_fg_lightness) + 40%);
|
||||
--disabled_bg_lightness: calc(var(--default_bg_lightness) + 10%);
|
||||
--disabled_bd_lightness: calc(var(--default_bd_lightness) - 10%);
|
||||
|
||||
--hover_fg_lightness: calc(var(--default_fg_lightness) - 5%);
|
||||
--hover_bg_lightness: calc(var(--default_bg_lightness) - 20%);
|
||||
--hover_bd_lightness: calc(var(--default_bd_lightness) - 30%);
|
||||
|
||||
|
||||
--site_menu_btn_color: hsla(0,0%,var(--default_fg_lightness),1);
|
||||
--site_menu_btn_bg_color: hsla(0,0%,var(--default_bg_lightness),1);
|
||||
--site_menu_btn_border_color: hsla(0,0%,var(--default_bd_lightness),1);
|
||||
|
||||
--site_menu_btn_disabled_color: hsla(0,0%,var(--disabled_fg_lightness),1);
|
||||
--site_menu_btn_disabled_bg_color: hsla(0,0%,var(--disabled_bg_lightness),1);
|
||||
--site_menu_btn_disabled_border_color: hsla(0,0%,var(--disabled_bd_lightness),1);
|
||||
|
||||
--site_menu_btn_hover_color: hsla(0,50%,var(--hover_fg_lightness),1);
|
||||
--site_menu_btn_hover_bg_color: hsla(0,0%,var(--hover_bg_lightness),1);
|
||||
--site_menu_btn_hover_border_color: hsla(0,0%,var(--hover_bd_lightness),1);
|
||||
|
||||
--site_footer_color: hsla(0,0%,35%,1);
|
||||
--site_footer_bg_color: hsla(0,0%,100%,1);
|
||||
--site_footer_border_color: hsla(0,0%,80%,1);
|
||||
|
||||
--site_footer_hover_color: hsla(0,0%,5%,1);
|
||||
--site_footer_hover_bg_color: hsla(0,0%,100%,1);
|
||||
--site_footer_hover_border_color: hsla(0,0%,70%,1);
|
||||
|
||||
--system_footer_color: hsla(0,0%,35%,1);
|
||||
--system_footer_bg_color: hsla(0,0%,90%,1);
|
||||
--system_footer_border_color: hsla(0,0%,80%,1);
|
||||
|
||||
--system_footer_hover_color: hsla(0,0%,5%,1);
|
||||
--system_footer_hover_bg_color: hsla(0,0%,80%,1);
|
||||
--system_footer_hover_border_color: hsla(0,0%,70%,1);
|
||||
|
||||
--btn_font_weight_disabled: 300;
|
||||
--btn_font_weight_default: 400;
|
||||
--btn_font_weight_active: 500;
|
||||
--btn_font_weight_primary: 700;
|
||||
|
||||
/* Default Buttons */
|
||||
--default_btn_color: hsla(var(--hue-default),var(--saturation-least),var(--default_fg_lightness),1);
|
||||
--default_btn_bg_color: hsla(var(--hue-default),var(--saturation-least),var(--default_bg_lightness),1);
|
||||
--default_btn_border_color: hsla(var(--hue-default),var(--saturation-least),var(--default_bd_lightness),1);
|
||||
|
||||
--default_btn_outline_color: hsla(var(--hue-default),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--default_btn_outline_bg_color: hsla(var(--hue-default),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--default_btn_outline_border_color: hsla(var(--hue-default),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--default_btn_disabled_color: hsla(var(--hue-default),var(--saturation-least),var(--disabled_fg_lightness),1);
|
||||
--default_btn_disabled_bg_color: hsla(var(--hue-default),var(--saturation-least),var(--disabled_bg_lightness),1);
|
||||
--default_btn_disabled_border_color: hsla(var(--hue-default),var(--saturation-least),var(--disabled_bd_lightness),1);
|
||||
|
||||
--default_btn_hover_color: hsla(var(--hue-default),var(--saturation-least),var(--hover_fg_lightness),1);
|
||||
--default_btn_hover_bg_color: hsla(var(--hue-default),var(--saturation-least),var(--hover_bg_lightness),1);
|
||||
--default_btn_hover_border_color: hsla(var(--hue-default),var(--saturation-least),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Primary Buttons */
|
||||
--primary_btn_color: hsla(var(--hue-primary),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--primary_btn_bg_color: hsla(var(--hue-primary),var(--saturation-less),var(--default_bg_lightness),1);
|
||||
--primary_btn_border_color: hsla(var(--hue-primary),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--primary_btn_outline_color: hsla(var(--hue-primary),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--primary_btn_outline_bg_color: hsla(var(--hue-primary),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--primary_btn_outline_border_color: hsla(var(--hue-primary),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--primary_btn_disabled_color: hsla(var(--hue-primary),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--primary_btn_disabled_bg_color: hsla(var(--hue-primary),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--primary_btn_disabled_border_color: hsla(var(--hue-primary),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--primary_btn_hover_color: hsla(var(--hue-primary),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--primary_btn_hover_bg_color: hsla(var(--hue-primary),var(--saturation-less),var(--hover_bg_lightness),1);
|
||||
--primary_btn_hover_border_color: hsla(var(--hue-primary),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Secondary Buttons */
|
||||
--secondary_btn_color: hsla(var(--hue-secondary),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--secondary_btn_bg_color: hsla(var(--hue-secondary),var(--saturation-less),var(--default_bg_lightness),1);
|
||||
--secondary_btn_border_color: hsla(var(--hue-secondary),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--secondary_btn_outline_color: hsla(var(--hue-secondary),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--secondary_btn_outline_bg_color: hsla(var(--hue-secondary),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--secondary_btn_outline_border_color: hsla(var(--hue-secondary),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--secondary_btn_disabled_color: hsla(var(--hue-secondary),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--secondary_btn_disabled_bg_color: hsla(var(--hue-secondary),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--secondary_btn_disabled_border_color: hsla(var(--hue-secondary),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--secondary_btn_hover_color: hsla(var(--hue-secondary),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--secondary_btn_hover_bg_color: hsla(var(--hue-secondary),var(--saturation-less),var(--hover_bg_lightness),1);
|
||||
--secondary_btn_hover_border_color: hsla(var(--hue-secondary),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Info Buttons */
|
||||
--info_btn_color: hsla(var(--hue-info),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--info_btn_bg_color: hsla(var(--hue-info),var(--saturation-less),var(--default_bg_lightness),1);
|
||||
--info_btn_border_color: hsla(var(--hue-info),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--info_btn_outline_color: hsla(var(--hue-info),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--info_btn_outline_bg_color: hsla(var(--hue-info),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--info_btn_outline_border_color: hsla(var(--hue-info),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--info_btn_disabled_color: hsla(var(--hue-info),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--info_btn_disabled_bg_color: hsla(var(--hue-info),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--info_btn_disabled_border_color: hsla(var(--hue-info),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--info_btn_hover_color: hsla(var(--hue-info),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--info_btn_hover_bg_color: hsla(var(--hue-info),var(--saturation-less),var(--hover_bg_lightness),1);
|
||||
--info_btn_hover_border_color: hsla(var(--hue-info),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Success Buttons */
|
||||
--success_btn_color: hsla(var(--hue-success),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--success_btn_bg_color: hsla(var(--hue-success),var(--saturation-less),var(--default_bg_lightness),1);
|
||||
--success_btn_border_color: hsla(var(--hue-success),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--success_btn_outline_color: hsla(var(--hue-success),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--success_btn_outline_bg_color: hsla(var(--hue-success),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--success_btn_outline_border_color: hsla(var(--hue-success),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--success_btn_disabled_color: hsla(var(--hue-success),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--success_btn_disabled_bg_color: hsla(var(--hue-success),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--success_btn_disabled_border_color: hsla(var(--hue-success),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--success_btn_hover_color: hsla(var(--hue-success),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--success_btn_hover_bg_color: hsla(var(--hue-success),var(--saturation-less),var(--hover_bg_lightness),1);
|
||||
--success_btn_hover_border_color: hsla(var(--hue-success),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Warning Buttons */
|
||||
--warning_btn_color: hsla(var(--hue-warning),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--warning_btn_bg_color: hsla(var(--hue-warning),var(--saturation-less),var(--default_bg_lightness),1);
|
||||
--warning_btn_border_color: hsla(var(--hue-warning),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--warning_btn_outline_color: hsla(var(--hue-warning),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--warning_btn_outline_bg_color: hsla(var(--hue-warning),var(--saturation-less),var(--outline_bg_lightness),1);
|
||||
--warning_btn_outline_border_color: hsla(var(--hue-warning),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--warning_btn_disabled_color: hsla(var(--hue-warning),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--warning_btn_disabled_bg_color: hsla(var(--hue-warning),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--warning_btn_disabled_border_color: hsla(var(--hue-warning),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--warning_btn_hover_color: hsla(var(--hue-warning),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--warning_btn_hover_bg_color: hsla(var(--hue-warning),var(--saturation-less),var(--hover_bg_lightness),1);
|
||||
--warning_btn_hover_border_color: hsla(var(--hue-warning),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
/* Danger Buttons */
|
||||
--danger_btn_color: hsla(var(--hue-danger),var(--saturation-less),var(--default_fg_lightness),1);
|
||||
--danger_btn_bg_color: hsla(var(--hue-danger),var(--saturation-more),var(--default_bg_lightness),1);
|
||||
--danger_btn_border_color: hsla(var(--hue-danger),var(--saturation-less),var(--default_bd_lightness),1);
|
||||
|
||||
--danger_btn_outline_color: hsla(var(--hue-danger),var(--saturation-most),var(--outline_fg_lightness),1);
|
||||
--danger_btn_outline_bg_color: hsla(var(--hue-danger),var(--saturation-more),var(--outline_bg_lightness),1);
|
||||
--danger_btn_outline_border_color: hsla(var(--hue-danger),var(--saturation-most),var(--outline_bd_lightness),1);
|
||||
|
||||
--danger_btn_disabled_color: hsla(var(--hue-danger),var(--saturation-less),var(--disabled_fg_lightness),1);
|
||||
--danger_btn_disabled_bg_color: hsla(var(--hue-danger),var(--saturation-less),var(--disabled_bg_lightness),1);
|
||||
--danger_btn_disabled_border_color: hsla(var(--hue-danger),var(--saturation-less),var(--disabled_bd_lightness),1);
|
||||
|
||||
--danger_btn_hover_color: hsla(var(--hue-danger),var(--saturation-less),var(--hover_fg_lightness),1);
|
||||
--danger_btn_hover_bg_color: hsla(var(--hue-danger),var(--saturation-more),var(--hover_bg_lightness),1);
|
||||
--danger_btn_hover_border_color: hsla(var(--hue-danger),var(--saturation-less),var(--hover_bd_lightness),1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* https://encycolorpedia.com/035096
|
||||
* Medium electric blue / #035096
|
||||
*
|
||||
* https://encycolorpedia.com/32527b
|
||||
* Metallic blue / #32527b
|
||||
*
|
||||
* https://encycolorpedia.com/4682b4
|
||||
* Steelblue / Steel blue / #4682b4
|
||||
*/
|
||||
|
||||
/*
|
||||
* Faux-Metallic Blue #335f83
|
||||
* http://www.2020colours.com/335f83
|
||||
* https://encycolorpedia.com/335f83
|
||||
* https://www.w3schools.com/w3css/w3css_color_generator.asp
|
||||
*
|
||||
* #335f83
|
||||
* rgb(51, 95, 131)
|
||||
* hsl(147, 112%, 91%)
|
||||
* cmyk(61, 27, 0, 49)
|
||||
*
|
||||
* complementary #825633
|
||||
* warning #CFB33C, rgb(207,179,60)
|
||||
* danger #B55F35, rgb(181,95,53)
|
||||
*/
|
||||
.aether__theme--l5 {color:#000 !important; background-color:#f1f6fa !important}
|
||||
.aether__theme--l4 {color:#000 !important; background-color:#d0e0ed !important}
|
||||
.aether__theme--l3 {color:#000 !important; background-color:#a1c1da !important}
|
||||
.aether__theme--l2 {color:#fff !important; background-color:#72a1c8 !important}
|
||||
.aether__theme--l1 {color:#fff !important; background-color:#4682b3 !important}
|
||||
.aether__theme--d1 {color:#fff !important; background-color:#2e5677 !important}
|
||||
.aether__theme--d2 {color:#fff !important; background-color:#294d6a !important}
|
||||
.aether__theme--d3 {color:#fff !important; background-color:#24435d !important}
|
||||
.aether__theme--d4 {color:#fff !important; background-color:#1f3a4f !important}
|
||||
.aether__theme--d5 {color:#fff !important; background-color:#1a3042 !important}
|
||||
|
||||
.aether__theme--light {color:#000 !important; background-color:#f1f6fa !important}
|
||||
.aether__theme--dark {color:#fff !important; background-color:#1a3042 !important}
|
||||
.aether__theme--action {color:#fff !important; background-color:#1a3042 !important}
|
||||
|
||||
.aether__theme {color:#fff !important; background-color:#335f83 !important}
|
||||
.aether__theme--text {color:#335f83 !important}
|
||||
.aether__theme--border {border-color:#335f83 !important}
|
||||
|
||||
.aether__theme--hover:hover {color:#fff !important; background-color:#335f83 !important}
|
||||
.aether__theme--text_hover:hover {color:#335f83 !important}
|
||||
.aether__theme--border_hover:hover {border-color:#335f83 !important}
|
||||
|
||||
/*
|
||||
* success #66be07
|
||||
* info #00beff
|
||||
* danger #660007
|
||||
*
|
||||
* error #660007
|
||||
*
|
||||
* primary 5196CF
|
||||
* secondary 688297
|
||||
*
|
||||
* info 8FB2CF (blue)
|
||||
* success 2C827B (green)
|
||||
*
|
||||
* warning 7F8226 (brown yellow)
|
||||
* danger 824240 (brown orange)
|
||||
*
|
||||
* other 393B82 (purple)
|
||||
*/
|
||||
774
app/css/base_style_event_launcher.css
Normal file
774
app/css/base_style_event_launcher.css
Normal file
@@ -0,0 +1,774 @@
|
||||
body {
|
||||
background-color: steelblue;
|
||||
/* https://app.haikei.app/ */
|
||||
background-image: url('/static/images/site_background.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
body>.body_container {
|
||||
}
|
||||
|
||||
/* #System-Nav-Menu { } */
|
||||
#Site-Header { }
|
||||
#Site-Nav-Menu { }
|
||||
#System-Notifications { }
|
||||
#Main-Body {
|
||||
}
|
||||
#Main-Notifications { }
|
||||
#Main-Nav-Menu { }
|
||||
#Main-Content { }
|
||||
#Site-Footer { }
|
||||
/* #System-Footer { } */
|
||||
/* #System-Nav-Menu-Float { } */
|
||||
/* #System-Debug { } */
|
||||
|
||||
|
||||
/* #System-Nav-Menu { outline: dashed thin red; } */
|
||||
/* #Site-Header { outline: dashed thin red; } */
|
||||
/* #Site-Nav-Menu { outline: dashed thin pink; } */
|
||||
/* #System-Notifications { outline: dashed thin red; } */
|
||||
/* #Main-Body { outline: dotted thin green; } */
|
||||
/* #Main-Notifications { outline: dotted thin blue; } */
|
||||
/* #Main-Nav-Menu { outline: dotted thin blue; } */
|
||||
/* #Main-Content { outline: dotted thin blue; } */
|
||||
/* #Site-Footer { outline: dotted thin blue; } */
|
||||
/* #System-Footer { outline: dashed thin red; } */
|
||||
/* #System-Debug { outline: dashed thin red; } */
|
||||
|
||||
|
||||
#System-Nav-Menu {
|
||||
border: solid thick transparent;
|
||||
border-top: none;
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
}
|
||||
|
||||
#System-Nav-Menu:hover {
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
/* background-color: hsla(0,0%,80%,1); */
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest).1) 0%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 3%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 97%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.1) 100%);
|
||||
|
||||
}
|
||||
|
||||
#System-Nav-Menu img {
|
||||
}
|
||||
#System-Nav-Menu:hover img {
|
||||
}
|
||||
|
||||
.system_menu_clicked {
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest).1) 0%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 3%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 97%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.1) 100%);
|
||||
}
|
||||
|
||||
|
||||
.system_menu_begin {
|
||||
/*border: solid thin red;*/
|
||||
|
||||
text-shadow: 0 0 .25rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 .75rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 1rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1);
|
||||
|
||||
color: black;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 100%);*/
|
||||
}
|
||||
.system_menu_begin:hover {
|
||||
}
|
||||
|
||||
.system_menu_center {
|
||||
/*border: solid thin blue;*/
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.1) 25%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.8) 50%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.9) 75%);*/
|
||||
}
|
||||
|
||||
.system_menu_end {
|
||||
/*border: solid thin red;*/
|
||||
|
||||
text-shadow: 0 0 .25rem white, 0 0 .75rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 1rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1);
|
||||
|
||||
color: black;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.6) 20%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.6) 80%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_end:hover {
|
||||
}
|
||||
|
||||
.system_menu_hidden {
|
||||
border-bottom: solid thin gray;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_hidden:hover {
|
||||
}
|
||||
|
||||
.system_menu_visible {
|
||||
/*border-bottom: solid thin gray;*/
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_visible:hover {
|
||||
}
|
||||
|
||||
.system_menu_name {
|
||||
/*border: dashed thin blue;*/
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);
|
||||
}
|
||||
|
||||
.system_menu_name img {
|
||||
}
|
||||
|
||||
.system_menu_information {
|
||||
/*border: dashed thin green;*/
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);
|
||||
}
|
||||
.system_menu_information:hover {
|
||||
/*background-color: gray;*/
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 100%);*/
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.97) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.97) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.0) 100%);
|
||||
|
||||
}
|
||||
|
||||
/* Set style based on the user's permissions */
|
||||
.system_menu.user_super {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_manager {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-orange),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_administrator {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-yellow),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_verified {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-yellow),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_authenticated {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-cyan),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu .user_status_options {
|
||||
font-size: .8rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
/* *** END *** System *** System Menu (root menu) *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Menu Floating/Fixed (root menu) *** */
|
||||
#System-Nav-Menu-Float {
|
||||
background-color: rgba(220,175,175,.8);
|
||||
}
|
||||
/* *** END *** System *** System Menu Floating/Fixed (root menu) *** */
|
||||
|
||||
|
||||
#Site-Header {
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
}
|
||||
|
||||
#Site-Header img {
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Site Nav Menu *** */
|
||||
#Site-Nav-Menu {
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
border-bottom: solid thin hsla(0,0%,80%,1);
|
||||
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul {
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li {
|
||||
/* background-color: var(--site_menu_btn_bg_color); */
|
||||
/* border: solid thin var(--site_menu_btn_border_color);
|
||||
* border-radius: .25rem; */
|
||||
/* font-weight: var(--btn_font_weight_default); */
|
||||
/* color: var(--site_menu_btn_color); */
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li:hover {
|
||||
/* background-color: var(--site_menu_btn_hover_bg_color); */
|
||||
/* border: solid thin var(--site_menu_btn_hover_border_color); */
|
||||
/* color: var(--site_menu_btn_hover_color); */
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li.nav_disabled {
|
||||
/* background-color: var(--site_menu_btn_disabled_bg_color);
|
||||
* border: solid thin var(--site_menu_btn_disabled_border_color);
|
||||
*
|
||||
* font-weight: var(--btn_font_weight_disabled);
|
||||
* color: var(--site_menu_btn_disabled_color);
|
||||
* text-decoration: line-through; */
|
||||
}
|
||||
#Site-Nav-Menu ul>li.nav_active {
|
||||
/* font-weight: var(--btn_font_weight_active); */
|
||||
}
|
||||
#Site-Nav-Menu ul>li.nav_primary {
|
||||
font-weight: var(--btn_font_weight_primary);
|
||||
/* border-right: solid thin hsla(0,0%,50%,.5); */
|
||||
}
|
||||
|
||||
#Site-Nav-Menu .btn {
|
||||
border-color: hsla(0,0%,90%,.1);
|
||||
background-color: hsla(0,0%,90%,.1);
|
||||
}
|
||||
/* *** END *** System *** System Site Nav Menu *** */
|
||||
|
||||
#System-Notifications {
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
}
|
||||
|
||||
|
||||
#Main-Body {
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
}
|
||||
|
||||
#Main-Notifications {
|
||||
/* background-color: hsla(var(--hue-info),var(--saturation-least),var(--lum-lighter),.1); */
|
||||
/* background-color: hsla(0,0%,100%,.98); */
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** Main *** Main Nav Menu *** */
|
||||
#Main-Nav-Menu {
|
||||
|
||||
}
|
||||
|
||||
#Main-Nav-Menu ul {
|
||||
}
|
||||
|
||||
#Main-Nav-Menu ul>li {
|
||||
}
|
||||
|
||||
#Main-Nav-Menu ul>li:hover {
|
||||
}
|
||||
|
||||
#Main-Nav-Menu ul>li.disabled {
|
||||
background-color: var(--site_menu_btn_disabled_bg_color);
|
||||
border: solid thin var(--site_menu_btn_disabled_border_color);
|
||||
|
||||
font-weight: var(--btn_font_weight_disabled);
|
||||
color: var(--site_menu_btn_disabled_color);
|
||||
text-decoration: line-through;
|
||||
}
|
||||
#Main-Nav-Menu ul>li.active {
|
||||
font-weight: var(--btn_font_weight_active);
|
||||
}
|
||||
#Main-Nav-Menu ul>li.primary {
|
||||
font-weight: var(--btn_font_weight_primary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#Main-Nav-Menu .m_btn {
|
||||
appearance: button;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
background-color: var(--site_menu_btn_bg_color);
|
||||
|
||||
border: solid thin var(--site_menu_btn_border_color);
|
||||
border-radius: .25rem;
|
||||
|
||||
/* line-height: 1rem; */
|
||||
/* font-size: 1rem; */
|
||||
font-weight: var(--btn_font_weight_default);
|
||||
text-align: center;
|
||||
|
||||
color: var(--site_menu_btn_color);
|
||||
|
||||
/* NOTE: transition when hover ends */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_out_delay); /* short delay */
|
||||
transition-duration: var(--btn_trans_out_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#Main-Nav-Menu .m_btn:hover {
|
||||
/* background-color: var(--site_menu_btn_hover_bg_color); */
|
||||
|
||||
/* border: solid thin var(--site_menu_btn_hover_border_color); */
|
||||
|
||||
/* color: var(--site_menu_btn_hover_color); */
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_in_delay); /* no delay */
|
||||
transition-duration: var(--btn_trans_in_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
/* *** END *** System *** System Main Nav Menu *** */
|
||||
|
||||
#Main-Content {
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Site Footer *** */
|
||||
/* site_footer or site_footer or site_status is the global (root) footer or status bar */
|
||||
#Site-Footer {
|
||||
background-color: var(--site_footer_bg_color);
|
||||
|
||||
border-top: solid thin var(--site_footer_border_color);
|
||||
|
||||
color: var(--site_footer_color);
|
||||
}
|
||||
|
||||
#Site-Footer:hover {
|
||||
background-color: var(--site_footer_hover_bg_color);
|
||||
|
||||
border-top: solid thin var(--site_footer_hover_border_color);
|
||||
|
||||
color: var(--site_footer_hover_color);
|
||||
}
|
||||
|
||||
.site_footer .footer_left {
|
||||
}
|
||||
.site_footer .footer_right {
|
||||
}
|
||||
/* *** END *** System *** Site Footer *** */
|
||||
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Footer *** */
|
||||
/* system_footer or system_footer or system_status is the global (root) footer or status bar */
|
||||
#System-Footer {
|
||||
font-size: .8rem;
|
||||
|
||||
background-color: var(--system_footer_bg_color);
|
||||
|
||||
border-top: solid thin var(--system_footer_border_color);
|
||||
|
||||
color: var(--system_footer_color);
|
||||
|
||||
/* NOTE: transition when hover ends */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_out_delay); /* short delay */
|
||||
transition-duration: var(--btn_trans_out_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#System-Footer:hover {
|
||||
background-color: var(--system_footer_hover_bg_color);
|
||||
|
||||
border-top: solid thin var(--system_footer_hover_border_color);
|
||||
|
||||
color: var(--system_footer_hover_color);
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_in_delay); /* no delay */
|
||||
transition-duration: var(--btn_trans_in_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.system_footer .footer_left {
|
||||
}
|
||||
.system_footer .footer_right {
|
||||
}
|
||||
/* *** END *** System *** System Footer *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Debug *** */
|
||||
#hidden_system_debug {
|
||||
}
|
||||
|
||||
#System-Debug {
|
||||
/* background-color: rgba(220,175,175,.95); */
|
||||
background-color: rgba(220,175,175,1);
|
||||
|
||||
border: dashed thin pink;
|
||||
|
||||
font-size: .7rem;
|
||||
|
||||
opacity: .75;
|
||||
transition: opacity .95s linear .5s;
|
||||
}
|
||||
|
||||
#System-Debug:hover {
|
||||
border: solid thin pink;
|
||||
|
||||
opacity: .95;
|
||||
|
||||
/* background-color: rgba(220,175,175,1); */
|
||||
}
|
||||
|
||||
.view_system_debug {
|
||||
cursor: help;
|
||||
}
|
||||
/* *** END *** System *** Debug *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Buttons *** */
|
||||
a.btn {
|
||||
/* font-family: inherit; */
|
||||
/* font-size: inherit; */
|
||||
/* font-style: inherit; */
|
||||
/* font-weight: inherit; */
|
||||
/* line-height: inherit; */
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button.btn {
|
||||
/* font-family: inherit; */
|
||||
/* font-size: inherit; */
|
||||
/* font-style: inherit; */
|
||||
/* font-weight: inherit; */
|
||||
/* line-height: inherit; */
|
||||
/* text-decoration: none; */
|
||||
}
|
||||
|
||||
.btn {
|
||||
appearance: button;
|
||||
|
||||
display: inline-block;
|
||||
|
||||
border: solid thin var(--default_btn_border_color);
|
||||
border-radius: .25em;
|
||||
|
||||
margin: .0em;
|
||||
padding: .25em .5em;
|
||||
|
||||
line-height: 1em;
|
||||
font-size: 1em;
|
||||
text-align: center;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
/*display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;*/
|
||||
|
||||
/* NOTE: transition when hover ends */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_out_delay); /* short delay */
|
||||
transition-duration: var(--btn_trans_out_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
.btn:hover {
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: color, background-color, border-color;
|
||||
transition-delay: var(--btn_trans_in_delay); /* no delay */
|
||||
transition-duration: var(--btn_trans_in_duration);
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.btn_default {
|
||||
color: var(--default_btn_color);
|
||||
background-color: var(--default_btn_bg_color);
|
||||
border: solid thin var(--default_btn_border_color);
|
||||
}
|
||||
.btn_default:hover {
|
||||
color: var(--default_btn_hover_color);
|
||||
background-color: var(--default_btn_hover_bg_color);
|
||||
border: solid thin var(--default_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_default {
|
||||
color: var(--default_btn_outline_color);
|
||||
background-color: var(--default_btn_outline_bg_color);
|
||||
border: solid thin var(--default_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_default:hover {
|
||||
color: var(--default_btn_hover_color);
|
||||
background-color: var(--default_btn_hover_bg_color);
|
||||
border: solid thin var(--default_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_primary {
|
||||
font-weight: var(--btn_font_weight_primary);
|
||||
color: var(--primary_btn_color);
|
||||
background-color: var(--primary_btn_bg_color);
|
||||
border: solid thin var(--primary_btn_border_color);
|
||||
}
|
||||
.btn_primary:hover {
|
||||
color: var(--primary_btn_hover_color);
|
||||
background-color: var(--primary_btn_hover_bg_color);
|
||||
border: solid thin var(--primary_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_primary {
|
||||
font-weight: var(--btn_font_weight_primary);
|
||||
color: var(--primary_btn_outline_color);
|
||||
background-color: var(--primary_btn_outline_bg_color);
|
||||
border: solid thin var(--primary_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_primary:hover {
|
||||
color: var(--primary_btn_hover_color);
|
||||
background-color: var(--primary_btn_hover_bg_color);
|
||||
border: solid thin var(--primary_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_secondary {
|
||||
font-weight: var(--btn_font_weight_default);
|
||||
color: var(--secondary_btn_color);
|
||||
background-color: var(--secondary_btn_bg_color);
|
||||
border: solid thin var(--secondary_btn_border_color);
|
||||
}
|
||||
.btn_secondary:hover {
|
||||
color: var(--secondary_btn_hover_color);
|
||||
background-color: var(--secondary_btn_hover_bg_color);
|
||||
border: solid thin var(--secondary_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_secondary {
|
||||
font-weight: var(--btn_font_weight_default);
|
||||
color: var(--secondary_btn_outline_color);
|
||||
background-color: var(--secondary_btn_outline_bg_color);
|
||||
border: solid thin var(--secondary_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_secondary:hover {
|
||||
color: var(--secondary_btn_hover_color);
|
||||
background-color: var(--secondary_btn_hover_bg_color);
|
||||
border: solid thin var(--secondary_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_info {
|
||||
color: var(--info_btn_color);
|
||||
background-color: var(--info_btn_bg_color);
|
||||
border: solid thin var(--info_btn_border_color);
|
||||
}
|
||||
.btn_info:hover {
|
||||
color: var(--info_btn_hover_color);
|
||||
background-color: var(--info_btn_hover_bg_color);
|
||||
border: solid thin var(--info_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_info {
|
||||
color: var(--info_btn_outline_color);
|
||||
background-color: var(--info_btn_outline_bg_color);
|
||||
border: solid thin var(--info_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_info:hover {
|
||||
color: var(--info_btn_hover_color);
|
||||
background-color: var(--info_btn_hover_bg_color);
|
||||
border: solid thin var(--info_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_success {
|
||||
color: var(--success_btn_color);
|
||||
background-color: var(--success_btn_bg_color);
|
||||
border: solid thin var(--success_btn_border_color);
|
||||
}
|
||||
.btn_success:hover {
|
||||
color: var(--success_btn_hover_color);
|
||||
background-color: var(--success_btn_hover_bg_color);
|
||||
border: solid thin var(--success_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_success {
|
||||
color: var(--success_btn_outline_color);
|
||||
background-color: var(--success_btn_outline_bg_color);
|
||||
border: solid thin var(--success_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_success:hover {
|
||||
color: var(--success_btn_hover_color);
|
||||
background-color: var(--success_btn_hover_bg_color);
|
||||
border: solid thin var(--success_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_warning {
|
||||
color: var(--warning_btn_color);
|
||||
background-color: var(--warning_btn_bg_color);
|
||||
border: solid thin var(--warning_btn_border_color);
|
||||
}
|
||||
.btn_warning:hover {
|
||||
color: var(--warning_btn_hover_color);
|
||||
background-color: var(--warning_btn_hover_bg_color);
|
||||
border: solid thin var(--warning_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_warning {
|
||||
color: var(--warning_btn_outline_color);
|
||||
background-color: var(--warning_btn_outline_bg_color);
|
||||
border: solid thin var(--warning_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_warning:hover {
|
||||
color: var(--warning_btn_hover_color);
|
||||
background-color: var(--warning_btn_hover_bg_color);
|
||||
border: solid thin var(--warning_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_danger {
|
||||
color: var(--danger_btn_color);
|
||||
background-color: var(--danger_btn_bg_color);
|
||||
border: solid thin var(--danger_btn_border_color);
|
||||
}
|
||||
.btn_danger:hover {
|
||||
color: var(--danger_btn_hover_color);
|
||||
background-color: var(--danger_btn_hover_bg_color);
|
||||
border: solid thin var(--danger_btn_hover_border_color);
|
||||
}
|
||||
|
||||
.btn_outline_danger {
|
||||
color: var(--danger_btn_outline_color);
|
||||
background-color: var(--danger_btn_outline_bg_color);
|
||||
border: solid thin var(--danger_btn_outline_border_color);
|
||||
}
|
||||
.btn_outline_danger:hover {
|
||||
color: var(--danger_btn_hover_color);
|
||||
background-color: var(--danger_btn_hover_bg_color);
|
||||
border: solid thin var(--danger_btn_hover_border_color);
|
||||
}
|
||||
|
||||
/* Button Modifiers */
|
||||
.btn.btn_active {
|
||||
}
|
||||
.btn.btn_disabled {
|
||||
/* background-color: var(--site_menu_btn_disabled_bg_color); */
|
||||
/* border: solid thin var(--site_menu_btn_disabled_border_color); */
|
||||
|
||||
font-weight: var(--btn_font_weight_disabled);
|
||||
/* color: var(--site_menu_btn_disabled_color); */
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.btn.btn_sm {
|
||||
line-height: 1em;
|
||||
font-size: .9em;
|
||||
}
|
||||
.btn.btn_md {
|
||||
line-height: 1em;
|
||||
font-size: 1em;
|
||||
}
|
||||
.btn.btn_lg {
|
||||
line-height: 1em;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
ul.btn_list>li {
|
||||
display: block;
|
||||
/* margin: .75rem 0rem; */
|
||||
/* padding: 0; */
|
||||
}
|
||||
ul.btn_list>li:hover {
|
||||
outline: dashed thin pink;
|
||||
}
|
||||
/* *** END *** System *** Buttons *** */
|
||||
|
||||
|
||||
/*x-Small devices (portrait phones, less than 576px)*/
|
||||
@media (max-width: 575px) {
|
||||
.btn {
|
||||
padding: .1em .1em;
|
||||
}
|
||||
}
|
||||
|
||||
/*Small devices (landscape phones, 576px and up)*/
|
||||
@media (min-width: 576px) and (max-width: 767px) {
|
||||
.btn {
|
||||
padding: .1em .25em;
|
||||
}
|
||||
}
|
||||
555
app/css/base_style_grid_event_launcher.css
Normal file
555
app/css/base_style_grid_event_launcher.css
Normal file
@@ -0,0 +1,555 @@
|
||||
html {
|
||||
}
|
||||
body {
|
||||
/*padding-top: 2.6rem;*/
|
||||
/*padding-top: 1rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;*/
|
||||
/*padding-bottom: 2rem;*/
|
||||
padding-bottom: 0rem;
|
||||
padding: .3rem;
|
||||
}
|
||||
|
||||
body>.body_container {
|
||||
display: grid;
|
||||
grid-template-columns: 100%;
|
||||
/* grid-template-rows: min-content min-content min-content min-content max-content min-content min-content; */
|
||||
/*grid-template-rows: min-content min-content min-content max-content min-content;*/
|
||||
grid-template-rows: 100%;
|
||||
gap: 0px 0px;
|
||||
grid-auto-flow: row;
|
||||
grid-template-areas:
|
||||
/* "System-Nav-Menu" */
|
||||
"Site-Header"
|
||||
"Site-Nav-Menu"
|
||||
"System-Notifications"
|
||||
"Main-Body"
|
||||
"Site-Footer";
|
||||
/* "System-Footer"; */
|
||||
|
||||
max-width: 1440px;
|
||||
margin: auto;
|
||||
/*padding: 2.25rem 0rem 2rem;*/ /* top right/left bottom */
|
||||
|
||||
/*max-height: 100vh;*/
|
||||
}
|
||||
|
||||
/* #System-Nav-Menu { grid-area: System-Nav-Menu; } */
|
||||
#Site-Header { grid-area: Site-Header; }
|
||||
#Site-Nav-Menu { grid-area: Site-Nav-Menu; }
|
||||
#System-Notifications { grid-area: System-Notifications; }
|
||||
#Main-Body {
|
||||
display: grid;
|
||||
/*grid-template-columns: fit-content(15%) fit-content(85%);*/
|
||||
grid-template-columns: 15rem 1fr;
|
||||
grid-template-rows: auto 1fr;
|
||||
gap: 0px 0px;
|
||||
grid-auto-flow: row;
|
||||
grid-template-areas:
|
||||
/*"Main-Nav-Menu Main-Notifications"*/
|
||||
"Main-Nav-Menu Main-Content";
|
||||
grid-area: Main-Body;
|
||||
}
|
||||
/*#Main-Notifications { grid-area: Main-Notifications; }*/
|
||||
#Main-Nav-Menu { grid-area: Main-Nav-Menu; }
|
||||
#Main-Content { grid-area: Main-Content; }
|
||||
#Site-Footer { grid-area: Site-Footer; }
|
||||
/* #System-Footer { grid-area: System-Footer; } */
|
||||
/* #System-Nav-Menu-Float { } */
|
||||
/* #System-Debug { grid-area: System-Debug; } */
|
||||
|
||||
|
||||
|
||||
#System-Nav-Menu {
|
||||
z-index: 1040; /* Bootstrap's modal background is also z-index: 1040 */
|
||||
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
width: 100vw;
|
||||
max-width: 1440px;
|
||||
|
||||
/* margin: auto; */
|
||||
padding-top: .03rem;
|
||||
padding-left: .03rem;
|
||||
padding-right: .03rem;
|
||||
padding-bottom: .03rem;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
min-height: 2.25rem;
|
||||
max-height: 2.25rem;
|
||||
|
||||
/* NOTE: transition when no longer hovering */
|
||||
transition-property: height, max-height;
|
||||
transition-delay: 4s;
|
||||
transition-duration: .1s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#System-Nav-Menu:hover {
|
||||
z-index: 1051; /* Bootstrap's modal background is z-index: 1040 */
|
||||
|
||||
/* height: auto; */
|
||||
max-height: 10rem;
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: height, max-height;
|
||||
transition-delay: 1.5s;
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#System-Nav-Menu img {
|
||||
max-height: 2rem;
|
||||
}
|
||||
#System-Nav-Menu:hover img {
|
||||
max-height: 2.5rem;
|
||||
}
|
||||
|
||||
.system_menu_clicked {
|
||||
z-index: 1051; /* Bootstrap's modal background is z-index: 1040 */
|
||||
|
||||
/* height: 5.5rem; */
|
||||
max-height: 10rem;
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: height;
|
||||
transition-delay: 0s;
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
|
||||
.system_menu_begin {
|
||||
/*border: solid thin red;*/
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
/*align-content: center;*/
|
||||
align-items: center;
|
||||
/*justify-content: center;*/
|
||||
|
||||
height: 100%;
|
||||
padding: 0 .25rem;
|
||||
}
|
||||
.system_menu_begin:hover {
|
||||
}
|
||||
|
||||
.system_menu_center {
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.system_menu_end {
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
/*align-content: center;*/
|
||||
align-items: center;
|
||||
/*justify-content: center;*/
|
||||
|
||||
height: 100%;
|
||||
padding: 0 .25rem;
|
||||
}
|
||||
.system_menu_end:hover {
|
||||
}
|
||||
|
||||
.system_menu_hidden {
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
margin: 0;
|
||||
padding: .1rem .75rem;
|
||||
}
|
||||
.system_menu_hidden:hover {
|
||||
}
|
||||
|
||||
.system_menu_visible {
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
margin: 0;
|
||||
padding: .1rem .75rem;
|
||||
}
|
||||
.system_menu_visible:hover {
|
||||
}
|
||||
|
||||
.system_menu_name {
|
||||
/*flex: auto;*/
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-begin;
|
||||
align-items: center;
|
||||
|
||||
margin: 0;
|
||||
padding: 0rem .5rem;
|
||||
}
|
||||
|
||||
.system_menu_name img {
|
||||
max-height: 1rem;
|
||||
}
|
||||
|
||||
.system_menu_information {
|
||||
/*border: dashed thin green;*/
|
||||
/*flex: auto;*/
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
margin: 0;
|
||||
padding: 0rem .5rem;
|
||||
}
|
||||
.system_menu_information:hover {
|
||||
}
|
||||
|
||||
/* Set style based on the user's permissions */
|
||||
.system_menu.user_super {
|
||||
}
|
||||
|
||||
.system_menu.user_manager {
|
||||
}
|
||||
|
||||
.system_menu.user_administrator {
|
||||
}
|
||||
|
||||
.system_menu.user_verified {
|
||||
}
|
||||
|
||||
.system_menu.user_authenticated {
|
||||
}
|
||||
|
||||
.system_menu .user_status_options {
|
||||
}
|
||||
/* *** END *** System *** System Menu (root menu) *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Menu Floating/Fixed (root menu) *** */
|
||||
#System-Nav-Menu-Float {
|
||||
z-index: 1040;
|
||||
position: fixed;
|
||||
top: .1rem;
|
||||
right: .1rem;
|
||||
|
||||
padding: .1rem .5rem;
|
||||
}
|
||||
/* *** END *** System *** System Menu Floating/Fixed (root menu) *** */
|
||||
|
||||
|
||||
#Site-Header {
|
||||
position: relative;
|
||||
|
||||
max-height: 10vh;
|
||||
|
||||
margin: 0;
|
||||
padding: .25rem;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: wrap; */
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
/* overflow: hidden; */
|
||||
}
|
||||
|
||||
#Site-Header img {
|
||||
/* max-height: 4rem; */
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Site Nav Menu *** */
|
||||
#Site-Nav-Menu {
|
||||
position: sticky;
|
||||
top: 2.25rem;
|
||||
|
||||
height: 3.0rem;
|
||||
max-height: 3.0rem;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center; /* flex-start */
|
||||
align-items: center;
|
||||
/* align-content: center; */
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul {
|
||||
width: 100%;
|
||||
|
||||
list-style-type: none;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center; /* flex-start */
|
||||
/* align-items: center; */
|
||||
/* align-content: center; */
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li {
|
||||
display: flex; /* inline */
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
margin: .1rem .5rem;
|
||||
padding: .2rem .4rem;
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li:hover {
|
||||
}
|
||||
|
||||
#Site-Nav-Menu ul>li.nav_disabled {
|
||||
}
|
||||
#Site-Nav-Menu ul>li.nav_active {
|
||||
}
|
||||
#Site-Nav-Menu ul>li.nav_primary {
|
||||
}
|
||||
|
||||
#Site-Nav-Menu .btn {
|
||||
}
|
||||
/* *** END *** System *** System Site Nav Menu *** */
|
||||
|
||||
#System-Notifications {
|
||||
}
|
||||
|
||||
|
||||
#Main-Body {
|
||||
contain: content;
|
||||
padding: .5rem .1rem;
|
||||
|
||||
min-height: 90vh;
|
||||
|
||||
/*max-height: 100%;*/
|
||||
}
|
||||
|
||||
#Main-Notifications {
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Site Nav Menu *** */
|
||||
#Main-Nav-Menu {
|
||||
contain: content;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/*flex-wrap: wrap;*/
|
||||
/*justify-content: flex-start;*/ /* flex-start */
|
||||
/*align-items: center;*/
|
||||
/*align-content: center;*/
|
||||
}
|
||||
|
||||
#Main-Nav-Menu .m_btn {
|
||||
appearance: button;
|
||||
|
||||
height: auto;
|
||||
width: auto;
|
||||
|
||||
inline-size: auto;
|
||||
|
||||
margin: .1rem .5rem;
|
||||
padding: .2rem .4rem;
|
||||
}
|
||||
|
||||
#Main-Nav-Menu .m_btn:hover {
|
||||
}
|
||||
/* *** END *** System *** System Main Nav Menu *** */
|
||||
|
||||
#Main-Content {
|
||||
contain: content;
|
||||
|
||||
/*max-height: 100%;
|
||||
min-height: 100vh;
|
||||
max-height: 100vh;*/
|
||||
|
||||
overflow: auto;
|
||||
|
||||
padding: .75rem;
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Site Footer *** */
|
||||
/* site_footer or site_footer or site_status is the global (root) footer or status bar */
|
||||
#Site-Footer {
|
||||
max-height: 1.75rem;
|
||||
|
||||
/* width: 100%;
|
||||
max-width: 1440px; */
|
||||
|
||||
margin: 0 0;
|
||||
padding: 0 .5rem;
|
||||
}
|
||||
|
||||
#Site-Footer:hover {
|
||||
}
|
||||
|
||||
.site_footer .footer_left {
|
||||
float: left;
|
||||
}
|
||||
.site_footer .footer_right {
|
||||
float: right;
|
||||
}
|
||||
/* *** END *** System *** Site Footer *** */
|
||||
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Footer *** */
|
||||
/* system_footer or system_footer or system_status is the global (root) footer or status bar */
|
||||
#System-Footer {
|
||||
z-index: 1040; /* Bootstrap's modal background is also z-index: 1040 */
|
||||
|
||||
max-height: 1.5rem;
|
||||
|
||||
width: 100%;
|
||||
max-width: 1440px;
|
||||
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
width: 100vw;
|
||||
max-width: 1440px;
|
||||
|
||||
/* margin: auto; */
|
||||
padding: 0 .5rem;
|
||||
}
|
||||
|
||||
#System-Footer:hover {
|
||||
}
|
||||
|
||||
.system_footer .footer_left {
|
||||
float: left;
|
||||
}
|
||||
.system_footer .footer_right {
|
||||
float: right;
|
||||
}
|
||||
/* *** END *** System *** System Footer *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Debug *** */
|
||||
#hidden_system_debug {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#System-Debug {
|
||||
z-index: 1050; /* Bootstrap 4 sticky-top class has a z-index of 1020 */
|
||||
position: fixed;
|
||||
/* top: 1rem; */
|
||||
right: 0rem;
|
||||
/* left: 0rem; */
|
||||
bottom: 1.5rem;
|
||||
|
||||
margin: 0rem;
|
||||
padding: .1rem;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
height: 100%;
|
||||
max-height: 2rem;
|
||||
width: 50%;
|
||||
max-width: 2rem;
|
||||
|
||||
/* NOTE: transition when hover ends */
|
||||
transition-property: height, max-height, width, max-width;
|
||||
transition-delay: 4s; /* short delay */
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#System-Debug:hover {
|
||||
z-index: 1051;
|
||||
|
||||
overflow-y: auto;
|
||||
|
||||
max-height: calc(100vh - 5rem);
|
||||
max-width: calc(100vh - 2rem);
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: height, max-height, width, max-width, opacity;
|
||||
transition-delay: .5s; /* min delay */
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.view_system_debug {
|
||||
}
|
||||
/* *** END *** System *** Debug *** */
|
||||
|
||||
|
||||
/*x-Small devices (portrait phones, less than 576px)*/
|
||||
@media (max-width: 575px) {
|
||||
body {
|
||||
padding-left: .1rem;
|
||||
padding-right: .1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/*Small devices (landscape phones, 576px and up)*/
|
||||
@media (min-width: 576px) and (max-width: 767px) {
|
||||
body {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* #System-Nav-Menu { outline: dashed thin red; } */
|
||||
/* #Site-Header { outline: dashed thin red; } */
|
||||
/* #Site-Nav-Menu { outline: dashed thin pink; } */
|
||||
/* #System-Notifications { outline: dashed thin red; } */
|
||||
/*#Main-Body { outline: dotted thin green; }*/
|
||||
/*#Main-Notifications { outline: dotted thin blue; }*/
|
||||
/*#Main-Nav-Menu { outline: dotted thin blue; }*/
|
||||
/*#Main-Content { outline: dotted thin blue; }*/
|
||||
/* #Site-Footer { outline: dotted thin blue; } */
|
||||
/* #System-Footer { outline: dashed thin red; } */
|
||||
/* #System-Debug { outline: dashed thin red; } */
|
||||
|
||||
#System-Nav-Menu { display: none; }
|
||||
#Site-Header { display: none; }
|
||||
#Site-Nav-Menu { display: none; }
|
||||
#System-Notifications { display: none; }
|
||||
/* #Main-Body { display: none; } */
|
||||
/* #Main-Notifications { display: none; } */
|
||||
/* #Main-Nav-Menu { display: none; } */
|
||||
/* #Main-Content { display: none; } */
|
||||
#Site-Footer { display: none; }
|
||||
#System-Footer { display: none; }
|
||||
#System-Debug { display: none; }
|
||||
259
app/css/event_launcher.css
Normal file
259
app/css/event_launcher.css
Normal file
@@ -0,0 +1,259 @@
|
||||
.event_launcher_file_cont {
|
||||
max-width: 100%;
|
||||
}
|
||||
.event_launcher_file_cont .event_file_meta {
|
||||
color: hsla(0,0%,50%,1);
|
||||
font-size: smaller;
|
||||
}
|
||||
.event_launcher_file_cont .event_file_meta:hover {
|
||||
color: hsla(0,0%,0%,1);
|
||||
}
|
||||
.event_launcher_file_cont .event_file_download {
|
||||
color: hsla(0,0%,50%,1);
|
||||
font-size: smaller;
|
||||
}
|
||||
.event_launcher_file_cont .event_file_download:hover {
|
||||
color: hsla(0,0%,0%,1);
|
||||
}
|
||||
|
||||
.event_launcher_file_cont .download_clicked {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.event_launcher_file_cont .download_clicked>strong {
|
||||
font-size: 1.75em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.event_launcher_message {
|
||||
background: yellow;
|
||||
padding: .5em;
|
||||
}
|
||||
.event_launcher_message>header {
|
||||
margin: .1em;
|
||||
padding: .1em;
|
||||
border-bottom: solid thin gray;
|
||||
}
|
||||
.event_launcher_message h1 {
|
||||
font-size: 2em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.event_launcher_message>section {
|
||||
font-size: 1.6em;
|
||||
margin: .1em;
|
||||
padding: .1em;
|
||||
}
|
||||
|
||||
|
||||
.event_launcher_main_nav_menu {
|
||||
contain: content;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start; /* flex-start */
|
||||
align-items: center;
|
||||
/*align-content: center;*/
|
||||
|
||||
background-color: hsla(0,0%,100%,.98);
|
||||
font-size: 1.1em;
|
||||
|
||||
padding-right: .1em;
|
||||
|
||||
border-right: solid medium hsla(0,0%,90%,1);
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu section {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
contain: content;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu h1,h2 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
list-style-type: none;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center; /* flex-start */
|
||||
/* align-items: center; */
|
||||
/* align-content: center; */
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu ul>li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
/*display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;*/
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu .btn {
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
border-radius: .25em;
|
||||
margin: .1em 0em;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu .event_session_selector_btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: no-wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
/*align-content: center;*/
|
||||
}
|
||||
.event_session_selector_btn .event_session_datetime {
|
||||
outline: dashed thin green;
|
||||
transform: rotate(-15deg);
|
||||
|
||||
text-align: center;
|
||||
font-size: .7em;
|
||||
min-width: 5em;
|
||||
|
||||
margin: .1em .2em;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu .event_launcher_event {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu .event_launcher_location {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.event_launcher_main_nav_menu .event_launcher_options {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.event_launcher_options_fixed {
|
||||
margin: .1em .4em;
|
||||
padding: 0;
|
||||
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 5em;
|
||||
|
||||
z-index: 500;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.event_launcher_main_content header.event_session_about {
|
||||
border-bottom: solid thin hsla(0,0%,50%,1);
|
||||
}
|
||||
.event_launcher_main_content header.event_session_about>h2 {
|
||||
margin: .1em 0;
|
||||
padding: .1em 0;
|
||||
}
|
||||
.event_launcher_main_content .event_session_datetimes {
|
||||
font-size: .8em;
|
||||
}
|
||||
.event_launcher_main_content section.event_session_description {
|
||||
border-bottom: solid thin hsla(0,0%,75%,1);
|
||||
font-size: .8em;
|
||||
}
|
||||
.event_launcher_main_content section.event_session_file_list {
|
||||
border-bottom: solid thin hsla(0,0%,75%,1);
|
||||
}
|
||||
|
||||
.event_launcher_main_content .event_session_file_list li {
|
||||
margin: .5em 0em;
|
||||
}
|
||||
|
||||
.event_launcher_main_content section.event_presentation_list {
|
||||
/* border-top: solid thin hsla(0,0%,75%,1); */
|
||||
}
|
||||
.event_launcher_main_content ul.event_presentation_list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.event_launcher_main_content .event_presentation_list>li {
|
||||
margin: 1em 0em;
|
||||
}
|
||||
.event_launcher_main_content ul.event_presentation_list>li {
|
||||
display: block;
|
||||
}
|
||||
.event_launcher_main_content ul.event_presentation_list>li:hover {
|
||||
outline: dashed thin pink;
|
||||
background-color: hsla(0,0%,95%,1);
|
||||
}
|
||||
|
||||
.event_launcher_main_content ul.event_presentation_list>li>ul>li {
|
||||
margin: .5em 0em;
|
||||
}
|
||||
|
||||
ul.event_presentation_list .btn_list>li {
|
||||
margin: .25em 0em;
|
||||
}
|
||||
|
||||
.event_launcher_main_content .event_presentation_datetime_name {
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/*flex-wrap: no-wrap;*/
|
||||
/*justify-content: space-between;*/
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
.event_launcher_main_content .event_presentation_datetime_name .event_presentation_datetime {
|
||||
/*align-self: flex-start;*/
|
||||
/*border-right: dashed thin green;*/
|
||||
|
||||
text-align: center;
|
||||
font-size: .7em;
|
||||
min-width: 5em;
|
||||
|
||||
margin: .1em .2em;
|
||||
}
|
||||
|
||||
.event_launcher_main_content .event_presentation_datetime_name .event_presentation_name {
|
||||
border-left: solid thin gray;
|
||||
|
||||
margin: .1em .2em;
|
||||
padding-left: .2em;
|
||||
}
|
||||
@@ -102,3 +102,50 @@ mynewcolor:#77cccc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
#file_import_drag_area {
|
||||
font-size: 3rem;
|
||||
font-weight: 600;
|
||||
width: 90%;
|
||||
height: 15rem;
|
||||
}
|
||||
|
||||
#file_import_drag_area:hover {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 1000;
|
||||
}
|
||||
|
||||
#file_import_drag_area:hover:before {
|
||||
/*font-weight: 1000;
|
||||
content: 'Here';*/
|
||||
}
|
||||
|
||||
#file_import_drag_area::before {
|
||||
content: attr(data-value);
|
||||
|
||||
position: relative;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 15rem;
|
||||
/*border: 1px solid red;*/
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
body {
|
||||
padding-top: 3rem;
|
||||
}
|
||||
.starter-template {
|
||||
padding: 1rem 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: auto;
|
||||
max-width: 2560px;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
*/
|
||||
@@ -1,50 +0,0 @@
|
||||
|
||||
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
#file_import_drag_area {
|
||||
font-size: 3rem;
|
||||
font-weight: 600;
|
||||
width: 90%;
|
||||
height: 15rem;
|
||||
}
|
||||
|
||||
#file_import_drag_area:hover {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 1000;
|
||||
}
|
||||
|
||||
#file_import_drag_area:hover:before {
|
||||
/*font-weight: 1000;
|
||||
content: 'Here';*/
|
||||
}
|
||||
|
||||
#file_import_drag_area::before {
|
||||
content: attr(data-value);
|
||||
|
||||
position: relative;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 15rem;
|
||||
/*border: 1px solid red;*/
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="location_menu" class="location_menu col-2 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sessions_detail" class="sessions_detail col">
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js"></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script src="js/api.js"></script>
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<script src="js/testing.js"></script>
|
||||
|
||||
<script>
|
||||
// Development variables:
|
||||
let event_id = 14;
|
||||
let event_location_id = 13;
|
||||
let event_session_id = 827;
|
||||
let event_presentation_id = 2002;
|
||||
let event_presenter_id = 2539;
|
||||
let event_file_id = 28;
|
||||
let api_base_url = 'http://192.168.1.7:5001'; // 'http://api.localhost:5001' 'https://api.oneskyit.com';
|
||||
|
||||
// Initialize variables:
|
||||
//const { ipcRenderer } = require('electron');
|
||||
//const os = require('os');
|
||||
//const path = require('path');
|
||||
//const fs = require('fs');
|
||||
|
||||
const secret_key = 'YWAAk39H2qH0edK6lPH0yg';
|
||||
let api_temporary_token = null;
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*';
|
||||
|
||||
api_temporary_token = api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
return result;
|
||||
});
|
||||
|
||||
api_token_request_async().then( function(result) {
|
||||
// Do something with result.
|
||||
//get_all_events();
|
||||
//get_event(event_id);
|
||||
//get_event_sessions(event_id);
|
||||
//get_event_files(event_id);
|
||||
});
|
||||
|
||||
const loop_delay = 2000; // 2 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let launcher_object_check_datetime = Date.now(); // default to current datetime in ms
|
||||
const launcher_object_check_period = 30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
const launcher_files_check_period = 30000; // 30 seconds
|
||||
const file_cache_path = 'file_cache/';
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
|
||||
if (launcher_object_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = api.launcher_cache_check(launcher, api_base_url, api_temporary_token, file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
launcher_object_check_datetime = Date.now() + launcher_object_check_period;
|
||||
|
||||
launcher_render_results = api.launcher_render(launcher);
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+loop_delay+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, loop_delay);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,242 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<!--
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
-->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>-->
|
||||
<!--
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/esm/popper.min.js" integrity="sha256-g491Yv8nsEVSfQ6aonhVVFXoX5vF2uJQIU0hVNRg4JQ=" crossorigin="anonymous"></script>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="location_menu" class="location_menu col-2 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="location_detail" class="location_detail col">
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js"></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/app_idb');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
let config = app.load_config();
|
||||
let event_id = config.event_id;
|
||||
let event_location_id = config.event_location_id;
|
||||
|
||||
const secret_key = config.api_secret_key; //'YWAAk39H2qH0edK6lPH0yg';
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; //'http://api.localhost:5001'; // 'http://api.localhost:5001' 'https://api.oneskyit.com';
|
||||
|
||||
if (config.use_local_api) {
|
||||
api_base_url = config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = config.api_remote_base_url; // 'https://api.oneskyit.com';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Development variables:
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
let event_session_id = 827;
|
||||
let event_presentation_id = 2002;
|
||||
let event_presenter_id = 2539;
|
||||
let event_file_id = 28;
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*';
|
||||
|
||||
api_temporary_token = api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
return result;
|
||||
});
|
||||
|
||||
/*
|
||||
api_token_request_async().then( function(result) {
|
||||
// Do something with result.
|
||||
//get_all_events();
|
||||
//get_event(event_id);
|
||||
//get_event_sessions(event_id);
|
||||
//get_event_files(event_id);
|
||||
});
|
||||
*/
|
||||
let idb_name = config.local_idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
var db_event = new idbKeyval.Store(idb_name, 'event');
|
||||
console.log('IndexedDB is supported');
|
||||
var db_event_location = new idbKeyval.Store(idb_name, 'event_location');
|
||||
var db_event_session = new idbKeyval.Store(idb_name, 'event_session');
|
||||
var db_event_presentation = new idbKeyval.Store(idb_name, 'event_presentation');
|
||||
var db_event_presenter = new idbKeyval.Store(idb_name, 'event_presenter');
|
||||
var db_event_file = new idbKeyval.Store(idb_name, 'event_file');
|
||||
var db_hosted_file = new idbKeyval.Store(idb_name, 'hosted_file');
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
}
|
||||
|
||||
|
||||
|
||||
const main_loop_interval = config.main_loop_interval; //2000; // 2 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let launcher_object_check_datetime = Date.now(); // default to current datetime in ms
|
||||
const launcher_object_check_period = config.local_idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
const launcher_files_check_period = config.local_file_cache_check_period; //30000; // 30 seconds
|
||||
const file_cache_path = config.local_file_cache_path; //'file_cache/';
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
|
||||
if (launcher_object_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
launcher_object_check_datetime = Date.now() + launcher_object_check_period;
|
||||
|
||||
launcher_render_results = idb.launcher_render(launcher);
|
||||
//var location_temp = launcher_object_result;
|
||||
//idbKeyval.set('test2', location_temp, custom_store);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,224 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="location_menu" class="location_menu col-2 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="location_detail" class="location_detail col">
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/app_idb');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
let config = app.load_config();
|
||||
let event_id = config.event_id;
|
||||
let event_location_id = config.event_location_id;
|
||||
|
||||
const secret_key = config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (config.use_local_api) {
|
||||
api_base_url = config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = config.access_control_allow_origin; // '*';
|
||||
|
||||
api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
api_temporary_token = result;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
let idb_name = config.local_idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
var tbl_event = new idbKeyval.Store(idb_name, 'event');
|
||||
var tbl_event_location = new idbKeyval.Store(idb_name, 'event_location');
|
||||
var tbl_event_session = new idbKeyval.Store(idb_name, 'event_session');
|
||||
var tbl_event_presentation = new idbKeyval.Store(idb_name, 'event_presentation');
|
||||
var tbl_event_presenter = new idbKeyval.Store(idb_name, 'event_presenter');
|
||||
var tbl_event_file = new idbKeyval.Store(idb_name, 'event_file');
|
||||
var tbl_hosted_file = new idbKeyval.Store(idb_name, 'hosted_file');
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
const main_loop_interval = config.main_loop_interval; //2000; // 2 seconds
|
||||
|
||||
const idb_check_period = config.idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let idb_check_datetime = Date.now(); // default to current datetime in ms
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
|
||||
const host_file_cache_path = config.host_file_cache_path; //'file_cache/';
|
||||
const host_file_cache_check_period = config.host_file_cache_check_period; //30000; // 30 seconds
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
// Development variables:
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
//let event_session_id = 827;
|
||||
//let event_presentation_id = 2002;
|
||||
//let event_presenter_id = 2539;
|
||||
//let event_file_id = 28;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, host_file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
|
||||
launcher_render_results = idb.launcher_render(launcher);
|
||||
//var location_temp = launcher_object_result;
|
||||
//idbKeyval.set('test2', location_temp, custom_store);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,289 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="location_menu" class="location_menu col-2 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="location_detail" class="location_detail col">
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>-->
|
||||
<!--<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>-->
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/module_app_idb');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
let config = app.load_config();
|
||||
let event_id = config.event_id;
|
||||
let event_location_id = config.event_location_id;
|
||||
|
||||
const secret_key = config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (config.use_local_api) {
|
||||
api_base_url = config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = config.access_control_allow_origin; // '*';
|
||||
|
||||
api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
api_temporary_token = result;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
let idb_name = config.idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
/*
|
||||
var tbl_event = new idbKeyval.Store(idb_name, 'event');
|
||||
var tbl_event_location = new idbKeyval.Store(idb_name, 'event_location');
|
||||
var tbl_event_session = new idbKeyval.Store(idb_name, 'event_session');
|
||||
var tbl_event_presentation = new idbKeyval.Store(idb_name, 'event_presentation');
|
||||
var tbl_event_presenter = new idbKeyval.Store(idb_name, 'event_presenter');
|
||||
var tbl_event_file = new idbKeyval.Store(idb_name, 'event_file');
|
||||
var tbl_hosted_file = new idbKeyval.Store(idb_name, 'hosted_file');
|
||||
*/
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
version: 1,
|
||||
name: idb_name
|
||||
});
|
||||
|
||||
var tbl_event = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event',
|
||||
});
|
||||
var tbl_event_location = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_location',
|
||||
});
|
||||
var tbl_event_session = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_session',
|
||||
});
|
||||
var tbl_event_presentation = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presentation',
|
||||
});
|
||||
var tbl_event_presenter = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presenter',
|
||||
});
|
||||
var tbl_event_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_file',
|
||||
});
|
||||
var tbl_hosted_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'hosted_file',
|
||||
});
|
||||
|
||||
//tbl_event.setItem(Math.random().toString(), Math.random());
|
||||
//tbl_event_location.setItem('99', 'hello world 2');
|
||||
|
||||
//store.setItem("key", "value");
|
||||
//otherStore.setItem("key", "value2");
|
||||
|
||||
/*
|
||||
var db_test = indexedDB.open(idb_name, 1);
|
||||
var tbl_test = db_test.createObjectStore("tbl_test", "id", false);
|
||||
|
||||
idb_names = Dexie.getDatabaseNames();
|
||||
if (idb_names.length === 0) {
|
||||
console.log("No databases found.");
|
||||
} else {
|
||||
console.log(idb_names);
|
||||
for (var i in idb_names) {
|
||||
if (idb_names[i] == idb_name) {
|
||||
} else {
|
||||
var db = new Dexie(idb_name);
|
||||
db.version(1).stores({event: "id,name,test", event_location: "id,name,test2"});
|
||||
db.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
const main_loop_interval = config.main_loop_interval; //2000; // 2 seconds
|
||||
|
||||
const idb_check_period = config.idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let idb_check_datetime = Date.now(); // default to current datetime in ms
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
|
||||
const host_file_cache_path = config.host_file_cache_path; //'file_cache/';
|
||||
const host_file_cache_check_period = config.host_file_cache_check_period; //30000; // 30 seconds
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
// Development variables:
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
//let event_session_id = 827;
|
||||
//let event_presentation_id = 2002;
|
||||
//let event_presenter_id = 2539;
|
||||
//let event_file_id = 28;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, host_file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
|
||||
launcher_render_results = idb.launcher_render(launcher);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,438 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="location_menu" class="location_menu col-2 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="location_detail" class="location_detail col">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Session Files:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item btn btn-info d-flex justify-content-between align-items-center">File 1.txt<span class="badge badge-pill badge-light">91.22 KB; Jul 7 6:12 AM; win</span></li>
|
||||
<li class="list-group-item btn btn-info d-flex justify-content-between align-items-center">NASPGHAN 2020: Not happening this is long Filename 2 Hello World Todays date here.pptx<span class="badge badge-pill badge-light">1.36 MB; Sep 9 7:17 AM; mac</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Presentations:</div>
|
||||
<div class="card-body">
|
||||
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading">How do I best evaluate a cholestatic infant?</div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
|
||||
<li class="list-group-item list-group-item-action">Presentation File 1.txt</li>
|
||||
<li class="list-group-item list-group-item-action">Presentation File 2.pptx</li>
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Scott Idem</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">filename.pptx</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Holly Danner</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Rick Mathews</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading">Common Feeding Problems and Management Strategies in Autism Spectrum Disorder</div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
|
||||
<li class="list-group-item list-group-item-action">Presentation File 2.pptx</li>
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Scott Idem</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">filename.pptx</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Rick Mathews</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header">Presentations:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading"><strong>Scott Idem:</strong></div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading"><strong>Holly Danner:</strong></div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">New File 1.txt</li>
|
||||
<li class="list-group-item">My Filename 2.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Scott Idem:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Holly Danner:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>-->
|
||||
<!--<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>-->
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/module_app_idb');</script>
|
||||
<script>const ui = require('./js/module_app_ui');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
let config = app.load_config();
|
||||
let event_id = config.event_id;
|
||||
let event_location_id = config.event_location_id;
|
||||
|
||||
const secret_key = config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (config.use_local_api) {
|
||||
api_base_url = config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = config.access_control_allow_origin; // '*';
|
||||
|
||||
api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
api_temporary_token = result;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
let idb_name = config.idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
/*
|
||||
var tbl_event = new idbKeyval.Store(idb_name, 'event');
|
||||
var tbl_event_location = new idbKeyval.Store(idb_name, 'event_location');
|
||||
var tbl_event_session = new idbKeyval.Store(idb_name, 'event_session');
|
||||
var tbl_event_presentation = new idbKeyval.Store(idb_name, 'event_presentation');
|
||||
var tbl_event_presenter = new idbKeyval.Store(idb_name, 'event_presenter');
|
||||
var tbl_event_file = new idbKeyval.Store(idb_name, 'event_file');
|
||||
var tbl_hosted_file = new idbKeyval.Store(idb_name, 'hosted_file');
|
||||
*/
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
version: 1,
|
||||
name: idb_name
|
||||
});
|
||||
|
||||
var tbl_event = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event',
|
||||
});
|
||||
var tbl_event_location = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_location',
|
||||
});
|
||||
var tbl_event_session = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_session',
|
||||
});
|
||||
var tbl_event_presentation = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presentation',
|
||||
});
|
||||
var tbl_event_presenter = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presenter',
|
||||
});
|
||||
var tbl_event_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_file',
|
||||
});
|
||||
var tbl_hosted_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'hosted_file',
|
||||
});
|
||||
|
||||
//tbl_event.setItem(Math.random().toString(), Math.random());
|
||||
//tbl_event_location.setItem('99', 'hello world 2');
|
||||
|
||||
//store.setItem("key", "value");
|
||||
//otherStore.setItem("key", "value2");
|
||||
|
||||
/*
|
||||
var db_test = indexedDB.open(idb_name, 1);
|
||||
var tbl_test = db_test.createObjectStore("tbl_test", "id", false);
|
||||
|
||||
idb_names = Dexie.getDatabaseNames();
|
||||
if (idb_names.length === 0) {
|
||||
console.log("No databases found.");
|
||||
} else {
|
||||
console.log(idb_names);
|
||||
for (var i in idb_names) {
|
||||
if (idb_names[i] == idb_name) {
|
||||
} else {
|
||||
var db = new Dexie(idb_name);
|
||||
db.version(1).stores({event: "id,name,test", event_location: "id,name,test2"});
|
||||
db.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
const main_loop_interval = config.main_loop_interval; //2000; // 2 seconds
|
||||
|
||||
const idb_check_period = config.idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let idb_check_datetime = Date.now(); // default to current datetime in ms
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
|
||||
const host_file_cache_path = config.host_file_cache_path; //'file_cache/';
|
||||
const host_file_cache_check_period = config.host_file_cache_check_period; //30000; // 30 seconds
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
// Development variables:
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
//let event_session_id = 827;
|
||||
//let event_presentation_id = 2002;
|
||||
//let event_presenter_id = 2539;
|
||||
//let event_file_id = 28;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, host_file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
|
||||
launcher_render_results = ui.launcher_render(launcher);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,557 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT: macOS App</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container w-100">
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div id="location_title" class="location_title border-bottom">Launcher</div>
|
||||
</div>
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div id="location_menu" class="location_menu col-3 border-right">
|
||||
|
||||
<div id="event_files_menu" class="event_files_menu">
|
||||
*event files
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu">
|
||||
*location files
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu">
|
||||
*sessions<br>
|
||||
**session<br>
|
||||
***session files<br>
|
||||
***presentations<br>
|
||||
****presentation<br>
|
||||
*****presentation files<br>
|
||||
*****presenters<br>
|
||||
******presenter<br>
|
||||
*******presenter files<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="location_detail" class="location_detail col">
|
||||
<!--
|
||||
<div class="card">
|
||||
<div class="card-header">Session Files:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item btn btn-info d-flex justify-content-between align-items-center">File 1.txt<span class="badge badge-pill badge-light">91.22 KB; Jul 7 6:12 AM; win</span></li>
|
||||
<li class="list-group-item btn btn-info d-flex justify-content-between align-items-center">NASPGHAN 2020: Not happening this is long Filename 2 Hello World Todays date here.pptx<span class="badge badge-pill badge-light">1.36 MB; Sep 9 7:17 AM; mac</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Presentations:</div>
|
||||
<div class="card-body">
|
||||
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading">How do I best evaluate a cholestatic infant?</div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
|
||||
<li class="list-group-item list-group-item-action">Presentation File 1.txt</li>
|
||||
<li class="list-group-item list-group-item-action">Presentation File 2.pptx</li>
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Scott Idem</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">filename.pptx</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Holly Danner</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Rick Mathews</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading">Common Feeding Problems and Management Strategies in Autism Spectrum Disorder</div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
|
||||
<li class="list-group-item list-group-item-action">Presentation File 2.pptx</li>
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Scott Idem</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">filename.pptx</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<strong class="list-group-item-heading">Rick Mathews</strong>
|
||||
<ul class="list-group list-group-flush list-group-item-text">
|
||||
<li class="list-group-item list-group-item-action">another filename.key</li>
|
||||
<li class="list-group-item list-group-item-action">my new file.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<br><br>
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header">Presentations:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading"><strong>Scott Idem:</strong></div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<div class="list-group-item-heading"><strong>Holly Danner:</strong></div>
|
||||
<div class="list-group-item-text">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">New File 1.txt</li>
|
||||
<li class="list-group-item">My Filename 2.pptx</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Scott Idem:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">Holly Danner:</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">File 1.txt</li>
|
||||
<li class="list-group-item">Filename 2.pptx</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
</div>
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>-->
|
||||
<!--<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>-->
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/module_app_idb');</script>
|
||||
<script>const ui = require('./js/module_app_ui');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
let app_config = app.load_config();
|
||||
let account_id = app_config.account_id;
|
||||
let event_id = app_config.event_id;
|
||||
let event_location_id = app_config.event_location_id;
|
||||
|
||||
const secret_key = app_config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (app_config.use_local_api) {
|
||||
api_base_url = app_config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = app_config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = app_config.access_control_allow_origin; // '*';
|
||||
|
||||
api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
api_temporary_token = result;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
let idb_name = app_config.idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
/*
|
||||
var tbl_event = new idbKeyval.Store(idb_name, 'event');
|
||||
var tbl_event_location = new idbKeyval.Store(idb_name, 'event_location');
|
||||
var tbl_event_session = new idbKeyval.Store(idb_name, 'event_session');
|
||||
var tbl_event_presentation = new idbKeyval.Store(idb_name, 'event_presentation');
|
||||
var tbl_event_presenter = new idbKeyval.Store(idb_name, 'event_presenter');
|
||||
var tbl_event_file = new idbKeyval.Store(idb_name, 'event_file');
|
||||
var tbl_hosted_file = new idbKeyval.Store(idb_name, 'hosted_file');
|
||||
*/
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
version: 1,
|
||||
name: idb_name
|
||||
});
|
||||
|
||||
var tbl_event = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event',
|
||||
});
|
||||
var tbl_event_location = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_location',
|
||||
});
|
||||
var tbl_event_session = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_session',
|
||||
});
|
||||
var tbl_event_presentation = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presentation',
|
||||
});
|
||||
var tbl_event_presenter = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presenter',
|
||||
});
|
||||
var tbl_event_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_file',
|
||||
});
|
||||
var tbl_hosted_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'hosted_file',
|
||||
});
|
||||
|
||||
/*
|
||||
function tbl_check(value, key, iteration) {
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
function tbl_check_success(result) {
|
||||
console.log(result);
|
||||
}
|
||||
function tbl_check_error(result) {
|
||||
console.log(result);
|
||||
}
|
||||
*/
|
||||
//console.log('Table data?');
|
||||
//console.log(tbl_event);
|
||||
//console.log('Table data? ^^^^');
|
||||
//tbl_event_session.iterate(tbl_check, tbl_check_success, tbl_check_error); //tbl_check(value, key, iteration)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//tbl_event.setItem(Math.random().toString(), Math.random());
|
||||
//tbl_event_location.setItem('99', 'hello world 2');
|
||||
|
||||
//store.setItem("key", "value");
|
||||
//otherStore.setItem("key", "value2");
|
||||
|
||||
/*
|
||||
var db_test = indexedDB.open(idb_name, 1);
|
||||
var tbl_test = db_test.createObjectStore("tbl_test", "id", false);
|
||||
|
||||
idb_names = Dexie.getDatabaseNames();
|
||||
if (idb_names.length === 0) {
|
||||
console.log("No databases found.");
|
||||
} else {
|
||||
console.log(idb_names);
|
||||
for (var i in idb_names) {
|
||||
if (idb_names[i] == idb_name) {
|
||||
} else {
|
||||
var db = new Dexie(idb_name);
|
||||
db.version(1).stores({event: "id,name,test", event_location: "id,name,test2"});
|
||||
db.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//const main_loop_interval = app_config.main_loop_interval; //2000; // 2 seconds
|
||||
const main_loop_interval = 3000; //10000; // 10 seconds
|
||||
|
||||
idb_event_check_period = app_config.idb_event_check_period;
|
||||
idb_event_check_datetime = Date.now();
|
||||
idb_event_location_check_period = app_config.idb_event_location_check_period;
|
||||
idb_event_location_check_datetime = Date.now();
|
||||
idb_event_session_check_period = app_config.idb_event_session_check_period;
|
||||
idb_event_session_check_datetime = Date.now();
|
||||
idb_event_presentation_check_period = app_config.idb_event_presentation_check_period;
|
||||
idb_event_presentation_check_datetime = Date.now();
|
||||
idb_event_presenter_check_period = app_config.idb_event_presenter_check_period;
|
||||
idb_event_presenter_check_datetime = Date.now();
|
||||
idb_event_file_check_period = app_config.idb_event_file_check_period;
|
||||
idb_event_file_check_datetime = Date.now();
|
||||
|
||||
const idb_check_period = app_config.idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let idb_check_datetime = Date.now(); // default to current datetime in ms
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
|
||||
const host_file_cache_path = app_config.host_file_cache_path; //'file_cache/';
|
||||
const host_file_cache_check_period = app_config.host_file_cache_check_period; //30000; // 30 seconds
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
//let v2_launcher = new Object();
|
||||
launcher.account_id = account_id;
|
||||
launcher.event_id = event_id;
|
||||
launcher.event_location_id = event_location_id;
|
||||
|
||||
let idb_to_launcher_result = false;
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
// Development variables:
|
||||
//let account_id = 12;
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
//let event_session_id = 827;
|
||||
//let event_presentation_id = 2002;
|
||||
//let event_presenter_id = 2539;
|
||||
//let event_file_id = 28;
|
||||
|
||||
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null && true == true) {
|
||||
|
||||
if (idb_event_check_datetime < Date.now()) {
|
||||
console.log('Time to check events');
|
||||
let v2_account_events = await api.v2_get_account_events(axios, launcher.account_id);
|
||||
for (var i in v2_account_events) {
|
||||
tbl_event.setItem(v2_account_events[i].id.toString(), v2_account_events[i]);
|
||||
}
|
||||
idb_event_check_datetime = Date.now() + idb_event_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_location_check_datetime < Date.now()) {
|
||||
console.log('Time to check event locations');
|
||||
let v2_event_locations = await api.v2_get_event_locations(axios, launcher.event_id);
|
||||
for (var i in v2_event_locations) {
|
||||
tbl_event_location.setItem(v2_event_locations[i].id.toString(), v2_event_locations[i]);
|
||||
}
|
||||
idb_event_location_check_datetime = Date.now() + idb_event_location_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_session_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location sessions');
|
||||
let v2_event_sessions = await api.v2_get_event_location_sessions(axios, launcher.event_location_id);
|
||||
for (var i in v2_event_sessions) {
|
||||
tbl_event_session.setItem(v2_event_sessions[i].id.toString(), v2_event_sessions[i]);
|
||||
}
|
||||
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_presentation_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location presentations');
|
||||
let v2_event_presentations = await api.v2_get_event_location_presentations(axios, launcher.event_location_id);
|
||||
for (var i in v2_event_presentations) {
|
||||
tbl_event_presentation.setItem(v2_event_presentations[i].id.toString(), v2_event_presentations[i]);
|
||||
}
|
||||
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_presenter_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location presenters');
|
||||
let v2_event_presenters = await api.v2_get_event_location_presenters(axios, launcher.event_location_id);
|
||||
for (var i in v2_event_presenters) {
|
||||
tbl_event_presenter.setItem(v2_event_presenters[i].id.toString(), v2_event_presenters[i]);
|
||||
}
|
||||
idb_event_presenter_check_datetime = Date.now() + idb_event_presenter_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_file_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location files');
|
||||
let v2_event_files = await api.v2_get_event_location_files(axios, launcher.event_location_id);
|
||||
for (var i in v2_event_files) {
|
||||
tbl_event_file.setItem(v2_event_files[i].event_file_id.toString(), v2_event_files[i]);
|
||||
}
|
||||
idb_event_file_check_datetime = Date.now() + idb_event_file_check_period;
|
||||
}
|
||||
|
||||
if (!idb_to_launcher_result) {
|
||||
console.log('index.html: v2 idb_to_launcher_result is false. Run idb_to_launcher. ***');
|
||||
idb_to_launcher_result = await idb.idb_to_launcher(launcher);
|
||||
console.log('index.html: v2 launcher object: ***');
|
||||
console.log(launcher);
|
||||
console.log('index.html: v2 launcher object: ^^^');
|
||||
|
||||
check_file_cache = idb.check_file_cache();
|
||||
} else {
|
||||
console.log('index.html: v2 idb_to_launcher result is true ***');
|
||||
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
console.log('Render launcher...');
|
||||
launcher_render_results = await ui.launcher_render(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
} else {
|
||||
console.log('Waiting to render launcher again...');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
/*
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, host_file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
|
||||
launcher_render_results = ui.launcher_render(launcher);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,631 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/launcher.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container w-100">
|
||||
|
||||
<!--
|
||||
<div class="row no-gutters">
|
||||
<div id="launcher_title" class="launcher_title border-bottom">Please wait while the data is checked and files are cached.</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div id="launcher_menu" class="launcher_menu col-3 border-right">
|
||||
<div id="event_files_menu" class="event_files_menu"></div>
|
||||
<div id="location_files_menu" class="location_files_menu"></div>
|
||||
<div id="sessions_menu" class="sessions_menu"></div>
|
||||
<div id="location_name" class="location_name"></div>
|
||||
</div>
|
||||
|
||||
<div id="launcher_sessions" class="launcher_sessions col"></div> <!-- end location details div -->
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>-->
|
||||
<!--<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>-->
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script>const api = require('./js/module_api');</script>
|
||||
<script>const idb = require('./js/module_app_idb');</script>
|
||||
<script>const ui = require('./js/module_app_ui');</script>
|
||||
<!--<script src="js/api.js"></script>-->
|
||||
<!--<script src="js/script.js"></script>-->
|
||||
<!--<script src="js/testing.js"></script>-->
|
||||
|
||||
<script>
|
||||
let app_config = app.load_config();
|
||||
let account_id = app_config.account_id;
|
||||
let event_id = app_config.event_id;
|
||||
let event_location_id = app_config.event_location_id;
|
||||
|
||||
const secret_key = app_config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (app_config.use_local_api) {
|
||||
api_base_url = app_config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = app_config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = app_config.access_control_allow_origin; // '*';
|
||||
|
||||
api.api_token_request_async(axios, secret_key).then( function(result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
api_temporary_token = result;
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
let idb_name = app_config.idb_name;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
var tbl_event = null;
|
||||
var tbl_event_location = null;
|
||||
var tbl_event_session = null;
|
||||
var tbl_event_presentation = null;
|
||||
var tbl_event_presenter = null;
|
||||
var tbl_event_file = null;
|
||||
var tbl_hosted_file = null;
|
||||
|
||||
var tbl_event_key_count = null;
|
||||
var tbl_event_location_key_count = null;
|
||||
var tbl_event_session_key_count = null;
|
||||
var tbl_event_presentation_key_count = null;
|
||||
var tbl_event_presenter_key_count = null;
|
||||
var tbl_event_file_key_count = null;
|
||||
var tbl_hosted_file_key_count = null;
|
||||
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
version: 1,
|
||||
name: idb_name
|
||||
});
|
||||
|
||||
var tbl_event = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event',
|
||||
});
|
||||
tbl_event.length().then(function(key_count) {
|
||||
console.log('tbl_event count: '+key_count);
|
||||
tbl_event_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
var tbl_event_location = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_location',
|
||||
});
|
||||
tbl_event_location.length().then(function(key_count) {
|
||||
console.log('tbl_event_location count: '+key_count);
|
||||
tbl_event_location_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
var tbl_event_session = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_session',
|
||||
});
|
||||
tbl_event_session.length().then(function(key_count) {
|
||||
console.log('tbl_event_session count: '+key_count);
|
||||
tbl_event_session_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
var tbl_event_presentation = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presentation',
|
||||
});
|
||||
tbl_event_presentation.length().then(function(key_count) {
|
||||
console.log('tbl_event_presentation_key_count count: '+key_count);
|
||||
tbl_event_presentation_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
var tbl_event_presenter = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_presenter',
|
||||
});
|
||||
tbl_event_presenter.length().then(function(key_count) {
|
||||
console.log('tbl_event_presenter count: '+key_count);
|
||||
tbl_event_presenter_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
var tbl_event_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'event_file',
|
||||
});
|
||||
tbl_event_file.length().then(function(key_count) {
|
||||
console.log('tbl_event_file count: '+key_count);
|
||||
tbl_event_file_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
/*
|
||||
var tbl_hosted_file = localforage.createInstance({
|
||||
name: idb_name,
|
||||
storeName: 'hosted_file',
|
||||
});
|
||||
tbl_hosted_file.length().then(function(key_count) {
|
||||
tbl_hosted_file_key_count = key_count;
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
*/
|
||||
|
||||
//let create_load_idb_result = idb.create_load_idb();
|
||||
|
||||
//console.log(tbl_event_session_key_count);
|
||||
|
||||
/*
|
||||
// Check if table exists by trying to interate.
|
||||
function tbl_check(value, key, iteration) {
|
||||
console.log(value);
|
||||
}
|
||||
function tbl_check_success(result) {
|
||||
console.log(result);
|
||||
}
|
||||
function tbl_check_error(result) {
|
||||
console.log(result);
|
||||
}
|
||||
tbl_event_session.iterate(tbl_check, tbl_check_success, tbl_check_error); //tbl_check(value, key, iteration)
|
||||
*/
|
||||
|
||||
|
||||
//const loading_loop_interval = app_config.loading_loop_interval; // in milliseconds
|
||||
const loading_loop_interval = 500;
|
||||
//const main_loop_interval = app_config.main_loop_interval; // in milliseconds
|
||||
const main_loop_interval = 1500; //10000; // 10 seconds
|
||||
|
||||
idb_event_check_period = app_config.idb_event_check_period;
|
||||
idb_event_check_datetime = Date.now();
|
||||
idb_event_location_check_period = app_config.idb_event_location_check_period;
|
||||
idb_event_location_check_datetime = Date.now();
|
||||
idb_event_session_check_period = app_config.idb_event_session_check_period;
|
||||
idb_event_session_check_datetime = Date.now();
|
||||
idb_event_presentation_check_period = app_config.idb_event_presentation_check_period;
|
||||
idb_event_presentation_check_datetime = Date.now();
|
||||
idb_event_presenter_check_period = app_config.idb_event_presenter_check_period;
|
||||
idb_event_presenter_check_datetime = Date.now();
|
||||
idb_event_file_check_period = app_config.idb_event_file_check_period;
|
||||
idb_event_file_check_datetime = Date.now();
|
||||
|
||||
const idb_check_period = app_config.idb_check_period; //30000; // 60 seconds
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the object check period into event, location, session, presentation, presenter
|
||||
let idb_check_datetime = Date.now(); // default to current datetime in ms
|
||||
// The datetime is when it should be checked again, not when it was last checked.
|
||||
// It may be good to split the file check period into event, location, session, presentation, presenter
|
||||
let launcher_files_check_datetime = Date.now(); // default to current datetime in ms
|
||||
|
||||
const host_file_cache_path = app_config.host_file_cache_path; //'file_cache/';
|
||||
const host_file_cache_check_period = app_config.host_file_cache_check_period; //30000; // 30 seconds
|
||||
|
||||
let launcher = new Object(); // This will create the something like location > sessions and location files > presenters and session files > presenter files
|
||||
|
||||
|
||||
let idb_to_launcher_result = false;
|
||||
//let launcher_cache_check_results = false;
|
||||
let launcher_render_results = false;
|
||||
|
||||
let run_idb_to_launcher = false;
|
||||
let run_check_file_cache = false;
|
||||
let run_render_launcher = false;
|
||||
|
||||
let axios_headers_set = false;
|
||||
let idb_tables_opened = false;
|
||||
let idb_tables_have_records = false;
|
||||
|
||||
// Development variables:
|
||||
//let account_id = 12;
|
||||
//let event_id = 14;
|
||||
//let event_location_id = 13;
|
||||
//let event_session_id = 827;
|
||||
//let event_presentation_id = 2002;
|
||||
//let event_presenter_id = 2539;
|
||||
//let event_file_id = 28;
|
||||
|
||||
//console.log(tbl_event_session);
|
||||
//console.log(tbl_event_file);
|
||||
|
||||
/*
|
||||
while (!axios_headers_set && !idb_tables_opened && !idb_tables_have_records) {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined'
|
||||
&& axios.defaults.headers.common['Authorization'] != null) {
|
||||
axios_headers_set = true;
|
||||
console.log('Axios headers have been set.');
|
||||
} else {
|
||||
axios_headers_set = false;
|
||||
console.log('Waiting for Axios headers to be set.');
|
||||
}
|
||||
if (tbl_event && tbl_event_location && tbl_event_session
|
||||
&& tbl_event_presentation && tbl_event_presenter
|
||||
&& tbl_event_file) {
|
||||
idb_tables_opened = true;
|
||||
console.log('IDB tables have been opened');
|
||||
} else {
|
||||
idb_tables_opened = false;
|
||||
console.log('Waiting for IDB tables to be opened');
|
||||
}
|
||||
if (tbl_event_key_count && tbl_event_location_key_count && tbl_event_session_key_count
|
||||
&& tbl_event_presentation_key_count && tbl_event_presenter_key_count
|
||||
&& tbl_event_file_key_count) {
|
||||
idb_tables_have_records = true;
|
||||
console.log('All IDB tables have records.');
|
||||
} else {
|
||||
console.log('No IDB records for one of the tables.');
|
||||
}
|
||||
|
||||
//someanimation();
|
||||
setTimeout(function(){
|
||||
console.log('looping....');
|
||||
}, 250);
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
var load_cached_data_loop = setInterval(function() {
|
||||
if (tbl_event && tbl_event_location && tbl_event_session
|
||||
&& tbl_event_presentation && tbl_event_presenter
|
||||
&& tbl_event_file) {
|
||||
idb_tables_opened = true;
|
||||
console.log('IDB tables have been opened');
|
||||
|
||||
|
||||
if (tbl_event_key_count != null && tbl_event_location_key_count != null && tbl_event_session_key_count != null
|
||||
&& tbl_event_presentation_key_count != null && tbl_event_presenter_key_count != null
|
||||
&& tbl_event_file_key_count != null) {
|
||||
idb_tables_have_records = true;
|
||||
console.log('All IDB tables have been checked for records.');
|
||||
|
||||
console.log('Running idb_to_launcher with cached data.');
|
||||
|
||||
idb.idb_to_launcher().then(function(response) {
|
||||
console.log('Launcher object has now been created with cached data.');
|
||||
console.log(response);
|
||||
clearInterval(load_cached_data_loop);
|
||||
|
||||
launcher = response;
|
||||
//let launcher_tmp = launcher;
|
||||
|
||||
//render_launcher_result = ui.render_launcher(response);
|
||||
console.log('The launcher has now been rendered with cached data. ***');
|
||||
});
|
||||
|
||||
/*
|
||||
idb_to_launcer_result.then(function (response) {
|
||||
console.log('Launcher object has now been created with cached data.');
|
||||
console.log(response);
|
||||
clearInterval(load_cached_data_loop);
|
||||
|
||||
launcher = response;
|
||||
//let launcher_tmp = launcher;
|
||||
|
||||
render_launcher_result = ui.render_launcher(response);
|
||||
console.log('The launcher has now been rendered with cached data. ***');
|
||||
|
||||
|
||||
//render_launcher_result.then(function (response) {
|
||||
// console.log('The launcher has now been rendered with cached data. ***');
|
||||
// clearInterval(load_cached_data_loop);
|
||||
//});
|
||||
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
let launcher_new = idb.idb_to_launcher();
|
||||
launcher_new_result.then
|
||||
render_launcher_result = ui.render_launcher(launcher_new);
|
||||
if (render_launcher_result) {
|
||||
clearInterval(load_cached_data_loop);
|
||||
} else {
|
||||
console.log('Launcher object not really ready yet...');
|
||||
}
|
||||
//render_launcher_result.then(function (response) {
|
||||
// console.log('The launcher has now been rendered with cached data. ***');
|
||||
|
||||
//});
|
||||
*/
|
||||
|
||||
} else {
|
||||
//console.log('One or more tables did not have any records. Moving on...');
|
||||
console.log('Still waiting for the table record counts.');
|
||||
}
|
||||
|
||||
} else {
|
||||
idb_tables_opened = false;
|
||||
console.log('Waiting for IDB tables to be opened');
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
/*
|
||||
function load_cached_data () {
|
||||
idb_tables_opened = true;
|
||||
console.log('IDB tables have been opened');
|
||||
|
||||
if (tbl_event_key_count && tbl_event_location_key_count && tbl_event_session_key_count
|
||||
&& tbl_event_presentation_key_count && tbl_event_presenter_key_count
|
||||
&& tbl_event_file_key_count) {
|
||||
idb_tables_have_records = true;
|
||||
console.log('All IDB tables have records.');
|
||||
|
||||
console.log('Running idb_to_launcher with cached data.');
|
||||
idb_to_launcher_result = idb.idb_to_launcher(launcher);
|
||||
|
||||
idb_to_launcher_result.then(function (response) {
|
||||
console.log('Launcher object has now been created with cached data.');
|
||||
console.log(launcher);
|
||||
|
||||
let launcher_tmp = launcher;
|
||||
|
||||
render_launcher_result = ui.render_launcher(launcher_tmp);
|
||||
render_launcher_result.then(function (response) {
|
||||
console.log('The launcher has now been rendered with cached data. ***');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var load_cached_data_results = load_cached_data();
|
||||
*/
|
||||
|
||||
|
||||
// NOTE This loop needs to end at some point...
|
||||
var load_auth_loop = setInterval(function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined'
|
||||
&& axios.defaults.headers.common['Authorization'] != null) {
|
||||
axios_headers_set = true;
|
||||
console.log('Axios headers have been set.');
|
||||
clearInterval(load_auth_loop);
|
||||
} else {
|
||||
axios_headers_set = false;
|
||||
console.log('Waiting for Axios headers to be set.');
|
||||
}
|
||||
}, loading_loop_interval);
|
||||
|
||||
|
||||
|
||||
setInterval(async function() {
|
||||
if (axios_headers_set && idb_tables_opened && idb_tables_have_records) {
|
||||
|
||||
if (idb_event_check_datetime < Date.now()) {
|
||||
console.log('Time to check events');
|
||||
let v2_account_events = await api.v2_get_account_events(axios, account_id);
|
||||
for (var i in v2_account_events) {
|
||||
tbl_event.setItem(v2_account_events[i].id.toString(), v2_account_events[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
idb_event_check_datetime = Date.now() + idb_event_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_location_check_datetime < Date.now()) {
|
||||
console.log('Time to check event locations');
|
||||
let v2_event_locations = await api.v2_get_event_locations(axios, event_id);
|
||||
for (var i in v2_event_locations) {
|
||||
tbl_event_location.setItem(v2_event_locations[i].id.toString(), v2_event_locations[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
idb_event_location_check_datetime = Date.now() + idb_event_location_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_session_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location sessions');
|
||||
let v2_event_sessions = await api.v2_get_event_location_sessions(axios, event_location_id);
|
||||
for (var i in v2_event_sessions) {
|
||||
tbl_event_session.setItem(v2_event_sessions[i].id.toString(), v2_event_sessions[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_presentation_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location presentations');
|
||||
let v2_event_presentations = await api.v2_get_event_location_presentations(axios, event_location_id);
|
||||
for (var i in v2_event_presentations) {
|
||||
tbl_event_presentation.setItem(v2_event_presentations[i].id.toString(), v2_event_presentations[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_presenter_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location presenters');
|
||||
let v2_event_presenters = await api.v2_get_event_location_presenters(axios, event_location_id);
|
||||
for (var i in v2_event_presenters) {
|
||||
tbl_event_presenter.setItem(v2_event_presenters[i].id.toString(), v2_event_presenters[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
idb_event_presenter_check_datetime = Date.now() + idb_event_presenter_check_period;
|
||||
}
|
||||
|
||||
if (idb_event_file_check_datetime < Date.now()) {
|
||||
console.log('Time to check event location files');
|
||||
let v2_event_files = await api.v2_get_event_location_files(axios, event_location_id);
|
||||
for (var i in v2_event_files) {
|
||||
tbl_event_file.setItem(v2_event_files[i].event_file_id.toString(), v2_event_files[i]);
|
||||
}
|
||||
run_idb_to_launcher = true; // Set to true so that the launcher object is rebuilt
|
||||
run_check_file_cache = true; // Set to true so that the local file cache will be checked against the updated event files
|
||||
idb_event_file_check_datetime = Date.now() + idb_event_file_check_period;
|
||||
}
|
||||
|
||||
if (run_idb_to_launcher) {
|
||||
console.log('Flag to run idb_to_launcher has been set to true.');
|
||||
idb_to_launcher_result = idb.idb_to_launcher(launcher);
|
||||
|
||||
idb_to_launcher_result.then(function (response) {
|
||||
console.log('Launcher object has now been updated.');
|
||||
console.log(launcher);
|
||||
|
||||
run_idb_to_launcher = false;
|
||||
run_render_launcher = true; // Set to true so that the launcher will be rendered again
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (run_check_file_cache) {
|
||||
console.log('Flag to run check_file_cache has been set to true.');
|
||||
check_file_cache_result = idb.check_file_cache();
|
||||
|
||||
check_file_cache_result.then(function (response) {
|
||||
console.log('Cached files have now been updated.');
|
||||
run_check_file_cache = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (run_render_launcher) {
|
||||
console.log('Flag to run render_launcher has been set to true.');
|
||||
let launcher_tmp = launcher;
|
||||
/*
|
||||
//render_launcher_result = ui.render_launcher(launcher_tmp);
|
||||
render_launcher_result.then(function (response) {
|
||||
console.log('The launcher has now been rendered.');
|
||||
run_render_launcher = false;
|
||||
});
|
||||
*/
|
||||
// NOTE This is a terrible way to work around the page refreshing and blanking out.
|
||||
setTimeout(() => {
|
||||
render_launcher_result = ui.render_launcher(launcher_tmp);
|
||||
|
||||
render_launcher_result.then(function (response) {
|
||||
console.log('The launcher has now been rendered.');
|
||||
run_render_launcher = false;
|
||||
});
|
||||
}, 100);
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
else {
|
||||
console.log('index.html: v2 idb_to_launcher result is true ***');
|
||||
|
||||
if (idb_check_datetime < Date.now()) {
|
||||
console.log('Render launcher...');
|
||||
launcher_render_results = await ui.launcher_render(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
} else {
|
||||
console.log('Waiting to render launcher again...');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
current_datetime = Date.now();
|
||||
//let launcher_cache_check_results = false;
|
||||
/*
|
||||
if (idb_check_datetime < current_datetime) {
|
||||
launcher_cache_check_results = idb.launcher_cache_check(launcher, api_base_url, api_temporary_token, host_file_cache_path);
|
||||
|
||||
launcher_cache_check_results.then(function (response) {
|
||||
console.log(launcher);
|
||||
idb_check_datetime = Date.now() + idb_check_period;
|
||||
|
||||
launcher_render_results = ui.launcher_render(launcher);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
} else {
|
||||
console.log('Waiting '+main_loop_interval+'ms to see if Authorization header is set, tables are opened, and record counts have been done.');
|
||||
}
|
||||
}, main_loop_interval);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//const custom_store = new idbKeyval.Store('custom_db', 'custom_store_name');
|
||||
//idbKeyval.set('foo', 'bar', custom_store);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/launcher.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
497
app/index 2022-03-01.html.bak
Normal file
497
app/index 2022-03-01.html.bak
Normal file
@@ -0,0 +1,497 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>One Sky IT</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> -->
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/native_app.css">
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.22.0/axios.min.js" integrity="sha512-m2ssMAtdCEYGWXQ8hXVG4Q39uKYtbfaJL5QMTbhl2kc6vYyubrKHhr6aLLXW4ITeXSywQLn1AhsAaqrJl8Acfg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.2.0/socket.io.js" integrity="sha512-WL6WGKMPBiM9PnHRYIn5YEtq0Z8XP4fkVb4qy7PP4vhmYQErJ/dySyXuFIMDf1eEYCXCrQrMJfkNwKc9gsjTjA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.7/dayjs.min.js" integrity="sha512-bwD3VD/j6ypSSnyjuaURidZksoVx3L1RPvTkleC48SbHCZsemT3VKMD39KknPnH728LLXVMTisESIBOAb5/W0Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> -->
|
||||
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<main id="main_content" class="svelte_target event_launcher_main">
|
||||
</main>
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script src="js/app_api.js"></script>
|
||||
<script src="js/app_idb.js"></script>
|
||||
<script src="js/app_ui_misc.js"></script>
|
||||
<script src="js/app_ui_sessions.js"></script>
|
||||
<script src="js/app_ui_presentations.js"></script>
|
||||
<script src="js/app_ui_presenters.js"></script>
|
||||
<script src="js/app_ui_files.js"></script>
|
||||
|
||||
<script>
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
|
||||
let app_config = app.load_config();
|
||||
let account_id = app_config.account_id;
|
||||
let event_id = app_config.event_id;
|
||||
let event_location_id = app_config.event_location_id;
|
||||
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Set display options
|
||||
|
||||
const display_menu_session_times = app_config.display_menu_session_times;
|
||||
const display_session_codes = app_config.display_session_codes;
|
||||
const display_session_badges = app_config.display_session_badges;
|
||||
const display_presentation_codes = app_config.display_presentation_codes; // NOTE: not currently used
|
||||
const display_presentation_badges = app_config.display_presentation_badges;
|
||||
const display_presenter_codes = app_config.display_presenter_codes; // NOTE: not currently used
|
||||
const display_presenter_badges = app_config.display_presenter_badges; // NOTE: not currently used
|
||||
|
||||
|
||||
// END: Set display options
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: API section
|
||||
|
||||
|
||||
const api_token_loop_interval = app_config.api_token_loop_interval;
|
||||
let api_update_period = app_config.idb_event_location_check_period;
|
||||
let api_update_datetime = Date.now();
|
||||
let waiting_on_api_token = false;
|
||||
|
||||
const secret_key = app_config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (app_config.use_local_api) {
|
||||
api_base_url = app_config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
api_base_url = app_config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = app_config.access_control_allow_origin; // '*';
|
||||
|
||||
// Axios needs to authenticate first
|
||||
let axios_headers_set = false;
|
||||
|
||||
let app_online = false;
|
||||
//let app_use_cached_data = true;
|
||||
window.addEventListener('online', app.currently_online);
|
||||
window.addEventListener('offline', app.currently_offline);
|
||||
|
||||
var api_token_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: API Token Loop ******************');
|
||||
|
||||
if (app_online && api_update_datetime < Date.now()) {
|
||||
//let api_temporary_token_result = api_token_request_async(axios, secret_key)
|
||||
api_temporary_token = await api_token_request_async(axios, secret_key)
|
||||
.then(function (result) {
|
||||
if (result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
//api_temporary_token = result;
|
||||
|
||||
console.log('Axios headers have been set.');
|
||||
axios_headers_set = true;
|
||||
api_update_datetime = Date.now() + api_update_period;
|
||||
return result;
|
||||
} else {
|
||||
console.log('The temporary API token appears to have failed. Are we actually online? Setting the app to offline mode.');
|
||||
console.log(navigator.onLine);
|
||||
app.currently_offline();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong while trying to request a temporary API token.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
} else if (app_online) {
|
||||
//console.log('Currently online, but not asking for a new temporary token yet.');
|
||||
} else {
|
||||
console.log('Currently offline. Can not request a new temporary API token.');
|
||||
}
|
||||
}, 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
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Load IDB section
|
||||
|
||||
|
||||
let idb_name = app_config.idb_name;
|
||||
|
||||
var tbl_event = null;
|
||||
var tbl_event_location = null;
|
||||
var tbl_event_session = null;
|
||||
var tbl_event_presentation = null;
|
||||
var tbl_event_presenter = null;
|
||||
var tbl_event_file = null;
|
||||
var tbl_hosted_file = null;
|
||||
|
||||
var tbl_event_key_count = null;
|
||||
var tbl_event_location_key_count = null;
|
||||
var tbl_event_session_key_count = null;
|
||||
var tbl_event_presentation_key_count = null;
|
||||
var tbl_event_presenter_key_count = null;
|
||||
var tbl_event_file_key_count = null;
|
||||
var tbl_hosted_file_key_count = null;
|
||||
|
||||
//const open_tables_loop_interval = 10; // only runs briefly on start up
|
||||
|
||||
const update_idb_loop_interval = app_config.update_idb_loop_interval; // loop forever
|
||||
//const update_render_loop_interval = 10000; // loop forever; only run when the launcher object is safe
|
||||
|
||||
// IDB tables need to be opened
|
||||
let idb_tables_opened = false;
|
||||
|
||||
// check periods and datetimes for update_idb_loop
|
||||
let idb_event_check_period = app_config.idb_event_check_period;
|
||||
let idb_event_check_datetime = Date.now();
|
||||
let idb_event_location_check_period = app_config.idb_event_location_check_period;
|
||||
let idb_event_location_check_datetime = Date.now();
|
||||
let idb_event_session_check_period = app_config.idb_event_session_check_period;
|
||||
let idb_event_session_check_datetime = Date.now();
|
||||
let idb_event_presentation_check_period = app_config.idb_event_presentation_check_period;
|
||||
let idb_event_presentation_check_datetime = Date.now();
|
||||
let idb_event_presenter_check_period = app_config.idb_event_presenter_check_period;
|
||||
let idb_event_presenter_check_datetime = Date.now();
|
||||
let idb_event_file_check_period = app_config.idb_event_file_check_period;
|
||||
let idb_event_file_check_datetime = Date.now();
|
||||
|
||||
|
||||
//let run_update_idb = false;
|
||||
let run_check_file_cache = false;
|
||||
|
||||
let looping_tbl_event = false;
|
||||
let looping_tbl_event_location = false;
|
||||
let looping_tbl_event_session = false;
|
||||
let looping_tbl_event_presentation = false;
|
||||
let looping_tbl_event_presenter = false;
|
||||
let looping_tbl_event_file = false;
|
||||
|
||||
//let idb_tables_have_records = false;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
|
||||
let load_idb_tables_result = load_idb_tables()
|
||||
.then(async function (result) {
|
||||
console.log('IDB tables have been opened');
|
||||
idb_tables_opened = load_idb_tables_result;
|
||||
|
||||
console.log('Attempting to use cached IDB data...');
|
||||
|
||||
if (tbl_event_key_count
|
||||
&& tbl_event_location_key_count
|
||||
&& tbl_event_session_key_count
|
||||
&& tbl_event_presentation_key_count
|
||||
&& tbl_event_presenter_key_count
|
||||
&& tbl_event_file_key_count) {
|
||||
let render_event_records_result = render_event_records();
|
||||
let render_event_location_records_result = render_event_location_records();
|
||||
let render_event_session_records_result = render_event_session_records()
|
||||
.then(async function (result) {
|
||||
console.log('Rendering session records has finished. Moving to other records.');
|
||||
console.log(result);
|
||||
let render_event_presentation_records_result = await render_event_presentation_records();
|
||||
let render_event_presenter_records_result = await render_event_presenter_records();
|
||||
let render_event_file_records_result = await render_event_file_records();
|
||||
|
||||
return true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong rendering session records.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
console.log('One or more of the IDB tables has 0 records. The IDB probably needs to be updated.');
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong opening the IDB tables.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
// END: Load IDB section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Update IDB section
|
||||
|
||||
|
||||
var update_idb_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: Update IDB ******************');
|
||||
|
||||
if (app_online && axios_headers_set && idb_tables_opened) {
|
||||
if (idb_event_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check events * ** *** ****');
|
||||
let v2_account_events = await v2_get_account_events(axios, account_id)
|
||||
.then(function (response) {
|
||||
for (var i in response) {
|
||||
tbl_event.setItem(response[i].id.toString(), response[i]);
|
||||
}
|
||||
idb_event_check_datetime = Date.now() + idb_event_check_period;
|
||||
let render_event_records_result = render_event_records(); // NOTE: v2 idb to ui
|
||||
//update_event_ui = true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Trying to check events. Something went wrong. Expired token?');
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (idb_event_location_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event locations * ** *** ****');
|
||||
let v2_event_locations = await v2_get_event_locations(axios, event_id);
|
||||
for (var i in v2_event_locations) {
|
||||
tbl_event_location.setItem(v2_event_locations[i].id.toString(), v2_event_locations[i]);
|
||||
}
|
||||
idb_event_location_check_datetime = Date.now() + idb_event_location_check_period;
|
||||
let render_event_location_records_result = render_event_location_records(); // NOTE: v2 idb to ui
|
||||
//update_event_location_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_session_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event sessions * ** *** ****'); // All event sessions, not just location specific.
|
||||
let v2_event_sessions = await v2_get_event_sessions(axios, event_id); // Was v2_get_event_location_sessions
|
||||
//tbl_event_session.clear();
|
||||
for (var i in v2_event_sessions) {
|
||||
tbl_event_session.setItem(v2_event_sessions[i].id.toString(), v2_event_sessions[i]);
|
||||
}
|
||||
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
||||
let render_event_session_records_result = render_event_session_records(); // NOTE: v2 idb to ui
|
||||
//update_event_session_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_presentation_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location presentations * ** *** ****');
|
||||
let v2_event_presentations = await v2_get_event_location_presentations(axios, event_location_id);
|
||||
for (var i in v2_event_presentations) {
|
||||
tbl_event_presentation.setItem(v2_event_presentations[i].id.toString(), v2_event_presentations[i]);
|
||||
}
|
||||
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
||||
let render_event_presentation_records_result = await render_event_presentation_records(); // NOTE: v2 idb to ui
|
||||
//update_event_presentation_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_presenter_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location presenters * ** *** ****');
|
||||
let v2_event_presenters = await v2_get_event_location_presenters(axios, event_location_id);
|
||||
for (var i in v2_event_presenters) {
|
||||
tbl_event_presenter.setItem(v2_event_presenters[i].id.toString(), v2_event_presenters[i]);
|
||||
}
|
||||
idb_event_presenter_check_datetime = Date.now() + idb_event_presenter_check_period;
|
||||
|
||||
let render_event_presenter_records_result = await render_event_presenter_records(); // NOTE: v2 idb to ui
|
||||
//update_event_presenter_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_file_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location files * ** *** ****');
|
||||
|
||||
let v2_event_files = await v2_get_event_files(axios, event_id);
|
||||
for (var i in v2_event_files) {
|
||||
tbl_event_file.setItem(v2_event_files[i].id.toString(), v2_event_files[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files = await v2_get_event_location_files(axios, event_location_id);
|
||||
for (var i in v2_event_location_files) {
|
||||
tbl_event_file.setItem(v2_event_location_files[i].id.toString(), v2_event_location_files[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_sessions = await v2_get_event_location_files_sessions(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_sessions) {
|
||||
tbl_event_file.setItem(v2_event_location_files_sessions[i].id.toString(), v2_event_location_files_sessions[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_presentations = await v2_get_event_location_files_presentations(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_presentations) {
|
||||
tbl_event_file.setItem(v2_event_location_files_presentations[i].id.toString(), v2_event_location_files_presentations[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_presenters = await v2_get_event_location_files_presenters(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_presenters) {
|
||||
tbl_event_file.setItem(v2_event_location_files_presenters[i].id.toString(), v2_event_location_files_presenters[i]);
|
||||
}
|
||||
|
||||
//run_check_file_cache = true; // Set to true so that the local file cache will be checked against the updated event files
|
||||
idb_event_file_check_datetime = Date.now() + idb_event_file_check_period;
|
||||
|
||||
let render_event_file_records_result = await render_event_file_records(); // NOTE: v2 idb to ui
|
||||
|
||||
let check_file_cache_result = app.check_file_cache()
|
||||
.then(function (result) {
|
||||
if (result) {
|
||||
console.log('Cached files have now been updated.');
|
||||
} else {
|
||||
console.log('Cached files were not updated.');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//update_event_file_ui = true;
|
||||
}
|
||||
|
||||
} else if (app_online && idb_tables_opened && !axios_headers_set) {
|
||||
console.log('Online and waiting for the Axios headers to be set.');
|
||||
} else if (app_online && axios_headers_set && !idb_tables_opened) {
|
||||
console.log('Online and Axios headers are set. Waiting for the IDB tables to be opened');
|
||||
} else if (!app_online) {
|
||||
console.log('Waiting to update IDB once online.');
|
||||
} else {
|
||||
console.log('This should not happen.');
|
||||
}
|
||||
}, update_idb_loop_interval);
|
||||
|
||||
|
||||
// END: IDB section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Cached file section
|
||||
|
||||
|
||||
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 host_file_cache_path = app_config.host_file_cache_path; // 'file_cache/'
|
||||
|
||||
var check_file_cache_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: Check File Cache ******************');
|
||||
|
||||
if (run_check_file_cache) {
|
||||
console.log('FLAG: check_file_cache='+run_check_file_cache);
|
||||
check_file_cache_result = app.check_file_cache();
|
||||
|
||||
check_file_cache_result.then(function (response) {
|
||||
console.log('Cached files have now been updated.');
|
||||
});
|
||||
run_check_file_cache = false;
|
||||
} else {
|
||||
//console.log('Flag to run check_file_cache is set to false');
|
||||
}
|
||||
}, check_file_cache_loop_interval);
|
||||
|
||||
|
||||
// END: Cached file section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// 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('Secondary online status check?');
|
||||
//console.log(navigator.onLine);
|
||||
//clearInterval(check_initial_online_status);
|
||||
/*
|
||||
if (navigator.onLine) {
|
||||
//app.currently_online();
|
||||
} else {
|
||||
//app.currently_offline();
|
||||
}
|
||||
*/
|
||||
}, 3000);
|
||||
|
||||
|
||||
// END: Check online status section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Status clock section
|
||||
|
||||
|
||||
let status_clock = setInterval(function() {
|
||||
//console.log('****************** LOOP: Status Clock ******************');
|
||||
//https://date-fns.org/v1.30.1/docs/format
|
||||
let datetime_string = dateFns.format(new Date(), 'dddd, Do h:mm:ss A'); //dddd, Do hh:mm:ss A
|
||||
document.getElementById('app_datetime').innerHTML = datetime_string;
|
||||
}, 1000);
|
||||
|
||||
|
||||
// END: Status clock section
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/test.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
579
app/index.html
579
app/index.html
@@ -9,14 +9,32 @@
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.ico">
|
||||
|
||||
<!-- Cascading Style Sheets (CSS) start -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/materia/bootstrap.min.css" rel="stylesheet" integrity="sha384-1tymk6x9Y5K+OF0tlmG2fDRcn67QGzBkiM3IgtJ3VrtGrIi5ryhHjKjeeS60f1FA" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.10.2/css/all.css">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> -->
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<!-- One Sky IT default custom Cascading Style Sheets (CSS) -->
|
||||
|
||||
<!-- One Sky IT site custom Cascading Style Sheets (CSS) -->
|
||||
<link rel="stylesheet" href="css/starter-template.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link href="svelte/build/bundle.css" rel="stylesheet">
|
||||
<link href="svelte/build/reloading.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="css/aether_variables.css">
|
||||
<link rel="stylesheet" href="css/aether_utilities.css">
|
||||
<link rel="stylesheet" href="css/aether_system.css">
|
||||
<!-- <link rel="stylesheet" href="svelte/build/aether_layout.css"> -->
|
||||
<!-- <link rel="stylesheet" href="css/aether_layout_flow.css"> -->
|
||||
<!-- <link rel="stylesheet" href="css/aether_layout_grid.css"> -->
|
||||
<link rel="stylesheet" href="css/aether_modules_core.css">
|
||||
<link rel="stylesheet" href="css/aether_modules_other.css">
|
||||
<link href="css/base_style_grid_event_launcher.css" rel="stylesheet">
|
||||
<link href="css/base_style_event_launcher.css" rel="stylesheet">
|
||||
<link href="css/event_launcher.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="css/native_app.css">
|
||||
|
||||
<style>
|
||||
@@ -24,519 +42,108 @@
|
||||
<!-- Cascading Style Sheets (CSS) end -->
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.22.0/axios.min.js" integrity="sha512-m2ssMAtdCEYGWXQ8hXVG4Q39uKYtbfaJL5QMTbhl2kc6vYyubrKHhr6aLLXW4ITeXSywQLn1AhsAaqrJl8Acfg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.2.0/socket.io.js" integrity="sha512-WL6WGKMPBiM9PnHRYIn5YEtq0Z8XP4fkVb4qy7PP4vhmYQErJ/dySyXuFIMDf1eEYCXCrQrMJfkNwKc9gsjTjA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.7/dayjs.min.js" integrity="sha512-bwD3VD/j6ypSSnyjuaURidZksoVx3L1RPvTkleC48SbHCZsemT3VKMD39KknPnH728LLXVMTisESIBOAb5/W0Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> -->
|
||||
|
||||
<script src="https://static.oneskyit.com/js/utilities.js"></script>
|
||||
|
||||
<script defer src="svelte/build/bundle.js" crossorigin></script>
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--<main id="main_content" role="main" class="container">-->
|
||||
<div id="main_content" class="container w-100">
|
||||
|
||||
<!--
|
||||
<div class="row no-gutters">
|
||||
<div id="launcher_title" class="launcher_title border-bottom">Please wait while the data is checked and files are cached.</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div id="launcher_menu" class="launcher_menu col-3 border-right">
|
||||
<div id="event_files_menu" class="event_files_menu d-none">
|
||||
<h2>Event Files</h2>
|
||||
<ul class="list-group list-group-flush event_files_list" role=""></ul>
|
||||
</div>
|
||||
<div id="location_files_menu" class="location_files_menu d-none">
|
||||
<h2>Location Files</h2>
|
||||
<ul class="list-group list-group-flush location_files_list event_files_list" role=""></ul>
|
||||
</div>
|
||||
<div id="sessions_menu" class="sessions_menu d-none">
|
||||
<h2>Sessions</h2>
|
||||
<ul class="list-group list-group-flush" role=""></ul>
|
||||
</div>
|
||||
<!--<div id="location_name" class="location_name"></div>-->
|
||||
<div id="launcher_location_name" class="launcher_location_name">
|
||||
<span id="location_name"></span><span id="event_name"></span>
|
||||
</div>
|
||||
<div id="reset1" class="btn btn-warning app_reset" data-spy="affix" data-offset-top="200" onclick="location.reload();">
|
||||
<span class="fas fa-sync"></span> Reset Launcher
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="launcher_sessions" class="launcher_sessions col"></div> <!-- end location details div -->
|
||||
</div> <!-- end row div -->
|
||||
|
||||
</div>
|
||||
<!--</main>--> <!-- /.container -->
|
||||
|
||||
<!-- BEGIN: App status bar -->
|
||||
<div id="app_status_bar" class="app_status_bar">
|
||||
<span id="app_network_status" class="app_network_status">
|
||||
<span class="fas fa-globe"></span> Network Status
|
||||
</span>
|
||||
<span id="app_datetime" class="app_datetime">datetime</span>
|
||||
</div>
|
||||
<!-- END: App status bar -->
|
||||
<main id="Main-Body" class="body_container svelte_target event_launcher_main">
|
||||
</main>
|
||||
|
||||
|
||||
<!-- JavaScript (JS) start -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js" integrity="sha256-wCBClaCr6pJ7sGU5kfb3gQMOOcIZNzaWpWcj/lD9Vfk=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js" crossorigin></script>
|
||||
|
||||
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js" crossorigin></script>
|
||||
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/idb-keyval@3/dist/idb-keyval-iife.min.js"></script>-->
|
||||
<!--<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>-->
|
||||
<script src="https://cdn.rawgit.com/mozilla/localForage/master/dist/localforage.js"></script>
|
||||
|
||||
<!--
|
||||
<!-- JavaScript (JS) start -->
|
||||
<!--
|
||||
Using node.js may require this: npm install jquery, add script below.
|
||||
https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
-->
|
||||
<!--
|
||||
<script>
|
||||
window.jQuery = window.$ = require('jquery');
|
||||
</script>
|
||||
-->
|
||||
</script>
|
||||
-->
|
||||
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
<!-- One Sky IT default custom JavaScript (JS) -->
|
||||
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<script src="js/app_api.js"></script>
|
||||
<script src="js/app_idb.js"></script>
|
||||
<script src="js/app_ui_misc.js"></script>
|
||||
<script src="js/app_ui_sessions.js"></script>
|
||||
<script src="js/app_ui_presentations.js"></script>
|
||||
<script src="js/app_ui_presenters.js"></script>
|
||||
<script src="js/app_ui_files.js"></script>
|
||||
<!-- One Sky IT site custom JavaScript (JS) -->
|
||||
<script>const app = require('./js/module_app');</script>
|
||||
<!-- <script src="js/app_api.js"></script> -->
|
||||
<!-- <script src="js/app_idb.js"></script> -->
|
||||
<!-- <script src="js/app_ui_misc.js"></script> -->
|
||||
<!-- <script src="js/app_ui_sessions.js"></script> -->
|
||||
<!-- <script src="js/app_ui_presentations.js"></script> -->
|
||||
<!-- <script src="js/app_ui_presenters.js"></script> -->
|
||||
<!-- <script src="js/app_ui_files.js"></script> -->
|
||||
|
||||
<script>
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
<script>
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
|
||||
let app_config = app.load_config();
|
||||
let account_id = app_config.account_id;
|
||||
let event_id = app_config.event_id;
|
||||
let event_location_id = app_config.event_location_id;
|
||||
let app_config = app.load_config();
|
||||
|
||||
const flask_env = 'development'; // 'development', 'production'
|
||||
const env = 'development'; // 'development', 'production'
|
||||
const app_env = 'development_local'; // 'development_local', 'development_remote'
|
||||
const api_env = 'development_local'; // 'development_local', 'development_remote'
|
||||
const app_mode = 'onsite'; // null, 'default', 'onsite'
|
||||
|
||||
let account_id = app_config.account_id;
|
||||
let event_id = app_config.event_id;
|
||||
let event_location_id = app_config.event_location_id;
|
||||
|
||||
const page_for = { 'event': event_id, 'event_location': event_location_id }; // Simple key value like object
|
||||
console.log(page_for);
|
||||
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Set display options
|
||||
|
||||
const display_menu_session_times = app_config.display_menu_session_times;
|
||||
const display_session_codes = app_config.display_session_codes;
|
||||
const display_session_badges = app_config.display_session_badges;
|
||||
const display_presentation_codes = app_config.display_presentation_codes; // NOTE: not currently used
|
||||
const display_presentation_badges = app_config.display_presentation_badges;
|
||||
const display_presenter_codes = app_config.display_presenter_codes; // NOTE: not currently used
|
||||
const display_presenter_badges = app_config.display_presenter_badges; // NOTE: not currently used
|
||||
// BEGIN: API section
|
||||
|
||||
|
||||
// END: Set display options
|
||||
// const api_token_loop_interval = app_config.api_token_loop_interval;
|
||||
// let api_update_period = app_config.idb_event_location_check_period;
|
||||
// let api_update_datetime = Date.now();
|
||||
// let waiting_on_api_token = false;
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
const secret_key = app_config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
// BEGIN: API section
|
||||
let api_base_url = null;
|
||||
|
||||
|
||||
const api_token_loop_interval = app_config.api_token_loop_interval;
|
||||
let api_update_period = app_config.idb_event_location_check_period;
|
||||
let api_update_datetime = Date.now();
|
||||
let waiting_on_api_token = false;
|
||||
|
||||
const secret_key = app_config.api_secret_key;
|
||||
let api_temporary_token = null;
|
||||
|
||||
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
|
||||
|
||||
if (app_config.use_local_api) {
|
||||
if (app_config.use_local_api) {
|
||||
api_base_url = app_config.api_local_base_url; // 'http://api.localhost:5001'
|
||||
} else {
|
||||
} else {
|
||||
api_base_url = app_config.api_remote_base_url; // 'https://api.oneskyit.com'
|
||||
}
|
||||
}
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = app_config.access_control_allow_origin; // '*';
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.common['Access-Control-Allow-Origin'] = app_config.access_control_allow_origin;
|
||||
axios.defaults.headers.common['content-type'] = 'application/json';
|
||||
axios.defaults.headers.common['x-aether-api-key'] = app_config.api_secret_key;
|
||||
axios.defaults.headers.common['x-account-id'] = app_config.account_id;
|
||||
|
||||
// Axios needs to authenticate first
|
||||
let axios_headers_set = false;
|
||||
let app_online = false;
|
||||
//let app_use_cached_data = true;
|
||||
window.addEventListener('online', app.currently_online);
|
||||
window.addEventListener('offline', app.currently_offline);
|
||||
</script>
|
||||
|
||||
let app_online = false;
|
||||
//let app_use_cached_data = true;
|
||||
window.addEventListener('online', app.currently_online);
|
||||
window.addEventListener('offline', app.currently_offline);
|
||||
|
||||
var api_token_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: API Token Loop ******************');
|
||||
|
||||
if (app_online && api_update_datetime < Date.now()) {
|
||||
//let api_temporary_token_result = api_token_request_async(axios, secret_key)
|
||||
api_temporary_token = await api_token_request_async(axios, secret_key)
|
||||
.then(function (result) {
|
||||
if (result) {
|
||||
console.log('Setting temporary API token to axios Authorization header: '+result);
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${result}`;
|
||||
//api_temporary_token = result;
|
||||
|
||||
console.log('Axios headers have been set.');
|
||||
axios_headers_set = true;
|
||||
api_update_datetime = Date.now() + api_update_period;
|
||||
return result;
|
||||
} else {
|
||||
console.log('The temporary API token appears to have failed. Are we actually online? Setting the app to offline mode.');
|
||||
console.log(navigator.onLine);
|
||||
app.currently_offline();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong while trying to request a temporary API token.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
} else if (app_online) {
|
||||
//console.log('Currently online, but not asking for a new temporary token yet.');
|
||||
} else {
|
||||
console.log('Currently offline. Can not request a new temporary API token.');
|
||||
}
|
||||
}, 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
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Load IDB section
|
||||
|
||||
|
||||
let idb_name = app_config.idb_name;
|
||||
|
||||
var tbl_event = null;
|
||||
var tbl_event_location = null;
|
||||
var tbl_event_session = null;
|
||||
var tbl_event_presentation = null;
|
||||
var tbl_event_presenter = null;
|
||||
var tbl_event_file = null;
|
||||
var tbl_hosted_file = null;
|
||||
|
||||
var tbl_event_key_count = null;
|
||||
var tbl_event_location_key_count = null;
|
||||
var tbl_event_session_key_count = null;
|
||||
var tbl_event_presentation_key_count = null;
|
||||
var tbl_event_presenter_key_count = null;
|
||||
var tbl_event_file_key_count = null;
|
||||
var tbl_hosted_file_key_count = null;
|
||||
|
||||
//const open_tables_loop_interval = 10; // only runs briefly on start up
|
||||
|
||||
const update_idb_loop_interval = app_config.update_idb_loop_interval; // loop forever
|
||||
//const update_render_loop_interval = 10000; // loop forever; only run when the launcher object is safe
|
||||
|
||||
// IDB tables need to be opened
|
||||
let idb_tables_opened = false;
|
||||
|
||||
// check periods and datetimes for update_idb_loop
|
||||
let idb_event_check_period = app_config.idb_event_check_period;
|
||||
let idb_event_check_datetime = Date.now();
|
||||
let idb_event_location_check_period = app_config.idb_event_location_check_period;
|
||||
let idb_event_location_check_datetime = Date.now();
|
||||
let idb_event_session_check_period = app_config.idb_event_session_check_period;
|
||||
let idb_event_session_check_datetime = Date.now();
|
||||
let idb_event_presentation_check_period = app_config.idb_event_presentation_check_period;
|
||||
let idb_event_presentation_check_datetime = Date.now();
|
||||
let idb_event_presenter_check_period = app_config.idb_event_presenter_check_period;
|
||||
let idb_event_presenter_check_datetime = Date.now();
|
||||
let idb_event_file_check_period = app_config.idb_event_file_check_period;
|
||||
let idb_event_file_check_datetime = Date.now();
|
||||
|
||||
|
||||
//let run_update_idb = false;
|
||||
let run_check_file_cache = false;
|
||||
|
||||
let looping_tbl_event = false;
|
||||
let looping_tbl_event_location = false;
|
||||
let looping_tbl_event_session = false;
|
||||
let looping_tbl_event_presentation = false;
|
||||
let looping_tbl_event_presenter = false;
|
||||
let looping_tbl_event_file = false;
|
||||
|
||||
//let idb_tables_have_records = false;
|
||||
|
||||
if (window.indexedDB) {
|
||||
console.log('IndexedDB is supported');
|
||||
|
||||
let load_idb_tables_result = load_idb_tables()
|
||||
.then(async function (result) {
|
||||
console.log('IDB tables have been opened');
|
||||
idb_tables_opened = load_idb_tables_result;
|
||||
|
||||
console.log('Attempting to use cached IDB data...');
|
||||
|
||||
if (tbl_event_key_count
|
||||
&& tbl_event_location_key_count
|
||||
&& tbl_event_session_key_count
|
||||
&& tbl_event_presentation_key_count
|
||||
&& tbl_event_presenter_key_count
|
||||
&& tbl_event_file_key_count) {
|
||||
let render_event_records_result = render_event_records();
|
||||
let render_event_location_records_result = render_event_location_records();
|
||||
let render_event_session_records_result = render_event_session_records()
|
||||
.then(async function (result) {
|
||||
console.log('Rendering session records has finished. Moving to other records.');
|
||||
console.log(result);
|
||||
let render_event_presentation_records_result = await render_event_presentation_records();
|
||||
let render_event_presenter_records_result = await render_event_presenter_records();
|
||||
let render_event_file_records_result = await render_event_file_records();
|
||||
|
||||
return true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong rendering session records.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
console.log('One or more of the IDB tables has 0 records. The IDB probably needs to be updated.');
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong opening the IDB tables.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('IndexedDB is NOT supported');
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
// END: Load IDB section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Update IDB section
|
||||
|
||||
|
||||
var update_idb_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: Update IDB ******************');
|
||||
|
||||
if (app_online && axios_headers_set && idb_tables_opened) {
|
||||
if (idb_event_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check events * ** *** ****');
|
||||
let v2_account_events = await v2_get_account_events(axios, account_id)
|
||||
.then(function (response) {
|
||||
for (var i in response) {
|
||||
tbl_event.setItem(response[i].id.toString(), response[i]);
|
||||
}
|
||||
idb_event_check_datetime = Date.now() + idb_event_check_period;
|
||||
let render_event_records_result = render_event_records(); // NOTE: v2 idb to ui
|
||||
//update_event_ui = true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Trying to check events. Something went wrong. Expired token?');
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (idb_event_location_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event locations * ** *** ****');
|
||||
let v2_event_locations = await v2_get_event_locations(axios, event_id);
|
||||
for (var i in v2_event_locations) {
|
||||
tbl_event_location.setItem(v2_event_locations[i].id.toString(), v2_event_locations[i]);
|
||||
}
|
||||
idb_event_location_check_datetime = Date.now() + idb_event_location_check_period;
|
||||
let render_event_location_records_result = render_event_location_records(); // NOTE: v2 idb to ui
|
||||
//update_event_location_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_session_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event sessions * ** *** ****'); // All event sessions, not just location specific.
|
||||
let v2_event_sessions = await v2_get_event_sessions(axios, event_id); // Was v2_get_event_location_sessions
|
||||
//tbl_event_session.clear();
|
||||
for (var i in v2_event_sessions) {
|
||||
tbl_event_session.setItem(v2_event_sessions[i].id.toString(), v2_event_sessions[i]);
|
||||
}
|
||||
idb_event_session_check_datetime = Date.now() + idb_event_session_check_period;
|
||||
let render_event_session_records_result = render_event_session_records(); // NOTE: v2 idb to ui
|
||||
//update_event_session_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_presentation_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location presentations * ** *** ****');
|
||||
let v2_event_presentations = await v2_get_event_location_presentations(axios, event_location_id);
|
||||
for (var i in v2_event_presentations) {
|
||||
tbl_event_presentation.setItem(v2_event_presentations[i].id.toString(), v2_event_presentations[i]);
|
||||
}
|
||||
idb_event_presentation_check_datetime = Date.now() + idb_event_presentation_check_period;
|
||||
let render_event_presentation_records_result = await render_event_presentation_records(); // NOTE: v2 idb to ui
|
||||
//update_event_presentation_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_presenter_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location presenters * ** *** ****');
|
||||
let v2_event_presenters = await v2_get_event_location_presenters(axios, event_location_id);
|
||||
for (var i in v2_event_presenters) {
|
||||
tbl_event_presenter.setItem(v2_event_presenters[i].id.toString(), v2_event_presenters[i]);
|
||||
}
|
||||
idb_event_presenter_check_datetime = Date.now() + idb_event_presenter_check_period;
|
||||
|
||||
let render_event_presenter_records_result = await render_event_presenter_records(); // NOTE: v2 idb to ui
|
||||
//update_event_presenter_ui = true;
|
||||
}
|
||||
|
||||
if (idb_event_file_check_datetime < Date.now()) {
|
||||
console.log('**** *** ** * Time to check event location files * ** *** ****');
|
||||
|
||||
let v2_event_files = await v2_get_event_files(axios, event_id);
|
||||
for (var i in v2_event_files) {
|
||||
tbl_event_file.setItem(v2_event_files[i].id.toString(), v2_event_files[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files = await v2_get_event_location_files(axios, event_location_id);
|
||||
for (var i in v2_event_location_files) {
|
||||
tbl_event_file.setItem(v2_event_location_files[i].id.toString(), v2_event_location_files[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_sessions = await v2_get_event_location_files_sessions(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_sessions) {
|
||||
tbl_event_file.setItem(v2_event_location_files_sessions[i].id.toString(), v2_event_location_files_sessions[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_presentations = await v2_get_event_location_files_presentations(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_presentations) {
|
||||
tbl_event_file.setItem(v2_event_location_files_presentations[i].id.toString(), v2_event_location_files_presentations[i]);
|
||||
}
|
||||
|
||||
let v2_event_location_files_presenters = await v2_get_event_location_files_presenters(axios, event_location_id);
|
||||
for (var i in v2_event_location_files_presenters) {
|
||||
tbl_event_file.setItem(v2_event_location_files_presenters[i].id.toString(), v2_event_location_files_presenters[i]);
|
||||
}
|
||||
|
||||
//run_check_file_cache = true; // Set to true so that the local file cache will be checked against the updated event files
|
||||
idb_event_file_check_datetime = Date.now() + idb_event_file_check_period;
|
||||
|
||||
let render_event_file_records_result = await render_event_file_records(); // NOTE: v2 idb to ui
|
||||
|
||||
let check_file_cache_result = app.check_file_cache()
|
||||
.then(function (result) {
|
||||
if (result) {
|
||||
console.log('Cached files have now been updated.');
|
||||
} else {
|
||||
console.log('Cached files were not updated.');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//update_event_file_ui = true;
|
||||
}
|
||||
|
||||
} else if (app_online && idb_tables_opened && !axios_headers_set) {
|
||||
console.log('Online and waiting for the Axios headers to be set.');
|
||||
} else if (app_online && axios_headers_set && !idb_tables_opened) {
|
||||
console.log('Online and Axios headers are set. Waiting for the IDB tables to be opened');
|
||||
} else if (!app_online) {
|
||||
console.log('Waiting to update IDB once online.');
|
||||
} else {
|
||||
console.log('This should not happen.');
|
||||
}
|
||||
}, update_idb_loop_interval);
|
||||
|
||||
|
||||
// END: IDB section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Cached file section
|
||||
|
||||
|
||||
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 host_file_cache_path = app_config.host_file_cache_path; // 'file_cache/'
|
||||
|
||||
var check_file_cache_loop = setInterval(async function() {
|
||||
//console.log('****************** LOOP: Check File Cache ******************');
|
||||
|
||||
if (run_check_file_cache) {
|
||||
console.log('FLAG: check_file_cache='+run_check_file_cache);
|
||||
check_file_cache_result = app.check_file_cache();
|
||||
|
||||
check_file_cache_result.then(function (response) {
|
||||
console.log('Cached files have now been updated.');
|
||||
});
|
||||
run_check_file_cache = false;
|
||||
} else {
|
||||
//console.log('Flag to run check_file_cache is set to false');
|
||||
}
|
||||
}, check_file_cache_loop_interval);
|
||||
|
||||
|
||||
// END: Cached file section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// 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('Secondary online status check?');
|
||||
//console.log(navigator.onLine);
|
||||
//clearInterval(check_initial_online_status);
|
||||
/*
|
||||
if (navigator.onLine) {
|
||||
//app.currently_online();
|
||||
} else {
|
||||
//app.currently_offline();
|
||||
}
|
||||
*/
|
||||
}, 3000);
|
||||
|
||||
|
||||
// END: Check online status section
|
||||
|
||||
/* ***** **** *** ** * ### * ** *** **** ***** */
|
||||
|
||||
// BEGIN: Status clock section
|
||||
|
||||
|
||||
let status_clock = setInterval(function() {
|
||||
//console.log('****************** LOOP: Status Clock ******************');
|
||||
//https://date-fns.org/v1.30.1/docs/format
|
||||
let datetime_string = dateFns.format(new Date(), 'dddd, Do h:mm:ss A'); //dddd, Do hh:mm:ss A
|
||||
document.getElementById('app_datetime').innerHTML = datetime_string;
|
||||
}, 1000);
|
||||
|
||||
|
||||
// END: Status clock section
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="js/test.js"></script>-->
|
||||
<!-- JavaScript (JS) end -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,413 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
|
||||
exports.launcher_cache_check = async function (launcher, api_base_url, api_temporary_token, host_file_cache_path) {
|
||||
if (typeof launcher.event === 'undefined') {
|
||||
launcher.event = await api.get_event_details(axios, launcher.event_id);
|
||||
console.log(launcher.event.id);
|
||||
idbKeyval.set(launcher.event.id, launcher.event, tbl_event);
|
||||
/*
|
||||
.then(function (data) {
|
||||
console.log(data.id);
|
||||
idbKeyval.set(data.id, data, tbl_event);
|
||||
//for (var i in response) {
|
||||
//var event_record = data[i];
|
||||
//idbKeyval.set(response[i].id, response[i], tbl_event);
|
||||
//}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
if (typeof launcher.location === 'undefined') {
|
||||
launcher.location = await api.get_event_location_details(axios, launcher.event_id, launcher.event_location_id);
|
||||
}
|
||||
|
||||
if (typeof launcher.event_files === 'undefined') {
|
||||
console.log('Check for global event files.');
|
||||
let for_id = launcher.event_id;
|
||||
launcher.event_files = await api.get_files_for_type_for_id(axios, 'event', for_id);
|
||||
for (var i in launcher.event_files) {
|
||||
console.log('f: ('+launcher.event_files[i].event_file_id+') '+launcher.event_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.event_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.event_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for global event files');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.location_files === 'undefined') {
|
||||
console.log('Check for location specific files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.location_files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.location_files) {
|
||||
console.log('f: ('+launcher.location_files[i].event_file_id+') '+launcher.location_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.location_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.location_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location specific files.');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***')
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
|
||||
console.log('Location cache check finished.');
|
||||
return true;
|
||||
}
|
||||
|
||||
exports.launcher_render = async function (launcher) {
|
||||
console.log('Rendering launcher...');
|
||||
document.getElementById('location_title').innerHTML = '<h1>Launcher '+launcher.location.name+'@'+launcher.event.name+'</h1>';
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="">';
|
||||
for (var i in launcher.event_files) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.event_files[i].id+'" class="btn btn-info btn_no_case open_local_file" data-hash_sha256="'+launcher.event_files[i].hash_sha256+'.file" data-filename="'+launcher.event_files[i].event_file_filename+'">'+launcher.event_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('location_files_menu').innerHTML = '<h2>Location Files</h2>';
|
||||
document.getElementById('location_files_menu').innerHTML += '<ul class="" role="">';
|
||||
for (var i in launcher.location_files) {
|
||||
document.getElementById('location_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.location_files[i].id+'" class="btn btn-info open_local_file" data-hash_sha256="'+launcher.location_files[i].hash_sha256+'.file" data-filename="'+launcher.location_files[i].event_file_filename+'">'+launcher.location_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('location_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('sessions_menu').innerHTML = '<h2>Sessions</h2>';
|
||||
document.getElementById('sessions_menu').innerHTML += '<ul class="" role="">';
|
||||
//let location_detail = '';
|
||||
if (document.getElementById('location_detail').innerHTML.length) {
|
||||
console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
console.log('location_detail already populated');
|
||||
document.getElementById('location_detail').innerHTML = ''; // This needs to be reviewed.
|
||||
}
|
||||
for (var i in launcher.sessions) {
|
||||
// List sessions in menu
|
||||
document.getElementById('sessions_menu').innerHTML += '<li id="menu_session_id_'+launcher.sessions[i].id+'" class="btn btn-info btn_view_session" data-session_id="'+launcher.sessions[i].id+'">'+launcher.sessions[i].name+'</li>';
|
||||
|
||||
// Create containers for each session
|
||||
let session_detail = '';
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
//console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
//console.log('Adding detail_session_id_xx');
|
||||
session_detail += '<div id="detail_session_id_'+launcher.sessions[i].id+'" class="container d-none session_detail" data-session_id="'+launcher.sessions[i].id+'">';
|
||||
}
|
||||
|
||||
|
||||
|
||||
var session_startdatetime = new Date(launcher.sessions[i].start_datetime);
|
||||
|
||||
session_detail += '<h2 class="session_title">'+launcher.sessions[i].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'ddd h:mm A')+'</span>'+'</h2>';
|
||||
|
||||
|
||||
//session_detail += '<div class="">'; // for card-group
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">Session Files:</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
//console.log(launcher.sessions[i].files[j].event_file_filename);
|
||||
session_detail += '<li class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].files[j].hash_sha256+'.file" data-filename="'+launcher.sessions[i].files[j].event_file_filename+'">'+launcher.sessions[i].files[j].event_file_filename+'</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for session files card -->'; // for session files card
|
||||
|
||||
|
||||
//session_detail += '<div class="session_presentations">';
|
||||
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
//session_detail += '<li>'+launcher.sessions[i].presentations[j].name;
|
||||
|
||||
var session_presentation_startdatetime = new Date(launcher.sessions[i].presentations[j].start_datetime);
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">'+launcher.sessions[i].presentations[j].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'h:mm a')+'</span>'+':</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].files[k].event_file_filename);
|
||||
session_detail += '<li class="list-group-item btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'">'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].given_name);
|
||||
session_detail += '<li>'+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name;
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename);
|
||||
//session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename;
|
||||
session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">';
|
||||
session_detail += '<button class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'</button>';
|
||||
|
||||
var event_file_size = launcher.sessions[i].presentations[j].presenters[k].files[l].size;
|
||||
var event_file_created_on = new Date(launcher.sessions[i].presentations[j].presenters[k].files[l].created_on);
|
||||
|
||||
session_detail += '<span class="badge badge-pill badge-light float-right">'+format_bytes(event_file_size, 2)+'; '+dateFns.format(event_file_created_on, 'MMM M h:mm A')+'; '+launcher.sessions[i].presentations[j].presenters[k].files[l].internal_os+'</span>';
|
||||
|
||||
|
||||
session_detail += '</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail +='</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '</ul>';
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for card -->'; // for card
|
||||
|
||||
}
|
||||
//session_detail += '</div> <!-- for session_presentations -->'; // for session_presentations
|
||||
|
||||
//session_detail += '</div>'; // for card-group
|
||||
session_detail += '</div> <!-- End session detail for '+launcher.sessions[i].id+' -->';
|
||||
|
||||
|
||||
//document.getElementById('location_detail').innerHTML += session_detail;
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
document.getElementById('detail_session_id_'+launcher.sessions[i].id).innerHTML = session_detail;
|
||||
} else {
|
||||
document.getElementById('location_detail').innerHTML += session_detail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
document.getElementById('sessions_menu').innerHTML += '</ul>';
|
||||
|
||||
index_location_detail('btn_view_session');
|
||||
|
||||
index_open_file_buttons('open_local_file');
|
||||
|
||||
|
||||
//const btn_session_{{ event_presentation.id }}_name = document.querySelector('button#presentation_{{ event_presentation.id }}_name');
|
||||
//btn_presentation_{{ event_presentation.id }}_name.onclick = display_hide_poster_for_type_id.bind(this, true, 'presentation', {{ event_presentation.id }});
|
||||
console.log('Rendering launcher finished.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function index_location_detail(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail');
|
||||
console.log('*** Session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2019-12-20 */
|
||||
function index_open_file_buttons(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
//class_elements[i].addEventListener( 'click', function() {open_local_file( this.getAttribute('data-filename')) } );
|
||||
|
||||
//let directory = 'file_cache/';
|
||||
|
||||
//directory_and_filename = path.join(directory, class_elements[i].getAttribute('data-filename'));
|
||||
|
||||
let file_path = path.join(host_file_cache_path, class_elements[i].getAttribute('data-hash_sha256'));
|
||||
let filename = class_elements[i].getAttribute('data-filename');
|
||||
|
||||
class_elements[i].addEventListener( 'click', function() { ipcRenderer.send('open_local_file', file_path, filename) } );
|
||||
//ipcRenderer.send('open_local_file', this.getAttribute('data-filename')); // in render thread
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
let request_waiting = false;
|
||||
|
||||
setInterval(async function() {
|
||||
if (typeof axios.defaults.headers.common['Authorization'] !== 'undefined' && axios.defaults.headers.common['Authorization'] != null) {
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.files) {
|
||||
console.log('f: ('+launcher.files[i].event_file_id+') '+launcher.files[i].event_file_filename+' ***')
|
||||
file_id = launcher.files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
filename = launcher.files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
//console.log(directory_and_filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
//response.data.pipe(fs.createWriteStream(directory_and_filename));
|
||||
}
|
||||
//let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location files.');
|
||||
}
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***')
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
/*
|
||||
if (launcher.sessions) {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('f: ('+launcher.sessions[i].event_file_id+') '+launcher.files[i].event_file_filename+' ***')
|
||||
file_id = launcher.files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let results = await api.download_file_id(axios, file_id);
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location files.');
|
||||
}
|
||||
*/
|
||||
|
||||
} else {
|
||||
console.log('Waiting a few more seconds to see if Authorization header is set.');
|
||||
}
|
||||
}, 5000);
|
||||
@@ -1,422 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
exports.api_token_request_async = async function (axios, secret_key) {
|
||||
console.log('Requesting API temporary token...');
|
||||
const url = '/api_token_request';
|
||||
|
||||
let data = { secret_key: secret_key };
|
||||
|
||||
const response = await axios.post(url, data)
|
||||
.then(function (response) {
|
||||
//console.log(response);
|
||||
const api_temporary_token = response.data.temporary_token;
|
||||
//console.log('API Temporary Token: '+temporary_token);
|
||||
return api_temporary_token;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
return error;
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
exports.get_event_location_sessions = async function (axios, event_id, event_location_id) {
|
||||
console.log('Requesting location sessions...');
|
||||
const url = '/event/'+event_id+'/location/'+event_location_id+'/session';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_session_presentations = async function (axios, event_id, event_session_id) {
|
||||
console.log('Requesting session presentations...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_presentation_presenters = async function (axios, event_id, event_session_id, event_presentation_id) {
|
||||
console.log('Requesting presentation presenters...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation/'+event_presentation_id+'/presenter';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_files_for_type_for_id = async function (axios, for_type, for_id) {
|
||||
console.log('Requesting files for '+for_type+' '+for_id);
|
||||
const url = '/event/file/'+for_type+'/'+for_id;
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.download_file_id = async function (axios, file_id, filename) {
|
||||
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // in render thread
|
||||
|
||||
console.log('1: download file id '+file_id);
|
||||
const url = '/event/file/'+file_id+'/download';
|
||||
|
||||
//const data = await axios.get(url, responseType: 'stream')
|
||||
const data = await axios({
|
||||
method: "get",
|
||||
url: url,
|
||||
responseType: "stream"
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log('2: downloaded file id '+file_id);
|
||||
console.log(response);
|
||||
//console.log(response.data);
|
||||
|
||||
let filename = 'default.txt';
|
||||
|
||||
if (typeof filename_override === 'undefined' || filename_override == null) {
|
||||
let headerLine = response.data.headers['content-disposition'];
|
||||
|
||||
console.log(headerLine);
|
||||
console.log(headerLine.indexOf('="'));
|
||||
console.log(headerLine.indexOf('='));
|
||||
if (headerLine.indexOf('="') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('="') + 2;
|
||||
let endFileNameIndex = headerLine.lastIndexOf('"');
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else if (headerLine.indexOf('=') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('=') + 1;
|
||||
let endFileNameIndex = headerLine.length;
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else {
|
||||
filename = 'filename_not_found_in_header.txt';
|
||||
}
|
||||
} else {
|
||||
filename = filename_override;
|
||||
}
|
||||
|
||||
let directory = 'file_cache/';
|
||||
|
||||
directory_and_filename = path.join(directory, filename);
|
||||
|
||||
//console.log(directory_and_filename);
|
||||
|
||||
if (fs.existsSync(directory_and_filename)) {
|
||||
console.log('3a: file already exists: '+directory_and_filename);
|
||||
} else {
|
||||
console.log('3b: saving file: '+directory_and_filename);
|
||||
response.data.pipe(fs.createWriteStream(directory_and_filename));
|
||||
}
|
||||
//data = response.data;
|
||||
console.log('4: saved file id '+file_id);
|
||||
return true;
|
||||
//return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
//return data;
|
||||
}
|
||||
|
||||
exports.launcher_cache_check = async function (launcher, api_base_url, api_temporary_token, file_cache_path) {
|
||||
if (typeof launcher.event_files === 'undefined') {
|
||||
console.log('Check for global event files.');
|
||||
let for_id = launcher.event_id;
|
||||
launcher.event_files = await api.get_files_for_type_for_id(axios, 'event', for_id);
|
||||
for (var i in launcher.event_files) {
|
||||
console.log('f: ('+launcher.event_files[i].event_file_id+') '+launcher.event_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.event_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.event_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for global event files');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.location_files === 'undefined') {
|
||||
console.log('Check for location specific files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.location_files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.location_files) {
|
||||
console.log('f: ('+launcher.location_files[i].event_file_id+') '+launcher.location_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.location_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.location_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location specific files.');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***')
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
|
||||
console.log('Location cache check finished.');
|
||||
return true;
|
||||
}
|
||||
|
||||
exports.launcher_render = async function (launcher) {
|
||||
console.log('Rendering launcher...');
|
||||
document.getElementById('location_title').innerHTML = '<h1>Launcher '+launcher.event_location_id+'@'+launcher.event_id+'</h1>';
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="">';
|
||||
for (var i in launcher.event_files) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.event_files[i].id+'" class="btn btn-info">'+launcher.event_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('location_files_menu').innerHTML = '<h2>Location Files</h2>';
|
||||
document.getElementById('location_files_menu').innerHTML += '<ul class="" role="">';
|
||||
for (var i in launcher.location_files) {
|
||||
document.getElementById('location_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.location_files[i].id+'" class="btn btn-info">'+launcher.location_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('location_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('sessions_menu').innerHTML = '<h2>Sessions</h2>';
|
||||
document.getElementById('sessions_menu').innerHTML += '<ul class="" role="">';
|
||||
//let sessions_detail = '';
|
||||
document.getElementById('sessions_detail').innerHTML = ''; // This needs to be reviewed.
|
||||
for (var i in launcher.sessions) {
|
||||
// List sessions in menu
|
||||
document.getElementById('sessions_menu').innerHTML += '<li id="menu_session_id_'+launcher.sessions[i].id+'" class="btn btn-info btn_view_session" data-session_id="'+launcher.sessions[i].id+'">'+launcher.sessions[i].name+'</li>';
|
||||
|
||||
// Create containers for each session
|
||||
let session_detail = '';
|
||||
session_detail += '<div id="detail_session_id_'+launcher.sessions[i].id+'" class="container d-none session_detail" data-session_id="'+launcher.sessions[i].id+'">';
|
||||
session_detail += '<h2 class="session_title">'+launcher.sessions[i].name+'</h2>';
|
||||
session_detail += '<div class="session_presentations"><ul>';
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
session_detail += '<li>'+launcher.sessions[i].presentations[j].name+'</li>';
|
||||
}
|
||||
session_detail += '</ul></div>';
|
||||
session_detail += '</div> <!-- End session detail for '+launcher.sessions[i].id+' -->';
|
||||
|
||||
document.getElementById('sessions_detail').innerHTML += session_detail;
|
||||
|
||||
//document.getElementById('sessions_menu').innerHTML += '</ul>';
|
||||
|
||||
}
|
||||
document.getElementById('sessions_menu').innerHTML += '</ul>';
|
||||
|
||||
index_sessions_detail('btn_view_session');
|
||||
|
||||
|
||||
//const btn_session_{{ event_presentation.id }}_name = document.querySelector('button#presentation_{{ event_presentation.id }}_name');
|
||||
//btn_presentation_{{ event_presentation.id }}_name.onclick = display_hide_poster_for_type_id.bind(this, true, 'presentation', {{ event_presentation.id }});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function index_sessions_detail(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail');
|
||||
console.log('*** Session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,614 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
exports.api_token_request_async = async function (axios, secret_key) {
|
||||
console.log('Requesting API temporary token...');
|
||||
const url = '/api_token_request';
|
||||
|
||||
let data = { secret_key: secret_key };
|
||||
|
||||
const response = await axios.post(url, data)
|
||||
.then(function (response) {
|
||||
//console.log(response);
|
||||
const api_temporary_token = response.data.temporary_token;
|
||||
//console.log('API Temporary Token: '+temporary_token);
|
||||
return api_temporary_token;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
return error;
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
exports.get_event_details = async function (axios, event_id) {
|
||||
console.log('Requesting event details...');
|
||||
const url = '/event/'+event_id;
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_event_location_details = async function (axios, event_id, event_location_id) {
|
||||
console.log('Requesting event location details...');
|
||||
const url = '/event/'+event_id+'/location/'+event_location_id;
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_event_location_sessions = async function (axios, event_id, event_location_id) {
|
||||
console.log('Requesting location sessions...');
|
||||
const url = '/event/'+event_id+'/location/'+event_location_id+'/session';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_session_presentations = async function (axios, event_id, event_session_id) {
|
||||
console.log('Requesting session presentations...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_presentation_presenters = async function (axios, event_id, event_session_id, event_presentation_id) {
|
||||
console.log('Requesting presentation presenters...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation/'+event_presentation_id+'/presenter';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_files_for_type_for_id = async function (axios, for_type, for_id) {
|
||||
console.log('Requesting files for '+for_type+' '+for_id);
|
||||
const url = '/event/file/'+for_type+'/'+for_id;
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.download_file_id = async function (axios, file_id, filename) {
|
||||
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // in render thread
|
||||
|
||||
console.log('1: download file id '+file_id);
|
||||
const url = '/event/file/'+file_id+'/download';
|
||||
|
||||
//const data = await axios.get(url, responseType: 'stream')
|
||||
const data = await axios({
|
||||
method: "get",
|
||||
url: url,
|
||||
responseType: "stream"
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log('2: downloaded file id '+file_id);
|
||||
console.log(response);
|
||||
//console.log(response.data);
|
||||
|
||||
let filename = 'default.txt';
|
||||
|
||||
if (typeof filename_override === 'undefined' || filename_override == null) {
|
||||
let headerLine = response.data.headers['content-disposition'];
|
||||
|
||||
console.log(headerLine);
|
||||
console.log(headerLine.indexOf('="'));
|
||||
console.log(headerLine.indexOf('='));
|
||||
if (headerLine.indexOf('="') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('="') + 2;
|
||||
let endFileNameIndex = headerLine.lastIndexOf('"');
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else if (headerLine.indexOf('=') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('=') + 1;
|
||||
let endFileNameIndex = headerLine.length;
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else {
|
||||
filename = 'filename_not_found_in_header.txt';
|
||||
}
|
||||
} else {
|
||||
filename = filename_override;
|
||||
}
|
||||
|
||||
let directory = 'file_cache/';
|
||||
|
||||
directory_and_filename = path.join(directory, filename);
|
||||
|
||||
//console.log(directory_and_filename);
|
||||
|
||||
if (fs.existsSync(directory_and_filename)) {
|
||||
console.log('3a: file already exists: '+directory_and_filename);
|
||||
} else {
|
||||
console.log('3b: saving file: '+directory_and_filename);
|
||||
response.data.pipe(fs.createWriteStream(directory_and_filename));
|
||||
}
|
||||
//data = response.data;
|
||||
console.log('4: saved file id '+file_id);
|
||||
return true;
|
||||
//return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
//return data;
|
||||
}
|
||||
|
||||
exports.launcher_cache_check = async function (launcher, api_base_url, api_temporary_token, file_cache_path) {
|
||||
|
||||
if (typeof launcher.event === 'undefined') {
|
||||
launcher.event = await api.get_event_details(axios, launcher.event_id);
|
||||
console.log(launcher.event.id);
|
||||
idbKeyval.set(launcher.event.id, launcher.event, db_event);
|
||||
/*
|
||||
.then(function (data) {
|
||||
console.log(data.id);
|
||||
idbKeyval.set(data.id, data, db_event);
|
||||
//for (var i in response) {
|
||||
//var event_record = data[i];
|
||||
//idbKeyval.set(response[i].id, response[i], db_event);
|
||||
//}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
if (typeof launcher.location === 'undefined') {
|
||||
launcher.location = await api.get_event_location_details(axios, launcher.event_id, launcher.event_location_id);
|
||||
}
|
||||
|
||||
if (typeof launcher.event_files === 'undefined') {
|
||||
console.log('Check for global event files.');
|
||||
let for_id = launcher.event_id;
|
||||
launcher.event_files = await api.get_files_for_type_for_id(axios, 'event', for_id);
|
||||
for (var i in launcher.event_files) {
|
||||
console.log('f: ('+launcher.event_files[i].event_file_id+') '+launcher.event_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.event_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.event_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for global event files');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.location_files === 'undefined') {
|
||||
console.log('Check for location specific files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.location_files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.location_files) {
|
||||
console.log('f: ('+launcher.location_files[i].event_file_id+') '+launcher.location_files[i].event_file_filename+' ***')
|
||||
file_id = launcher.location_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.location_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location specific files.');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***')
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
|
||||
console.log('Location cache check finished.');
|
||||
return true;
|
||||
}
|
||||
|
||||
exports.launcher_render = async function (launcher) {
|
||||
console.log('Rendering launcher...');
|
||||
document.getElementById('location_title').innerHTML = '<h1>Launcher '+launcher.location.name+'@'+launcher.event.name+'</h1>';
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="">';
|
||||
for (var i in launcher.event_files) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.event_files[i].id+'" class="btn btn-info btn_no_case open_local_file" data-hash_sha256="'+launcher.event_files[i].hash_sha256+'.file" data-filename="'+launcher.event_files[i].event_file_filename+'">'+launcher.event_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('location_files_menu').innerHTML = '<h2>Location Files</h2>';
|
||||
document.getElementById('location_files_menu').innerHTML += '<ul class="" role="">';
|
||||
for (var i in launcher.location_files) {
|
||||
document.getElementById('location_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.location_files[i].id+'" class="btn btn-info open_local_file" data-hash_sha256="'+launcher.location_files[i].hash_sha256+'.file" data-filename="'+launcher.location_files[i].event_file_filename+'">'+launcher.location_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('location_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('sessions_menu').innerHTML = '<h2>Sessions</h2>';
|
||||
document.getElementById('sessions_menu').innerHTML += '<ul class="" role="">';
|
||||
//let location_detail = '';
|
||||
if (document.getElementById('location_detail').innerHTML.length) {
|
||||
console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
console.log('location_detail already populated');
|
||||
document.getElementById('location_detail').innerHTML = ''; // This needs to be reviewed.
|
||||
}
|
||||
for (var i in launcher.sessions) {
|
||||
// List sessions in menu
|
||||
document.getElementById('sessions_menu').innerHTML += '<li id="menu_session_id_'+launcher.sessions[i].id+'" class="btn btn-info btn_view_session" data-session_id="'+launcher.sessions[i].id+'">'+launcher.sessions[i].name+'</li>';
|
||||
|
||||
// Create containers for each session
|
||||
let session_detail = '';
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
//console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
//console.log('Adding detail_session_id_xx');
|
||||
session_detail += '<div id="detail_session_id_'+launcher.sessions[i].id+'" class="container d-none session_detail" data-session_id="'+launcher.sessions[i].id+'">';
|
||||
}
|
||||
|
||||
|
||||
|
||||
var session_startdatetime = new Date(launcher.sessions[i].start_datetime);
|
||||
|
||||
session_detail += '<h2 class="session_title">'+launcher.sessions[i].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'ddd h:mm A')+'</span>'+'</h2>';
|
||||
|
||||
|
||||
//session_detail += '<div class="">'; // for card-group
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">Session Files:</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
//console.log(launcher.sessions[i].files[j].event_file_filename);
|
||||
session_detail += '<li class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].files[j].hash_sha256+'.file" data-filename="'+launcher.sessions[i].files[j].event_file_filename+'">'+launcher.sessions[i].files[j].event_file_filename+'</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for session files card -->'; // for session files card
|
||||
|
||||
|
||||
//session_detail += '<div class="session_presentations">';
|
||||
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
//session_detail += '<li>'+launcher.sessions[i].presentations[j].name;
|
||||
|
||||
var session_presentation_startdatetime = new Date(launcher.sessions[i].presentations[j].start_datetime);
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">'+launcher.sessions[i].presentations[j].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'h:mm a')+'</span>'+':</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].files[k].event_file_filename);
|
||||
session_detail += '<li class="list-group-item btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'">'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].given_name);
|
||||
session_detail += '<li>'+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name;
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename);
|
||||
//session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename;
|
||||
session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">';
|
||||
session_detail += '<button class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'</button>';
|
||||
|
||||
var event_file_size = launcher.sessions[i].presentations[j].presenters[k].files[l].size;
|
||||
var event_file_created_on = new Date(launcher.sessions[i].presentations[j].presenters[k].files[l].created_on);
|
||||
|
||||
session_detail += '<span class="badge badge-pill badge-light float-right">'+format_bytes(event_file_size, 2)+'; '+dateFns.format(event_file_created_on, 'MMM M h:mm A')+'; '+launcher.sessions[i].presentations[j].presenters[k].files[l].internal_os+'</span>';
|
||||
|
||||
|
||||
session_detail += '</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail +='</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '</ul>';
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for card -->'; // for card
|
||||
|
||||
}
|
||||
//session_detail += '</div> <!-- for session_presentations -->'; // for session_presentations
|
||||
|
||||
//session_detail += '</div>'; // for card-group
|
||||
session_detail += '</div> <!-- End session detail for '+launcher.sessions[i].id+' -->';
|
||||
|
||||
|
||||
//document.getElementById('location_detail').innerHTML += session_detail;
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
document.getElementById('detail_session_id_'+launcher.sessions[i].id).innerHTML = session_detail;
|
||||
} else {
|
||||
document.getElementById('location_detail').innerHTML += session_detail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
document.getElementById('sessions_menu').innerHTML += '</ul>';
|
||||
|
||||
index_location_detail('btn_view_session');
|
||||
|
||||
index_open_file_buttons('open_local_file');
|
||||
|
||||
|
||||
//const btn_session_{{ event_presentation.id }}_name = document.querySelector('button#presentation_{{ event_presentation.id }}_name');
|
||||
//btn_presentation_{{ event_presentation.id }}_name.onclick = display_hide_poster_for_type_id.bind(this, true, 'presentation', {{ event_presentation.id }});
|
||||
console.log('Rendering launcher finished.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function index_location_detail(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail');
|
||||
console.log('*** Session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2019-12-20 */
|
||||
function index_open_file_buttons(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
//class_elements[i].addEventListener( 'click', function() {open_local_file( this.getAttribute('data-filename')) } );
|
||||
|
||||
//let directory = 'file_cache/';
|
||||
|
||||
//directory_and_filename = path.join(directory, class_elements[i].getAttribute('data-filename'));
|
||||
|
||||
let file_path = path.join(file_cache_path, class_elements[i].getAttribute('data-hash_sha256'));
|
||||
let filename = class_elements[i].getAttribute('data-filename');
|
||||
|
||||
class_elements[i].addEventListener( 'click', function() { ipcRenderer.send('open_local_file', file_path, filename) } );
|
||||
//ipcRenderer.send('open_local_file', this.getAttribute('data-filename')); // in render thread
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -1,300 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
exports.api_token_request_async = async function (axios, secret_key) {
|
||||
console.log('Requesting API temporary token...');
|
||||
const url = '/api_token_request';
|
||||
|
||||
let data = { secret_key: secret_key };
|
||||
|
||||
const response = await axios.post(url, data)
|
||||
.then(function (response) {
|
||||
//console.log(response);
|
||||
const api_temporary_token = response.data.temporary_token;
|
||||
//console.log('API Temporary Token: '+temporary_token);
|
||||
return api_temporary_token;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
return error;
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
exports.get_event_location_sessions = async function (axios, event_id, event_location_id) {
|
||||
console.log('Requesting location sessions...');
|
||||
const url = '/event/'+event_id+'/location/'+event_location_id+'/session';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_session_presentations = async function (axios, event_id, event_session_id) {
|
||||
console.log('Requesting session presentations...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_presentation_presenters = async function (axios, event_id, event_session_id, event_presentation_id) {
|
||||
console.log('Requesting presentation presenters...');
|
||||
const url = '/event/'+event_id+'/session/'+event_session_id+'/presentation/'+event_presentation_id+'/presenter';
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.get_files_for_type_for_id = async function (axios, for_type, for_id) {
|
||||
console.log('Requesting files...');
|
||||
const url = '/event/file/'+for_type+'/'+for_id;
|
||||
|
||||
const data = await axios.get(url)
|
||||
.then(function (response) {
|
||||
//console.log(response.data);
|
||||
//data = response.data;
|
||||
return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
exports.download_file_id = async function (axios, file_id, filename) {
|
||||
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // in render thread
|
||||
|
||||
console.log('1: download file id '+file_id);
|
||||
const url = '/event/file/'+file_id+'/download';
|
||||
|
||||
//const data = await axios.get(url, responseType: 'stream')
|
||||
const data = await axios({
|
||||
method: "get",
|
||||
url: url,
|
||||
responseType: "stream"
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log('2: downloaded file id '+file_id);
|
||||
console.log(response);
|
||||
//console.log(response.data);
|
||||
|
||||
let filename = 'default.txt';
|
||||
|
||||
if (typeof filename_override === 'undefined' || filename_override == null) {
|
||||
let headerLine = response.data.headers['content-disposition'];
|
||||
|
||||
console.log(headerLine);
|
||||
console.log(headerLine.indexOf('="'));
|
||||
console.log(headerLine.indexOf('='));
|
||||
if (headerLine.indexOf('="') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('="') + 2;
|
||||
let endFileNameIndex = headerLine.lastIndexOf('"');
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else if (headerLine.indexOf('=') != -1) {
|
||||
let startFileNameIndex = headerLine.indexOf('=') + 1;
|
||||
let endFileNameIndex = headerLine.length;
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
} else {
|
||||
filename = 'filename_not_found_in_header.txt';
|
||||
}
|
||||
} else {
|
||||
filename = filename_override;
|
||||
}
|
||||
|
||||
let directory = 'file_cache/';
|
||||
|
||||
directory_and_filename = path.join(directory, filename);
|
||||
|
||||
//console.log(directory_and_filename);
|
||||
|
||||
if (fs.existsSync(directory_and_filename)) {
|
||||
console.log('3a: file already exists: '+directory_and_filename);
|
||||
} else {
|
||||
console.log('3b: saving file: '+directory_and_filename);
|
||||
response.data.pipe(fs.createWriteStream(directory_and_filename));
|
||||
}
|
||||
//data = response.data;
|
||||
console.log('4: saved file id '+file_id);
|
||||
return true;
|
||||
//return response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
});
|
||||
|
||||
//return data;
|
||||
}
|
||||
|
||||
exports.launcher_cache = async function (launcher, api_base_url, api_endpoint, api_temporary_token, file_cache_path) {
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.files) {
|
||||
console.log('f: ('+launcher.files[i].event_file_id+') '+launcher.files[i].event_file_filename+' ***')
|
||||
file_id = launcher.files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(file_cache_path, filename);
|
||||
|
||||
//console.log(directory_and_filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
const api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
//response.data.pipe(fs.createWriteStream(directory_and_filename));
|
||||
}
|
||||
//let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location files.');
|
||||
}
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***')
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
hash_sha256 = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
let results = await api.download_file_id(axios, file_id, hash_sha256);
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
/*
|
||||
if (launcher.sessions) {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('f: ('+launcher.sessions[i].event_file_id+') '+launcher.files[i].event_file_filename+' ***')
|
||||
file_id = launcher.files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let results = await api.download_file_id(axios, file_id);
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location files.');
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,271 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
|
||||
exports.launcher_cache_check = async function (launcher, api_base_url, api_temporary_token, host_file_cache_path) {
|
||||
if (typeof launcher.event === 'undefined') {
|
||||
launcher.event = await api.get_event_details(axios, launcher.event_id);
|
||||
tbl_event.setItem(launcher.event.id.toString(), launcher.event);
|
||||
/*
|
||||
.then(function (data) {
|
||||
console.log(data.id);
|
||||
idbKeyval.set(data.id, data, tbl_event);
|
||||
//for (var i in response) {
|
||||
//var event_record = data[i];
|
||||
//idbKeyval.set(response[i].id, response[i], tbl_event);
|
||||
//}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
if (typeof launcher.location === 'undefined') {
|
||||
launcher.location = await api.get_event_location_details(axios, launcher.event_id, launcher.event_location_id);
|
||||
tbl_event_location.setItem(launcher.location.id.toString(), launcher.location);
|
||||
}
|
||||
|
||||
if (typeof launcher.event_files === 'undefined') {
|
||||
console.log('Check for global event files.');
|
||||
let for_id = launcher.event_id;
|
||||
launcher.event_files = await api.get_files_for_type_for_id(axios, 'event', for_id);
|
||||
for (var i in launcher.event_files) {
|
||||
console.log('f: ('+launcher.event_files[i].event_file_id+') '+launcher.event_files[i].event_file_filename+' ***')
|
||||
tbl_event_file.setItem(launcher.event_files[i].event_file_id.toString(), launcher.event_files[i]);
|
||||
|
||||
file_id = launcher.event_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.event_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for global event files');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.location_files === 'undefined') {
|
||||
console.log('Check for location specific files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.location_files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.location_files) {
|
||||
console.log('f: ('+launcher.location_files[i].event_file_id+') '+launcher.location_files[i].event_file_filename+' ***')
|
||||
tbl_event_file.setItem(launcher.location_files[i].event_file_id.toString(), launcher.location_files[i]);
|
||||
|
||||
file_id = launcher.location_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.location_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location specific files.');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
tbl_event_session.setItem(launcher.sessions[i].id.toString(), launcher.sessions[i]);
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].files[j].event_file_id.toString(), launcher.sessions[i].files[j]);
|
||||
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
tbl_event_presentation.setItem(launcher.sessions[i].presentations[j].id.toString(), launcher.sessions[i].presentations[j]);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].presentations[j].files[k].event_file_id.toString(), launcher.sessions[i].presentations[j].files[k]);
|
||||
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
tbl_event_presenter.setItem(launcher.sessions[i].presentations[j].presenters[k].id.toString(), launcher.sessions[i].presentations[j].presenters[k]);
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id.toString(), launcher.sessions[i].presentations[j].presenters[k].files[l]);
|
||||
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
|
||||
console.log('Location cache check finished.');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function index_location_detail(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail');
|
||||
console.log('*** Session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2019-12-20 */
|
||||
function index_open_file_buttons(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
//class_elements[i].addEventListener( 'click', function() {open_local_file( this.getAttribute('data-filename')) } );
|
||||
|
||||
//let directory = 'file_cache/';
|
||||
|
||||
//directory_and_filename = path.join(directory, class_elements[i].getAttribute('data-filename'));
|
||||
|
||||
let file_path = path.join(host_file_cache_path, class_elements[i].getAttribute('data-hash_sha256'));
|
||||
let filename = class_elements[i].getAttribute('data-filename');
|
||||
|
||||
class_elements[i].addEventListener( 'click', function() { ipcRenderer.send('open_local_file', file_path, filename) } );
|
||||
//ipcRenderer.send('open_local_file', this.getAttribute('data-filename')); // in render thread
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,368 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
|
||||
exports.launcher_cache_check = async function (launcher, api_base_url, api_temporary_token, host_file_cache_path) {
|
||||
if (typeof launcher.event === 'undefined') {
|
||||
launcher.event = await api.get_event_details(axios, launcher.event_id);
|
||||
tbl_event.setItem(launcher.event.id.toString(), launcher.event);
|
||||
/*
|
||||
.then(function (data) {
|
||||
console.log(data.id);
|
||||
idbKeyval.set(data.id, data, tbl_event);
|
||||
//for (var i in response) {
|
||||
//var event_record = data[i];
|
||||
//idbKeyval.set(response[i].id, response[i], tbl_event);
|
||||
//}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
if (typeof launcher.location === 'undefined') {
|
||||
launcher.location = await api.get_event_location_details(axios, launcher.event_id, launcher.event_location_id);
|
||||
tbl_event_location.setItem(launcher.location.id.toString(), launcher.location);
|
||||
}
|
||||
|
||||
if (typeof launcher.event_files === 'undefined') {
|
||||
console.log('Check for global event files.');
|
||||
let for_id = launcher.event_id;
|
||||
launcher.event_files = await api.get_files_for_type_for_id(axios, 'event', for_id);
|
||||
for (var i in launcher.event_files) {
|
||||
console.log('f: ('+launcher.event_files[i].event_file_id+') '+launcher.event_files[i].event_file_filename+' ***')
|
||||
tbl_event_file.setItem(launcher.event_files[i].event_file_id.toString(), launcher.event_files[i]);
|
||||
|
||||
file_id = launcher.event_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.event_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for global event files');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.location_files === 'undefined') {
|
||||
console.log('Check for location specific files.');
|
||||
let for_id = launcher.event_location_id;
|
||||
launcher.location_files = await api.get_files_for_type_for_id(axios, 'location', for_id);
|
||||
for (var i in launcher.location_files) {
|
||||
console.log('f: ('+launcher.location_files[i].event_file_id+') '+launcher.location_files[i].event_file_filename+' ***')
|
||||
tbl_event_file.setItem(launcher.location_files[i].event_file_id.toString(), launcher.location_files[i]);
|
||||
|
||||
file_id = launcher.location_files[i].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.location_files[i].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location specific files.');
|
||||
}
|
||||
|
||||
|
||||
if (typeof launcher.sessions === 'undefined') {
|
||||
console.log('Check for location sessions.');
|
||||
launcher.sessions = await api.get_event_location_sessions(axios, launcher.event_id, launcher.event_location_id);
|
||||
for (var i in launcher.sessions) {
|
||||
console.log('*** '+launcher.sessions[i].name+' ***')
|
||||
tbl_event_session.setItem(launcher.sessions[i].id.toString(), launcher.sessions[i]);
|
||||
|
||||
// Check for session files start
|
||||
if (typeof launcher.sessions[i].files === 'undefined') {
|
||||
console.log('Check for session files.');
|
||||
let for_id = launcher.sessions[i].id;
|
||||
launcher.sessions[i].files = await api.get_files_for_type_for_id(axios, 'session', for_id);
|
||||
if (launcher.sessions[i].files) {
|
||||
console.log('Session files found.');
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
console.log('f: ('+launcher.sessions[i].files[j].event_file_id+') '+launcher.sessions[i].files[j].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].files[j].event_file_id.toString(), launcher.sessions[i].files[j]);
|
||||
|
||||
file_id = launcher.sessions[i].files[j].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].files[j].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No session files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for session files.');
|
||||
}
|
||||
// Check for session files end
|
||||
|
||||
// Get session presentations and associated files
|
||||
launcher.sessions[i].presentations = await api.get_session_presentations(axios, launcher.event_id, launcher.sessions[i].id);
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
console.log('* '+launcher.sessions[i].presentations[j].name);
|
||||
tbl_event_presentation.setItem(launcher.sessions[i].presentations[j].id.toString(), launcher.sessions[i].presentations[j]);
|
||||
|
||||
// Check for presentation files start
|
||||
if (typeof launcher.sessions[i].presentations[j].files === 'undefined') {
|
||||
console.log('Check for presentation files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].files = await api.get_files_for_type_for_id(axios, 'presentation', for_id);
|
||||
if (launcher.sessions[i].presentations[j].files) {
|
||||
console.log('Presentation files found.');
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].files[k].event_file_id+') '+launcher.sessions[i].presentations[j].files[k].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].presentations[j].files[k].event_file_id.toString(), launcher.sessions[i].presentations[j].files[k]);
|
||||
|
||||
file_id = launcher.sessions[i].presentations[j].files[k].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presentation files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presentation files.');
|
||||
}
|
||||
// Check for presentation files end
|
||||
|
||||
|
||||
// Get session presentations presenters and associated files
|
||||
//let event_presentation_id = launcher.sessions[i].presentations[j].id;
|
||||
launcher.sessions[i].presentations[j].presenters = await api.get_presentation_presenters(axios, launcher.event_id, launcher.sessions[i].id, launcher.sessions[i].presentations[j].id);
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
console.log('-- '+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name)
|
||||
tbl_event_presenter.setItem(launcher.sessions[i].presentations[j].presenters[k].id.toString(), launcher.sessions[i].presentations[j].presenters[k]);
|
||||
|
||||
// Check for presenter files start
|
||||
if (typeof launcher.sessions[i].presentations[j].presenters[k].files === 'undefined') {
|
||||
console.log('Check for presenter files.');
|
||||
let for_id = launcher.sessions[i].presentations[j].presenters[k].id;
|
||||
launcher.sessions[i].presentations[j].presenters[k].files = await api.get_files_for_type_for_id(axios, 'presenter', for_id);
|
||||
if (launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('Presenter files found.');
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
console.log('f: ('+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id+') '+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+' ***');
|
||||
tbl_event_file.setItem(launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id.toString(), launcher.sessions[i].presentations[j].presenters[k].files[l]);
|
||||
|
||||
file_id = launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No presenter files found.');
|
||||
}
|
||||
} else {
|
||||
console.log('No check for presenter files.');
|
||||
}
|
||||
// Check for presenter files end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('No check for location sessions.');
|
||||
}
|
||||
|
||||
console.log('Location cache check finished.');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
exports.idb_to_launcher = async function idb_to_launcher() {
|
||||
//tbl_example.iterate(tbl_check, tbl_check_success, tbl_check_error); //tbl_check(value, key, iteration)
|
||||
//let launcher = new Object();
|
||||
|
||||
// Look for *events*
|
||||
let tmp_event = [];
|
||||
tbl_event.iterate(function(event_value, key, iteration) {
|
||||
tmp_event.push(event_value);
|
||||
});
|
||||
launcher.event = tmp_event;
|
||||
|
||||
// Look for *event files*
|
||||
let tmp_event_file = []
|
||||
tbl_event_file.iterate(function(file_value, key, iteration) {
|
||||
//console.log('event id: '+launcher.event[0].id+' -> file_id: '+file_value.id+'for type: '+file_value.for_type+' for id: '+file_value.id);
|
||||
if (file_value.for_type == 'event' && launcher.event[0].id == file_value.for_id) {
|
||||
tmp_event_file.push(file_value);
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_launcher: Iterate tbl_event_file complete')
|
||||
});
|
||||
launcher.event_file = tmp_event_file;
|
||||
|
||||
|
||||
// Look for *locations*
|
||||
let tmp_event_location = []
|
||||
tbl_event_location.iterate(function(location_value, key, iteration) {
|
||||
tmp_event_location.push(location_value);
|
||||
});
|
||||
launcher.location = tmp_event_location;
|
||||
|
||||
// Look for *event location files*
|
||||
let tmp_event_location_file = []
|
||||
tbl_event_file.iterate(function(file_value, key, iteration) {
|
||||
if (file_value.for_type == 'location' && launcher.location[0].id == file_value.for_id) {
|
||||
tmp_event_location_file.push(file_value);
|
||||
}
|
||||
});
|
||||
launcher.location_file = tmp_event_location_file;
|
||||
|
||||
|
||||
// Look for *sessions*
|
||||
let tmp_event_session = []
|
||||
tbl_event_session.iterate(function(session_value, session_key, session_iteration) {
|
||||
//console.log('session id: '+session_value.id);
|
||||
|
||||
|
||||
// Look for *session files*
|
||||
session_value.file = [];
|
||||
tbl_event_file.iterate(function(session_file_value, session_file_key, session_file_iteration) {
|
||||
if (session_file_value.for_type == 'session' && session_value.id == session_file_value.for_id) {
|
||||
//console.log('session id: '+session_value.id+' -> file id: '+session_file_value.id);
|
||||
session_value.file.push(session_file_value)
|
||||
//tmp_event_session_file.push(session_file_value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Look for *presentations per session*
|
||||
session_value.presentation = [];
|
||||
tbl_event_presentation.iterate(function(presentation_value, presentation_key, presentation_iteration) {
|
||||
if (session_value.id == presentation_value.event_session_id) {
|
||||
//console.log('session id: '+session_value.id+' -> presentation id: '+presentation_value.id);
|
||||
|
||||
|
||||
// Look for *presentation files*
|
||||
presentation_value.file = [];
|
||||
tbl_event_file.iterate(function(presentation_file_value, presentation_file_key, presentation_file_iteration) {
|
||||
if (presentation_file_value.for_type == 'presentation' && presentation_value.id == presentation_file_value.for_id) {
|
||||
presentation_value.file.push(presentation_file_value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Look for *presenters per presentation*
|
||||
presentation_value.presenter = [];
|
||||
tbl_event_presenter.iterate(function(presenter_value, presenter_key, presenter_iteration) {
|
||||
if (presentation_value.id == presenter_value.event_presentation_id) {
|
||||
//console.log('presentation id: '+presentation_value.id+' -> presenter id: '+presenter_value.id);
|
||||
|
||||
// Look for *presenter files*
|
||||
presenter_value.file = [];
|
||||
tbl_event_file.iterate(function(presenter_file_value, presenter_file_key, presenter_file_iteration) {
|
||||
if (presenter_file_value.for_type == 'presenter' && presenter_value.id == presenter_file_value.for_id) {
|
||||
presenter_value.file.push(presenter_file_value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//NOTE for some reason this is adding duplicate presenters to a session
|
||||
//NOTE is this iterating twice or something???
|
||||
/*
|
||||
tbl_event_file.iterate(function(presenter_file_value, key, iteration) {
|
||||
|
||||
});
|
||||
*/
|
||||
presentation_value.presenter.push(presenter_value);
|
||||
}
|
||||
});
|
||||
|
||||
//NOTE add in presenters and then presenter's files
|
||||
|
||||
|
||||
session_value.presentation.push(presentation_value);
|
||||
}//);
|
||||
|
||||
});
|
||||
//});
|
||||
|
||||
tmp_event_session.push(session_value);
|
||||
|
||||
}).then(function() {
|
||||
console.log('idb_to_launcher: Iterate tbl_event_session complete')
|
||||
});
|
||||
launcher.session = tmp_event_session;
|
||||
|
||||
/*
|
||||
console.log('v2 idb to launcher object: ***');
|
||||
console.log(launcher);
|
||||
console.log('v2 idb to launcher object: ^^^');
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
exports.check_file_cache = async function () {
|
||||
console.log('Checking the local file cache against the remote server.');
|
||||
tbl_event_file.iterate(function(file_value, key, iteration) {
|
||||
if (file_value.event_location_id == event_location_id) {
|
||||
console.log('f: ('+file_value.event_file_id+') '+file_value.event_file_filename+' ***')
|
||||
|
||||
file_id = file_value.event_file_id; // NOTE: the .id is the hosted_file.id!
|
||||
let filename = file_value.hash_sha256+'.file';
|
||||
|
||||
save_path = path.join(host_file_cache_path, filename);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
let api_endpoint = '/event/file/'+file_id+'/download';
|
||||
ipcRenderer.send('download_file', api_base_url, api_endpoint, api_temporary_token, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function tbl_check(value, key, iteration) {
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
function tbl_check_success(result) {
|
||||
console.log(result);
|
||||
}
|
||||
function tbl_check_error(result) {
|
||||
console.log(result);
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
|
||||
exports.launcher_render = async function (launcher) {
|
||||
console.log('Rendering launcher...');
|
||||
document.getElementById('location_title').innerHTML = '<h1>Launcher '+launcher.location.name+'@'+launcher.event.name+'</h1>';
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="">';
|
||||
for (var i in launcher.event_files) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.event_files[i].id+'" class="btn btn-info btn_no_case open_local_file" data-hash_sha256="'+launcher.event_files[i].hash_sha256+'.file" data-filename="'+launcher.event_files[i].event_file_filename+'">'+launcher.event_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('location_files_menu').innerHTML = '<h2>Location Files</h2>';
|
||||
document.getElementById('location_files_menu').innerHTML += '<ul class="" role="">';
|
||||
for (var i in launcher.location_files) {
|
||||
document.getElementById('location_files_menu').innerHTML += '<li id="menu_event_file_id_'+launcher.location_files[i].id+'" class="btn btn-info open_local_file" data-hash_sha256="'+launcher.location_files[i].hash_sha256+'.file" data-filename="'+launcher.location_files[i].event_file_filename+'">'+launcher.location_files[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('location_files_menu').innerHTML += '</ul>';
|
||||
|
||||
document.getElementById('sessions_menu').innerHTML = '<h2>Sessions</h2>';
|
||||
document.getElementById('sessions_menu').innerHTML += '<ul class="" role="">';
|
||||
//let location_detail = '';
|
||||
if (document.getElementById('location_detail').innerHTML.length) {
|
||||
console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
console.log('location_detail already populated');
|
||||
document.getElementById('location_detail').innerHTML = ''; // This needs to be reviewed.
|
||||
}
|
||||
for (var i in launcher.sessions) {
|
||||
// List sessions in menu
|
||||
document.getElementById('sessions_menu').innerHTML += '<li id="menu_session_id_'+launcher.sessions[i].id+'" class="btn btn-info btn_view_session" data-session_id="'+launcher.sessions[i].id+'">'+launcher.sessions[i].name+'</li>';
|
||||
|
||||
// Create containers for each session
|
||||
let session_detail = '';
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
//console.log('detail_session_id_xx already exists');
|
||||
} else {
|
||||
//console.log('Adding detail_session_id_xx');
|
||||
session_detail += '<div id="detail_session_id_'+launcher.sessions[i].id+'" class="container d-none session_detail" data-session_id="'+launcher.sessions[i].id+'">';
|
||||
}
|
||||
|
||||
|
||||
|
||||
var session_startdatetime = new Date(launcher.sessions[i].start_datetime);
|
||||
|
||||
session_detail += '<h2 class="session_title">'+launcher.sessions[i].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'ddd h:mm A')+'</span>'+'</h2>';
|
||||
|
||||
|
||||
//session_detail += '<div class="">'; // for card-group
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">Session Files:</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var j in launcher.sessions[i].files) {
|
||||
//console.log(launcher.sessions[i].files[j].event_file_filename);
|
||||
session_detail += '<li class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].files[j].hash_sha256+'.file" data-filename="'+launcher.sessions[i].files[j].event_file_filename+'">'+launcher.sessions[i].files[j].event_file_filename+'</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for session files card -->'; // for session files card
|
||||
|
||||
|
||||
//session_detail += '<div class="session_presentations">';
|
||||
|
||||
for (var j in launcher.sessions[i].presentations) {
|
||||
//session_detail += '<li>'+launcher.sessions[i].presentations[j].name;
|
||||
|
||||
var session_presentation_startdatetime = new Date(launcher.sessions[i].presentations[j].start_datetime);
|
||||
|
||||
session_detail += '<div class="card">';
|
||||
session_detail += '<div class="card-header">'+launcher.sessions[i].presentations[j].name+'<span class="badge badge-pill badge-info float-right">'+dateFns.format(session_startdatetime, 'h:mm a')+'</span>'+':</div>';
|
||||
session_detail += '<div class="card-body">';
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var k in launcher.sessions[i].presentations[j].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].files[k].event_file_filename);
|
||||
session_detail += '<li class="list-group-item data-hash_sha256="'+launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'">';
|
||||
|
||||
session_detail += '<button class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].files[k].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'">'+launcher.sessions[i].presentations[j].files[k].event_file_filename+'</button>';
|
||||
|
||||
var event_file_size = launcher.sessions[i].presentations[j].files[k].size;
|
||||
var event_file_created_on = new Date(launcher.sessions[i].presentations[j].files[k].created_on);
|
||||
|
||||
session_detail += '<span class="badge badge-pill badge-light float-right">'+format_bytes(event_file_size, 2)+'; '+dateFns.format(event_file_created_on, 'MMM M h:mm A')+'; '+launcher.sessions[i].presentations[j].files[k].internal_os+'</span>';
|
||||
|
||||
session_detail += '</li>';
|
||||
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '<ul>';
|
||||
for (var k in launcher.sessions[i].presentations[j].presenters) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].given_name);
|
||||
session_detail += '<li>'+launcher.sessions[i].presentations[j].presenters[k].given_name+' '+launcher.sessions[i].presentations[j].presenters[k].family_name;
|
||||
|
||||
session_detail += '<ul class="list-group">';
|
||||
for (var l in launcher.sessions[i].presentations[j].presenters[k].files) {
|
||||
//console.log(launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename);
|
||||
//session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename;
|
||||
session_detail += '<li class="list-group-item" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">';
|
||||
session_detail += '<button class="btn btn-info open_local_file" data-hash_sha256="'+launcher.sessions[i].presentations[j].presenters[k].files[l].hash_sha256+'.file" data-filename="'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'">'+launcher.sessions[i].presentations[j].presenters[k].files[l].event_file_filename+'</button>';
|
||||
|
||||
var event_file_size = launcher.sessions[i].presentations[j].presenters[k].files[l].size;
|
||||
var event_file_created_on = new Date(launcher.sessions[i].presentations[j].presenters[k].files[l].created_on);
|
||||
|
||||
session_detail += '<span class="badge badge-pill badge-light float-right">'+format_bytes(event_file_size, 2)+'; '+dateFns.format(event_file_created_on, 'MMM M h:mm A')+'; '+launcher.sessions[i].presentations[j].presenters[k].files[l].internal_os+'</span>';
|
||||
|
||||
|
||||
session_detail += '</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
session_detail +='</li>';
|
||||
}
|
||||
session_detail += '</ul>';
|
||||
|
||||
|
||||
session_detail += '</ul>';
|
||||
session_detail += '</div>'; // for card-body
|
||||
session_detail += '</div> <!-- for card -->'; // for card
|
||||
|
||||
}
|
||||
//session_detail += '</div> <!-- for session_presentations -->'; // for session_presentations
|
||||
|
||||
//session_detail += '</div>'; // for card-group
|
||||
session_detail += '</div> <!-- End session detail for '+launcher.sessions[i].id+' -->';
|
||||
|
||||
|
||||
//document.getElementById('location_detail').innerHTML += session_detail;
|
||||
|
||||
if (typeof(document.getElementById('detail_session_id_'+launcher.sessions[i].id)) != 'undefined' && document.getElementById('detail_session_id_'+launcher.sessions[i].id) != null) {
|
||||
document.getElementById('detail_session_id_'+launcher.sessions[i].id).innerHTML = session_detail;
|
||||
} else {
|
||||
document.getElementById('location_detail').innerHTML += session_detail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
document.getElementById('sessions_menu').innerHTML += '</ul>';
|
||||
|
||||
index_location_detail('btn_view_session');
|
||||
|
||||
index_open_file_buttons('open_local_file');
|
||||
|
||||
|
||||
//const btn_session_{{ event_presentation.id }}_name = document.querySelector('button#presentation_{{ event_presentation.id }}_name');
|
||||
//btn_presentation_{{ event_presentation.id }}_name.onclick = display_hide_poster_for_type_id.bind(this, true, 'presentation', {{ event_presentation.id }});
|
||||
console.log('Rendering launcher finished.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function index_location_detail(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2019-12-19 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail');
|
||||
console.log('*** Session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2019-12-20 */
|
||||
function index_open_file_buttons(class_name) {
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
//class_elements[i].addEventListener( 'click', function() {open_local_file( this.getAttribute('data-filename')) } );
|
||||
|
||||
//let directory = 'file_cache/';
|
||||
|
||||
//directory_and_filename = path.join(directory, class_elements[i].getAttribute('data-filename'));
|
||||
|
||||
let file_path = path.join(host_file_cache_path, class_elements[i].getAttribute('data-hash_sha256'));
|
||||
let filename = class_elements[i].getAttribute('data-filename');
|
||||
|
||||
class_elements[i].addEventListener( 'click', function() { ipcRenderer.send('open_local_file', file_path, filename) } );
|
||||
//ipcRenderer.send('open_local_file', this.getAttribute('data-filename')); // in render thread
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -1,436 +0,0 @@
|
||||
|
||||
exports.render_event_records = function () {
|
||||
console.log('Rendering event records...');
|
||||
//console.log(tbl_event);
|
||||
//console.log(event_id);
|
||||
|
||||
tbl_event.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('*** Event id ('+event_id+') found in table.');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('Event not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// NOTE: The event_file table should probably only be looped through once when the table is actually updated.
|
||||
// NOTE: Not each time the other objects (event, location, session, presentation, presenter) are updated.
|
||||
exports.render_event_file_records = function (event_files, event_id) {
|
||||
console.log('Rendering event file records...');
|
||||
|
||||
/*
|
||||
tbl_event_file.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('*** Event id ('+event_id+') found in table.');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('Event not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="list-group list-group-flush">';
|
||||
for (var i in launcher_tmp.event_file) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_'+launcher_tmp.event_file[i].event_file_id+'" class="list-group-item btn btn-secondary d-flex justify-content-between align-items-center open_local_file" data-hash_sha256="'+launcher_tmp.event_file[i].hash_sha256+'.file" data-filename="'+launcher_tmp.event_file[i].event_file_filename+'">'+launcher_tmp.event_file[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_records = async function () {
|
||||
console.log('Rendering event location records...');
|
||||
|
||||
await tbl_event_location.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_location_id) {
|
||||
console.log('*** Event location id ('+event_location_id+') found in table.');
|
||||
document.getElementById('location_name').innerHTML = '<span class="fas fa-map-marker"></span> '+value.name;
|
||||
} else {
|
||||
console.log('Event location not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_location_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_file_records = function (events) {
|
||||
console.log('Rendering event location file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_records = async function () {
|
||||
console.log('Rendering event session records...');
|
||||
|
||||
// First: update or add sessions
|
||||
tbl_event_session.iterate(function(value, key, iteration) {
|
||||
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.');
|
||||
|
||||
// *** ** * Checking if the session is already in the launcher menu * ** ***
|
||||
if (document.getElementById('menu_event_session_'+value.id)) {
|
||||
// Update the session menu list item
|
||||
document.getElementById('menu_event_session_'+value.id).innerHTML = value.name;
|
||||
} else {
|
||||
// Unhide the sessions menu
|
||||
if (document.getElementById('sessions_menu').classList.contains('d-none') ) {
|
||||
document.getElementById('sessions_menu').classList.remove('d-none');
|
||||
document.getElementById('sessions_menu').classList.add('d-block');
|
||||
}
|
||||
|
||||
// Add the new session to the session menu
|
||||
let node = document.createElement('LI');
|
||||
node.id = 'menu_event_session_'+value.id;
|
||||
node.className = 'list-group-item btn btn-info d-flex justify-content-between align-items-center btn_view_session';
|
||||
node.setAttribute('data-session_id', value.id);
|
||||
let text_node = document.createTextNode(value.name);
|
||||
node.appendChild(text_node);
|
||||
|
||||
document.getElementById('sessions_menu').getElementsByTagName('ul')[0].appendChild(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)) {
|
||||
// Update the launcher sessions list
|
||||
// NOTE: Updating this text is very awkward?
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].firstChild.data = value.name;
|
||||
console.log(document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0]);
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(session_startdatetime, 'ddd h:mm A');
|
||||
} else {
|
||||
// Add the new session to the launcher sessions list
|
||||
let div_node = document.createElement('DIV');
|
||||
div_node.id = 'detail_session_'+value.id;
|
||||
div_node.className = 'container d-none session_detail';
|
||||
div_node.setAttribute('data-session_id', value.id);
|
||||
|
||||
let h2_node = document.createElement('H2');
|
||||
h2_node.className = 'session_title d-flex justify-content-between align-items-center';
|
||||
|
||||
// NOTE: Instead of a text node should this just be wrapped in a set of tags?
|
||||
// Updating this is kind of awkward... see above
|
||||
let h2_text_node = document.createTextNode(value.name);
|
||||
h2_node.appendChild(h2_text_node);
|
||||
|
||||
let h2_span_node = document.createElement('SPAN');
|
||||
h2_span_node.className = 'badge badge-pill badge-info';
|
||||
|
||||
let h2_span_text_node = document.createTextNode(dateFns.format(session_startdatetime, 'ddd h:mm A'));
|
||||
h2_span_node.appendChild(h2_span_text_node);
|
||||
|
||||
h2_node.appendChild(h2_span_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);
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('Event session not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session complete')
|
||||
tbl_event_session_complete = true;
|
||||
}).then(function() {
|
||||
// Second: remove sessions from the launcher sessions menu and sessions list
|
||||
// This is basing the removal of sessions only on the menu list of sessions.
|
||||
// In theory this should be safe as long as nothing gets out sync...
|
||||
console.log('Looking for removed sessions...');
|
||||
|
||||
let session_list_items = document.getElementById('sessions_menu').getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(session_list_items);
|
||||
//console.log(session_list_items.length);
|
||||
|
||||
for (var i in session_list_items) {
|
||||
console.log(session_list_items[i].getAttribute('data-session_id'));
|
||||
//console.log(session_list_items[i]);
|
||||
let session_id = session_list_items[i].getAttribute('data-session_id')
|
||||
let session_valid = false;
|
||||
|
||||
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);
|
||||
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
|
||||
session_valid = true;
|
||||
} else {
|
||||
// The session is no longer part of the event and or the location
|
||||
//console.log('Need to remove session id '+session_id);
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session looking for sessions to remove 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
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Third: re-index view session buttons
|
||||
// NOTE: Should this go in a .then() section?
|
||||
// NOTE: It might make even more sense to only have this done individually per add. Should also do a remove to keep things clean.
|
||||
//index_launcher_sessions('btn_view_session');
|
||||
index_launcher_sessions('btn_view_session');
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_file_records = function (events) {
|
||||
console.log('Rendering event session file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presentation_records = async function (events) {
|
||||
console.log('********** ********* ****** ** * ** ****** ********* *********');
|
||||
console.log('Rendering event presentation records...');
|
||||
|
||||
let launcher_sessions = document.getElementById('launcher_sessions').childNodes; //_list_items
|
||||
console.log(launcher_sessions);
|
||||
console.log(tbl_event_presentation);
|
||||
|
||||
for (let 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 presentations_list = launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(presentations_list);
|
||||
//console.log(presentations_list.length);
|
||||
if (presentations_list.length) {
|
||||
console.log('Presentations listed under this session (id='+session_id+'). (launcher sessions loop i = '+i+')');
|
||||
console.log(launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul'));
|
||||
/*
|
||||
* loop through list of presentations
|
||||
* if in
|
||||
*/
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
if (document.getElementById('event_presentation_'+value.id)) {
|
||||
// Update the launcher presentations list for a session
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('strong')[0].innerHTML = value.name;
|
||||
let presentation_startdatetime = new Date(value.start_datetime);
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(presentation_startdatetime, 'h:mm A');
|
||||
} else {
|
||||
|
||||
}
|
||||
}).then(function() {
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('No presentations listed under this session (id='+session_id+'). Time to iterate through presentations table. (launcher sessions loop i = '+i+')');
|
||||
|
||||
let new_i = i;
|
||||
console.log(new_i);
|
||||
|
||||
|
||||
//if (!looping_tbl_event_presentation) {
|
||||
// looping_tbl_event_presentation = true;
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
console.log('Launcher sessions loop i: '+i+' : '+new_i);
|
||||
if (value.event_session_id == session_id) {
|
||||
console.log('*** Presentation id ('+value.id+') is part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
|
||||
// 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(launcher_sessions[i].getElementsByClassName('session_presentations'));
|
||||
//launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||
let launcher_session_details = document.getElementById('detail_session_'+session_id);
|
||||
console.log(launcher_session_details.getElementsByClassName('session_presentations'));
|
||||
let session = document.getElementById('detail_session_'+session_id).getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||
} else {
|
||||
console.log('*** Presentation id ('+value.id+') is NOT part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_presentation looking for presentations to update or add is complete');
|
||||
looping_tbl_event_presentation = true;
|
||||
//tbl_event_presentation_iterate_count++;
|
||||
/*
|
||||
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
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
//} else {
|
||||
// console.log('Waiting until tbl_event_presentation has finished iterating...');
|
||||
//}
|
||||
|
||||
|
||||
/*
|
||||
<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>
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
//} else {
|
||||
// console.log('Waiting until launcher_sessions has finished looping...');
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presention_file_records = function (events) {
|
||||
console.log('Rendering event presentation file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_records = function (events) {
|
||||
console.log('Rendering event presenter records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_file_records = function (events) {
|
||||
console.log('Rendering event presenter file records...');
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function index_launcher_sessions(class_name) {
|
||||
console.log('Indexing launcher sessions with class name: '+class_name);
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
console.log(class_elements);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail'); // This class name should be the class names for each div container
|
||||
console.log('*** View session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -1,459 +0,0 @@
|
||||
|
||||
exports.render_event_records = function () {
|
||||
console.log('Rendering event records...');
|
||||
//console.log(tbl_event);
|
||||
//console.log(event_id);
|
||||
|
||||
tbl_event.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('*** Event id ('+event_id+') found in table.');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('Event not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// NOTE: The event_file table should probably only be looped through once when the table is actually updated.
|
||||
// NOTE: Not each time the other objects (event, location, session, presentation, presenter) are updated.
|
||||
exports.render_event_file_records = function (event_files, event_id) {
|
||||
console.log('Rendering event file records...');
|
||||
|
||||
/*
|
||||
tbl_event_file.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('*** Event id ('+event_id+') found in table.');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('Event not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="list-group list-group-flush">';
|
||||
for (var i in launcher_tmp.event_file) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_'+launcher_tmp.event_file[i].event_file_id+'" class="list-group-item btn btn-secondary d-flex justify-content-between align-items-center open_local_file" data-hash_sha256="'+launcher_tmp.event_file[i].hash_sha256+'.file" data-filename="'+launcher_tmp.event_file[i].event_file_filename+'">'+launcher_tmp.event_file[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_records = async function () {
|
||||
console.log('Rendering event location records...');
|
||||
|
||||
await tbl_event_location.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_location_id) {
|
||||
console.log('*** Event location id ('+event_location_id+') found in table.');
|
||||
document.getElementById('location_name').innerHTML = '<span class="fas fa-map-marker"></span> '+value.name;
|
||||
} else {
|
||||
console.log('Event location not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_location_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_file_records = function (events) {
|
||||
console.log('Rendering event location file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_records = async function () {
|
||||
console.log('Rendering event session records...');
|
||||
|
||||
// First: update or add sessions
|
||||
tbl_event_session.iterate(function(value, key, iteration) {
|
||||
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.');
|
||||
|
||||
// *** ** * Checking if the session is already in the launcher menu * ** ***
|
||||
if (document.getElementById('menu_event_session_'+value.id)) {
|
||||
// Update the session menu list item
|
||||
document.getElementById('menu_event_session_'+value.id).innerHTML = value.name;
|
||||
} else {
|
||||
// Unhide the sessions menu
|
||||
if (document.getElementById('sessions_menu').classList.contains('d-none') ) {
|
||||
document.getElementById('sessions_menu').classList.remove('d-none');
|
||||
document.getElementById('sessions_menu').classList.add('d-block');
|
||||
}
|
||||
|
||||
// Add the new session to the session menu
|
||||
let node = document.createElement('LI');
|
||||
node.id = 'menu_event_session_'+value.id;
|
||||
node.className = 'list-group-item btn btn-info d-flex justify-content-between align-items-center btn_view_session';
|
||||
node.setAttribute('data-session_id', value.id);
|
||||
let text_node = document.createTextNode(value.name);
|
||||
node.appendChild(text_node);
|
||||
|
||||
document.getElementById('sessions_menu').getElementsByTagName('ul')[0].appendChild(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)) {
|
||||
// Update the launcher sessions list
|
||||
// NOTE: Updating this text is very awkward?
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].firstChild.data = value.name;
|
||||
console.log(document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0]);
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(session_startdatetime, 'ddd h:mm A');
|
||||
} else {
|
||||
// Add the new session to the launcher sessions list
|
||||
let div_node = document.createElement('DIV');
|
||||
div_node.id = 'detail_session_'+value.id;
|
||||
div_node.className = 'container d-none session_detail';
|
||||
div_node.setAttribute('data-session_id', value.id);
|
||||
|
||||
let h2_node = document.createElement('H2');
|
||||
h2_node.className = 'session_title d-flex justify-content-between align-items-center';
|
||||
|
||||
// NOTE: Instead of a text node should this just be wrapped in a set of tags?
|
||||
// Updating this is kind of awkward... see above
|
||||
let h2_text_node = document.createTextNode(value.name);
|
||||
h2_node.appendChild(h2_text_node);
|
||||
|
||||
let h2_span_node = document.createElement('SPAN');
|
||||
h2_span_node.className = 'badge badge-pill badge-info';
|
||||
|
||||
let h2_span_text_node = document.createTextNode(dateFns.format(session_startdatetime, 'ddd h:mm A'));
|
||||
h2_span_node.appendChild(h2_span_text_node);
|
||||
|
||||
h2_node.appendChild(h2_span_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);
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('Event session not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session complete')
|
||||
tbl_event_session_complete = true;
|
||||
}).then(function() {
|
||||
// Second: remove sessions from the launcher sessions menu and sessions list
|
||||
// This is basing the removal of sessions only on the menu list of sessions.
|
||||
// In theory this should be safe as long as nothing gets out sync...
|
||||
console.log('Looking for removed sessions...');
|
||||
|
||||
let session_list_items = document.getElementById('sessions_menu').getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(session_list_items);
|
||||
//console.log(session_list_items.length);
|
||||
|
||||
for (var i in session_list_items) {
|
||||
console.log(session_list_items[i].getAttribute('data-session_id'));
|
||||
//console.log(session_list_items[i]);
|
||||
let session_id = session_list_items[i].getAttribute('data-session_id')
|
||||
let session_valid = false;
|
||||
|
||||
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);
|
||||
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
|
||||
session_valid = true;
|
||||
} else {
|
||||
// The session is no longer part of the event and or the location
|
||||
//console.log('Need to remove session id '+session_id);
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session looking for sessions to remove 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
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Third: re-index view session buttons
|
||||
// NOTE: Should this go in a .then() section?
|
||||
// NOTE: It might make even more sense to only have this done individually per add. Should also do a remove to keep things clean.
|
||||
//index_launcher_sessions('btn_view_session');
|
||||
index_launcher_sessions('btn_view_session');
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_file_records = function (events) {
|
||||
console.log('Rendering event session file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presentation_records = async function (events) {
|
||||
console.log('********** ********* ****** ** * ** ****** ********* *********');
|
||||
console.log('Rendering event presentation records...');
|
||||
|
||||
let launcher_sessions = document.getElementById('launcher_sessions').childNodes; //_list_items
|
||||
console.log(launcher_sessions);
|
||||
console.log(tbl_event_presentation);
|
||||
|
||||
/*
|
||||
loop through the sessions list (not table) {
|
||||
let session_id = ;
|
||||
attempt to loop through list of presentations (possibly empty) {
|
||||
let presentation_id = ;
|
||||
let presentation_id_found = false;
|
||||
iterate through tbl_event_presentation
|
||||
if (li presentation_id = tbl_event_presentation.id and session id = tbl_event_presentation.event_session_id) {
|
||||
update the presentation_id
|
||||
presentation_id_found = true;
|
||||
} else if (session id = tbl_event_presentation.event_session_id) {
|
||||
add in the new presentation_id from the table
|
||||
presentation_id_found = true;
|
||||
}
|
||||
if (presentation_id_found == false) {
|
||||
// remove the presentation
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
for (let 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 presentations_list = launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(presentations_list);
|
||||
//console.log(presentations_list.length);
|
||||
if (presentations_list.length) {
|
||||
console.log('Presentations listed under this session (id='+session_id+'). (launcher sessions loop i = '+i+')');
|
||||
console.log(launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul'));
|
||||
/*
|
||||
* loop through list of presentations
|
||||
* if in
|
||||
*/
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
if (document.getElementById('event_presentation_'+value.id)) {
|
||||
// Update the launcher presentations list for a session
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('strong')[0].innerHTML = value.name;
|
||||
let presentation_startdatetime = new Date(value.start_datetime);
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(presentation_startdatetime, 'h:mm A');
|
||||
} else {
|
||||
|
||||
}
|
||||
}).then(function() {
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('No presentations listed under this session (id='+session_id+'). Time to iterate through presentations table. (launcher sessions loop i = '+i+')');
|
||||
|
||||
let new_i = i;
|
||||
console.log(new_i);
|
||||
|
||||
|
||||
//if (!looping_tbl_event_presentation) {
|
||||
// looping_tbl_event_presentation = true;
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
console.log('Launcher sessions loop i: '+i+' : '+new_i);
|
||||
if (value.event_session_id == session_id) {
|
||||
console.log('*** Presentation id ('+value.id+') is part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
|
||||
// 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(launcher_sessions[i].getElementsByClassName('session_presentations'));
|
||||
//launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||
let launcher_session_details = document.getElementById('detail_session_'+session_id);
|
||||
console.log(launcher_session_details.getElementsByClassName('session_presentations'));
|
||||
let session = document.getElementById('detail_session_'+session_id).getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||
} else {
|
||||
console.log('*** Presentation id ('+value.id+') is NOT part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_presentation looking for presentations to update or add is complete');
|
||||
looping_tbl_event_presentation = true;
|
||||
//tbl_event_presentation_iterate_count++;
|
||||
/*
|
||||
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
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
//} else {
|
||||
// console.log('Waiting until tbl_event_presentation has finished iterating...');
|
||||
//}
|
||||
|
||||
|
||||
/*
|
||||
<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>
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
//} else {
|
||||
// console.log('Waiting until launcher_sessions has finished looping...');
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presention_file_records = function (events) {
|
||||
console.log('Rendering event presentation file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_records = function (events) {
|
||||
console.log('Rendering event presenter records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_file_records = function (events) {
|
||||
console.log('Rendering event presenter file records...');
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function index_launcher_sessions(class_name) {
|
||||
console.log('Indexing launcher sessions with class name: '+class_name);
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
console.log(class_elements);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail'); // This class name should be the class names for each div container
|
||||
console.log('*** View session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -1,639 +0,0 @@
|
||||
|
||||
exports.render_event_records = function () {
|
||||
console.log('Rendering event records...');
|
||||
//console.log(tbl_event);
|
||||
//console.log(event_id);
|
||||
|
||||
tbl_event.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('*** Event id ('+event_id+') found in table.');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('Event not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// This function is used to render all event file records to the UI.
|
||||
// NOTE: The event_file table should probably only be looped through once when the table is actually updated.
|
||||
// NOTE: Not each time the other objects (event, location, session, presentation, presenter) are updated.
|
||||
exports.render_event_file_records = function (event_files, event_id) {
|
||||
console.log('Rendering event file records...');
|
||||
/*
|
||||
tbl_event_file.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_id) {
|
||||
console.log('This event file ('+value.id+') is part of the this event ('+event_id+').');
|
||||
document.getElementById('event_name').innerHTML = '@'+value.name;
|
||||
} else {
|
||||
console.log('This event file ('+value.id+') is NOT part of the this event ('+event_id+').');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_complete = true;
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('event_files_menu').innerHTML = '<h2>Event Files</h2>';
|
||||
document.getElementById('event_files_menu').innerHTML += '<ul class="list-group list-group-flush">';
|
||||
for (var i in launcher_tmp.event_file) {
|
||||
document.getElementById('event_files_menu').innerHTML += '<li id="menu_event_file_'+launcher_tmp.event_file[i].event_file_id+'" class="list-group-item btn btn-secondary d-flex justify-content-between align-items-center open_local_file" data-hash_sha256="'+launcher_tmp.event_file[i].hash_sha256+'.file" data-filename="'+launcher_tmp.event_file[i].event_file_filename+'">'+launcher_tmp.event_file[i].event_file_filename+'</li>';
|
||||
}
|
||||
document.getElementById('event_files_menu').innerHTML += '</ul>';
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_records = async function () {
|
||||
console.log('Rendering event location records...');
|
||||
|
||||
await tbl_event_location.iterate(function(value, key, iteration) {
|
||||
if (value.id == event_location_id) {
|
||||
console.log('*** Event location id ('+event_location_id+') found in table.');
|
||||
document.getElementById('location_name').innerHTML = '<span class="fas fa-map-marker"></span> '+value.name;
|
||||
} else {
|
||||
console.log('Event location not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_file complete')
|
||||
tbl_event_location_complete = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_location_file_records = function (events) {
|
||||
console.log('Rendering event location file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_records = async function () {
|
||||
console.log('Rendering event session records...');
|
||||
|
||||
// First: update or add sessions
|
||||
tbl_event_session.iterate(function(value, key, iteration) {
|
||||
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.');
|
||||
|
||||
// *** ** * Checking if the session is already in the launcher menu * ** ***
|
||||
if (document.getElementById('menu_event_session_'+value.id)) {
|
||||
// Update the session menu list item
|
||||
document.getElementById('menu_event_session_'+value.id).innerHTML = value.name;
|
||||
} else {
|
||||
// Unhide the sessions menu
|
||||
if (document.getElementById('sessions_menu').classList.contains('d-none') ) {
|
||||
document.getElementById('sessions_menu').classList.remove('d-none');
|
||||
document.getElementById('sessions_menu').classList.add('d-block');
|
||||
}
|
||||
|
||||
// Add the new session to the session menu
|
||||
let node = document.createElement('LI');
|
||||
node.id = 'menu_event_session_'+value.id;
|
||||
node.className = 'list-group-item btn btn-info d-flex justify-content-between align-items-center btn_view_session';
|
||||
node.setAttribute('data-session_id', value.id);
|
||||
let text_node = document.createTextNode(value.name);
|
||||
node.appendChild(text_node);
|
||||
|
||||
document.getElementById('sessions_menu').getElementsByTagName('ul')[0].appendChild(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)) {
|
||||
// Update the launcher sessions list
|
||||
// NOTE: Updating this text is very awkward?
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].firstChild.data = value.name;
|
||||
console.log(document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0]);
|
||||
document.getElementById('detail_session_'+value.id).getElementsByTagName('h2')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(session_startdatetime, 'ddd h:mm A');
|
||||
} else {
|
||||
// Add the new session to the launcher sessions list
|
||||
let div_node = document.createElement('DIV');
|
||||
div_node.id = 'detail_session_'+value.id;
|
||||
div_node.className = 'container d-none session_detail event_session';
|
||||
div_node.setAttribute('data-session_id', value.id);
|
||||
|
||||
let h2_node = document.createElement('H2');
|
||||
h2_node.className = 'session_title d-flex justify-content-between align-items-center';
|
||||
|
||||
// NOTE: Instead of a text node should this just be wrapped in a set of tags?
|
||||
// Updating this is kind of awkward... see above
|
||||
let h2_text_node = document.createTextNode(value.name);
|
||||
h2_node.appendChild(h2_text_node);
|
||||
|
||||
let h2_span_node = document.createElement('SPAN');
|
||||
h2_span_node.className = 'badge badge-pill badge-info';
|
||||
|
||||
let h2_span_text_node = document.createTextNode(dateFns.format(session_startdatetime, 'ddd h:mm A'));
|
||||
h2_span_node.appendChild(h2_span_text_node);
|
||||
|
||||
h2_node.appendChild(h2_span_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.id = 'event_session_files_'+value.id;
|
||||
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('Session 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.id = 'event_session_files_list_'+value.id;
|
||||
files_body_ul_node.className = 'list-group list-group-flush session_files_list event_files_list';
|
||||
|
||||
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.id = 'session_presentations_'+value.id;
|
||||
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.id = 'session_presentations_list_'+value.id;
|
||||
presentations_body_ul_node.className = 'list-group list-group-flush session_presentations_list';
|
||||
presentations_body_ul_node.setAttribute('data-session_id', value.id);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
} else {
|
||||
//console.log('Event session not it.');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session complete');
|
||||
tbl_event_session_complete = true;
|
||||
}).then(function() {
|
||||
// Second: remove sessions from the launcher sessions menu and sessions list
|
||||
// This is basing the removal of sessions only on the menu list of sessions.
|
||||
// In theory this should be safe as long as nothing gets out sync...
|
||||
console.log('Looking for removed sessions...');
|
||||
|
||||
let session_list_items = document.getElementById('sessions_menu').getElementsByTagName('ul')[0].childNodes;
|
||||
//console.log(session_list_items);
|
||||
|
||||
let session_list = document.getElementById('sessions_menu').getElementsByTagName('ul')[0].children;
|
||||
|
||||
if (session_list_items.length) {
|
||||
for (let i=0, len=session_list_items.length; i < len; i++) {
|
||||
console.log('session_id='+session_list_items[i].getAttribute('data-session_id'));
|
||||
let session_id = session_list_items[i].getAttribute('data-session_id');
|
||||
let session_valid = false;
|
||||
|
||||
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);
|
||||
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
|
||||
session_valid = true;
|
||||
} else {
|
||||
// The session is no longer part of the event and or the location
|
||||
//console.log('Need to remove session id '+session_id);
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_session looking for sessions to remove 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
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Third: re-index view session buttons
|
||||
// NOTE: Should this go in a .then() section?
|
||||
// NOTE: It might make even more sense to only have this done individually per add. Should also do a remove to keep things clean.
|
||||
//index_launcher_sessions('btn_view_session');
|
||||
index_launcher_sessions('btn_view_session');
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_session_file_records = function (events) {
|
||||
console.log('Rendering event session file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presentation_records = async function (events) {
|
||||
console.log('********** ********* ****** ** * ** ****** ********* *********');
|
||||
console.log('Rendering event presentation records...');
|
||||
|
||||
let launcher_sessions = document.getElementById('launcher_sessions').childNodes; //_list_items
|
||||
console.log(launcher_sessions);
|
||||
|
||||
for (let i=0, len=launcher_sessions.length; i < len; i++) {
|
||||
//for (let i in launcher_sessions) {
|
||||
console.log('Current launcher session_id='+launcher_sessions[i].getAttribute('data-session_id'));
|
||||
let session_id = launcher_sessions[i].getAttribute('data-session_id');
|
||||
|
||||
let presentations_list = launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(presentations_list);
|
||||
|
||||
// First: update or delete presentations
|
||||
if (presentations_list.length) {
|
||||
console.log('Presentations listed under this session (id='+session_id+'). (launcher sessions loop i = '+i+')');
|
||||
console.log(launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul'));
|
||||
|
||||
for (let j=0, len=presentations_list.length; j < len; j++) {
|
||||
console.log('Current launcher presentation_id='+presentations_list[j].getAttribute('data-presentation_id'));
|
||||
let presentation_id = presentations_list[j].getAttribute('data-presentation_id');
|
||||
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
//console.log('*** 1: session_id='+session_id+' | presentation.event_session_id='+value.event_session_id+' | presentation_id='+presentation_id+' | presentation.id='+value.id+' (launcher sessions loop i='+i+')');
|
||||
looping_tbl_event_presentation = true;
|
||||
if (session_id == value.event_session_id && presentation_id == value.id) {
|
||||
// Found presentation in that session. Updating...
|
||||
console.log('Presentation ('+presentation_id+') was found in the session ('+session_id+'). Updating...');
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('strong')[0].innerHTML = value.name;
|
||||
let presentation_startdatetime = new Date(value.start_datetime);
|
||||
document.getElementById('event_presentation_'+value.id).getElementsByTagName('div')[0].getElementsByTagName('span')[0].innerHTML = dateFns.format(presentation_startdatetime, 'h:mm A');
|
||||
|
||||
} else if (session_id != value.event_session_id && presentation_id == value.id) {
|
||||
// Found presentation in a session that it should not be in. Removing...
|
||||
console.log('Presentation exists but should not be part of this session. Removing...');
|
||||
console.log('*** Presentation id ('+value.id+') is NOT part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
document.getElementById('event_presentation_'+presentation_id).remove(); // Remove the node from the launcher presentations list
|
||||
|
||||
} else {
|
||||
//console.log('Not doing anything');
|
||||
}
|
||||
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_presentation looking for presentations to update or remove is complete');
|
||||
looping_tbl_event_presentation = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
} else { // Close for if presentations_list.length
|
||||
|
||||
} // Close for if presentations_list.length
|
||||
|
||||
|
||||
// Now that the updates and removals have been done we need to add presentations.
|
||||
await tbl_event_presentation.iterate(function(value, key, iteration) {
|
||||
//console.log('*** 2: session_id='+session_id+' | presentation.event_session_id='+value.event_session_id+' | presentation.id='+value.id+' (launcher sessions loop i='+i+')');
|
||||
looping_tbl_event_presentation = true;
|
||||
|
||||
let add_presentation = true;
|
||||
|
||||
if (session_id == value.event_session_id) {
|
||||
// This presentation should be part of the session. Adding if not there...
|
||||
|
||||
presentations_list = launcher_sessions[i].getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].childNodes;
|
||||
console.log(presentations_list);
|
||||
|
||||
if (presentations_list.length) {
|
||||
// One more presentations are already in this session.
|
||||
// Need to check if this one needs to be added.
|
||||
for (let j=0, len=presentations_list.length; j < len; j++) {
|
||||
let presentation_id = presentations_list[j].getAttribute('data-presentation_id');
|
||||
if (presentation_id == value.id) {
|
||||
// Nothing here so it for sure needs to be added.
|
||||
add_presentation = false;
|
||||
} else {
|
||||
// Don't reset the add_presentation back to true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Nothing here, so it for sure needs to be added.
|
||||
//add_presentation = true;
|
||||
}
|
||||
} else {
|
||||
add_presentation = false;
|
||||
}
|
||||
|
||||
|
||||
if (add_presentation) {
|
||||
// Presentation not found. Adding...
|
||||
console.log('Presentation was not found in the session but should be. Adding...');
|
||||
console.log('Presentation id ('+value.id+') is part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
|
||||
// Add the new presentation to the launcher presentation list
|
||||
let presentation_li_node = document.createElement('LI');
|
||||
presentation_li_node.id = 'event_presentation_'+value.id;
|
||||
presentation_li_node.className = 'list-group-item event_presentation';
|
||||
presentation_li_node.setAttribute('data-session_id', value.event_session_id);
|
||||
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);
|
||||
|
||||
|
||||
let presentation_li_text_div_node = document.createElement('DIV');
|
||||
//presentation_li_text_div_node.id = 'event_presentation_files_'+value.id;
|
||||
presentation_li_text_div_node.className = 'list-group-item-text';
|
||||
|
||||
let presentation_files_ul_group_node = document.createElement('UL');
|
||||
presentation_files_ul_group_node.id = 'event_presentation_files_list_'+value.id;
|
||||
presentation_files_ul_group_node.className = 'list-group list-group-flush presentation_files presentation_files_list event_files_list';
|
||||
|
||||
let presentation_presenters_ul_group_node = document.createElement('UL');
|
||||
presentation_presenters_ul_group_node.id = 'event_presentation_presenters_'+value.id;
|
||||
presentation_presenters_ul_group_node.className = 'list-group list-group-flush presentation_presenters presentation_presenters_list';
|
||||
presentation_presenters_ul_group_node.setAttribute('data-session_id', value.event_session_id);
|
||||
presentation_presenters_ul_group_node.setAttribute('data-presentation_id', value.id);
|
||||
|
||||
presentation_li_text_div_node.appendChild(presentation_files_ul_group_node);
|
||||
presentation_li_text_div_node.appendChild(presentation_presenters_ul_group_node);
|
||||
|
||||
|
||||
presentation_li_node.appendChild(presentation_li_heading_div_node);
|
||||
presentation_li_node.appendChild(presentation_li_text_div_node);
|
||||
|
||||
|
||||
//console.log(launcher_sessions[i].getElementsByClassName('session_presentations'));
|
||||
let launcher_session_details = document.getElementById('detail_session_'+session_id);
|
||||
//console.log(launcher_session_details.getElementsByClassName('session_presentations'));
|
||||
|
||||
// Trying to remove old ID in case there is one already rendered
|
||||
try {
|
||||
document.getElementById('event_presentation_'+value.id).remove();
|
||||
}
|
||||
catch(err) {
|
||||
console.log('A node with the ID of event_presentation_'+value.id+' was not found.');
|
||||
console.log(err.message);
|
||||
}
|
||||
|
||||
let session = document.getElementById('detail_session_'+session_id).getElementsByClassName('session_presentations')[0].getElementsByTagName('ul')[0].appendChild(presentation_li_node);
|
||||
presentation_id_found = true;
|
||||
} else {
|
||||
// Presentation not part of this session. Moving on...
|
||||
//console.log('Presentation was not found in the session and should not be. Moving on...');
|
||||
//console.log('*** Presentation id ('+value.id+') is not part of this session ('+session_id+'). (launcher sessions loop i='+i+')');
|
||||
}
|
||||
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_presentation looking for presentations to add is complete');
|
||||
looping_tbl_event_presentation = false;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presention_file_records = function (events) {
|
||||
console.log('Rendering event presentation file records...');
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_records = async function (events) {
|
||||
console.log('Rendering event presenter records...');
|
||||
console.log('****************** Presenters ******************');
|
||||
|
||||
if (looping_tbl_event_presenter) {
|
||||
console.log('Already looping through the tbl_event_presenter table. Not starting until finished.');
|
||||
return false;
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
looping_tbl_event_presenter = true;
|
||||
|
||||
let presentations_presenters_lists = document.getElementsByClassName('presentation_presenters'); // from the UL nodes for presenters
|
||||
console.log(presentations_presenters_lists);
|
||||
|
||||
// First: Loop through the presenters table looking for presenters for each presentation list
|
||||
await tbl_event_presenter.iterate(function(value, key, iteration) {
|
||||
let tbl_presentation_id = value.event_presentation_id;
|
||||
let tbl_presenter_id = value.id;
|
||||
console.log('presenter tbl iteration='+iteration+' | tbl_presenter_id='+tbl_presenter_id+' for tbl_presentation_id='+tbl_presentation_id);
|
||||
|
||||
if (presentations_presenters_lists.length) {
|
||||
for (var i = 0; i < presentations_presenters_lists.length; i++) {
|
||||
let ul_session_id = presentations_presenters_lists[i].getAttribute('data-session_id');
|
||||
let ul_presentation_id = presentations_presenters_lists[i].getAttribute('data-presentation_id');
|
||||
console.log('i='+i+' | ul_presentation_id='+ul_presentation_id);
|
||||
|
||||
// Check if this presenter is part of this presentation
|
||||
let add_presenter_id = true; // Set flag to true. Update if found. Add if not found.
|
||||
let remove_presenter_id = true;
|
||||
if (tbl_presentation_id == ul_presentation_id) {
|
||||
console.log('This tbl_presentation_id '+tbl_presentation_id+' matches this ul_presentation_id '+ul_presentation_id+'. Trying to loop through list of presenters to see if it needs to be updated or added...');
|
||||
// Get a list of list items under the UL presenters node for a presentation
|
||||
let presentation_presenters_list_items = presentations_presenters_lists[i].children;
|
||||
|
||||
if (presentation_presenters_list_items.length) {
|
||||
for (let j=0, len=presentation_presenters_list_items.length; j < len; j++) {
|
||||
console.log('li_presenter_id='+presentation_presenters_list_items[j].getAttribute('data-presenter_id'));
|
||||
let li_presentation_id = presentation_presenters_list_items[j].getAttribute('data-presentation_id');
|
||||
let li_presenter_id = presentation_presenters_list_items[j].getAttribute('data-presenter_id');
|
||||
|
||||
if ( tbl_presentation_id == li_presentation_id && tbl_presenter_id == li_presenter_id ) {
|
||||
console.log('Updating presenter ID '+li_presenter_id);
|
||||
// Update the presenter information
|
||||
document.getElementById('event_presenter_'+tbl_presenter_id).getElementsByClassName('presenter_name')[0].innerHTML = value.given_name+' '+value.family_name;
|
||||
// Could have used getElementsByTagName('strong') instead
|
||||
add_presenter_id = false;
|
||||
remove_presenter_id = false;
|
||||
} else if (tbl_presentation_id != li_presentation_id ) {
|
||||
console.log('Set flag to remove presenter ID '+li_presenter_id);
|
||||
remove_presenter_id = true;
|
||||
} else {
|
||||
// Remove presenter here?????
|
||||
// NOTE: This section is not finished!!!
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// No need to remove anything if the list is empty.
|
||||
console.log('Ignoring this presentation\'s list ('+ul_presentation_id+') of presenters because it is empty. Adding this presenter ('+tbl_presenter_id+') to the list...');
|
||||
add_presenter_id = true; // Technically this line is not needed since the value was initialized to true.
|
||||
remove_presenter_id = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// Remove presenter here?????
|
||||
// NOTE: This section is not finished!!!
|
||||
add_presenter_id = false;
|
||||
//remove_presenter_id = true;
|
||||
}
|
||||
|
||||
|
||||
// The presenter ID was not found. Need to add.
|
||||
if ( add_presenter_id ) {
|
||||
console.log('Adding this presenter ('+tbl_presenter_id+') to the list of presenters for this presentation ('+ul_presentation_id+').');
|
||||
let presenter_li_node = document.createElement('LI');
|
||||
presenter_li_node.id = 'event_presenter_'+tbl_presenter_id;
|
||||
presenter_li_node.className = 'list-group-item event_presenter';
|
||||
presenter_li_node.setAttribute('data-session_id', value.event_session_id);
|
||||
presenter_li_node.setAttribute('data-presentation_id', ul_presentation_id);
|
||||
presenter_li_node.setAttribute('data-presenter_id', tbl_presenter_id);
|
||||
|
||||
let presenter_name_strong_node = document.createElement('STRONG');
|
||||
presenter_name_strong_node.className = 'list-group-item-heading presenter_name';
|
||||
|
||||
let presenter_name_text_node= document.createTextNode(value.given_name+' '+value.family_name);
|
||||
presenter_name_strong_node.appendChild(presenter_name_text_node);
|
||||
|
||||
presenter_li_node.appendChild(presenter_name_strong_node);
|
||||
|
||||
|
||||
let presentation_presenters_ul_group_node = document.createElement('UL');
|
||||
presentation_presenters_ul_group_node.id = 'event_presentation_presenter_files_'+tbl_presenter_id;
|
||||
presentation_presenters_ul_group_node.className = 'list-group list-group-flush list-group-item-text presenter_files presenter_files_list event_files_list';
|
||||
presentation_presenters_ul_group_node.setAttribute('data-presenter_id', tbl_presenter_id);
|
||||
|
||||
presenter_li_node.appendChild(presentation_presenters_ul_group_node);
|
||||
|
||||
console.log('BEFORE appendChild:');
|
||||
console.log(document.getElementById('event_presentation_presenters_'+tbl_presentation_id));
|
||||
document.getElementById('event_presentation_presenters_'+tbl_presentation_id).appendChild(presenter_li_node);
|
||||
console.log('AFTER appendChild:');
|
||||
console.log(document.getElementById('event_presentation_presenters_'+tbl_presentation_id));
|
||||
//document.getElementById('event_presentation_presenters_'+tbl_presentation_id).innerHTML = 'WTF';
|
||||
//document.getElementById('event_presentation_presenters_'+tbl_presentation_id).appendChild(presentation_presenters_ul_group_node);
|
||||
|
||||
remove_presenter_id = false;
|
||||
} else {
|
||||
//console.log('Not going to add this presenter ('+tbl_presenter_id+') to the list of presenters for this presentation ('+ul_presentation_id+').');
|
||||
}
|
||||
|
||||
|
||||
// The presenter ID was found, but not part of this presentation. Need to remove.
|
||||
if ( remove_presenter_id ) {
|
||||
if ( ul_presentation_id != tbl_presentation_id ) {
|
||||
console.log('Removing this presenter ('+tbl_presenter_id+') from the list of presenters for this presentation ('+ul_presentation_id+').');
|
||||
|
||||
// Trying to remove old ID in case there is one already rendered
|
||||
try {
|
||||
presentations_presenters_lists[i].remove();
|
||||
//document.getElementById('event_presentation_'+tbl_presenter_id).getElementById('event_presenter_'+tbl_presenter_id).remove();
|
||||
}
|
||||
catch(err) {
|
||||
//console.log('A node with the ID of event_presenter_'+tbl_presenter_id+' was not found.');
|
||||
console.log('This presenter list item node was not found.');
|
||||
console.log(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('This presenter ('+tbl_presenter_id+') is already part of the list of presenters for this presentation ('+ul_presentation_id+') and is correct.');
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
console.log('No list of presenters found under any presentations');
|
||||
}
|
||||
}).then(function() {
|
||||
console.log('idb_to_ui: Iterate tbl_event_presenter looking for presenters to update, add, or remove is complete');
|
||||
looping_tbl_event_presenter = false;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
exports.render_event_presenter_file_records = function (events) {
|
||||
console.log('Rendering event presenter file records...');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function index_launcher_sessions(class_name) {
|
||||
console.log('Indexing launcher sessions with class name: '+class_name);
|
||||
var class_elements = document.getElementsByClassName(class_name);
|
||||
|
||||
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
class_elements[i].addEventListener( 'click', function() {view_session( this.getAttribute('data-session_id')) } );
|
||||
}
|
||||
console.log(class_elements);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Updated 2020-01-31 */
|
||||
function view_session(session_id) {
|
||||
var class_elements = document.getElementsByClassName('session_detail'); // This class name should be the class names for each div container
|
||||
console.log('View session ID: '+session_id);
|
||||
for (var i = 0; i < class_elements.length; i++) {
|
||||
//console.log('*** checking: '+class_elements[i].getAttribute('data-session_id'));
|
||||
if (class_elements[i].getAttribute('data-session_id') == session_id) {
|
||||
//console.log('show');
|
||||
class_elements[i].classList.remove('d-none');
|
||||
class_elements[i].classList.add('d-block');
|
||||
} else {
|
||||
//console.log('hide');
|
||||
class_elements[i].classList.remove('d-block');
|
||||
class_elements[i].classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function format_bytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
878
app/svelte/build/aether_layout.css
Normal file
878
app/svelte/build/aether_layout.css
Normal file
@@ -0,0 +1,878 @@
|
||||
html {
|
||||
/* Parent Layout */
|
||||
/* Box Model */
|
||||
/* Positioning */
|
||||
/*height: 100%;*/
|
||||
/* Display */
|
||||
}
|
||||
|
||||
body {
|
||||
/* Parent Layout */
|
||||
/* Box Model */
|
||||
/* Positioning */
|
||||
margin-bottom: 2.25rem; /* full height */
|
||||
/* margin: 0; */
|
||||
/* padding: 0; */
|
||||
/* Display */
|
||||
}
|
||||
|
||||
nav {
|
||||
}
|
||||
|
||||
|
||||
/* *** BEGIN *** Layout *** System Menu (root menu) *** */
|
||||
|
||||
|
||||
/* *** END *** Layout *** System Menu (root menu) *** */
|
||||
|
||||
|
||||
|
||||
|
||||
/* Aether System Styles */
|
||||
/* Most of this should not be overridden by the client unless using something like an iframe for specific content. */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** General *** */
|
||||
/* *** END *** System *** General *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Menu (root menu) *** */
|
||||
.system_menu {
|
||||
z-index: 1040; /* Bootstrap's modal background is also z-index: 1040 */
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
|
||||
/*height: .1rem;*/
|
||||
height: 2.68rem;
|
||||
/*height: 6.12rem;*/
|
||||
width: 100vw;
|
||||
max-width: 1440px; /*100vw*/
|
||||
|
||||
transform: translateX(-50%);
|
||||
|
||||
margin: 0 0;
|
||||
margin-bottom: .1rem;
|
||||
|
||||
padding-top: .03rem;
|
||||
padding-left: .03rem;
|
||||
padding-right: .03rem;
|
||||
padding-bottom: .03rem;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
/*background: linear-gradient(to right, rgba(220,220,220,.9) 25%, rgba(128,128,128,.8) 50%, rgba(220,220,220,.9) 75%);*/
|
||||
|
||||
border: solid thick transparent;
|
||||
|
||||
border-top: none;
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest));
|
||||
border-bottom: none;
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-green),var(--saturation-least),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
/* NOTE: transition when no longer hovering */
|
||||
transition-property: height;
|
||||
transition-delay: 4s;
|
||||
transition-duration: .1s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.system_menu:hover {
|
||||
z-index: 1051; /* Bootstrap's modal background is z-index: 1040 */
|
||||
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest).1) 0%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 3%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 97%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.1) 100%);
|
||||
|
||||
|
||||
height: 5.33rem;
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: height;
|
||||
transition-delay: 1.5s;
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.system_menu_clicked {
|
||||
z-index: 1051; /* Bootstrap's modal background is z-index: 1040 */
|
||||
|
||||
border-left: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest).1) 0%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 3%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.9) 97%, hsla(var(--hue-yellow), var(--saturation-less), var(--lum-lightest),.1) 100%);
|
||||
|
||||
|
||||
height: 5.33rem;
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: height;
|
||||
transition-delay: 0s;
|
||||
transition-duration: .15s;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
.system_menu_begin {
|
||||
/*border: solid thin red;*/
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
/*align-content: center;*/
|
||||
align-items: center;
|
||||
/*justify-content: center;*/
|
||||
|
||||
height: 100%;
|
||||
padding: 0 .25rem;
|
||||
|
||||
text-shadow: 0 0 .25rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 .75rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 1rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1);
|
||||
|
||||
color: black;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 100%);*/
|
||||
}
|
||||
.system_menu_begin:hover {
|
||||
}
|
||||
|
||||
.system_menu_center {
|
||||
/*border: solid thin blue;*/
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.1) 25%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.8) 50%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-mid),.9) 75%);*/
|
||||
}
|
||||
|
||||
.system_menu_end {
|
||||
/*border: solid thin red;*/
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
/*align-content: center;*/
|
||||
align-items: center;
|
||||
/*justify-content: center;*/
|
||||
|
||||
height: 100%;
|
||||
padding: 0 .25rem;
|
||||
|
||||
text-shadow: 0 0 .25rem white, 0 0 .75rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1), 0 0 1rem hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),1);
|
||||
|
||||
color: black;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.6) 20%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.6) 80%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_end:hover {
|
||||
}
|
||||
|
||||
.system_menu_hidden {
|
||||
border-bottom: none;
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
margin: 0;
|
||||
padding: .1rem .75rem;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_hidden:hover {
|
||||
/*border-bottom: solid thin gray;*/
|
||||
}
|
||||
|
||||
.system_menu_visible {
|
||||
border-bottom: none;
|
||||
/*border-bottom: solid thin gray;*/
|
||||
align-self: flex-end;
|
||||
flex: auto;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
margin: 0;
|
||||
padding: .1rem .75rem;
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);*/
|
||||
}
|
||||
.system_menu_visible:hover {
|
||||
/*border-bottom: solid thin gray;*/
|
||||
}
|
||||
|
||||
.system_menu_name {
|
||||
/*border: dashed thin blue;*/
|
||||
/*flex: auto;*/
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-begin;
|
||||
align-items: center;
|
||||
|
||||
margin: 0;
|
||||
padding: 0rem .5rem;
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);
|
||||
}
|
||||
|
||||
.system_menu_name img {
|
||||
max-height: 1rem;
|
||||
}
|
||||
|
||||
.system_menu_information {
|
||||
/*border: dashed thin green;*/
|
||||
/*flex: auto;*/
|
||||
align-self: flex-end;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
margin: 0;
|
||||
padding: 0rem .5rem;
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.8) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),0) 100%);
|
||||
}
|
||||
.system_menu_information:hover {
|
||||
/*background-color: gray;*/
|
||||
|
||||
/*background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),.9) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lighter),0) 100%);*/
|
||||
|
||||
background-image: linear-gradient(to right, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.0) 0%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.97) 3%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.97) 97%, hsla(var(--hue-blue), var(--saturation-least), var(--lum-lightest),.0) 100%);
|
||||
|
||||
}
|
||||
|
||||
|
||||
.system_menu_float {
|
||||
z-index: 1040;
|
||||
position: fixed;
|
||||
top: 2.75rem;
|
||||
right: .1rem;
|
||||
|
||||
background-color: rgba(220,175,175,.8);
|
||||
|
||||
padding: .1rem .5rem;
|
||||
|
||||
/*position: fixed; top: 0; right: 0; */
|
||||
}
|
||||
|
||||
/* Set style based on the user's permissions */
|
||||
.system_menu.user_super {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_manager {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-orange),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_administrator {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-yellow),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_verified {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-yellow),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu.user_authenticated {
|
||||
border-left: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-right: solid thick hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-bottom: solid thin hsl(var(--hue-red),var(--saturation-most),var(--lum-darkest));
|
||||
border-image:
|
||||
linear-gradient(
|
||||
to top,
|
||||
hsl(var(--hue-green),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
) 1;
|
||||
|
||||
background-image:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
hsl(var(--hue-cyan),var(--saturation-most),var(--lum-darkest)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.system_menu .user_status_options {
|
||||
font-size: .8rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
/* *** END *** System *** System Menu (root menu) *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** User Login *** */
|
||||
.user_login .account__name--container {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.user_login .account__none--container {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
color: darkred;
|
||||
}
|
||||
|
||||
.user_login .show_password, .user_change_password .show_password {
|
||||
font-size: 1.1rem;
|
||||
line-height: 3.0rem;
|
||||
color: darkred;
|
||||
cursor: zoom-in; /*progress*/
|
||||
}
|
||||
|
||||
.user_login .show_password:hover, .user_change_password .show_password:hover {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
/* *** END *** System *** User Login *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** System Footer *** */
|
||||
/* system_footer or system_footer or system_status is the global (root) footer or status bar */
|
||||
.system_footer {
|
||||
position: fixed;
|
||||
/*width: 100vw;*/
|
||||
bottom: 0;
|
||||
|
||||
margin: 0 0;
|
||||
padding: 0 .5rem;
|
||||
|
||||
color: gray;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.system_footer .footer_left {
|
||||
float: left;
|
||||
}
|
||||
.system_footer .footer_right {
|
||||
float: right;
|
||||
}
|
||||
/* *** END *** System *** System Footer *** */
|
||||
|
||||
|
||||
/* *** BEGIN *** System *** Debug *** */
|
||||
.view_debug {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.hidden_debug {
|
||||
display: none;
|
||||
|
||||
position: fixed;
|
||||
bottom: 1.5rem;
|
||||
right: 0;
|
||||
background: pink;
|
||||
border: dashed thin pink;
|
||||
margin: .25rem .25rem .25rem;
|
||||
padding: .25rem;
|
||||
opacity: .5;
|
||||
|
||||
font-size: .7rem;
|
||||
|
||||
overflow-y: scroll;
|
||||
|
||||
max-height: 96.75vh;
|
||||
|
||||
z-index: 1050; /* Bootstrap 4 sticky-top class has a z-index of 1020 */
|
||||
}
|
||||
|
||||
.hidden_debug:hover {
|
||||
z-index: 1051;
|
||||
border: solid thin pink;
|
||||
opacity: .95;
|
||||
}
|
||||
/* *** END *** System *** Debug *** */
|
||||
|
||||
|
||||
/* BEGIN: Global System Classes */
|
||||
|
||||
|
||||
/* BEGIN: Main section of the page layout */
|
||||
|
||||
.site_header {
|
||||
padding-top: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
margin-bottom: .25rem;
|
||||
|
||||
max-height: 15rem; /* Just in case something is added that is very high. */
|
||||
|
||||
width: 95%;
|
||||
max-width: 1400px;
|
||||
}
|
||||
|
||||
.site_header img {
|
||||
max-width: 100%;
|
||||
max-height: 8rem; /* Just in case something is added that is very high. */
|
||||
/*border: solid thin #aaa;*/
|
||||
border-radius: .25rem;
|
||||
}
|
||||
|
||||
/* primary_menu is generally the site_menu */
|
||||
.primary_menu {
|
||||
z-index: 1040; /* Bootstrap's modal background is also z-index: 1040 */
|
||||
/*padding-top: 2rem;*/
|
||||
|
||||
width: 95%;
|
||||
max-width: 1400px; /* 2048px or 2560px is 2K */
|
||||
margin-bottom: .25rem;
|
||||
|
||||
padding-right: 1.75rem;
|
||||
padding-left: 1.75rem;
|
||||
|
||||
background-image: linear-gradient(to right, rgba(255,255,255,.7) 0%, rgba(255,255,255,.95) 3%, rgba(255,255,255,.95) 97%, rgba(255,255,255,.7) 100%);
|
||||
}
|
||||
.primary_menu:hover {
|
||||
z-index: 1041; /* Bootstrap's modal background is also z-index: 1040 */
|
||||
}
|
||||
|
||||
|
||||
.flash_messages {
|
||||
width: 95%;
|
||||
max-width: 1400px; /* 2048px or 2560px is 2K */
|
||||
margin-bottom: .25rem;
|
||||
|
||||
padding-top: .25rem;
|
||||
padding-right: 1.75rem;
|
||||
padding-bottom: .25rem;
|
||||
padding-left: 1.75rem;
|
||||
|
||||
background-image: linear-gradient(to right, #ffff80 0%, #ffffe1 2%, #ffffe1 98%, #ffff80 100%);
|
||||
/*border: solid thin #ffff80;*/
|
||||
}
|
||||
|
||||
.flash_messages ul {
|
||||
margin: .25rem .25rem .25rem .25rem;
|
||||
padding: .25rem .25rem .25rem .25rem;
|
||||
}
|
||||
|
||||
.flash_messages li {
|
||||
list-style-type: circle;
|
||||
}
|
||||
|
||||
.flash_messages li.info {
|
||||
/*background-color: green;*/
|
||||
}
|
||||
|
||||
.flash_messages .flashes {
|
||||
}
|
||||
|
||||
.flash_messages.show_dev .debug {
|
||||
}
|
||||
|
||||
/* BEGIN: main_template_content section of the page layout */
|
||||
|
||||
.main_template_container {
|
||||
/*border: dashed medium darkred;
|
||||
* background-color: red;*/
|
||||
|
||||
position: relative;
|
||||
/*display: flex;*/
|
||||
align-items: stretch;
|
||||
|
||||
height: auto;
|
||||
min-height: 60vh;
|
||||
width: 95%;
|
||||
max-width: 1400px; /* 2048px or 2560px is 2K */
|
||||
|
||||
margin: .5rem auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/* secondary_menu is generally the page_menu or object_type_menu */
|
||||
.secondary_menu {
|
||||
/*border: dashed medium darkgreen;
|
||||
* background-color: green;*/
|
||||
|
||||
/*position: relative;*/
|
||||
|
||||
margin-top: .25rem;
|
||||
margin-right: 0rem;
|
||||
margin-bottom: .25rem;
|
||||
margin-left: 0rem;
|
||||
|
||||
padding-top: .25rem;
|
||||
padding-right: 1.75rem;
|
||||
padding-bottom: .25rem;
|
||||
padding-left: 1.75rem;
|
||||
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
background-image: linear-gradient(to right, rgba(255,255,255,.7) 0%, rgba(255,255,255,.95) 3%, rgba(255,255,255,.95) 97%, rgba(255,255,255,.7) 100%);
|
||||
}
|
||||
|
||||
.secondary_menu>.btn-toolbar>.btn-group {
|
||||
margin-left: .1em;
|
||||
margin-right: .1em;
|
||||
}
|
||||
|
||||
.secondary_menu>.btn-toolbar>.btn-group>.btn {
|
||||
margin-left: .05em;
|
||||
margin-right: .05em;
|
||||
/*
|
||||
* border-left: solid thin #aaa;
|
||||
* border-right: solid thin #aaa;*/
|
||||
}
|
||||
|
||||
|
||||
.main_template_content {
|
||||
/*border: dashed medium darkgreen;
|
||||
* background-color: green;*/
|
||||
|
||||
position: relative;
|
||||
/*display: flex;
|
||||
* align-items: stretch;*/
|
||||
|
||||
margin-top: .25rem;
|
||||
margin-right: 0rem; /* Keep 0 to avoid horizontal scroll */
|
||||
margin-bottom: .25rem;
|
||||
margin-left: 0rem; /* Keep 0 to avoid horizontal scroll */
|
||||
padding-top: .5rem;
|
||||
padding-right: 1.75rem;
|
||||
padding-bottom: .5rem;
|
||||
padding-left: 1.75rem;
|
||||
|
||||
height: 100%;
|
||||
min-height: 50vh;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
/*background: white;*/
|
||||
/*background-image: linear-gradient(to right, #eee 0%, #fff 2%, #fff 98%, #eee 100%);*/
|
||||
background-image: linear-gradient(to right, rgba(255,255,255,.7) 0%, rgba(255,255,255,.95) 3%, rgba(255,255,255,.95) 97%, rgba(255,255,255,.7) 100%);
|
||||
}
|
||||
|
||||
/* END: main_template_content section of the page layout */
|
||||
|
||||
|
||||
/* END: Global System Classes */
|
||||
|
||||
|
||||
/*X-Small devices (portrait phones, less than 576px)*/
|
||||
/*No media query for `xs` since this is the default in Bootstrap*/
|
||||
|
||||
/*x-Small devices (portrait phones, less than 576px)*/
|
||||
@media (max-width: 575px) {
|
||||
.viewport_width {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
background-color: blue;
|
||||
color: white;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'xs';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
header.site_header, nav.primary_menu.site_menu, section.flash_messages, div.main_template_container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main_template_container {
|
||||
width: 100%;
|
||||
margin: 0rem auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.main_template_content {
|
||||
margin-top: .05rem;
|
||||
margin-right: 0rem; /* Keep 0 to avoid horizontal scroll */
|
||||
margin-bottom: .05rem;
|
||||
margin-left: 0rem; /* Keep 0 to avoid horizontal scroll */
|
||||
padding-top: .0rem;
|
||||
padding-right: .05rem;
|
||||
padding-bottom: .0rem;
|
||||
padding-left: .05rem;
|
||||
}
|
||||
|
||||
footer.system_footer {
|
||||
font-size: .8em;
|
||||
}
|
||||
}
|
||||
|
||||
/*Small devices (landscape phones, 576px and up)*/
|
||||
@media (min-width: 576px) {
|
||||
.viewport_width {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
background-color: green;
|
||||
color: black;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'sm';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
header.site_header, nav.primary_menu.site_menu, section.flash_messages, div.main_template_container {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.main_template_container {
|
||||
width: 97%;
|
||||
margin: .25rem auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.main_template_content {
|
||||
margin-top: .1rem;
|
||||
margin-right: 0rem;
|
||||
margin-bottom: .1rem;
|
||||
margin-left: 0rem;
|
||||
padding-top: .25rem;
|
||||
padding-right: 1.00rem;
|
||||
padding-bottom: .25rem;
|
||||
padding-left: 1.00rem;
|
||||
}
|
||||
|
||||
|
||||
footer.system_footer {
|
||||
font-size: .85em;
|
||||
}
|
||||
}
|
||||
|
||||
/*Medium devices (tablets, 768px and up)*/
|
||||
@media (min-width: 768px) {
|
||||
.viewport_width {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
background-color: yellow;
|
||||
color: black;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'md';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
footer.system_footer {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
/*Large devices (desktops, 992px and up)*/
|
||||
@media (min-width: 992px) {
|
||||
.viewport_width {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
background-color: orange;
|
||||
color: black;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'lg';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/*X-Large devices (large desktops, 1200px and up)*/
|
||||
@media (min-width: 1200px) {
|
||||
.viewport_width {
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
background-color: red;
|
||||
color: white;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'xl';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/*XX-Large devices (larger desktops, 1400px and up)*/
|
||||
@media (min-width: 1400px) {
|
||||
.viewport_width {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
.viewport_width::after {
|
||||
content: 'xxl';
|
||||
padding-left: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: Letter; /*Legal*/
|
||||
margin: .5in !important; /* top and bottom margin is set to .41 because of Google Chrome */
|
||||
padding: 0in;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: white !important;
|
||||
background-image: none !important;
|
||||
color: black !important;
|
||||
|
||||
margin: .25in !important;
|
||||
padding: .1in !important;
|
||||
|
||||
border: solid thin #eeeeee;
|
||||
}
|
||||
|
||||
.system_menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.system_menu_float {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site_header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site_menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.flash_messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main_template_container {
|
||||
/*border: dashed thin red;*/
|
||||
|
||||
background-color: white !important;
|
||||
background-image: none !important;
|
||||
color: black !important;
|
||||
|
||||
margin: .01in !important;
|
||||
padding: .0in !important;
|
||||
|
||||
min-width: 0 !important;
|
||||
/*width: 0 !important;*/
|
||||
max-width: 100% !important;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.secondary_menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main_template_content {
|
||||
/*border: dotted thin red;*/
|
||||
|
||||
background-color: white !important;
|
||||
background-image: none !important;
|
||||
color: black !important;
|
||||
|
||||
margin: .01in !important;
|
||||
padding: .01in !important;
|
||||
|
||||
min-width: 0 !important;
|
||||
/*width: 0 !important;*/
|
||||
max-width: 100% !important;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.system_footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden_debug {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.page_help {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.page_links {
|
||||
float: right;
|
||||
}
|
||||
1
app/svelte/build/aether_layout_flow.css
Normal file
1
app/svelte/build/aether_layout_flow.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
app/svelte/build/aether_layout_grid.css
Normal file
1
app/svelte/build/aether_layout_grid.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
app/svelte/build/bundle.css
Normal file
1
app/svelte/build/bundle.css
Normal file
File diff suppressed because one or more lines are too long
6
app/svelte/build/bundle.js
Normal file
6
app/svelte/build/bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
app/svelte/build/bundle.js.map
Normal file
1
app/svelte/build/bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
60
app/svelte/build/reloading.css
Normal file
60
app/svelte/build/reloading.css
Normal file
@@ -0,0 +1,60 @@
|
||||
/* This file will trigger the browser to reload quickly */
|
||||
|
||||
/* Component types */
|
||||
/* A section is a main component and should be outlined. It may be displayed as block. */
|
||||
section.component {
|
||||
outline: dashed thin;
|
||||
outline-color: var(--default-color-lighter);
|
||||
}
|
||||
section.component:hover {
|
||||
outline: dashed thin;
|
||||
outline-color: var(--default-color-light);
|
||||
}
|
||||
/* A div is a shared component, block, and should not be styled internally */
|
||||
div.component {
|
||||
outline: dotted thin;
|
||||
outline-color: var(--default-color-lighter);
|
||||
}
|
||||
div.component:hover {
|
||||
outline-color: var(--default-color-light);
|
||||
}
|
||||
/* A span is a shared component, inline, and should not be styled internally */
|
||||
span.component {
|
||||
outline: dotted thin;
|
||||
outline-color: var(--default-color-lighter);
|
||||
}
|
||||
span.component:hover {
|
||||
outline-color: var(--default-color-light);
|
||||
}
|
||||
|
||||
|
||||
.main_template_container {
|
||||
/*outline: dashed medium green;*/
|
||||
}
|
||||
|
||||
|
||||
.main_template_content {
|
||||
/*outline: dashed thin red;*/
|
||||
|
||||
}
|
||||
|
||||
.qr_scanner_form {
|
||||
/*outline: solid thin green;*/
|
||||
}
|
||||
|
||||
.qr_scanner {
|
||||
/*outline: solid thin pink;*/
|
||||
}
|
||||
|
||||
|
||||
.badge_body {
|
||||
/*outline: dotted thin red;*/
|
||||
}
|
||||
|
||||
.badge_person_name {
|
||||
/*outline: dashed thin pink;*/
|
||||
}
|
||||
|
||||
.badge_affiliations_location {
|
||||
/*outline: dashed thin pink;*/
|
||||
}
|
||||
14
config.json
14
config.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"account_id": 12,
|
||||
"event_id": 14,
|
||||
"event_location_id": 13,
|
||||
"account_id": "_XY7DXtc9MY",
|
||||
"event_id": "pjrcghqwert",
|
||||
"event_location_id": null,
|
||||
"event_session_id": null,
|
||||
"event_presentation_id": null,
|
||||
"event_presenter_id": null,
|
||||
@@ -13,18 +13,18 @@
|
||||
"idb_to_launcher_loop_interval": 250,
|
||||
"update_render_loop_interval": 1000,
|
||||
"check_file_cache_loop_interval": 250,
|
||||
"api_secret_key": "YWAAk39H2qH0edK6lPH0yg",
|
||||
"api_secret_key": "dFP6J9DVj9hUgIMn-fNIqg",
|
||||
"use_local_api": true,
|
||||
"use_local_db": false,
|
||||
"api_remote_base_url": "https://api.oneskyit.com",
|
||||
"api_local_base_url": "http://api.localhost:5001",
|
||||
"api_remote_base_url": "https://dev-fastapi.oneskyit.com",
|
||||
"api_local_base_url": "http://dev-fastapi.oneskyit.local:5005",
|
||||
"access_control_allow_origin": "*",
|
||||
"remote_db_server": "db.oneskyit.com",
|
||||
"remote_db_port": "3306",
|
||||
"remote_db_name": "onesky_ams_test",
|
||||
"remote_db_username": "username_here",
|
||||
"remote_db_password": "password_here",
|
||||
"local_db_server": "db.localhost",
|
||||
"local_db_server": "db.oneskyit.local",
|
||||
"local_db_port": "3306",
|
||||
"local_db_name": "onesky_ams_test",
|
||||
"local_db_username": "username_here",
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
{
|
||||
"device_id": null,
|
||||
"account_id": 12,
|
||||
"event_id": 14,
|
||||
"event_location_id": 13,
|
||||
"account_id": "_XY7DXtc9MY",
|
||||
"event_id": "pjrcghqwert",
|
||||
"event_location_id": "LUNt2zdMKCUNb9VReMZu8A",
|
||||
"main_loop_interval": 2000,
|
||||
"api_token_loop_interval": 1000,
|
||||
"api_update_period": 90000,
|
||||
"api_secret_key": "YWAAk39H2qH0edK6lPH0yg",
|
||||
"api_secret_key": "dFP6J9DVj9hUgIMn-fNIqg",
|
||||
"use_local_api": true,
|
||||
"use_local_db": false,
|
||||
"api_remote_base_url": "https://api.oneskyit.com",
|
||||
"api_local_base_url": "http://api.localhost:5001",
|
||||
"api_remote_base_url": "https://dev-fastapi.oneskyit.com",
|
||||
"api_local_base_url": "http://dev-fastapi.oneskyit.local:5005",
|
||||
"access_control_allow_origin": "*",
|
||||
"remote_db_server": "db.oneskyit.com",
|
||||
"remote_db_server": "linode.oneskyit.com",
|
||||
"remote_db_port": "3306",
|
||||
"remote_db_name": "onesky_ams_test",
|
||||
"remote_db_username": "username_here",
|
||||
"remote_db_password": "password_here",
|
||||
"local_db_server": "db.localhost",
|
||||
"local_db_server": "db.oneskyit.local",
|
||||
"local_db_port": "3306",
|
||||
"local_db_name": "onesky_ams_test",
|
||||
"local_db_username": "username_here",
|
||||
|
||||
10
index.js
10
index.js
@@ -38,7 +38,9 @@ function createWindow () {
|
||||
backgroundColor: '#fff',
|
||||
icon: './app/img/favicon.ico',
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
contextIsolation: false,
|
||||
nodeIntegration: true,
|
||||
nodeIntegrationInWorker: true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -98,8 +100,10 @@ ipcMain.on('download_file', (event, api_base_url, api_endpoint, api_temporary_to
|
||||
console.log('ipcMain download and save file: '+api_endpoint+' -> '+save_path);
|
||||
|
||||
axios.defaults.baseURL = api_base_url;
|
||||
axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*';
|
||||
axios.defaults.headers.common['Authorization'] = `Token ${api_temporary_token}`;
|
||||
axios.defaults.headers.common['Access-Control-Allow-Origin'] = access_control_allow_origin;
|
||||
axios.defaults.headers.common['content-type'] = 'application/json';
|
||||
axios.defaults.headers.common['x-aether-api-key'] = api_secret_key;
|
||||
axios.defaults.headers.common['x-account-id'] = account_id;
|
||||
|
||||
const url = api_endpoint;
|
||||
|
||||
|
||||
2133
package-lock.json
generated
2133
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"name": "onesky_native",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0",
|
||||
"description": "One Sky Native App",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "electron . --disable-gpu",
|
||||
"start": "electron .",
|
||||
"start_nogpu": "electron . --disable-gpu",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"electron": "^7.1.14",
|
||||
"axios": "^0.26.0",
|
||||
"electron": "^17.1.0",
|
||||
"fs": "0.0.1-security",
|
||||
"os": "^0.1.1",
|
||||
"path": "^0.12.7",
|
||||
|
||||
Reference in New Issue
Block a user