User:Anne drew Andrew and Drew/WatchingIndicator.js

(function {	let saveButtonWatchingIndicator = document.getElementById('wpSave');	if (saveButtonWatchingIndicator) {		saveButtonWatchingIndicator.onmousedown = function(event) {			let watchBox = document.getElementById("wpWatchthis");			let textBox = document.getElementById('wpTextbox1');			if (textBox && watchBox) {			    let watching = document.getElementById("ca-unwatch") || watchBox.checked ? "watching this page'>★" : "not watching this page'>☆";			    let text = textBox.value;			    if (text.search(/````/g) > -1) {			        if (confirm("Replace ```` with signature and watching indicator?") && ((text.match(/````/g) || []).length == 1 || confirm("Multiple instances found. Continue?")))			            textBox.value = text.replace(/````/g, " <span style='color:#09F' title='I’m "+ watching + " ");			    }			}		}	} });