function initializeGlobalNotification() {
        addGlobalMsgBtn.innerHTML = "Send Global Message";
        addGlobalMsgBtn.onclick = function (){
            var sendNote = document.getElementById('sendNote');
            var cancelNote = document.getElementById('cancelNote');
            var globalNoteInp = document.getElementById('globalNoteInp');
            var spanNote = document.getElementById('globalNoteSpan');
            var globalNoteTitle = document.getElementById('globalNoteTitle');

            globalNoteInp.placeholder = "WARNING: An Important Message...";
            globalNoteTitle.innerHTML = "Enter Global Notification Below";

            sendNote.onclick = function (){
                if(globalNoteInp.value.includes(",")){
                    alert("Please do not use commas in the notification. Thank you!");
                } else {
                    addGlobalMessageToDB(globalNoteInp.value);
                    globalNoteInp.value = "";
                    addGlobalMsgModal.style.display = "none";
                    currentModalOpen = "";
                    alert("The Global Message Has Been Sent!");
                }
            };
            cancelNote.onclick = function (){
                globalNoteInp.value = "";
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
            };

            addGlobalMsgModal.style.display = "block";
            currentModalOpen = "globalMessageModal";

            //close on close
            spanNote.onclick = function() {
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
            };

            //close on click
            window.onclick = function(event) {
                if (event.target == addGlobalMsgModal) {
                    addGlobalMsgModal.style.display = "none";
                    currentModalOpen = "";
                }
            };
        };
    }
//This function generates the modal that is used for sending messages to users globally
This function generates the modal that is used for sending messages to users globally
This function generates the modal that is used for sending messages to users globally
function initializeGlobalNotification() {
        addGlobalMsgBtn.innerHTML = "Send Global Message";
        addGlobalMsgBtn.onclick = function (){
            var sendNote = document.getElementById('sendNote');
            var cancelNote = document.getElementById('cancelNote');
            var globalNoteInp = document.getElementById('globalNoteInp');
            var spanNote = document.getElementById('globalNoteSpan');
            var globalNoteTitle = document.getElementById('globalNoteTitle');
            globalNoteInp.placeholder = "WARNING: An Important Message...";
            globalNoteTitle.innerHTML = "Enter Global Notification Below";
            sendNote.onclick = function (){
                if(globalNoteInp.value.includes(",")){
                    alert("Please do not use commas in the notification. Thank you!");
                } else {
                    addGlobalMessageToDB(globalNoteInp.value);
                    globalNoteInp.value = "";
                    addGlobalMsgModal.style.display = "none";
                    currentModalOpen = "";
                    alert("The Global Message Has Been Sent!");
                }
            };
            cancelNote.onclick = function (){
                globalNoteInp.value = "";
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
            };
            addGlobalMsgModal.style.display = "block";
            currentModalOpen = "globalMessageModal";
            spanNote.onclick = function() {
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
            };
            window.onclick = function(event) {
                if (event.target == addGlobalMsgModal) {
                    addGlobalMsgModal.style.display = "none";
                    currentModalOpen = "";
                }
            };
        };
    }
function initializeGlobalNotification ( ) { addGlobalMsgBtn . innerHTML = "Send Global Message" ; addGlobalMsgBtn . onclick = function ( ) { var sendNote = document . getElementById ( 'sendNote' ) ; var cancelNote = document . getElementById ( 'cancelNote' ) ; var globalNoteInp = document . getElementById ( 'globalNoteInp' ) ; var spanNote = document . getElementById ( 'globalNoteSpan' ) ; var globalNoteTitle = document . getElementById ( 'globalNoteTitle' ) ; globalNoteInp . placeholder = "WARNING: An Important Message..." ; globalNoteTitle . innerHTML = "Enter Global Notification Below" ; sendNote . onclick = function ( ) { if ( globalNoteInp . value . includes ( "," ) ) { alert ( "Please do not use commas in the notification. Thank you!" ) ; } else { addGlobalMessageToDB ( globalNoteInp . value ) ; globalNoteInp . value = "" ; addGlobalMsgModal . style . display = "none" ; currentModalOpen = "" ; alert ( "The Global Message Has Been Sent!" ) ; } } ; cancelNote . onclick = function ( ) { globalNoteInp . value = "" ; addGlobalMsgModal . style . display = "none" ; currentModalOpen = "" ; } ; addGlobalMsgModal . style . display = "block" ; currentModalOpen = "globalMessageModal" ; spanNote . onclick = function ( ) { addGlobalMsgModal . style . display = "none" ; currentModalOpen = "" ; } ; window . onclick = function ( event ) { if ( event . target == addGlobalMsgModal ) { addGlobalMsgModal . style . display = "none" ; currentModalOpen = "" ; } } ; } ; }
This function generates the modal that is used for sending messages to users globally
This function generates the modal that is used for sending messages to users globally
//close on close //close on click