hugo-theme-zzo/layouts/partials/script/pub-single-script.html

30 lines
876 B
HTML
Raw Normal View History

2020-02-05 17:23:27 +00:00
{{ $micromodal := resources.Get "js/micromodal.min.js" | resources.Fingerprint }}
<script defer src="{{ $micromodal.RelPermalink }}"></script>
{{ $clipboard := resources.Get "js/clipboard.min.js" | resources.Fingerprint }}
<script defer src="{{ $clipboard.RelPermalink }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
// modal
MicroModal.init({
disableScroll: true,
disableFocus: true,
awaitOpenAnimation: false,
awaitCloseAnimation: false,
debugMode: false,
onClose: function(modal) {
if (clipboard) {
clipboard = null;
}
},
});
var citeBtn = document.getElementById('citeBtn');
citeBtn.addEventListener('click', function () {
MicroModal.show('modal');
});
// clipboard
var clipboard = new ClipboardJS('#copyBtn');
});
</script>