From Test-Scratch-Wiki

< User:Jakel181

Line 1: Line 1:
function nouvelleEnquete(){localStorage.clear(),newEnquetePopup(),document.getElementById("popupEnqueteClose").onclick=function(){localStorage.setItem("enquete",JSON.stringify({hiddenOn:Date.now()})),document.getElementById("popupEnquete").remove()}}function newEnquetePopup(){var e=document.getElementById("mw-content-text"),t=document.createElement("div");t.id="popupEnquete",t.style.padding="20px",t.style.maxWidth="calc(100% - 80px)",t.style.backgroundColor="#f9d44d",t.style.borderRadius="5px",t.style.color="#000000",t.style.bottom="calc(0% + 20px)",t.style.right="calc(0% + 20px)",t.style.width="300px",t.style.position="fixed",t.style.boxShadow="0px 1px 5px black",t.style.zIndex="10",t.style.transition="0.5s cubic-bezier(0.43, 0.02, 0.52, 0.96)",t.innerHTML='<img src="https://fr.scratch-wiki.info/w/images/4/4c/Enqu%C3%AAte.png" style="float:left;height:50px;padding-right: 20px;"/><button id="popupEnqueteClose" style="float:right;background-color: transparent;cursor: pointer;border:none;"><u>X</u></button></html> <div style="line-height: 1.7em;color: black;font-size: 16px;font-weight: bold;">Enquête de Satisfaction</div><hr>YOUR TEXT HERE.',e.appendChild(t)}window.onload=function(){if(localStorage.getItem("enquete"))try{var e=JSON.parse(localStorage.getItem("enquete"));Date.now()-6048e5>e.hiddenOn&&nouvelleEnquete()}catch(e){nouvelleEnquete()}else nouvelleEnquete()};
+
function Popup(){localStorage.clear(),newPopup(),document.getElementById("popupClose").onclick=function(){localStorage.setItem("enquete",JSON.stringify({hiddenOn:Date.now()})),document.getElementById("popupbox").remove()}}function newPopup(){var e=document.getElementById("mw-content-text"),t=document.createElement("div");t.id="popupbox",t.style.padding="20px",t.style.maxWidth="calc(100% - 80px)",t.style.backgroundColor="#f9d44d",t.style.borderRadius="5px",t.style.color="#000000",t.style.bottom="calc(0% + 20px)",t.style.right="calc(0% + 20px)",t.style.width="300px",t.style.position="fixed",t.style.boxShadow="0px 1px 5px black",t.style.zIndex="10",t.style.transition="0.5s cubic-bezier(0.43, 0.02, 0.52, 0.96)",t.innerHTML='<img src="https://fr.scratch-wiki.info/w/images/4/4c/Enqu%C3%AAte.png" style="float:left;height:50px;padding-right: 20px;"/><button id="popupClose" style="float:right;background-color: transparent;cursor: pointer;border:none;"><u>X</u></button></html> <div style="line-height: 1.7em;color: black;font-size: 16px;font-weight: bold;">YOUR TITLE HERE</div><hr>YOUR TEXT HERE.',e.appendChild(t)}window.onload=function(){if(localStorage.getItem("closed"))try{var e=JSON.parse(localStorage.getItem("closed"));Date.now()-6048e5>e.hiddenOn&&Popup()}catch(e){Popup()}else Popup()};

Revision as of 22:24, 29 April 2019

function Popup(){localStorage.clear(),newPopup(),document.getElementById("popupClose").onclick=function(){localStorage.setItem("enquete",JSON.stringify({hiddenOn:Date.now()})),document.getElementById("popupbox").remove()}}function newPopup(){var e=document.getElementById("mw-content-text"),t=document.createElement("div");t.id="popupbox",t.style.padding="20px",t.style.maxWidth="calc(100% - 80px)",t.style.backgroundColor="#f9d44d",t.style.borderRadius="5px",t.style.color="#000000",t.style.bottom="calc(0% + 20px)",t.style.right="calc(0% + 20px)",t.style.width="300px",t.style.position="fixed",t.style.boxShadow="0px 1px 5px black",t.style.zIndex="10",t.style.transition="0.5s cubic-bezier(0.43, 0.02, 0.52, 0.96)",t.innerHTML='<img src="https://fr.scratch-wiki.info/w/images/4/4c/Enqu%C3%AAte.png" style="float:left;height:50px;padding-right: 20px;"/><button id="popupClose" style="float:right;background-color: transparent;cursor: pointer;border:none;"><u>X</u></button></html> <div style="line-height: 1.7em;color: black;font-size: 16px;font-weight: bold;">YOUR TITLE HERE</div><hr>YOUR TEXT HERE.',e.appendChild(t)}window.onload=function(){if(localStorage.getItem("closed"))try{var e=JSON.parse(localStorage.getItem("closed"));Date.now()-6048e5>e.hiddenOn&&Popup()}catch(e){Popup()}else Popup()};