Upload and Begin

This commit is contained in:
2024-11-20 20:36:28 +01:00
parent af1749b884
commit ed9222df6a
61 changed files with 13202 additions and 0 deletions

View File

@ -0,0 +1,25 @@
form {
margin-bottom: 20px;
display: inline-block;
}
thead {
text-align: left;
}
table {
border-collapse: collapse;
border: 2px ridge gray;
}
tr:nth-child(odd) {
background-color: lightgray;
}
td, th {
padding: 0px 5px;
}
#sorszam, #cim {
font-style: italic;
}

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="utf-8">
<title>Lemezek</title>
<meta name="author" content="Hatwagner F. Miklós" />
<link type="text/css" rel="stylesheet" href="gknb_intm049_2019-20-2_03.css" />
</head>
<body>
<h1><a href="https://musicbrainz.org/" target="_blank">Lemezek</a></h1>
<form action="#">
<fieldset>
<legend>Válasszon albumot:</legend>
<div><input id="fekete" name="album" type="radio" /><label for="fekete">Sub Bass Monster - Fekete lemez</label></div>
<div><input id="rigel" name="album" type="radio" /><label for="rigel">Dynatron - The Rigel Axiom</label></div>
</fieldset>
</form>
<table>
<thead>
<th><a id="sorszam">Sorszám</a></th>
<th><a id="cim">Cím</a></th>
<th><a id="eloado">Előadó</a></th>
<th><a id="hossz">Hossz</a></th>
</thead>
<tbody id="lista">
</tbody>
</table>
<noscript>Ez a weboldal nem működik az Ön gépén a JavaScript támogatás hiánya miatt.</noscript>
<script src="albumok.js"></script>
<script src="gknb_intm049_2019-20-2_03.js"></script>
</body>
</html>

View File

@ -0,0 +1,64 @@
var rendezes = sorszamSzerint;
function sorszamSzerint(a, b) {
if(a.sorszam < b.sorszam) return -1;
else if(a.sorszam == b.sorszam) return 0;
else return 1;
}
function cimSzerint(a, b) {
if(a.cim < b.cim) return -1;
else if(a.cim == b.cim) return 0;
else return 1;
}
window.addEventListener("load", function() {
let radiok = document.querySelectorAll("input[type='radio']");
for(var i=0; i<radiok.length; i++) {
radiok[i].addEventListener("change", feltolt);
}
document.getElementById("sorszam").addEventListener("click", function() {
rendezes = sorszamSzerint;
feltolt();
});
document.getElementById("cim").addEventListener("click", function() {
rendezes = cimSzerint;
feltolt();
});
});
function feltolt() {
var lista = document.getElementById("lista");
while(lista.firstChild) {
lista.removeChild(lista.firstChild);
}
let radiok = document.querySelectorAll("input[type='radio']");
let kivAlbum = null;
for(var i=0; i<radiok.length; i++) {
if(radiok[i].checked) {
kivAlbum = radiok[i].id;
break;
}
}
if(kivAlbum !== null) {
let sor;
let cella;
albumok[kivAlbum].sort(rendezes);
for(var szam in albumok[kivAlbum]) {
sor = document.createElement("tr");
cella = document.createElement("td");
cella.textContent = albumok[kivAlbum][szam]["sorszam"];
sor.appendChild(cella);
cella = document.createElement("td");
cella.textContent = albumok[kivAlbum][szam]["cim"];
sor.appendChild(cella);
cella = document.createElement("td");
cella.textContent = albumok[kivAlbum][szam]["eloado"];
sor.appendChild(cella);
cella = document.createElement("td");
cella.textContent = albumok[kivAlbum][szam]["hossz"];
sor.appendChild(cella);
lista.appendChild(sor);
}
}
}

Binary file not shown.