User:DTLHS/exclude.js

Hello, you have come here looking for the meaning of the word User:DTLHS/exclude.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:DTLHS/exclude.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:DTLHS/exclude.js in singular and plural. Everything you need to know about the word User:DTLHS/exclude.js you have here. The definition of the word User:DTLHS/exclude.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:DTLHS/exclude.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
$(function () {
	var location = window.location.toString();
	if (!location.toString().includes("User:DTLHS/word_tracking")) {
		return;
	}

	var wordStatus = {};
	
	function modifyText(text, wordStatus) {
		var result = ;
		text.split("\n").forEach(function(item) {
			if (item.startsWith("# {{User:DTLHS/tracking_line|")) {
				var parts = item.split("|");
				var word = parts;
				if (word in wordStatus) {
					parts = "excluded=" + wordStatus + "}}";
					result.push(parts.join("|"))
				} else {
					result.push(item);
				}
			} else {
				result.push(item);
			}
		});
		return result.join("\n");
	}

	function include_exclude_click(event) {
		event.preventDefault();

		var el = event.target;
		var inner = el.innerText;
		if (inner == "exclude") {
			el.innerText = "include";
			var i = el.parentElement.parentElement.getElementsByTagName("i");

			var str = document.createElement("s");
			i.parentNode.insertBefore(str, i);
			str.appendChild(i);
			var word = i.innerText;

			wordStatus = "False";
		} else {
			el.innerText = "exclude";

			var i = el.parentElement.parentElement.getElementsByTagName("i");
			var str = i.parentElement;
			str.outerHTML = str.innerHTML;

			var word = i.innerText;

			
		}
		editor.addEdit({
	        'edit': function(text) {
	        	wordStatus = "True";
	        	return modifyText(text, wordStatus);
	        },
	        'redo': function () {
			},
			'undo': function () {
			},
	        'summary': 'update excluded words'
	    });

	}

	$('.toggle_include_exclude').each(function () {
		var link = document.createElement('a');

		this.parentNode.insertBefore(link, this);
		link.appendChild(this);

		this.addEventListener("click", include_exclude_click);
	});
	
	var editor = new Editor();

});