function generatePrivateMessageDialog(userData) {
      var sendNote = document.getElementById('sendNote');
      var cancelNote = document.getElementById('cancelNote');
      var privateNoteInp = document.getElementById('privateNoteInp');
      var spanNote = document.getElementById('privateNoteSpan');
      var globalNoteTitle = document.getElementById('privateNoteTitle');
      var message = "";

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

      sendNote.onclick = function (){
          message = generatePrivateMessage(user.uid, privateNoteInp.value);
          addPrivateMessageToDB(userData, message);
          privateNoteInp.value = "";
          addGlobalMsgModal.style.display = "none";
          alert("The Message Has Been Sent!");
      };
      cancelNote.onclick = function (){
          privateNoteInp.value = "";
          addGlobalMsgModal.style.display = "none";
      };

      addGlobalMsgModal.style.display = "block";

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

      //close on click
      window.onclick = function(event) {
          if (event.target == addGlobalMsgModal) {
              addGlobalMsgModal.style.display = "none";
          }
      };
  }
//in the message and clicks "Send", the message will be added to the appropriate user's notifications in the database.
in the message and clicks "Send", the message will be added to the appropriate user's notifications in the database.
in the message and clicks " Send " the message will be added to the appropriate user ' s notifications in the database .
function generatePrivateMessageDialog(userData) {
      var sendNote = document.getElementById('sendNote');
      var cancelNote = document.getElementById('cancelNote');
      var privateNoteInp = document.getElementById('privateNoteInp');
      var spanNote = document.getElementById('privateNoteSpan');
      var globalNoteTitle = document.getElementById('privateNoteTitle');
      var message = "";
      globalNoteTitle.innerHTML = "Send A Private Message Below";
      privateNoteInp.placeholder = "Hey! Just to let you know...";
      sendNote.onclick = function (){
          message = generatePrivateMessage(user.uid, privateNoteInp.value);
          addPrivateMessageToDB(userData, message);
          privateNoteInp.value = "";
          addGlobalMsgModal.style.display = "none";
          alert("The Message Has Been Sent!");
      };
      cancelNote.onclick = function (){
          privateNoteInp.value = "";
          addGlobalMsgModal.style.display = "none";
      };
      addGlobalMsgModal.style.display = "block";
      spanNote.onclick = function() {
          addGlobalMsgModal.style.display = "none";
      };
      window.onclick = function(event) {
          if (event.target == addGlobalMsgModal) {
              addGlobalMsgModal.style.display = "none";
          }
      };
  }
function generatePrivateMessageDialog ( userData ) { var sendNote = document . getElementById ( 'sendNote' ) ; var cancelNote = document . getElementById ( 'cancelNote' ) ; var privateNoteInp = document . getElementById ( 'privateNoteInp' ) ; var spanNote = document . getElementById ( 'privateNoteSpan' ) ; var globalNoteTitle = document . getElementById ( 'privateNoteTitle' ) ; var message = "" ; globalNoteTitle . innerHTML = "Send A Private Message Below" ; privateNoteInp . placeholder = "Hey! Just to let you know..." ; sendNote . onclick = function ( ) { message = generatePrivateMessage ( user . uid , privateNoteInp . value ) ; addPrivateMessageToDB ( userData , message ) ; privateNoteInp . value = "" ; addGlobalMsgModal . style . display = "none" ; alert ( "The Message Has Been Sent!" ) ; } ; cancelNote . onclick = function ( ) { privateNoteInp . value = "" ; addGlobalMsgModal . style . display = "none" ; } ; addGlobalMsgModal . style . display = "block" ; spanNote . onclick = function ( ) { addGlobalMsgModal . style . display = "none" ; } ; window . onclick = function ( event ) { if ( event . target == addGlobalMsgModal ) { addGlobalMsgModal . style . display = "none" ; } } ; }
in the message and clicks "Send", the message will be added to the appropriate user's notifications in the database.
in the message and clicks " Send " the message will be added to the appropriate user ' s notifications in the database .
//close on close //close on click