×
Create a new article
Write your page title here:
We currently have 302 articles on Knights of the Olde Speech. Type your article name above or click on one of the titles below and start writing!



Knights of the Olde Speech

MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 13: Line 13:


//April Fools' 2020
//April Fools' 2020
const body = document.getElementsByTagName('article')[0];
var audio = document.createElement("audio");
audio.setAttribute('loop', true);
audio.setAttribute('id', 'april-fool-audio');
if (location.href.indexOf('thedude') != -1)
    audio.setAttribute('src', "File:Paint_It_Black_Special.ogg");
else if(location.href.indexOf('Doom') != -1)
    audio.setAttribute('src', "File:X_Men_First_Class_-_Frankenstein_39_s_Monster.ogg");
else audio.setAttribute('src', "File:Barney_Theme_Song.ogg");
body.appendChild(audio);
var button = document.createElement("button");
button.setAttribute('id', 'april-fool-button');
var icon = document.createElement("i");
icon.setAttribute('id', 'april-fool-button-icon');
icon.setAttribute('class', 'fas fa-volume-up');
var textNode = document.createTextNode("Are you sure you want to continue?");
icon.appendChild(textNode);
button.appendChild(icon);
body.appendChild(button);
//const button = document.getElementById("april-fool-button");
//const icon = document.getElementById("april-fool-button-icon");
//const audio = document.getElementById("april-fool-audio");
button.addEventListener("click", () => {
  if (audio.paused) {
if(confirm("There is only pain ahead") &&
confirm("You are entering the world of nightmares")) {
alert("Fine you chose this yourself");
audio.volume = 0.2;
audio.play();
icon.classList.remove('fa-volume-up');
icon.classList.add('fa-volume-mute');
  button.classList.add("april-fool-fade");
}
else {
alert("Then you have chosen death");
window.location.href = "https://www.youtube.com/watch?v=MtN1YnoL46Q";
}
   
  } else {
    //audio.pause();
    icon.classList.remove('fa-volume-mute');
    icon.classList.add('fa-volume-up');
  button.classList.add("april-fool-fade");
  }
  //alert("Enjoy! :)");
  //button.style.display = 'none';
});

Revision as of 12:32, 1 April 2020

/* Any JavaScript here will be loaded for all users on every page load. */

importArticles({
    type: "script",
    articles: [
        "u:dev:MediaWiki:Medals/code.js"
    ]
});





//April Fools' 2020

const body = document.getElementsByTagName('article')[0];
var audio = document.createElement("audio");
audio.setAttribute('loop', true);
audio.setAttribute('id', 'april-fool-audio');
if (location.href.indexOf('thedude') != -1)
    audio.setAttribute('src', "File:Paint_It_Black_Special.ogg");
else if(location.href.indexOf('Doom') != -1)
    audio.setAttribute('src', "File:X_Men_First_Class_-_Frankenstein_39_s_Monster.ogg");
else audio.setAttribute('src', "File:Barney_Theme_Song.ogg");
body.appendChild(audio);
var button = document.createElement("button");
button.setAttribute('id', 'april-fool-button');
var icon = document.createElement("i");
icon.setAttribute('id', 'april-fool-button-icon');
icon.setAttribute('class', 'fas fa-volume-up');
var textNode = document.createTextNode("Are you sure you want to continue?");
icon.appendChild(textNode);
button.appendChild(icon);
body.appendChild(button);


//const button = document.getElementById("april-fool-button");
//const icon = document.getElementById("april-fool-button-icon");
//const audio = document.getElementById("april-fool-audio");

button.addEventListener("click", () => {
  if (audio.paused) {
	if(confirm("There is only pain ahead") &&
	 confirm("You are entering the world of nightmares")) {
		alert("Fine you chose this yourself");
		audio.volume = 0.2;
		audio.play();
		icon.classList.remove('fa-volume-up');
		icon.classList.add('fa-volume-mute');
		  button.classList.add("april-fool-fade");
		
	}
	else {
		alert("Then you have chosen death");
		window.location.href = "https://www.youtube.com/watch?v=MtN1YnoL46Q";
	}
    
  } else {
    //audio.pause();
    icon.classList.remove('fa-volume-mute');
    icon.classList.add('fa-volume-up');
	  button.classList.add("april-fool-fade");
  }

  //alert("Enjoy! :)");
  //button.style.display = 'none';
});