forked from CollectionBuilder/collectionbuilder-csv
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add global trigger warning * change to localStorage * feat: style trigger warning --------- Co-authored-by: mtwente <127845092+mtwente@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
77 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div | ||
class="modal fade" | ||
id="triggerWarning" | ||
tabindex="-1" | ||
role="dialog" | ||
aria-labelledby="triggerWarningTitle" | ||
aria-hidden="true" | ||
> | ||
<div class="modal-dialog modal-dialog-centered" role="document"> | ||
<div class="modal-content" style="display: flex; justify-content: center; align-items: center;"> | ||
<div class="modal-body" style="max-width: 600px; text-align: center; margin: 0 auto;"> | ||
<h5 class="modal-title text-center w-100" id="triggerWarningTitle">Content Note</h5> | ||
<p>{{ site.data.theme['trigger-warning-text'] | default: 'This collection may contain sensitive content.' }}</p> | ||
<button id="proceedButton" type="button" class="btn btn-triggerwarning mt-4" aria-label="Hinweis ausblenden"> | ||
Hinweis ausblenden | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script> | ||
// Function to hide the trigger warning using Bootstrap's modal method | ||
function hideWarning() { | ||
const modal = document.getElementById('triggerWarning'); | ||
const bootstrapModal = bootstrap.Modal.getInstance(modal) || new bootstrap.Modal(modal); | ||
bootstrapModal.hide(); | ||
|
||
// Set in localStorage to not show the warning again | ||
localStorage.setItem('triggerWarningDismissed', 'true'); | ||
} | ||
|
||
// Show the modal if the user has not seen it yet | ||
window.onload = function () { | ||
if (!localStorage.getItem('triggerWarningDismissed')) { | ||
const modal = new bootstrap.Modal(document.getElementById('triggerWarning')); | ||
modal.show(); | ||
} | ||
|
||
// Add event listener to the button | ||
document.getElementById('proceedButton').addEventListener('click', hideWarning); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.