Apply prettier coding style

This commit is contained in:
Claudio Zizza
2026-03-11 00:10:06 +01:00
parent e547996278
commit d768b9c716
3 changed files with 39 additions and 27 deletions

View File

@@ -21,17 +21,23 @@ export default function () {
$(document).ready(function () {
$('button[role="tab"]').on('click', function () {
const tabId = $(this).attr('aria-controls');
const tabContent = $('#' + tabId);
const tabId = $(this).attr('aria-controls');
const tabContent = $('#' + tabId);
$(this).closest('[role=tablist]').find('button[role="tab"]')
.attr('data-active', null)
.attr('aria-selected', 'false');
$(this)
.closest('[role=tablist]')
.find('button[role="tab"]')
.attr('data-active', null)
.attr('aria-selected', 'false');
$(this).attr('data-active', 'true').attr('aria-selected', 'true');
$(this).attr('data-active', 'true').attr('aria-selected', 'true');
$(this).closest('[role=tablist]').parent().find('div[role="tabpanel"]').hide();
tabContent.show();
$(this)
.closest('[role=tablist]')
.parent()
.find('div[role="tabpanel"]')
.hide();
tabContent.show();
});
$('button.copy-to-clipboard').on('click', async function () {
@@ -42,14 +48,17 @@ export default function () {
let copyText = '';
if (copyElement) {
const children = Array.from(copyElement.childNodes);
copyText = children.map(node => {
if (node.nodeType === Node.TEXT_NODE) {
return node.textContent;
} else if (node.nodeType === Node.ELEMENT_NODE) {
return node.textContent;
}
return '';
}).filter(Boolean).join('\n');
copyText = children
.map((node) => {
if (node.nodeType === Node.TEXT_NODE) {
return node.textContent;
} else if (node.nodeType === Node.ELEMENT_NODE) {
return node.textContent;
}
return '';
})
.filter(Boolean)
.join('\n');
}
await navigator.clipboard.writeText(copyText);

View File

@@ -22,8 +22,8 @@ export default function (projectSlug, versionSlug, searchBoxSettings) {
poweredBy: false,
reset: false,
searchClient: algoliasearch(
'YVYTFT9XMW',
'a6dada5f33f148586b92cc3afefeaaf6'
'YVYTFT9XMW',
'a6dada5f33f148586b92cc3afefeaaf6',
),
searchFunction: function (helper) {
if (helper.state.query === '') {

View File

@@ -643,15 +643,16 @@ a img.card-img-top {
@import 'railscasts';
@import 'carbonads';
pre.code-block-table{
pre.code-block-table {
counter-reset: line;
}
code.line{
code.line {
counter-increment: line;
}
code.empty:before, code.line:before{
content: " ";
code.empty:before,
code.line:before {
content: ' ';
display: inline-block;
width: 38px;
background: #333;
@@ -665,19 +666,21 @@ code.line:before {
content: counter(line);
}
.footnote-label, .footnote-content {
display: inline;
.footnote-label,
.footnote-content {
display: inline;
}
.footnote-label {
vertical-align: super;
font-size: .75em;
vertical-align: super;
font-size: 0.75em;
}
div.row table:not([width]) {
border: 1px solid #dee2e6;
td, th {
td,
th {
padding: 0.5em;
border: 1px solid #dee2e6;
}