theonlychase
7/23/2018 - 9:19 PM

Heartbeat Function

This script was necessary to change two words in a paragraph. This paragraph only shows up in a modal if the login credentials are incorrect upon submission.

//Heartbeat Function
function updateString() {
	if (nextQuery('body').hasClass('nextLogin')) {
		if (nextQuery(".isModified")[0]){
			return;
		} else {
			var oldString = "We're sorry . . .",
			newString = "<span class='isModified'>We're sorry . . .</span>",
			newText = nextQuery('p.nextInvalidLoginMessage1').text().replace(RegExp(oldString,"gi"),newString);
			nextQuery('p.nextInvalidLoginMessage1').html(newText);
		}
	}
}
updateString();
setInterval( function(){updateString();} , 1000 );