Skip to content

Commit

Permalink
html.paginaServer
Browse files Browse the repository at this point in the history
  • Loading branch information
PJvanDiepen committed Sep 4, 2024
1 parent e2410b5 commit 68e80e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
11 changes: 6 additions & 5 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ en opnieuw lezen uit de MySQL database.
*/
db.clubToevoegen(synchroon.compleet,
{ clubCode: db.WAAGTOREN, vereniging: "Waagtoren", teamNaam: "Waagtoren" });
["1819", "1920", "2021", "2122", "2223", "2324"].forEach(function (seizoen) {
for (const seizoen of ["1819", "1920", "2021", "2122", "2223", "2324", "2425"]) {
db.seizoenToevoegen(synchroon.compleet, {clubCode: db.WAAGTOREN, seizoen: seizoen});
});
}

db.clubToevoegen(synchroon.compleet,
{ clubCode: db.WAAGTOREN_JEUGD, vereniging: "Waagtoren", teamNaam: "Waagtoren jeugd" });
["2309", "2401"].forEach(function (seizoen) {
for (const seizoen of ["2309", "2401"]) {
db.seizoenToevoegen(synchroon.compleet, {clubCode: db.WAAGTOREN_JEUGD, seizoen: seizoen});
});
}

async function databaseLezen(clubCode, seizoen, teamCode, rondeNummer) {
const eenSeizoen = db.boom.eenClub(clubCode).eenSeizoen(seizoen);
Expand Down Expand Up @@ -180,7 +180,8 @@ Frontend: o_o_o.js
Frontend: beheer.js
*/
url.get("/versie", async function (ctx) {
ctx.body = JSON.stringify({versie: package_json.version, tijdstip: serverStart});
ctx.body = JSON.stringify(
{versie: package_json.version, tijdstip: synchroon.serverStart});
});

/*
Expand Down
2 changes: 1 addition & 1 deletion public/js/beheer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TODO mutaties met verwijderen
}],
[db.ONTWIKKElAAR, `backup spelers ${zyq.seizoenVoluit(o_o_o.seizoen)}` , async function () {
zyq.backupSQL("speler", await zyq.serverFetch(
`/${o_o_o.club}/${o_o_o.seizoen}/${o_o_o.competitie}/schakers`));
`/${o_o_o.club}/${o_o_o.seizoen}/${o_o_o.competitie}/spelers`));
}],
[db.ONTWIKKElAAR, "test API", function () {
html.anderePagina("test.html");
Expand Down
4 changes: 3 additions & 1 deletion public/js/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import * as db from "./db.js";

export const pagina = new URL(location);
export const params = pagina.searchParams;
export const paginaServer = pagina.host.match("localhost") ? "http://localhost:3000" : "https://0-0-0.nl";


export const SCHEIDING = " \u232A ";
export const VINKJE = "\u00a0\u00a0✔\u00a0"; // met no break spaces
Expand Down Expand Up @@ -203,7 +205,7 @@ export function plaatje(bestand, percentage, breed, hoog) {
export function tabblad(link) {
const a = document.createElement("a");
a.append(link);
a.href = server + link;
a.href = paginaServer + link;
a.target = "_blank"; // https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
a.rel = "noopener noreferrer"
return a;
Expand Down
2 changes: 1 addition & 1 deletion public/js/o_o_o.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async function vraagLokaal(url) {
return antwoord;
}

const server = html.pagina.host.match("localhost") ? "http://localhost:3000" : "https://0-0-0.nl";
const server = html.paginaServer;
/**
* vraagServer maakt verbinding met de server
*
Expand Down

0 comments on commit 68e80e5

Please sign in to comment.