Verbotene Konzepte in JavaScript entfernt #61
+16
-15
@@ -123,9 +123,9 @@ $categories = [
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<button type="submit" class="nav__search-button">Filter anwenden</button>
|
||||
</noscript>
|
||||
<button type="submit" class="nav__search-button">
|
||||
|
caroline.slt marked this conversation as resolved
Outdated
|
||||
Filter anwenden
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</aside>
|
||||
@@ -189,21 +189,22 @@ $categories = [
|
||||
<option value="50" <?php echo $limit === 50 ? 'selected' : ''; ?>>50</option>
|
||||
<option value="100" <?php echo $limit === 100 ? 'selected' : ''; ?>>100</option>
|
||||
</select>
|
||||
<noscript><button type="submit" form="s-res-filter-form" class="nav__search-button">Übernehmen</button></noscript>
|
||||
<button type="submit"
|
||||
|
caroline.slt marked this conversation as resolved
Outdated
niklas.ortmann
commented
s.o. s.o.
|
||||
form="s-res-filter-form"
|
||||
class="nav__search-button">
|
||||
Übernehmen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav class="s-res-page-navigation" aria-label="Seitennavigation">
|
||||
<!-- No-JS-Fallback: -->
|
||||
<noscript>
|
||||
<?php echo renderNoJsPagination($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>
|
||||
<span id="dynamic-page-numbers"></span>
|
||||
<button type="button" class="s-res-page-btn" id="next-page-btn">»</button>
|
||||
</div>
|
||||
<?php echo renderNoJsPagination(
|
||||
|
caroline.slt marked this conversation as resolved
Outdated
niklas.ortmann
commented
s.o. s.o.
|
||||
$currentPage,
|
||||
$totalPages,
|
||||
$query,
|
||||
$currentSort,
|
||||
$currentCategory,
|
||||
$limit
|
||||
); ?>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
+20
-10
@@ -251,11 +251,23 @@ if ($replyAuthor === null) {
|
||||
(string) $comment->getArticleId()
|
||||
); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
||||
Kommentar löschen
|
||||
</button>
|
||||
<form method="post"
|
||||
action="index.php?pfad=deleteComment"
|
||||
class="delete-comment-form confirm-delete-comment">
|
||||
|
||||
<input type="hidden"
|
||||
name="comment_id"
|
||||
value="<?php echo htmlspecialchars((string) $comment->getId()); ?>">
|
||||
|
||||
<input type="hidden"
|
||||
name="article_id"
|
||||
value="<?php echo htmlspecialchars((string) $comment->getArticleId()); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="delete-comment-button">
|
||||
Kommentar löschen
|
||||
</button>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -383,11 +395,9 @@ if ($replyAuthor === null) {
|
||||
(string) $reply->getArticleId()
|
||||
); ?>">
|
||||
|
||||
<button type="submit"
|
||||
class="delete-comment-button"
|
||||
onclick="return confirm('Möchtest du diesen Kommentar wirklich löschen?');">
|
||||
Kommentar löschen
|
||||
</button>
|
||||
<form method="post"
|
||||
action="index.php?pfad=deleteComment"
|
||||
class="delete-comment-form confirm-delete-comment">
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -26,7 +26,6 @@ include_once "php/controller/index-controller.php";
|
||||
<script src="js/comments.js" defer></script>
|
||||
<script src="js/profile.js" defer></script>
|
||||
<script src="js/editor.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/search-results.js" async></script>
|
||||
<script src="js/showCategory.js" async></script>
|
||||
|
||||
|
||||
|
||||
+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>
|
||||
|
||||
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.