User:WikiMacaroons/random.js

var random = $(mw.util.addPortletLink('p-personal','#','Refined Random','Search random refined','Search random refined','','#pt-mytalk')); $( random ).click( function {	document.getElementById("firstHeading").textContent = "Random Refined Search";	const popup = `	 Refined Random Search 	.button {	 border: none;	  color: white;	  padding: 16px 32px;	  text-align: center;	  text-decoration: none;	  display: inline-block;	  font-size: 16px;	  margin: 4px 2px;	  transition-duration: 0.4s;	  cursor: pointer;	}	.button1 {	  background-color: #ebf0f5; 	  color: black; 	  border: 2px solid #ebf0f5;	}	.button1:hover {	  background-color: #4CAF50;	  color: white;	  border: 2px solid #4CAF50;	}	 Featured Article      Featured List      A      GA      B      C      Start  Stub Find Random `;	document.getElementById("mw-content-text").innerHTML = popup; }); function getchecks(name) {	   const checkboxes = document.querySelectorAll(`input[name="${name}"]:checked`);	    let values = [];	    checkboxes.forEach((checkbox) => { values.push(checkbox.value); });	   if (values.length === 0) {	    	alert("Please check some values.");	    }	    else{	    	ranclass = values[Math.floor(Math.random * values.length)];	    	if(ranclass == "C"){	    		window.location.href = "https://randomincategory.toolforge.org/C-Class_articles?site=en.wikipedia.org&type=subcat";				doC;	    	}	    } } function doC{ }