mirror of
https://github.com/nelsbrock/NateMan.git
synced 2026-08-14 21:36:49 +02:00
Initialisierung: Übertragung aus altem Repository
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// JavaScript des NateMan von Niklas Elsbrock
|
||||
|
||||
// --- Flashnachrichten EventListener ---
|
||||
var flashNode;
|
||||
for (flashNode of document.getElementsByClassName('flash')) {
|
||||
flashNode.onclick = function () {
|
||||
this.style.display = 'none';
|
||||
};
|
||||
|
||||
flashNode.onkeydown = function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
this.style.display = 'none';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// --- Tabellenzeilen EventListener ---
|
||||
var trNode;
|
||||
var href;
|
||||
for (trNode of document.getElementsByTagName('tr')) {
|
||||
if (trNode.getAttribute('data-href') !== null) {
|
||||
trNode.onclick = function () {
|
||||
window.location = this.getAttribute('data-href');
|
||||
};
|
||||
|
||||
trNode.onkeydown = function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
window.location = this.getAttribute('data-href');
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user