Benutzer:Totto/common.js: Unterschied zwischen den Versionen

K
?
K (Schlechte Pareser vollen das in einer Zeile :yum:)
K (?)
Zeile 1:
 
 
function mainTotto(){
 
var tf=document.getElementById("p-personal");
 
var containerQuickJump=document.getElementById("p-personal") tf.getElementsByTagName("ul")[0];
var container = document.createElement('"li'");
container.setAttribute("class","TottoCustomContainer");
container.innerHTML='<a href="/wiki/ConanWiki:NextHints" dir="auto" title="Quick Acess Hints" accesskey=".">Hints</a>';
container.setAttribute("id","TottoHints");
containerQuickJump.prepend(container);
var container2 = document.createElement('"li'");
container2.setAttribute("class","TottoCustomContainer");
container2.innerHTML='<a href="/wiki/Vorlage:Anime-JP" dir="auto" title="Quick Acess Vorlage JP" accesskey=".">Vorlage JP</a>';
container2.setAttribute("id","TottoVorlageJP");
containerQuickJump.prepend(container2);
var container3 = document.createElement('"li'");
container3.setAttribute("class","TottoCustomContainer");
container3.innerHTML='<a onclick="scrollToBottom();" dir="auto" title="Quick Acess Down" accesskey=".">Downscroll</a>';
Zeile 45 ⟶ 44:
var num= hotkey.toUpperCase().charCodeAt(0);
 
document.addEventListener("keydown", event => { const key = event.keyCode; if(key==num){ window[function_to_call](); } } );
 
}
 
function addHotkeyF(hotkey,function_to_call){ var num= hotkey.toUpperCase().charCodeAt(0); document.addEventListener("keydown", event => { const key = event.keyCode; if(key==num){ function_to_call(); } } );
var num= hotkey.toUpperCase().charCodeAt(0);
document.addEventListener("keydown", event =>
{ const key = event.keyCode;
if(key==num){ function_to_call() }
 
} );
 
}
1.060

Bearbeitungen