<commit_before>var methods = {
    focusAllTheThings:function(){
        //This is so my internal links get keyboard focus (for accessibility's sake)
            //get that link
            var href=this.getAttribute("href");
            //take the hash (#) off
            var theID = href.substr(1);
            //set focus on THAT IDed element.
            document.getElementById(theID).focus();
    },//end function focusAllTheThings
    yellowFlash:function(){
        var slidesLength = methods.countTheSlides();
        for (var i = 0; i < slidesLength; i++) {
            var theActiveSlideElement = document.getElementById("slide"+(i+1));
            var theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[0];
            if(theFirstParagraph.parentNode.className !=="figure"){
             theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[0];
            }else{
                theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[1];
            }//end if
            theFirstParagraph.className = "TheFirst";

        }
    },//end yellowFlashFunction
    figureModalHandler: function(){
        //add the class that makes it a modal box

        var theFigureBox = this.parentNode;
        var theFigureImage = theFigureBox.children[1];
        var theFigureCaption = theFigureBox.children[2];
        var figureEval = theFigureBox.getAttribute("data-state");


        if (figureEval === "closed") {
            //closed --> open
            theFigureBox.setAttribute("data-state","open");
            theFigureBox.className = "figure-open-state";
            this.src = "img/figureClose.svg";
            if(theFigureImage.tagName === "IMG"){
                    theFigureImage.style.overflow = "scroll";
                }//endif
            if(theFigureCaption.tagName === "P"){
                    theFigureCaption.style.backgroundColor = "#FFF";
                }//endif
        }//endif
        if (figureEval === "open") {
            //open--->closed
            theFigureBox.setAttribute("data-state","closed");
            theFigureBox.className = "figure-closed-state";
            this.src = "img/figureOpen.svg";
            if(theFigureCaption.tagName === "IMG"){
                    theFigureCaption.style.overflow = "visible";
                }//endif
            if(theFigureCaption.tagName === "P"){
                    theFigureCaption.style.backgroundColor = "transparent";
                }//endif
        }//end if
    },//end figureModalHandler
    figureButtonInsertion:function(){
        //create a button element that will be inserted into each figure element.

        //first: gather and loop through each figure element.
        var allTheFigureElements = document.getElementsByClassName("figure");
        //each element needs to have a button inserted, and then a listener added to the button.
            for (var i = 0; i < allTheFigureElements.length; i++) {
                //create the button element
                var newFigureButtonElement = document.createElement("img");
                newFigureButtonElement.src = "img/figureOpen.svg";
                newFigureButtonElement.alt = "";
                newFigureButtonElement.className = "fullScreenButton";
                var theCurrentFigureID = "figureButton"+(i+1);
                newFigureButtonElement.id = theCurrentFigureID;
                // insertTheButton image element.
                var theFigureParentNode = allTheFigureElements[i];
                theFigureParentNode.setAttribute("data-state","closed");
                // grab the img in the box, and set it up as the reference node.
                var theIMGsInFigure = allTheFigureElements[i].getElementsByTagName("img");
                var theFigureReferenceNode = theIMGsInFigure[0];
                //now insert the button
                theFigureParentNode.insertBefore(newFigureButtonElement, theFigureReferenceNode);


                document.getElementById(theCurrentFigureID).addEventListener("click",methods.figureModalHandler,false);
            }//end for


    },//end figureButtonInsertion
    populateTheNavMenu: function () {
        //this function is called from main, and adds list items to the nav menu.
        var insertThisListItemElement,navLiParentNode,insertLiBeforeThis,theInitialTarget;
        //how many slides do I have?
        var theInitialSlideCount = methods.countTheSlides();



        //now that I have a target built I can send everything else it's way.
        //NOTE:this loop counts down from the total down to one.
        if(methods.countTheSlides()===1){
            //I just need to use the existing element if there is only one slide.
            //there is only one so treat it as such.
            //
            theInitialTarget = document.getElementById("mainNavList").children[0];
            theInitialTarget.id = "nav1";
            theInitialTarget.className = "activeNavElement";
            theInitialTarget.setAttribute("tabindex","-1");
            theInitialTarget.innerHTML = "1";


        }else{
            //there is more than one, so start ripping.
            //the initial target for insertion is the single empty li child in the mainNavList element
            theInitialTarget = document.getElementById("mainNavList").children[0];
            //give the blank Li an ID
            theInitialTarget.id = "nav"+theInitialSlideCount;
            //these three lines set the attributes of the target element.
            theInitialTarget.className = "navElement";

            theInitialTarget.innerHTML = theInitialSlideCount;
            for(var i=(methods.countTheSlides()-1);i>0;i--){
                //create and build the LI to be inserted
                insertThisListItemElement = document.createElement("li");
                insertThisListItemElement.id = "nav"+i;
                if(i===1){
                    insertThisListItemElement.className = "activeNavElement";
                }else{
                    insertThisListItemElement.className = "navElement";
                }//end if
                insertThisListItemElement.setAttribute("tabindex","-1");
                insertThisListItemElement.innerHTML = i;

                navLiParentNode = document.getElementById("mainNavList");
                insertLiBeforeThis = document.getElementById("nav"+(i+1));

                navLiParentNode.insertBefore(insertThisListItemElement,insertLiBeforeThis);
            }//end for
        }//end if


    },//end populateTheNavMenu
    clickScopeTOC: function () {
        var theIDtoSend, theTOCparentID;
        theTOCparentID = this.parentNode.id;
        //alert(theTOCparentID);
        if (theTOCparentID === "tocClosedState") {
            //This TOC is CLOSED and needs to be OPENED.

            theIDtoSend = this.id;//(theTocTarget)

            methods.openTOC(theIDtoSend);
        }//end if
        if (theTOCparentID === "tocOpenState") {
            //This TOC is OPEN and needs to be CLOSED.

            theIDtoSend = this.id;//(theTocTarget)

            methods.closeTOC(theIDtoSend);
        }//end if
    },//end scopeTOC function
    closeTOC: function (incomingSlideID) {

        var theTOCelement = document.getElementById(incomingSlideID).parentNode.id;//so theTocTarget's parentNode
        document.getElementById(theTOCelement).className = "TOCs";
        document.getElementById(theTOCelement).id = "tocClosedState";
    },//end justCloseTOC
    openTOC: function (theIDofWHatIClicked) {
        var theTOCelement = document.getElementById(theIDofWHatIClicked).parentNode;
        //add clearfix to the open menu so it shows everything inside.

        theTOCelement.classList.add = "clearfix";
        theTOCelement.id = "tocOpenState";<commit_msg>Moved one line in the JS file.<commit_after>var methods = {
    focusAllTheThings:function(){
        //This is so my internal links get keyboard focus (for accessibility's sake)
            //get that link
            var href=this.getAttribute("href");
            //take the hash (#) off
            var theID = href.substr(1);
            //set focus on THAT IDed element.
            document.getElementById(theID).focus();
    },//end function focusAllTheThings
    yellowFlash:function(){
        var slidesLength = methods.countTheSlides();
        for (var i = 0; i < slidesLength; i++) {
            var theActiveSlideElement = document.getElementById("slide"+(i+1));
            var theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[0];
            if(theFirstParagraph.parentNode.className !=="figure"){
             theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[0];
            }else{
                theFirstParagraph = theActiveSlideElement.getElementsByTagName('p')[1];
            }//end if
            theFirstParagraph.className = "TheFirst";

        }
    },//end yellowFlashFunction
    figureModalHandler: function(){
        //add the class that makes it a modal box

        var theFigureBox = this.parentNode;
        var theFigureImage = theFigureBox.children[1];
        var theFigureCaption = theFigureBox.children[2];
        var figureEval = theFigureBox.getAttribute("data-state");


        if (figureEval === "closed") {
            //closed --> open
            theFigureBox.setAttribute("data-state","open");
            theFigureBox.className = "figure-open-state";
            this.src = "img/figureClose.svg";
            if(theFigureImage.tagName === "IMG"){
                    theFigureImage.style.overflow = "scroll";
                }//endif
            if(theFigureCaption.tagName === "P"){
                    theFigureCaption.style.backgroundColor = "#FFF";
                }//endif
        }//endif
        if (figureEval === "open") {
            //open--->closed
            theFigureBox.setAttribute("data-state","closed");
            theFigureBox.className = "figure-closed-state";
            this.src = "img/figureOpen.svg";
            if(theFigureCaption.tagName === "IMG"){
                    theFigureCaption.style.overflow = "visible";
                }//endif
            if(theFigureCaption.tagName === "P"){
                    theFigureCaption.style.backgroundColor = "transparent";
                }//endif
        }//end if
    },//end figureModalHandler
    figureButtonInsertion:function(){
        //create a button element that will be inserted into each figure element.

        //first: gather and loop through each figure element.
        var allTheFigureElements = document.getElementsByClassName("figure");
        //each element needs to have a button inserted, and then a listener added to the button.
            for (var i = 0; i < allTheFigureElements.length; i++) {
                //create the button element
                var newFigureButtonElement = document.createElement("img");
                newFigureButtonElement.src = "img/figureOpen.svg";
                newFigureButtonElement.alt = "";
                newFigureButtonElement.className = "fullScreenButton";
                var theCurrentFigureID = "figureButton"+(i+1);
                newFigureButtonElement.id = theCurrentFigureID;
                // insertTheButton image element.
                var theFigureParentNode = allTheFigureElements[i];
                theFigureParentNode.setAttribute("data-state","closed");
                // grab the img in the box, and set it up as the reference node.
                var theIMGsInFigure = allTheFigureElements[i].getElementsByTagName("img");
                var theFigureReferenceNode = theIMGsInFigure[0];
                //now insert the button
                theFigureParentNode.insertBefore(newFigureButtonElement, theFigureReferenceNode);


                document.getElementById(theCurrentFigureID).addEventListener("click",methods.figureModalHandler,false);
            }//end for


    },//end figureButtonInsertion
    populateTheNavMenu: function () {
        //this function is called from main, and adds list items to the nav menu.
        var insertThisListItemElement,navLiParentNode,insertLiBeforeThis,theInitialTarget;
        //how many slides do I have?
        var theInitialSlideCount = methods.countTheSlides();



        //now that I have a target built I can send everything else it's way.
        //NOTE:this loop counts down from the total down to one.
        if(methods.countTheSlides()===1){
            //I just need to use the existing element if there is only one slide.
            //there is only one so treat it as such.
            //
            theInitialTarget = document.getElementById("mainNavList").children[0];
            theInitialTarget.id = "nav1";
            theInitialTarget.className = "activeNavElement";
            theInitialTarget.setAttribute("tabindex","-1");
            theInitialTarget.innerHTML = "1";


        }else{
            //there is more than one, so start ripping.
            //the initial target for insertion is the single empty li child in the mainNavList element
            theInitialTarget = document.getElementById("mainNavList").children[0];
            //give the blank Li an ID
            theInitialTarget.id = "nav"+theInitialSlideCount;
            //these three lines set the attributes of the target element.
            theInitialTarget.className = "navElement";

            theInitialTarget.innerHTML = theInitialSlideCount;
            for(var i=(methods.countTheSlides()-1);i>0;i--){
                //create and build the LI to be inserted
                insertThisListItemElement = document.createElement("li");
                insertThisListItemElement.id = "nav"+i;
                if(i===1){
                    insertThisListItemElement.className = "activeNavElement";
                }else{
                    insertThisListItemElement.className = "navElement";
                }//end if
                insertThisListItemElement.setAttribute("tabindex","-1");
                insertThisListItemElement.innerHTML = i;

                navLiParentNode = document.getElementById("mainNavList");
                insertLiBeforeThis = document.getElementById("nav"+(i+1));

                navLiParentNode.insertBefore(insertThisListItemElement,insertLiBeforeThis);
            }//end for
        }//end if


    },//end populateTheNavMenu
    clickScopeTOC: function () {
        var theIDtoSend, theTOCparentID;
        theTOCparentID = this.parentNode.id;
        //alert(theTOCparentID);
        if (theTOCparentID === "tocClosedState") {
            //This TOC is CLOSED and needs to be OPENED.

            theIDtoSend = this.id;//(theTocTarget)

            methods.openTOC(theIDtoSend);
        }//end if
        if (theTOCparentID === "tocOpenState") {
            //This TOC is OPEN and needs to be CLOSED.

            theIDtoSend = this.id;//(theTocTarget)

            methods.closeTOC(theIDtoSend);
        }//end if
    },//end scopeTOC function
    closeTOC: function (incomingSlideID) {

        var theTOCelement = document.getElementById(incomingSlideID).parentNode.id;//so theTocTarget's parentNode
        document.getElementById(theTOCelement).className = "TOCs";
        document.getElementById(theTOCelement).id = "tocClosedState";
    },//end justCloseTOC
    openTOC: function (theIDofWHatIClicked) {
        var theTOCelement = document.getElementById(theIDofWHatIClicked).parentNode;
        //add clearfix to the open menu so it shows everything inside.


        theTOCelement.id = "tocOpenState";
        theTOCelement.classList.add = "clearfix";
{'fraction_non_alphanumeric': 0.10034579918032786, 'fraction_numerical': 0.0028176229508196722, 'mean_word_length': 2.1761236526337195, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6286342', 'n_tokens_mistral': 4085, 'n_tokens_neox': 3919, 'n_words': 973}