Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
breakoutModewide
languagejs
<script>
	$(document).ready(function() {
		var siteDomain = "thisisatestsiteonly.com";
		if (window.location && window.location.href && window.location.href.includes(siteDomain)) {
			var languageReplacementMap = {
              " TEXT-NEEDING-CHANGE ": " DESIRED-TEXT ",
		  	  " TEXT-NEEDING-CHANGE ": " DESIRED-TEXT "
			}
			setInterval(function() {
				try {
					for (var str in languageReplacementMap) {
			 			var ccNode, ccWalker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, false);
				 	 	while (ccNode = ccWalker.nextNode()) {
				 	 		var parentTagName = ccNode && ccNode.parentElement && ccNode.parentElement.nodeName;
				  			if ((parentTagName === "DIV" || parentTagName === "SPAN") && parentTagName !== "SCRIPT") {
				  				ccNode.textContent = ccNode.textContent.replaceAll(str, languageReplacementMap[str]);
				  			}
				  		}
			  		}
			  	} catch(error) {}
			}, 100);
		}
	});
</script>

...

Code Block
breakoutModewide
languagejs
<!-- language script to support div,span,select -->
<script>
	$(document).ready(function() {
		var siteDomain = "thisisatestsiteonly.com";
		if (window.location && window.location.href && window.location.href.includes(siteDomain)) {
			var languageReplacementMap = {
              " TEXT-NEEDING-CHANGE ": " DESIRED-TEXT ",
              " TEXT-NEEDING-CHANGE ": " DESIRED-TEXT ",
              " TEXT-NEEDING-CHANGE ": " DESIRED-TEXT "
			}
			setInterval(function() {
				try {
					for (var str in languageReplacementMap) {
			 			var ccNode, ccWalker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, false);
				 	 	while (ccNode = ccWalker.nextNode()) {
				 	 		var parentTagName = ccNode && ccNode.parentElement && ccNode.parentElement.nodeName;
				  			if (["DIV", "SPAN", "OPTION"].includes(parentTagName) && parentTagName !== "SCRIPT") {
				  				ccNode.textContent = ccNode.textContent.replaceAll(str, languageReplacementMap[str]);
				  			}
				  		}
			  		}
			  	} catch(error) {}
			}, 100);
		}
	});
</script>

...