37 lines
1.6 KiB
Twig
37 lines
1.6 KiB
Twig
<div class="ms-2 me-2">
|
|
<button type="button" class="btn btn-light rounded-0" data-bs-toggle="modal" data-bs-target="#scripModal">
|
|
Script
|
|
</button>
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="scripModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="exampleModalLabel">Script</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Paste at the bottom of your page</p>
|
|
<textarea readonly class="form-control" rows="10" id="scriptView">
|
|
{{ setting_service.getSetting('javascript-script-button') }}
|
|
</textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" id="scriptCopy"><i class="bi bi-copy"></i> Copy
|
|
</button>
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
(function () {
|
|
let button = document.getElementById('scriptCopy');
|
|
button.addEventListener("click", function () {
|
|
let scriptView = document.getElementById('scriptView');
|
|
scriptView.select();
|
|
document.execCommand("copy");
|
|
})
|
|
})()
|
|
</script>
|
|
</div> |