NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Jeuxvideo.com | Afficher signature uniquement au passage de la souris // @namespace Script par CrazyJeux/Daring-Do / idée de eXo-Necro // @version 1 // @description Affiche la signature au survol de la souris // @author Script par CrazyJeux/Daring-Do / idée de eXo-Necro // @icon https://i.imgur.com/Lk5PM91.png // @match *://*.jeuxvideo.com/* // @grant none // ==/UserScript== var isCalled = false; function first() { function toCall() { var style = document.createElement("style"); style.type = "text/css"; style.innerHTML = ".signature-msg.temphidden::before { content: \"Signature cachée, survolez avec la souris pour l'afficher\"; font-weight: bold; } " + ".signature-msg.temphidden{ height: 25px; overflow: hidden; } " + ".signature-msg:not(.temphidden):hover::before { content: \"\"; }" + ".signature-msg:not(.temphidden):hover{ height: auto; }"; //style.innerHTML = ".signature-msg:hover { height: 300px; }"; document.head.appendChild(style); var signatures = document.querySelectorAll(".signature-msg"); signatures = Array.prototype.slice.call(signatures); signatures.forEach(function (s) { (function (divSignature) { var mouseOut = function (e) { var realMouseOut = function (evt) { //console.log("realMouseOut"); tHide = null; if (tShow !== null) { //console.log("realMouseOut clearTimeout"); clearTimeout(tShow); tShow = null; } if (divSignature.className.indexOf(" temphidden") < 0) { divSignature.className = divSignature.className + " temphidden"; } isShown = false; }; //console.log("mouseOut"); if (tHide !== null) { return; } if (tShow !== null) { realMouseOut(e); } else { //console.log("mouseOut before setTimeout"); tHide = setTimeout(function () { //console.log("mouseOut in setTimeout"); realMouseOut(e); }, 150); } }; var tShow = null; var tHide = null; var isShown = false; //divSignature.style.cursor = "wait"; divSignature.onmouseover = function () { if (tHide !== null) { //console.log("onmouseover clearTimeout"); clearTimeout(tHide); tHide = null; } if (tShow !== null || isShown === true) { return; } //console.log("onmouseover before setTimeout"); tShow = setTimeout(function () { //console.log("onmouseover in setTimeout"); tShow = null; divSignature.className = divSignature.className.replace(" temphidden", ""); //divSignature.style.cursor = "initial"; isShown = true; }, 400); }; divSignature.onmouseout = mouseOut; divSignature.className = divSignature.className + " temphidden"; })(s); }); } if (isCalled === true) { return; } isCalled = true; toCall(); //Respeed addEventListener('instantclick:newpage', toCall); } document.addEventListener('DOMContentLoaded', first, false); window.addEventListener('load', first, false);