<commit_before><script type="text/javascript">
	
	// pageChanged & sizeChanged functions are needed in every model file
	// other functions for model should also be in here to avoid conflicts
	var connectorPlainText = new function() {
		// function called every time the page is viewed after it has initially loaded
		this.pageChanged = function() {
            // turn off the buttons after we've called x_pageLoaded()
            if (x_currentPageXML.getAttribute("pageNav") == "none") {
                console.log("turn off buttons");
                $x_menuBtn.hide();
                $x_nextBtn
                        .button("disable")
                        .removeClass("ui-state-focus")
                        .removeClass("ui-state-hover");
                $x_prevBtn
                        .button("disable")
                        .removeClass("ui-state-focus")
                        .removeClass("ui-state-hover");
            }
		}
		
		// function called every time the size of the LO is changed
		this.sizeChanged = function() {
			
		}

        this.afterNavigation = function(strPage) {
            console.log("we were returned to the model");
            $x_menuBtn.show();
        }

        this.init = function() {
            var $pageContents = $("#pageContents");
            var strPageContents = x_addPageLinks(x_addLineBreaks(x_currentPageXML.childNodes[0].nodeValue), "connectorPlainText.afterNavigation()");
            $pageContents.html(strPageContents);

            /* Changing "textWidth" in XOT seems to have no effect at present
             if (x_currentPageXML.getAttribute("textWidth") == "Small") {
             $pageContents.addClass("width40");
             } else if (x_currentPageXML.getAttribute("textWidth") == "Medium") {
             $pageContents.addClass("width60");
             } else if (x_currentPageXML.getAttribute("textWidth") == "Large") {
             $pageContents.addClass("width80");
             }*/

            // call this function in every model once everything's loaded
            x_pageLoaded();

            this.pageChanged();
        }
	}

    connectorPlainText.init(); // Temporary solution until XMP ready

</script>

<div id="pageContents">
	
</div><commit_msg>Refactored some code.<commit_after><script type="text/javascript">
	
	// pageChanged & sizeChanged functions are needed in every model file
	// other functions for model should also be in here to avoid conflicts
	var connectorPlainText = new function() {
		// function called every time the page is viewed after it has initially loaded
		this.pageChanged = function() {
            this.setPageNav();
		}
		
		// function called every time the size of the LO is changed
		this.sizeChanged = function() {
			
		}

        this.setPageNav = function() {
            if (x_currentPageXML.getAttribute("pageNav") == "none") {
                $x_menuBtn.hide();
                $x_nextBtn
                        .button("disable")
                        .removeClass("ui-state-focus")
                        .removeClass("ui-state-hover");
                $x_prevBtn
                        .button("disable")
                        .removeClass("ui-state-focus")
                        .removeClass("ui-state-hover");
            }
        }

        this.afterNavigation = function(strPage) {
            $x_menuBtn.show();
        }

        this.init = function() {
            var $pageContents = $("#pageContents");
            var strPageContents = x_addPageLinks(x_addLineBreaks(x_currentPageXML.childNodes[0].nodeValue), "connectorPlainText.afterNavigation()");
            $pageContents.html(strPageContents);

            /* Changing "textWidth" in XOT seems to have no effect at present
             if (x_currentPageXML.getAttribute("textWidth") == "Small") {
             $pageContents.addClass("width40");
             } else if (x_currentPageXML.getAttribute("textWidth") == "Medium") {
             $pageContents.addClass("width60");
             } else if (x_currentPageXML.getAttribute("textWidth") == "Large") {
             $pageContents.addClass("width80");
             }*/

            // call this function in every model once everything's loaded
            x_pageLoaded();

            // *** Not sure why but the prevBtn isn't disabled when model loads but is when we return to this page !?!
            this.setPageNav();
        }
	}

    connectorPlainText.init(); // Temporarily call init() until XMP ready
</script>

<div id="pageContents">
</div>
{'fraction_non_alphanumeric': 0.11241166077738515, 'fraction_numerical': 0.0030918727915194345, 'mean_word_length': 2.001325381047051, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5015074', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1127, 'n_words': 293}