function generatePrivateMessageDialog(userData) {
        var sendNote = document.getElementById('sendNote');
        var cancelNote = document.getElementById('cancelNote');
        var privateNoteInp = document.getElementById('globalNoteInp');
        var spanNote = document.getElementById('globalNoteSpan');
        var globalNoteTitle = document.getElementById('globalNoteTitle');

        globalNoteTitle.innerHTML = "Send A Private Message Below";
        privateNoteInp.placeholder = "Hey! Just to let you know...";

        sendNote.onclick = function (){
            if(privateNoteInp.value.includes(",")){
                alert("Please do not use commas in the message. Thank you!");
            } else {
                addPrivateMessageToDB(userData, privateNoteInp.value);
                privateNoteInp.value = "";
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
                alert("The Private Message Has Been Sent!");
            }
        };
        cancelNote.onclick = function (){
            privateNoteInp.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 individual users
This function generates the modal that is used for sending messages to individual users
This function generates the modal that is used for sending messages to individual users
function generatePrivateMessageDialog(userData) {
        var sendNote = document.getElementById('sendNote');
        var cancelNote = document.getElementById('cancelNote');
        var privateNoteInp = document.getElementById('globalNoteInp');
        var spanNote = document.getElementById('globalNoteSpan');
        var globalNoteTitle = document.getElementById('globalNoteTitle');
        globalNoteTitle.innerHTML = "Send A Private Message Below";
        privateNoteInp.placeholder = "Hey! Just to let you know...";
        sendNote.onclick = function (){
            if(privateNoteInp.value.includes(",")){
                alert("Please do not use commas in the message. Thank you!");
            } else {
                addPrivateMessageToDB(userData, privateNoteInp.value);
                privateNoteInp.value = "";
                addGlobalMsgModal.style.display = "none";
                currentModalOpen = "";
                alert("The Private Message Has Been Sent!");
            }
        };
        cancelNote.onclick = function (){
            privateNoteInp.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 generatePrivateMessageDialog ( userData ) { var sendNote = document . getElementById ( 'sendNote' ) ; var cancelNote = document . getElementById ( 'cancelNote' ) ; var privateNoteInp = document . getElementById ( 'globalNoteInp' ) ; var spanNote = document . getElementById ( 'globalNoteSpan' ) ; var globalNoteTitle = document . getElementById ( 'globalNoteTitle' ) ; globalNoteTitle . innerHTML = "Send A Private Message Below" ; privateNoteInp . placeholder = "Hey! Just to let you know..." ; sendNote . onclick = function ( ) { if ( privateNoteInp . value . includes ( "," ) ) { alert ( "Please do not use commas in the message. Thank you!" ) ; } else { addPrivateMessageToDB ( userData , privateNoteInp . value ) ; privateNoteInp . value = "" ; addGlobalMsgModal . style . display = "none" ; currentModalOpen = "" ; alert ( "The Private Message Has Been Sent!" ) ; } } ; cancelNote . onclick = function ( ) { privateNoteInp . 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 individual users
This function generates the modal that is used for sending messages to individual users
//close on close //close on click