docs: add copy to clipboard javascript

add popper library for popup menus
This commit is contained in:
Nick Craig-Wood committed 2020-05-27 17:31:08 +01:00
1 parent c8683fc916
commit ab4a2275eb
3 files changed
+23 -11

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
<script src="/js/jquery.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/custom.js"></script>
</body>
+17 -10
View File
@@ -1,14 +1,21 @@
// Site JS
// Add hover links on headings
$(function() {
return $("h2, h3, h4, h5, h6").each(function(i, el) {
var $el, icon, id;
$el = $(el);
id = $el.attr('id');
icon = '<i class="fa fa-link"></i>';
if (id) {
return $el.prepend($("<a />").addClass("header-link").attr("href", "#" + id).html(icon));
}
});
// Add hover links on headings
$("h2, h3, h4, h5, h6").each(function(i, el) {
var $el, icon, id;
$el = $(el);
id = $el.attr('id');
icon = '<i class="fa fa-link"></i>';
if (id) {
return $el.prepend($("<a />").addClass("header-link").attr("href", "#" + id).html(icon));
}
});
// Wire up copy to clipboard buttons
$(".copy-to-clipboard").click(function() {
var copyText = $(this).prev();
copyText.select();
document.execCommand("copy");
$(this).attr("title", "Copied!");
});
});
+5
View File
File diff suppressed because one or more lines are too long.