User:Ioaxxere/archiver.js

Hello, you have come here looking for the meaning of the word User:Ioaxxere/archiver.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Ioaxxere/archiver.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Ioaxxere/archiver.js in singular and plural. Everything you need to know about the word User:Ioaxxere/archiver.js you have here. The definition of the word User:Ioaxxere/archiver.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Ioaxxere/archiver.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
if (document.getElementById("ca-nstab-main") || document.getElementsByClassName("minerva__tab selected")) {
	if (document.querySelector("body.skin-vector-2022")) {
		document.querySelector("header").style.zIndex = 0; // otherwise it doesn't go under the popup
	}

	let content_bar = (document.getElementById("ca-nstab-main") || document.getElementsByClassName("minerva__tab selected")).parentElement;
	let archiver = document.createElement("li");
	let popup = document.createElement("div");

	content_bar.appendChild(archiver);
	archiver.className = "mw-list-item mw-list-item-js vector-tab-noicon minerva__tab"; // the kitchen sink...
	archiver.innerHTML = "<a>Archive a page</a>";

	document.body.appendChild(popup);
	popup.style = "width: 100%; height: 100%; left: 0px; top: 0px; background: rgba(0, 0, 0, 0.5); position: fixed; display: none";
	popup.innerHTML = "<div style=\"border: 2px solid #009; border-radius: 5px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(238, 238, 238, 1); height: 150px; width: min(calc(100% - 20px), 600px)\"><div style=\"box-sizing: border-box; height: 100%; display: flex; flex-direction: column; padding: 5px; gap: 5px\"><div>Enter the URL:<span style=\"cursor: pointer; float: right\">❌</span></div><textarea style=\"height: 100%; resize: none\"></textarea><button style=\"width: max-content; margin: auto\">Archive</button></div></div>";

	let popup_button = archiver.firstChild;
	let close_popup_button = popup.querySelector("span");
	let URL_form = popup.querySelector("textarea");
	let submit_button = popup.querySelector("button");

	// Open popup.
	popup_button.addEventListener("click", () => {
		popup.style.display = "block";
	});

	// Close popup.
	.forEach(elem => elem.addEventListener("click", () => {
		URL_form.value = "";
		popup.style.display = "none";
	}));
	popup.firstChild.addEventListener("click", event => event.stopPropagation());

	// Archive URL.
	submit_button.addEventListener("click", () => {
		if (URL_form.value) {
			archive_window = window.open("https://archive.ph/submit/?anyway=1&url=" + URL_form.value);
		}
	});
}