-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDA-5720: configure publication terms on admin page
- Loading branch information
Showing
6 changed files
with
174 additions
and
11 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,19 @@ | ||
/* global bootstrap, DOMPurify */ | ||
'use strict' | ||
|
||
$(document).ready(function () { | ||
// Preview publication terms in a modal. | ||
$('#create-preview').on('click', function () { | ||
// Get the content of the textarea and sanitize it. | ||
const termsText = document.getElementById('publicationTerms').value | ||
const sanitizedContent = DOMPurify.sanitize(termsText) | ||
|
||
// Set the content in the modal body for preview. | ||
const modalBody = document.querySelector('#confirmAgreementConditions .modal-body') | ||
modalBody.innerHTML = sanitizedContent | ||
|
||
// Show the modal. | ||
const myModal = new bootstrap.Modal(document.getElementById('confirmAgreementConditions')) | ||
myModal.show() | ||
}) | ||
}) |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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