function changeUserElement(userData) {
        var editGift = document.getElementById("user" + userData.uid);
        editGift.innerHTML = userData.name;
        editGift.className = "gift";
        if (userData.secretSanta != null)
            if (userData.secretSanta == 1)
                editGift.className += " santa";
        editGift.onclick = function (){
            var spanGift = document.getElementsByClassName("close")[0];
            var warnBtn = document.getElementById('warnUser');
            var banBtn = document.getElementById('banUser');
            var userName = document.getElementById('userName');
            var userUID = document.getElementById('userUID');
            var userUserName = document.getElementById('userUserName');
            var userGifts = document.getElementById('userGifts');
            var userPrivateGifts = document.getElementById('userPrivateGifts');
            var userFriends = document.getElementById('userFriends');
            var userPassword = document.getElementById('userPassword');
            var userSecretSanta = document.getElementById('userSecretSanta');
            var moderatorOp = document.getElementById('moderatorOp');

            userName.innerHTML = userData.name;
            userUID.innerHTML = userData.uid;
            userUserName.innerHTML = userData.userName;
            if(userData.giftList != undefined){
                userGifts.innerHTML = "# Gifts: " + userData.giftList.length;
            } else {
                userGifts.innerHTML = "This User Has No Gifts";
            }
            if(userData.privateList != undefined){
                userPrivateGifts.innerHTML = "# Private Gifts: " + userData.privateList.length;
            } else {
                userPrivateGifts.innerHTML = "This User Has No Private Gifts";
            }
            if(userData.friends != undefined) {
                userFriends.innerHTML = "# Friends: " + userData.friends.length;
            } else {
                userFriends.innerHTML = "This User Has No Friends";
            }
            userPassword.innerHTML = "Click On Me To View Password";

            if(userData.secretSanta != undefined) {
                if (userData.secretSanta == 0)
                    userSecretSanta.innerHTML = "This User Is Not Opted Into Secret Santa";
                else
                    userSecretSanta.innerHTML = "This User Is Signed Up For Secret Santa";
            } else {
                userSecretSanta.innerHTML = "This User Is Not Opted Into Secret Santa";
            }

            userSecretSanta.onclick = function() {
                manuallyOptInOut(userData);
            };

            userGifts.onclick = function() {
                if(userData.uid == user.uid){
                    alert("Navigate to the home page to see your gifts!");
                } else {
                    sessionStorage.setItem("validGiftUser", JSON.stringify(userData));//Other User Data
                    navigation(4);
                }
            };
            userPrivateGifts.onclick = function() {
                if(userData.uid == user.uid){
                    alert("You aren't allowed to see these gifts, silly!");
                } else {
                    sessionStorage.setItem("validGiftUser", JSON.stringify(userData));//Other User Data
                    navigation(5);
                }
            };
            userPassword.onclick = function() {
                userPassword.innerHTML = decode(userData.encodeStr);
            };
            warnBtn.onclick = function(){
                alert("This will eventually warn the user of a certain offense");
                //warn function
            };
            banBtn.onclick = function(){
                alert("This will eventually ban the user for a certain offense");
                //ban function
            };
            if (userData.uid == "-L__dcUyFssV44G9stxY" && user.uid != "-L__dcUyFssV44G9stxY") {
                moderatorOp.innerHTML = "Don't Even Think About It";
                moderatorOp.onclick = function() {

                }
            } else if (userData.moderatorInt == 1) {
                moderatorOp.innerHTML = "Revoke Moderator Role";
                moderatorOp.onclick = function() {
                    if(userData.uid == user.uid){
                        alert("You cannot adjust your own role");
                    } else {
                        alert("Revoked role for: " + userData.userName);
                        firebase.database().ref("users/" + userData.uid).update({
                            moderatorInt: 0
                        });
                        modal.style.display = "none";
                        currentModalOpen = "";
                    }
                };
            } else {
                moderatorOp.innerHTML = "Grant Moderator Role";
                moderatorOp.onclick = function() {
                    if(userData.userName == user.userName){
                        alert("You cannot adjust your own role");
                        console.log("...How'd you get here...?");
                    } else {
                        alert("Granted role for: " + userData.userName);
                        firebase.database().ref("users/" + userData.uid).update({
                            moderatorInt: 1
                        });
                        modal.style.display = "none";
                        currentModalOpen = "";
                    }
                };
            }

            sendPrivateMessage.innerHTML = "Send Message To " + userData.name;
            sendPrivateMessage.onclick = function() {
                generatePrivateMessageDialog(userData);
            };

            //show modal
            modal.style.display = "block";
            currentModalOpen = userData.uid;

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

            //close on click
            window.onclick = function(event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                    currentModalOpen = "";
                }
            };
        };
    }
