t
This commit is contained in:
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@
|
|||||||
<button style="margin-left: 23px; margin-bottom: 20px;" id="toggle-collapse" class="page-btn">Prikaži/Skrij galerijo slik</button>
|
<button style="margin-left: 23px; margin-bottom: 20px;" id="toggle-collapse" class="page-btn">Prikaži/Skrij galerijo slik</button>
|
||||||
<br>
|
<br>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
<div id="page-collapse" class="page-collapse">
|
<div id="page-collapse" class="page-collapse">
|
||||||
<p class="page-paragraph">To je skrit del strani. Kliknite gumb zgoraj, da ga prikažete ali skrijete.</p>
|
<p class="page-paragraph">To je skrit del strani. Kliknite gumb zgoraj, da ga prikažete ali skrijete.</p>
|
||||||
|
|||||||
+2
-2
@@ -30,11 +30,11 @@
|
|||||||
<button type="submit" class="page-btn">Prijavi se</button>
|
<button type="submit" class="page-btn">Prijavi se</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<p>Še nimate računa? <a href="register.html" class="page-link">Registrirajte se</a></p>
|
<p>Še nimate računa? <a href="register.html" class="page-link" target="_top">Registrirajte se</a></p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<div id="entry-form-container">
|
<div id="entry-form-container">
|
||||||
</div>
|
</div>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="modal" id="new-entry-form-modal">
|
<div class="modal" id="new-entry-form-modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|||||||
+2
-2
@@ -38,11 +38,11 @@
|
|||||||
<button type="submit" class="page-btn">Registriraj se</button>
|
<button type="submit" class="page-btn">Registriraj se</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<p>Že imate račun? <a href="login.html" class="page-link">Prijavite se</a></p>
|
<p>Že imate račun? <a href="login.html" class="page-link" target="_top">Prijavite se</a></p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6
-2
@@ -6,6 +6,10 @@ const form = `
|
|||||||
<p><em>Vaše sporočilo bo vezano na vaš račun, zato vam bomo lahko odgovorili na e-pošto, ki ste jo vnesli ob registraciji.</em></p>
|
<p><em>Vaše sporočilo bo vezano na vaš račun, zato vam bomo lahko odgovorili na e-pošto, ki ste jo vnesli ob registraciji.</em></p>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const contactFormContainer = document.getElementById("contact-form-container");
|
const contactFormContainer = document.getElementById("contact-form-container");
|
||||||
// Najdi cookie "token" v cookies
|
// Najdi cookie "token" v cookies
|
||||||
@@ -35,14 +39,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
console.log("Success:", data);
|
console.log("Success:", data);
|
||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-success">Hvala za vaše sporočilo! Odgovorili vam bomo v najkrajšem možnem času.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-success">Hvala za vaše sporočilo! Odgovorili vam bomo v najkrajšem možnem času.</p>`;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = "index.html";
|
navigateTop("index.html");
|
||||||
}, 3000);
|
}, 3000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri pošiljanju vašega sporočila. Prosimo, poskusite znova pozneje.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri pošiljanju vašega sporočila. Prosimo, poskusite znova pozneje.</p>`;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = "index.html";
|
navigateTop("index.html");
|
||||||
}, 3000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
function getSpecific(kljuc) {
|
function getSpecific(kljuc) {
|
||||||
window.location.href = `vnos.html?kljuc=${kljuc}`;
|
window.open(new URL(`vnos.html?kljuc=${kljuc}`, window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLast() {
|
function getLast() {
|
||||||
@@ -101,7 +101,7 @@ document.getElementById("search-input").addEventListener("keydown", (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function addEntry() {
|
function addEntry() {
|
||||||
window.location.href = "new.html";
|
window.open(new URL("new.html", window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELAJ DELAJ
|
// DELAJ DELAJ
|
||||||
|
|||||||
+8
-3
@@ -4,6 +4,10 @@ const errmsg = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -14,6 +18,7 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
const username = document.getElementById("username").value;
|
const username = document.getElementById("username").value;
|
||||||
const password = document.getElementById("password").value;
|
const password = document.getElementById("password").value;
|
||||||
const form = document.getElementById("login-form");
|
const form = document.getElementById("login-form");
|
||||||
|
const cookiePath = window.location.pathname.replace(/[^/]+$/, "/");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch("https://ssnj.dcrubro.com/api/prijava", {
|
const response = await fetch("https://ssnj.dcrubro.com/api/prijava", {
|
||||||
@@ -28,10 +33,10 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
// Nastavi cookie, 3 ure veljaven
|
// Nastavi cookie, 3 ure veljaven
|
||||||
document.cookie = `token=${data.token}; max-age=${3 * 60 * 60}; path=/; secure; samesite=strict`;
|
document.cookie = `token=${data.token}; max-age=${3 * 60 * 60}; path=${cookiePath}; samesite=strict`;
|
||||||
document.cookie = `username=${username}; max-age=${3 * 60 * 60}; path=/; secure; samesite=strict`;
|
document.cookie = `username=${username}; max-age=${3 * 60 * 60}; path=${cookiePath}; samesite=strict`;
|
||||||
|
|
||||||
window.location.href = "index.html";
|
navigateTop("index.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-10
@@ -2,12 +2,12 @@ const headerHtml = `
|
|||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<div class="nav-left">
|
<div class="nav-left">
|
||||||
<a class="nav-title" href="index.html">Slovar Slovenskega Novega Jezika</a>
|
<a class="nav-title" href="index.html" target="_top">Slovar Slovenskega Novega Jezika</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-right" aria-label="Primary navigation">
|
<div class="nav-right" aria-label="Primary navigation">
|
||||||
<a class="nav-btn" href="about.html">O projektu</a>
|
<a class="nav-btn" href="about.html" target="_top">O projektu</a>
|
||||||
<a class="nav-btn" href="contact.html">Kontakt</a>
|
<a class="nav-btn" href="contact.html" target="_top">Kontakt</a>
|
||||||
<a class="nav-btn" href="extras.html">Dodatki</a>
|
<a class="nav-btn" href="extras.html" target="_top">Dodatki</a>
|
||||||
<div id="nav-login-holder"></div>
|
<div id="nav-login-holder"></div>
|
||||||
|
|
||||||
<button id="theme-toggle" class="toggle-btn" onclick="toggleTheme()" aria-label="Toggle colour scheme" aria-pressed="false">
|
<button id="theme-toggle" class="toggle-btn" onclick="toggleTheme()" aria-label="Toggle colour scheme" aria-pressed="false">
|
||||||
@@ -79,9 +79,10 @@ function updateToggleState(theme) {
|
|||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
// Odstrani cookie tako, da ga nastaviš z max-age=0
|
// Odstrani cookie tako, da ga nastaviš z max-age=0
|
||||||
document.cookie = "token=; max-age=0; path=/; secure; samesite=strict";
|
const cookiePath = window.location.pathname.replace(/[^/]+$/, "/");
|
||||||
document.cookie = "username=; max-age=0; path=/; secure; samesite=strict";
|
document.cookie = `token=; max-age=0; path=${cookiePath}; samesite=strict`;
|
||||||
window.location.href = "index.html";
|
document.cookie = `username=; max-age=0; path=${cookiePath}; samesite=strict`;
|
||||||
|
window.open(new URL("index.html", window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
@@ -98,7 +99,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
if (!isLoggedIn) {
|
if (!isLoggedIn) {
|
||||||
const navRight = document.querySelector(".nav-right");
|
const navRight = document.querySelector(".nav-right");
|
||||||
if (navRight) {
|
if (navRight) {
|
||||||
const loginBtn = `<a class="nav-btn nav-btn-primary" href="login.html">Prijava</a>`;
|
const loginBtn = `<a class="nav-btn nav-btn-primary" href="login.html" target="_top">Prijava</a>`;
|
||||||
// Najdi zadnji <a> element in dodaj gumb za njim
|
// Najdi zadnji <a> element in dodaj gumb za njim
|
||||||
const lastLink = navRight.querySelector("a:last-child");
|
const lastLink = navRight.querySelector("a:last-child");
|
||||||
document.getElementById("nav-login-holder").innerHTML = loginBtn;
|
document.getElementById("nav-login-holder").innerHTML = loginBtn;
|
||||||
@@ -106,11 +107,15 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
} else {
|
} else {
|
||||||
const navRight = document.querySelector(".nav-right");
|
const navRight = document.querySelector(".nav-right");
|
||||||
if (navRight) {
|
if (navRight) {
|
||||||
const logoutBtn = `<a class="nav-btn nav-btn-primary" href="index.html">Odjava</a>`;
|
const logoutBtn = `<a class="nav-btn nav-btn-primary" href="index.html" target="_top">Odjava</a>`;
|
||||||
// Najdi zadnji <a> element in dodaj gumb za njim
|
// Najdi zadnji <a> element in dodaj gumb za njim
|
||||||
const lastLink = navRight.querySelector("a:last-child");
|
const lastLink = navRight.querySelector("a:last-child");
|
||||||
document.getElementById("nav-login-holder").innerHTML = logoutBtn;
|
document.getElementById("nav-login-holder").innerHTML = logoutBtn;
|
||||||
document.querySelector(".nav-btn-primary").addEventListener("click", logout);
|
const logoutLink = document.getElementById("nav-login-holder").querySelector(".nav-btn-primary");
|
||||||
|
logoutLink?.addEventListener("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
logout();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -32,6 +32,10 @@ const form = `
|
|||||||
<p><em>Vaš vnos bo javno vezan na vaš račun.</em></p>
|
<p><em>Vaš vnos bo javno vezan na vaš račun.</em></p>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("confirm-add").addEventListener("click", () => {
|
document.getElementById("confirm-add").addEventListener("click", () => {
|
||||||
document.getElementById("new-entry-form-modal").style.display = "none";
|
document.getElementById("new-entry-form-modal").style.display = "none";
|
||||||
|
|
||||||
@@ -66,7 +70,7 @@ document.getElementById("confirm-add").addEventListener("click", () => {
|
|||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri dodajanju vnosa. Prosimo, poskusite znova pozneje.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri dodajanju vnosa. Prosimo, poskusite znova pozneje.</p>`;
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = "index.html";
|
navigateTop("index.html");
|
||||||
}, 3000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -4,6 +4,10 @@ const errmsg = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -63,7 +67,7 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
`<div class="form-group"><p class="page-paragraph-success">Uspešna registracija! Preusmerjanje na prijavo...</p></div>`
|
`<div class="form-group"><p class="page-paragraph-success">Uspešna registracija! Preusmerjanje na prijavo...</p></div>`
|
||||||
);
|
);
|
||||||
}, 500);
|
}, 500);
|
||||||
window.location.href = "login.html";
|
navigateTop("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
const kljuc = new URLSearchParams(window.location.search).get("kljuc");
|
const kljuc = new URLSearchParams(window.location.search).get("kljuc");
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
function getCookie(name) {
|
function getCookie(name) {
|
||||||
const match = document.cookie.split(";").map(c => c.trim()).find(c => c.startsWith(name + "="));
|
const match = document.cookie.split(";").map(c => c.trim()).find(c => c.startsWith(name + "="));
|
||||||
return match ? match.split("=")[1] : null;
|
return match ? match.split("=")[1] : null;
|
||||||
@@ -83,7 +87,7 @@ function getKey() {
|
|||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log("Success:", data);
|
console.log("Success:", data);
|
||||||
window.location.href = "index.html";
|
navigateTop("index.html");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
|
|||||||
Binary file not shown.
@@ -20,7 +20,7 @@
|
|||||||
<div id="entry-container-single" class="entry-container-single">
|
<div id="entry-container-single" class="entry-container-single">
|
||||||
</div>
|
</div>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="index.html">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="modal" id="delete-entry-modal">
|
<div class="modal" id="delete-entry-modal">
|
||||||
|
|||||||
Reference in New Issue
Block a user