Skip to content

Commit

Permalink
cookie disclaimer delayed & improved
Browse files Browse the repository at this point in the history
  • Loading branch information
j0hannr committed Jul 12, 2021
1 parent dc86214 commit 1bf9193
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
25 changes: 10 additions & 15 deletions components/cookie/cookie-alert.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<div class="overlay visible cookie-alert">
<div style="display:none;" class="cookie-alert">
<div class="overlay-content">
<div class="card card-large reminder shadow">
<div class="content large-margin-bottom">
<h4 class="heading-size-2">
🍪 <?php _e("Wir verwenden Cookies", "quartiersplattform"); ?>
</h4>
<p class="text-size-2">

<?php _e("Wir nutzen Cookies auf der Quartiersplattform. Mit der Nutzung stimmst du der Verwendung zu, jedoch verwenden wir keine Cookies von Dritten.", "quartiersplattform"); ?>
</p>
<?php _e("Wir nutzen Cookies auf der Quartiersplattform. Mit der Nutzung stimmst du der Verwendung zu, jedoch verwenden wir keine Cookies von Dritten.", "quartiersplattform"); ?>
</p>
</div>

<div class="button-group">
Expand All @@ -34,14 +33,19 @@

?>


<a onclick="cookie_disclaimer();" class="button accept is-primary" ><?php _e('Zustimmen', 'quartiersplattform'); ?> </a>
</div>
</div>
</div>
</div>

<script>

setTimeout(() => {
const disclaimer = document.querySelector("div.cookie-alert");
disclaimer.classList.add("visible", "overlay");
disclaimer.style.display = "block"
}, 6000);

function cookie_disclaimer() {

Expand All @@ -52,15 +56,7 @@ function cookie_disclaimer() {
'request': 1
};

// $.ajax({
// url: ajax_url,
// type: 'post',
// data: data,
// dataType: 'json',
// success: function(response){
// $("div.cookie-alert").fadeOut();
// }
// });
document.querySelector("div.cookie-alert").remove();

var request = new XMLHttpRequest();
request.open('POST', ajax_url, true);
Expand All @@ -70,7 +66,6 @@ function cookie_disclaimer() {
// If successful
console.log(this.response);
// $("div.cookie-alert").fadeOut();
document.querySelector("div.cookie-alert").remove();
// alert('done');
} else {
// If fail
Expand Down
1 change: 1 addition & 0 deletions documentation/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Entwicklung der Quartiersplattform
- [ ] Gestaltung der Startseite (Gutenberg Blocks)
- [ ] Emojis laden manchmal nicht direkt
- [ ] Energie Ampel Fallback/Error Display
- [ ] Advanced Custom fields (free) compatible

### Bugs
- [ ] Leere Chronik `no content card` wird im falschen reiter angezeigt
Expand Down

0 comments on commit 1bf9193

Please sign in to comment.