in a new div and append the toolbar
$pre.wrap('');
$pre.after($toolbar);
});
// Move the glossary popover content in the term´s container so we can show it on hover via CSS
$('.glossary-popover-contents').each(function () {
const $popover = $(this);
const $prevParagraph = $popover.prev('p');
if ($prevParagraph.length) {
$popover.appendTo($prevParagraph);
}
});
$('.copy-to-clipboard-button').on('click', function () {
// Find the closest .code-toolbar container
const $toolbar = $(this).closest('.code-toolbar');
// Find the tag within that container
const $pre = $toolbar.find('pre').first();
// Extract the text content from the tag
const textToCopy = $pre.text();
// Use the Clipboard API to copy the text
navigator.clipboard.writeText(textToCopy).then(() => {
// Optional: provide visual feedback
$(this).attr('data-copy-state', 'copied').find('span').text('Copied!');
const $button = $(this);
setTimeout(() => {
$button.attr('data-copy-state', 'copy').find('span').text('Copy');
}, 2000);
}).catch(err => {
console.error('Failed to copy text: ', err);
});
});
} ) ( LITHIUM.jQuery );
LITHIUM.InformationBox({"updateFeedbackEvent":"LITHIUM:updateAjaxFeedback","componentSelector":"#informationbox_90089b42a60614","feedbackSelector":".InfoMessage"});
; (function ( $ ) {
if ( localStorage.getItem("utopia.Collapsed.sidebar.right-panel") === "true" ) {
$('#right-panel').parent().parent().addClass('collapsed');
}
if ( localStorage.getItem("utopia.Collapsed.sidebar.left-panel") === "true" ) {
$('#left-panel').parent().parent().addClass('collapsed');
}
// Container with article content
const $content = $('.lia-message-body-content');
// Create TOC container
const $toc = $('