Updated Alloy Page

This commit is contained in:
TheEmeraldStarr 2020-09-10 13:20:23 -07:00
parent f737c20f0b
commit 6ca4ea9c0a

View file

@ -58,17 +58,18 @@
</div> </div>
<div> <div>
<script> <script>
// Add active class to the current button (highlight it) function $(id) {
var header = document.getElementById("scontainer"); return document.getElementById(id);
var btns = header.getElementsByClassName("select"); };
for (var i = 0; i < btns.length; i++) { $('scontainer').onclick = function() {
btns[i].addEventListener("click", function() { var url = $('url').value;
var current = document.getElementsByClassName("active"); var det = document.domain;
if (current.length > 0) { var domain = det.replace('www.', '').split(/[/?#]/)[0];
current[0].className = current[0].className.replace(" active", ""); window.location.href = "https://cdn." + domain + "/alloy?url=" + url;
} return false;
this.className += " active"; };
}); window.onload = function() {
$('url').focus();
} }
</script> </script>
</div> </div>