Verbotene Konzepte in JavaScript entfernt #61
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
+12
-10
@@ -81,10 +81,12 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
||||
|
||||
<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"
|
||||
class="button"
|
||||
onclick="return confirm('Möchtest du deinen Account und alle deine Beiträge wirklich unwiderruflich löschen?');">
|
||||
class="button">
|
||||
Account löschen
|
||||
</button>
|
||||
</form>
|
||||
@@ -154,14 +156,16 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
||||
Bearbeiten
|
||||
</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"
|
||||
name="id"
|
||||
value="<?php echo htmlspecialchars($userArticle->getID()); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="button"
|
||||
onclick="return confirm('Möchtest du diesen Artikel wirklich löschen?');">
|
||||
class="button">
|
||||
Löschen
|
||||
</button>
|
||||
</form>
|
||||
@@ -172,11 +176,9 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
|
||||
|
||||
<p>Du hast noch keine Beiträge erstellt.</p>
|
||||
|
||||
<button type="button"
|
||||
class="button"
|
||||
onclick="window.location.href='index.php?pfad=createArticle';">
|
||||
<a href="index.php?pfad=createArticle" class="button">
|
||||
Beitrag erstellen!
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,9 @@ $categories = [
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</form>
|
||||
|
||||
@@ -193,17 +195,34 @@ $categories = [
|
||||
</div>
|
||||
|
||||
<nav class="s-res-page-navigation" aria-label="Seitennavigation">
|
||||
<!-- No-JS-Fallback: -->
|
||||
|
||||
<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>
|
||||
|
||||
<!-- JS-Version: wird per search-results.js befüllt/eingeblendet: -->
|
||||
<div id="js-page-navigation" style="display:none;">
|
||||
<button type="button" class="s-res-page-btn" id="prev-page-btn">«</button>
|
||||
<div id="js-page-navigation" style="display: none;">
|
||||
<button type="button"
|
||||
class="s-res-page-btn"
|
||||
id="prev-page-btn">
|
||||
«
|
||||
</button>
|
||||
|
||||
<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>
|
||||
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -237,7 +237,7 @@ if ($replyAuthor === null) {
|
||||
|
||||
<form method="post"
|
||||
action="index.php?pfad=deleteComment"
|
||||
class="delete-comment-form">
|
||||
class="delete-comment-form confirm-delete-comment">
|
||||
|
||||
<input type="hidden"
|
||||
name="comment_id"
|
||||
@@ -252,8 +252,7 @@ if ($replyAuthor === null) {
|
||||
); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
||||
class="delete-comment-button">
|
||||
Kommentar löschen
|
||||
</button>
|
||||
</form>
|
||||
@@ -369,7 +368,7 @@ if ($replyAuthor === null) {
|
||||
|
||||
<form method="post"
|
||||
action="index.php?pfad=deleteComment"
|
||||
class="delete-comment-form">
|
||||
class="delete-comment-form confirm-delete-comment">
|
||||
|
||||
<input type="hidden"
|
||||
name="comment_id"
|
||||
@@ -384,9 +383,8 @@ if ($replyAuthor === null) {
|
||||
); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
||||
Kommentar löschen
|
||||
class="delete-comment-button">
|
||||
Antwort löschen
|
||||
</button>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@ include_once "php/controller/index-controller.php";
|
||||
<link rel="stylesheet" href="css/showCategory.css">
|
||||
|
||||
<script src="js/comments.js" defer></script>
|
||||
<script src="js/profile.js" defer></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/search.js" async></script>
|
||||
|
||||
|
||||
<title>EduForge</title>
|
||||
|
||||
+20
-2
@@ -11,6 +11,26 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const parentCommentInput = document.getElementById("parent-comment-id");
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
@@ -152,7 +172,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
<button
|
||||
type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');"
|
||||
>
|
||||
Kommentar löschen
|
||||
</button>
|
||||
@@ -230,7 +249,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
<button
|
||||
type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');"
|
||||
>
|
||||
Kommentar löschen
|
||||
</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.