Skip to content

Commit

Permalink
Deploy HTML files
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 30, 2024
1 parent e3ef87b commit aaef709
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 8 deletions.
33 changes: 31 additions & 2 deletions docs/10.1111_1467-6478.00057.html
Original file line number Diff line number Diff line change
Expand Up @@ -5733,9 +5733,38 @@ <h2>Legislation</h2>
tabs[i+1] = new Tabby(`[data-tab-${i+1}]`);
}
hljs.highlightAll();


// function to show code that is hidden in tabs
function revealTabBasedOnHash() {
let scrollElem;
if(window.location.hash) {
const hash = window.location.hash.substring(1);
// bibl elements might be in a hidden tab
if (hash.includes("bibl")) {
const tabElement = document.querySelector(`[data-bibl-ids*="${hash}"]`);
if (tabElement) {
const tabIndex = tabElement.dataset.tabIndex;
tabs[tabIndex].toggle(tabElement.id);
scrollElem = tabElement;
} else {
console.error(`Cannot find tab containing #${hash}`)
}
} else {
scrollElem = document.querySelector(`#${hash}`)
}
if (scrollElem) {
scrollElem.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});
}
}
}

// Trigger at page load and whenever hash changes
document.addEventListener("DOMContentLoaded", revealTabBasedOnHash);
window.addEventListener("hashchange", revealTabBasedOnHash);

// add links
function addLinks() {
console.log("Adding links to 'source' attributes...")
const spans = document.querySelectorAll('span')
spans.forEach((span, idx) => {
if (span.textContent.trim() == 'xml:id') {
Expand All @@ -5753,7 +5782,7 @@ <h2>Legislation</h2>
console.error(`Cannot find tab containing #${biblId}`)
} else {
const tabIndex = tabElement.dataset.tabIndex;
span.innerHTML = `"<a href="#${biblId}" onclick="tabs[${tabIndex}].toggle('${tabElement.id}')">#${biblId}</a>"`;
span.innerHTML = `"<a href="#${biblId}">#${biblId}</a>"`;
}
}
}
Expand Down
33 changes: 31 additions & 2 deletions docs/10.1111_1467-6478.00080.html
Original file line number Diff line number Diff line change
Expand Up @@ -3531,9 +3531,38 @@ <h1>English-language socio-legal article with footnotes</h1>
tabs[i+1] = new Tabby(`[data-tab-${i+1}]`);
}
hljs.highlightAll();


// function to show code that is hidden in tabs
function revealTabBasedOnHash() {
let scrollElem;
if(window.location.hash) {
const hash = window.location.hash.substring(1);
// bibl elements might be in a hidden tab
if (hash.includes("bibl")) {
const tabElement = document.querySelector(`[data-bibl-ids*="${hash}"]`);
if (tabElement) {
const tabIndex = tabElement.dataset.tabIndex;
tabs[tabIndex].toggle(tabElement.id);
scrollElem = tabElement;
} else {
console.error(`Cannot find tab containing #${hash}`)
}
} else {
scrollElem = document.querySelector(`#${hash}`)
}
if (scrollElem) {
scrollElem.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});
}
}
}

// Trigger at page load and whenever hash changes
document.addEventListener("DOMContentLoaded", revealTabBasedOnHash);
window.addEventListener("hashchange", revealTabBasedOnHash);

// add links
function addLinks() {
console.log("Adding links to 'source' attributes...")
const spans = document.querySelectorAll('span')
spans.forEach((span, idx) => {
if (span.textContent.trim() == 'xml:id') {
Expand All @@ -3551,7 +3580,7 @@ <h1>English-language socio-legal article with footnotes</h1>
console.error(`Cannot find tab containing #${biblId}`)
} else {
const tabIndex = tabElement.dataset.tabIndex;
span.innerHTML = `"<a href="#${biblId}" onclick="tabs[${tabIndex}].toggle('${tabElement.id}')">#${biblId}</a>"`;
span.innerHTML = `"<a href="#${biblId}">#${biblId}</a>"`;
}
}
}
Expand Down
33 changes: 31 additions & 2 deletions docs/10.1515_zfrs-1980-0103.html
Original file line number Diff line number Diff line change
Expand Up @@ -3823,9 +3823,38 @@ <h1>German-language socio-legal article with footnotes and bibliography</h1>
tabs[i+1] = new Tabby(`[data-tab-${i+1}]`);
}
hljs.highlightAll();


