Verbotene Konzepte in JavaScript entfernt #61
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="dataSourceStorageLocal" created-in="IU-261.25134.95">
|
<component name="dataSourceStorageLocal" created-in="IU-253.32098.101">
|
||||||
<data-source name="articles" uuid="315cb5c9-2b0f-435b-b602-59823b160908">
|
<data-source name="articles" uuid="315cb5c9-2b0f-435b-b602-59823b160908">
|
||||||
<database-info product="SQLite" version="3.51.1" jdbc-version="4.2" driver-name="SQLite JDBC" driver-version="3.51.1.0" dbms="SQLITE" exact-version="3.51.1" exact-driver-version="3.51">
|
<database-info product="SQLite" version="3.51.1" jdbc-version="4.2" driver-name="SQLite JDBC" driver-version="3.51.1.0" dbms="SQLITE" exact-version="3.51.1" exact-driver-version="3.51">
|
||||||
<identifier-quote-string>"</identifier-quote-string>
|
<identifier-quote-string>"</identifier-quote-string>
|
||||||
|
|||||||
+12
-10
@@ -81,10 +81,12 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<form action="php/controller/deleteAccount-controller.php" method="POST">
|
<form action="php/controller/deleteAccount-controller.php"
|
||||||
|
method="POST"
|
||||||
|
class="confirm-delete-account">
|
||||||
|
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="button"
|
class="button">
|
||||||
onclick="return confirm('Möchtest du deinen Account und alle deine Beiträge wirklich unwiderruflich löschen?');">
|
|
||||||
Account löschen
|
Account löschen
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -154,14 +156,16 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
|||||||
Bearbeiten
|
Bearbeiten
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<form action="php/controller/deleteArticle-controller.php" method="POST">
|
<form action="php/controller/deleteArticle-controller.php"
|
||||||
|
method="POST"
|
||||||
|
class="confirm-delete-article">
|
||||||
|
|
||||||
<input type="hidden"
|
<input type="hidden"
|
||||||
name="id"
|
name="id"
|
||||||
value="<?php echo htmlspecialchars($userArticle->getID()); ?>">
|
value="<?php echo htmlspecialchars($userArticle->getID()); ?>">
|
||||||
|
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="button"
|
class="button">
|
||||||
onclick="return confirm('Möchtest du diesen Artikel wirklich löschen?');">
|
|
||||||
Löschen
|
Löschen
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -172,11 +176,9 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
|||||||
|
|
||||||
<p>Du hast noch keine Beiträge erstellt.</p>
|
<p>Du hast noch keine Beiträge erstellt.</p>
|
||||||
|
|
||||||
<button type="button"
|
<a href="index.php?pfad=createArticle" class="button">
|
||||||
class="button"
|
|
||||||
onclick="window.location.href='index.php?pfad=createArticle';">
|
|
||||||
Beitrag erstellen!
|
Beitrag erstellen!
|
||||||
</button>
|
</a>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -124,7 +124,9 @@ $categories = [
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<noscript>
|
<noscript>
|
||||||
|
caroline.slt marked this conversation as resolved
Outdated
|
|||||||
<button type="submit" class="nav__search-button">Filter anwenden</button>
|
<button type="submit" class="nav__search-button">
|
||||||
|
Filter anwenden
|
||||||
|
</button>
|
||||||
</noscript>
|
</noscript>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -193,17 +195,34 @@ $categories = [
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="s-res-page-navigation" aria-label="Seitennavigation">
|
<nav class="s-res-page-navigation" aria-label="Seitennavigation">
|
||||||
<!-- No-JS-Fallback: -->
|
|
||||||
<noscript>
|
<noscript>
|
||||||
<?php echo renderNoJsPagination($currentPage, $totalPages, $query, $currentSort, $currentCategory, $limit); ?>
|
<?php echo renderNoJsPagination(
|
||||||
|
caroline.slt marked this conversation as resolved
Outdated
niklas.ortmann
commented
s.o. s.o.
|
|||||||
|
$currentPage,
|
||||||
|
$totalPages,
|
||||||
|
$query,
|
||||||
|
$currentSort,
|
||||||
|
$currentCategory,
|
||||||
|
$limit
|
||||||
|
); ?>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
<!-- JS-Version: wird per search-results.js befüllt/eingeblendet: -->
|
<div id="js-page-navigation" style="display: none;">
|
||||||
<div id="js-page-navigation" style="display:none;">
|
<button type="button"
|
||||||
<button type="button" class="s-res-page-btn" id="prev-page-btn">«</button>
|
class="s-res-page-btn"
|
||||||
|
id="prev-page-btn">
|
||||||
|
«
|
||||||
|
</button>
|
||||||
|
|
||||||
<span id="dynamic-page-numbers"></span>
|
<span id="dynamic-page-numbers"></span>
|
||||||
<button type="button" class="s-res-page-btn" id="next-page-btn">»</button>
|
|
||||||
|
<button type="button"
|
||||||
|
class="s-res-page-btn"
|
||||||
|
id="next-page-btn">
|
||||||
|
»
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ if ($replyAuthor === null) {
|
|||||||
|
|
||||||
<form method="post"
|
<form method="post"
|
||||||
action="index.php?pfad=deleteComment"
|
action="index.php?pfad=deleteComment"
|
||||||
class="delete-comment-form">
|
class="delete-comment-form confirm-delete-comment">
|
||||||
|
|
||||||
<input type="hidden"
|
<input type="hidden"
|
||||||
name="comment_id"
|
name="comment_id"
|
||||||
@@ -252,8 +252,7 @@ if ($replyAuthor === null) {
|
|||||||
); ?>">
|
); ?>">
|
||||||
|
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="delete-comment-button"
|
class="delete-comment-button">
|
||||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
|
||||||
Kommentar löschen
|
Kommentar löschen
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -369,7 +368,7 @@ if ($replyAuthor === null) {
|
|||||||
|
|
||||||
<form method="post"
|
<form method="post"
|
||||||
action="index.php?pfad=deleteComment"
|
action="index.php?pfad=deleteComment"
|
||||||
class="delete-comment-form">
|
class="delete-comment-form confirm-delete-comment">
|
||||||
|
|
||||||
<input type="hidden"
|
<input type="hidden"
|
||||||
name="comment_id"
|
name="comment_id"
|
||||||
@@ -384,9 +383,8 @@ if ($replyAuthor === null) {
|
|||||||
); ?>">
|
); ?>">
|
||||||
|
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="delete-comment-button"
|
class="delete-comment-button">
|
||||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
Antwort löschen
|
||||||
Kommentar löschen
|
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ include_once "php/controller/index-controller.php";
|
|||||||
<link rel="stylesheet" href="css/showCategory.css">
|
<link rel="stylesheet" href="css/showCategory.css">
|
||||||
|
|
||||||
<script src="js/comments.js" defer></script>
|
<script src="js/comments.js" defer></script>
|
||||||
|
<script src="js/profile.js" defer></script>
|
||||||
<script src="js/editor.js" async></script>
|
<script src="js/editor.js" async></script>
|
||||||
<script src="js/search-results.js" async></script>
|
|
||||||
|
caroline.slt marked this conversation as resolved
Outdated
niklas.ortmann
commented
warum entfernst du das ?!?! warum entfernst du das ?!?!
|
|||||||
<script src="js/showCategory.js" async></script>
|
<script src="js/showCategory.js" async></script>
|
||||||
|
<script src="js/search.js" async></script>
|
||||||
|
|
||||||
|
|
||||||
<title>EduForge</title>
|
<title>EduForge</title>
|
||||||
|
|||||||
+20
-2
@@ -11,6 +11,26 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
const parentCommentInput = document.getElementById("parent-comment-id");
|
const parentCommentInput = document.getElementById("parent-comment-id");
|
||||||
const replyInfo = document.getElementById("reply-info");
|
const replyInfo = document.getElementById("reply-info");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fragt vor dem Löschen eines Kommentars nach einer Bestätigung.
|
||||||
|
*
|
||||||
|
* Der Listener funktioniert auch für Kommentare,
|
||||||
|
* die später per AJAX eingefügt werden.
|
||||||
|
*/
|
||||||
|
document.addEventListener("submit", function (event) {
|
||||||
|
if (!event.target.classList.contains("delete-comment-form")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmed = confirm(
|
||||||
|
"Möchtest du diesen Kommentar wirklich löschen?"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (!form || !commentsList || !commentContent || !parentCommentInput) {
|
if (!form || !commentsList || !commentContent || !parentCommentInput) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -152,7 +172,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="delete-comment-button"
|
class="delete-comment-button"
|
||||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');"
|
|
||||||
>
|
>
|
||||||
Kommentar löschen
|
Kommentar löschen
|
||||||
</button>
|
</button>
|
||||||
@@ -230,7 +249,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="delete-comment-button"
|
class="delete-comment-button"
|
||||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');"
|
|
||||||
>
|
>
|
||||||
Kommentar löschen
|
Kommentar löschen
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
|
||||||
|
const deleteAccountForm = document.querySelector(".confirm-delete-account");
|
||||||
|
|
||||||
|
if (deleteAccountForm) {
|
||||||
|
deleteAccountForm.addEventListener("submit", function (event) {
|
||||||
|
|
||||||
|
if (!confirm("Möchtest du deinen Account und alle deine Beiträge wirklich unwiderruflich löschen?")) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteArticleForms = document.querySelectorAll(".confirm-delete-article");
|
||||||
|
|
||||||
|
deleteArticleForms.forEach(function (form) {
|
||||||
|
|
||||||
|
form.addEventListener("submit", function (event) {
|
||||||
|
|
||||||
|
if (!confirm("Möchtest du diesen Artikel wirklich löschen?")) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user
Alles, was mit noscript eingebunden wird, soll nur dann sichtbar sein, wenn kein js aktiviert ist. Davon abgesehen, warum sollte das ein verbotenes Konzept in js ein???
Das kann Maximilian auch nicht angemerkt haben, da das heute durch #54 erst hinzukam.