/* eslint-disable node/no-unsupported-features/node-builtins */ (function($, moment, ClipboardJS, config) { $('.article img:not(".not-gallery-item")').each(function() { // wrap images with link and add caption if possible if ($(this).parent('a').length === 0) { $(this).wrap(''); if (this.alt) { $(this).after('
'); } } }); if (typeof $.fn.lightGallery === 'function') { $('.article').lightGallery({ selector: '.gallery-item' }); } if (typeof $.fn.justifiedGallery === 'function') { if ($('.justified-gallery > p > .gallery-item').length) { $('.justified-gallery > p > .gallery-item').unwrap(); } $('.justified-gallery').justifiedGallery(); } if (typeof moment === 'function') { $('.article-meta time').each(function() { $(this).text(moment($(this).attr('datetime')).fromNow()); }); } $('.article > .content > table').each(function() { if ($(this).width() > $(this).parent().width()) { $(this).wrap(''); } }); function adjustNavbar() { const navbarWidth = $('.navbar-main .navbar-start').outerWidth() + $('.navbar-main .navbar-end').outerWidth(); if ($(document).outerWidth() < navbarWidth) { $('.navbar-main .navbar-menu').addClass('justify-content-start'); } else { $('.navbar-main .navbar-menu').removeClass('justify-content-start'); } } adjustNavbar(); $(window).resize(adjustNavbar); function toggleFold(codeBlock, isFolded) { const $toggle = $(codeBlock).find('.fold i'); !isFolded ? $(codeBlock).removeClass('folded') : $(codeBlock).addClass('folded'); !isFolded ? $toggle.removeClass('fa-angle-right') : $toggle.removeClass('fa-angle-down'); !isFolded ? $toggle.addClass('fa-angle-down') : $toggle.addClass('fa-angle-right'); } function createFoldButton(fold) { return '' + (fold === 'unfolded' ? '' : '') + ''; } $('figure.highlight table').wrap('