// function to show code that is hidden in tabs
function revealTabBasedOnHash() {
let scrollElem;
if(window.location.hash) {
const hash = window.location.hash.substring(1);
// bibl elements might be in a hidden tab
if (hash.includes("bibl")) {
const tabElement = document.querySelector(`[data-bibl-ids*="${hash}"]`);
if (tabElement) {
const tabIndex = tabElement.dataset.tabIndex;
tabs[tabIndex].toggle(tabElement.id);
scrollElem = tabElement;
} else {
console.error(`Cannot find tab containing #${hash}`)
}
} else {
scrollElem = document.querySelector(`#${hash}`)
}
if (scrollElem) {
scrollElem.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});
}
}
}

// Trigger at page load and whenever hash changes
document.addEventListener("DOMContentLoaded", revealTabBasedOnHash);
window.addEventListener("hashchange", revealTabBasedOnHash);

// add links
function addLinks() {
console.log("Adding links to 'source' attributes...")
const spans = document.querySelectorAll('span')
spans.forEach((span, idx) => {
if (span.textContent.trim() == 'xml:id') {
Expand All @@ -3843,7 +3872,7 @@ <h1>German-language socio-legal article with footnotes and bibliography</h1>
console.error(`Cannot find tab containing #${biblId}`)
} else {
const tabIndex = tabElement.dataset.tabIndex;
span.innerHTML = `"<a href="#${biblId}" onclick="tabs[${tabIndex}].toggle('${tabElement.id}')">#${biblId}</a>"`;
span.innerHTML = `"<a href="#${biblId}">#${biblId}</a>"`;
}
}
}
Expand Down
33 changes: 31 additions & 2 deletions docs/10.1515_zfrs-1980-0104.html
Original file line number Diff line number Diff line change
Expand Up @@ -6981,9 +6981,38 @@ <h1>German-language socio-legal article with references in the footnotes only</h
tabs[i+1] = new Tabby(`[data-tab-${i+1}]`);
}
hljs.highlightAll();


// function to show code that is hidden in tabs
function revealTabBasedOnHash() {
let scrollElem;
if(window.location.hash) {
const hash = window.location.hash.substring(1);
// bibl elements might be in a hidden tab
if (hash.includes("bibl")) {
const tabElement = document.querySelector(`[data-bibl-ids*="${hash}"]`);
if (tabElement) {
const tabIndex = tabElement.dataset.tabIndex;
tabs[tabIndex].toggle(tabElement.id);
scrollElem = tabElement;
} else {
console.error(`Cannot find tab containing #${hash}`)
}
} else {
scrollElem = document.querySelector(`#${hash}`)
}
if (scrollElem) {
scrollElem.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});
}
}
}

// Trigger at page load and whenever hash changes
document.addEventListener("DOMContentLoaded", revealTabBasedOnHash);
window.addEventListener("hashchange", revealTabBasedOnHash);

// add links
function addLinks() {
console.log("Adding links to 'source' attributes...")
const spans = document.querySelectorAll('span')
spans.forEach((span, idx) => {
if (span.textContent.trim() == 'xml:id') {
Expand All @@ -7001,7 +7030,7 @@ <h1>German-language socio-legal article with references in the footnotes only</h
console.error(`Cannot find tab containing #${biblId}`)
} else {
const tabIndex = tabElement.dataset.tabIndex;
span.innerHTML = `"<a href="#${biblId}" onclick="tabs[${tabIndex}].toggle('${tabElement.id}')">#${biblId}</a>"`;
span.innerHTML = `"<a href="#${biblId}">#${biblId}</a>"`;
}
}
}
Expand Down

0 comments on commit aaef709

Please sign in to comment.