//should be noted that warning and banning are not currently operational functions.
should be noted that warning and banning are not currently operational functions.
should be noted that warning and banning are not currently operational functions .
function changeUserElement(userData) {
        var editGift = document.getElementById("user" + userData.uid);
        editGift.innerHTML = userData.name;
        editGift.className = "gift";
        if (userData.secretSanta != null)
            if (userData.secretSanta == 1)
                editGift.className += " santa";
        editGift.onclick = function (){
            var spanGift = document.getElementsByClassName("close")[0];
            var warnBtn = document.getElementById('warnUser');
            var banBtn = document.getElementById('banUser');
            var userName = document.getElementById('userName');
            var userUID = document.getElementById('userUID');
            var userUserName = document.getElementById('userUserName');
            var userGifts = document.getElementById('userGifts');
            var userPrivateGifts = document.getElementById('userPrivateGifts');
            var userFriends = document.getElementById('userFriends');
            var userPassword = document.getElementById('userPassword');
            var userSecretSanta = document.getElementById('userSecretSanta');
            var moderatorOp = document.getElementById('moderatorOp');
            userName.innerHTML = userData.name;
            userUID.innerHTML = userData.uid;
            userUserName.innerHTML = userData.userName;
            if(userData.giftList != undefined){
                userGifts.innerHTML = "# Gifts: " + userData.giftList.length;
            } else {
                userGifts.innerHTML = "This User Has No Gifts";
            }
            if(userData.privateList != undefined){
                userPrivateGifts.innerHTML = "# Private Gifts: " + userData.privateList.length;
            } else {
                userPrivateGifts.innerHTML = "This User Has No Private Gifts";
            }
            if(userData.friends != undefined) {
                userFriends.innerHTML = "# Friends: " + userData.friends.length;
            } else {
                userFriends.innerHTML = "This User Has No Friends";
            }
            userPassword.innerHTML = "Click On Me To View Password";
            if(userData.secretSanta != undefined) {
                if (userData.secretSanta == 0)
                    userSecretSanta.innerHTML = "This User Is Not Opted Into Secret Santa";
                else
                    userSecretSanta.innerHTML = "This User Is Signed Up For Secret Santa";
            } else {
                userSecretSanta.innerHTML = "This User Is Not Opted Into Secret Santa";
            }
            userSecretSanta.onclick = function() {
                manuallyOptInOut(userData);
            };
            userGifts.onclick = function() {
                if(userData.uid == user.uid){
                    alert("Navigate to the home page to see your gifts!");
                } else {
                    sessionStorage.setItem("validGiftUser", JSON.stringify(userData));
                    navigation(4);
                }
            };
            userPrivateGifts.onclick = function() {
                if(userData.uid == user.uid){
                    alert("You aren't allowed to see these gifts, silly!");
                } else {
                    sessionStorage.setItem("validGiftUser", JSON.stringify(userData));
                    navigation(5);
                }
            };
            userPassword.onclick = function() {
                userPassword.innerHTML = decode(userData.encodeStr);
            };
            warnBtn.onclick = function(){
                alert("This will eventually warn the user of a certain offense");
            };
            banBtn.onclick = function(){
                alert("This will eventually ban the user for a certain offense");
            };
            if (userData.uid == "-L__dcUyFssV44G9stxY" && user.uid != "-L__dcUyFssV44G9stxY") {
                moderatorOp.innerHTML = "Don't Even Think About It";
                moderatorOp.onclick = function() {
                }
            } else if (userData.moderatorInt == 1) {
                moderatorOp.innerHTML = "Revoke Moderator Role";
                moderatorOp.onclick = function() {
                    if(userData.uid == user.uid){
                        alert("You cannot adjust your own role");
                    } else {
                        alert("Revoked role for: " + userData.userName);
                        firebase.database().ref("users/" + userData.uid).update({
                            moderatorInt: 0
                        });
                        modal.style.display = "none";
                        currentModalOpen = "";
                    }
                };
            } else {
                moderatorOp.innerHTML = "Grant Moderator Role";
                moderatorOp.onclick = function() {
                    if(userData.userName == user.userName){
                        alert("You cannot adjust your own role");
                        console.log("...How'd you get here...?");
                    } else {
                        alert("Granted role for: " + userData.userName);
                        firebase.database().ref("users/" + userData.uid).update({
                            moderatorInt: 1
                        });
                        modal.style.display = "none";
                        currentModalOpen = "";
                    }
                };
            }
            sendPrivateMessage.innerHTML = "Send Message To " + userData.name;
            sendPrivateMessage.onclick = function() {
                generatePrivateMessageDialog(userData);
            };
            modal.style.display = "block";
            currentModalOpen = userData.uid;
            spanGift.onclick = function() {
                modal.style.display = "none";
                currentModalOpen = "";
            };
            window.onclick = function(event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                    currentModalOpen = "";
                }
            };
        };
    }
