diff --git a/directory.css b/directory.css index 097f5f1..c720b12 100644 --- a/directory.css +++ b/directory.css @@ -1,16 +1,16 @@ -#_kfrombi_columns_slider{display: inline-block; vertical-align: middle;} +#kf-trombi_columns_slider{display: inline-block; vertical-align: middle;} -#_kfrombi_trombi { display: grid; grid-row-gap: 2em; font-size: 1.2em; text-align: center; } +#kf-trombi_trombi { display: grid; grid-row-gap: 2em; font-size: 1.2em; text-align: center; } -._kfrombi_trombi_3 { grid-template-columns: repeat(3, 1fr); } -._kfrombi_trombi_4 { grid-template-columns: repeat(4, 1fr); } -._kfrombi_trombi_5 { grid-template-columns: repeat(5, 1fr); } -._kfrombi_trombi_6 { grid-template-columns: repeat(6, 1fr); } -._kfrombi_trombi_7 { grid-template-columns: repeat(7, 1fr); } -._kfrombi_trombi_8 { grid-template-columns: repeat(8, 1fr); } +.kf-trombi_trombi_3 { grid-template-columns: repeat(3, 1fr); } +.kf-trombi_trombi_4 { grid-template-columns: repeat(4, 1fr); } +.kf-trombi_trombi_5 { grid-template-columns: repeat(5, 1fr); } +.kf-trombi_trombi_6 { grid-template-columns: repeat(6, 1fr); } +.kf-trombi_trombi_7 { grid-template-columns: repeat(7, 1fr); } +.kf-trombi_trombi_8 { grid-template-columns: repeat(8, 1fr); } .hidden { display: none; } -._kfrombi_trombi_img { +.kf-trombi_trombi_img { filter: grayscale(100%) contrast(150%); } diff --git a/directory.js b/directory.js index 1c9b04b..b9e8192 100644 --- a/directory.js +++ b/directory.js @@ -5,7 +5,7 @@ const ordNrRegex = /.*pOrgNr=([0-9]+).*/gm; const personalIDRegex = /.*pStPersonNr=([0-9]+).*/gm; function appendLink() { - if (document.getElementById("_kfrombi_row")) return; + if (document.getElementById("kf-trombi_row")) return; var row_header = document.createElement("th"); row_header.textContent = "Trombi"; @@ -16,23 +16,23 @@ function appendLink() { link.addEventListener("click", toggleTrombi); var slider = document.createElement("input"); - slider.id = "_kfrombi_columns_slider"; + slider.id = "kf-trombi_columns_slider"; slider.type = "range"; slider.value = 5; slider.min = 3; slider.max = 8; var column_nr = document.createElement("span"); - column_nr.id = "_kfrombi_column_nr"; + column_nr.id = "kf-trombi_column_nr"; column_nr.textContent = slider.value; var column_label = document.createElement("span"); column_label.textContent = " columns"; slider.addEventListener("input", (event) => { column_nr.textContent = slider.value; - const trombi = document.getElementById("_kfrombi_trombi"); - trombi.classList.remove( "_kfrombi_trombi_3", "_kfrombi_trombi_4", "_kfrombi_trombi_5", "_kfrombi_trombi_6", "_kfrombi_trombi_7", "_kfrombi_trombi_8" ); - trombi.classList.add(`_kfrombi_trombi_${slider.value}`); + const trombi = document.getElementById("kf-trombi_trombi"); + trombi.classList.remove( "kf-trombi_trombi_3", "kf-trombi_trombi_4", "kf-trombi_trombi_5", "kf-trombi_trombi_6", "kf-trombi_trombi_7", "kf-trombi_trombi_8" ); + trombi.classList.add(`kf-trombi_trombi_${slider.value}`); }) var row_links = document.createElement("td"); @@ -41,7 +41,7 @@ function appendLink() { var tr = document.createElement("tr"); tr.classList.add("coNavdocument.getElementByIdroup"); tr.append(row_header, row_links); - tr.id = "_kfrombi_row"; + tr.id = "kf-trombi_row"; const nav = document.getElementById("idPageNavi"); nav.tBodies[0].append(tr); @@ -61,7 +61,7 @@ function generateCard(student, col) { d.style.gridColumn = "auto"; const img = document.createElement("img"); - img.classList.add("_kfrombi_trombi_img"); + img.classList.add("kf-trombi_trombi_img"); img.src = url; const name_div = document.createElement("div"); @@ -72,20 +72,20 @@ function generateCard(student, col) { } function toggleTrombi() { - const trombi = document.getElementById("_kfrombi_trombi"); + const trombi = document.getElementById("kf-trombi_trombi"); const form = document.getElementById("idTNListe"); trombi.classList.toggle("hidden"); form.classList.toggle("hidden"); } function generateTrombi() { - var trombi = document.getElementById("_kfrombi_trombi"); + var trombi = document.getElementById("kf-trombi_trombi"); if (trombi) { trombi.remove(); } - const slider = document.getElementById("_kfrombi_columns_slider"); + const slider = document.getElementById("kf-trombi_columns_slider"); trombi = document.createElement("div"); - trombi.id = "_kfrombi_trombi"; + trombi.id = "kf-trombi_trombi"; trombi.classList.add("hidden"); - trombi.classList.add(`_kfrombi_trombi_${slider.value}`); + trombi.classList.add(`kf-trombi_trombi_${slider.value}`); const form = document.getElementById("idTNListe"); const table_body = document.getElementById("idTNVWTable").tBodies[0]; diff --git a/icons/icon-128.png b/icons/icon-128.png new file mode 100644 index 0000000..85a5902 Binary files /dev/null and b/icons/icon-128.png differ diff --git a/icons/icon-48.png b/icons/icon-48.png deleted file mode 100644 index af43028..0000000 Binary files a/icons/icon-48.png and /dev/null differ diff --git a/icons/icon.svg b/icons/icon.svg deleted file mode 100644 index bb2a3ab..0000000 --- a/icons/icon.svg +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - KFRombi - - - - - - - diff --git a/manifest.json b/manifest.json index 3fa8712..624fcc8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,11 @@ { "manifest_version": 2, - "name": "KFRombi", + "name": "KF-Trombi", "version": "0.1", "browser_specific_settings": { "gecko": { - "id": "kfrombi@math.janko.fr" + "id": "kf-trombi@math.janko.fr", "update_url": "https://gaspard.janko.fr/s/firefox-add-ons/updates.json" } }, @@ -13,7 +13,7 @@ "description": "Generates a directory of students with photos from online.uni-graz.at", "icons": { - "48": "icons/icon-48.png" + "128": "icons/icon-128.png" }, "content_scripts": [ diff --git a/updates.json b/updates.json new file mode 100644 index 0000000..5ca3481 --- /dev/null +++ b/updates.json @@ -0,0 +1,12 @@ +{ + "addons": { + "{kf-trombi@math.janko.fr}": { + "updates": [ + { + "version": "0.1", + "update_link": "https://gaspard.janko.fr/s/firefox-add-ons/kf-trombi/kf-trombi-0.1.xpi" + } + ] + } + } +}