function changeUserElement ( userData ) { var editGift = document . getElementById ( "user" + userData . uid ) ; editGift . innerHTML = userData . name ; editGift . className = "gift" ; if ( userData . secretSanta != null ) if ( userData . secretSanta == 1 ) editGift . className += " santa" ; editGift . onclick = function ( ) { var spanGift = document . getElementsByClassName ( "close" ) [ 0 ] ; var warnBtn = document . getElementById ( 'warnUser' ) ; var banBtn = document . getElementById ( 'banUser' ) ; var userName = document . getElementById ( 'userName' ) ; var userUID = document . getElementById ( 'userUID' ) ; var userUserName = document . getElementById ( 'userUserName' ) ; var userGifts = document . getElementById ( 'userGifts' ) ; var userPrivateGifts = document . getElementById ( 'userPrivateGifts' ) ; var userFriends = document . getElementById ( 'userFriends' ) ; var userPassword = document . getElementById ( 'userPassword' ) ; var userSecretSanta = document . getElementById ( 'userSecretSanta' ) ; var moderatorOp = document . getElementById ( 'moderatorOp' ) ; userName . innerHTML = userData . name ; userUID . innerHTML = userData . uid ; userUserName . innerHTML = userData . userName ; if ( userData . giftList != undefined ) { userGifts . innerHTML = "# Gifts: " + userData . giftList . length ; } else { userGifts . innerHTML = "This User Has No Gifts" ; } if ( userData . privateList != undefined ) { userPrivateGifts . innerHTML = "# Private Gifts: " + userData . privateList . length ; } else { userPrivateGifts . innerHTML = "This User Has No Private Gifts" ; } if ( userData . friends != undefined ) { userFriends . innerHTML = "# Friends: " + userData . friends . length ; } else { userFriends . innerHTML = "This User Has No Friends" ; } userPassword . innerHTML = "Click On Me To View Password" ; if ( userData . secretSanta != undefined ) { if ( userData . secretSanta == 0 ) userSecretSanta . innerHTML = "This User Is Not Opted Into Secret Santa" ; else userSecretSanta . innerHTML = "This User Is Signed Up For Secret Santa" ; } else { userSecretSanta . innerHTML = "This User Is Not Opted Into Secret Santa" ; } userSecretSanta . onclick = function ( ) { manuallyOptInOut ( userData ) ; } ; userGifts . onclick = function ( ) { if ( userData . uid == user . uid ) { alert ( "Navigate to the home page to see your gifts!" ) ; } else { sessionStorage . setItem ( "validGiftUser" , JSON . stringify ( userData ) ) ; navigation ( 4 ) ; } } ; userPrivateGifts . onclick = function ( ) { if ( userData . uid == user . uid ) { alert ( "You aren't allowed to see these gifts, silly!" ) ; } else { sessionStorage . setItem ( "validGiftUser" , JSON . stringify ( userData ) ) ; navigation ( 5 ) ; } } ; userPassword . onclick = function ( ) { userPassword . innerHTML = decode ( userData . encodeStr ) ; } ; warnBtn . onclick = function ( ) { alert ( "This will eventually warn the user of a certain offense" ) ; } ; banBtn . onclick = function ( ) { alert ( "This will eventually ban the user for a certain offense" ) ; } ; if ( userData . uid == "-L__dcUyFssV44G9stxY" && user . uid != "-L__dcUyFssV44G9stxY" ) { moderatorOp . innerHTML = "Don't Even Think About It" ; moderatorOp . onclick = function ( ) { } } else if ( userData . moderatorInt == 1 ) { moderatorOp . innerHTML = "Revoke Moderator Role" ; moderatorOp . onclick = function ( ) { if ( userData . uid == user . uid ) { alert ( "You cannot adjust your own role" ) ; } else { alert ( "Revoked role for: " + userData . userName ) ; firebase . database ( ) . ref ( "users/" + userData . uid ) . update ( { moderatorInt : 0 } ) ; modal . style . display = "none" ; currentModalOpen = "" ; } } ; } else { moderatorOp . innerHTML = "Grant Moderator Role" ; moderatorOp . onclick = function ( ) { if ( userData . userName == user . userName ) { alert ( "You cannot adjust your own role" ) ; console . log ( "...How'd you get here...?" ) ; } else { alert ( "Granted role for: " + userData . userName ) ; firebase . database ( ) . ref ( "users/" + userData . uid ) . update ( { moderatorInt : 1 } ) ; modal . style . display = "none" ; currentModalOpen = "" ; } } ; } sendPrivateMessage . innerHTML = "Send Message To " + userData . name ; sendPrivateMessage . onclick = function ( ) { generatePrivateMessageDialog ( userData ) ; } ; modal . style . display = "block" ; currentModalOpen = userData . uid ; spanGift . onclick = function ( ) { modal . style . display = "none" ; currentModalOpen = "" ; } ; window . onclick = function ( event ) { if ( event . target == modal ) { modal . style . display = "none" ; currentModalOpen = "" ; } } ; } ; }
should be noted that warning and banning are not currently operational functions.
should be noted that warning and banning are not currently operational functions .
//Other User Data //Other User Data //warn function //ban function //show modal //close on close //close on click