From 4a05e4ea9fa08213f5019f45b8cda90b52b11521 Mon Sep 17 00:00:00 2001 From: Tim Obert Date: Thu, 31 Oct 2024 07:45:16 +0100 Subject: [PATCH 1/7] Make toctree-expand Buttons accessible --- packages/typo3-docs-theme/assets/js/menu-expandable.js | 6 ++++++ packages/typo3-docs-theme/resources/public/js/theme.min.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/typo3-docs-theme/assets/js/menu-expandable.js b/packages/typo3-docs-theme/assets/js/menu-expandable.js index 3e3364cd4..a4df5e599 100644 --- a/packages/typo3-docs-theme/assets/js/menu-expandable.js +++ b/packages/typo3-docs-theme/assets/js/menu-expandable.js @@ -29,7 +29,13 @@ if (link.nextSibling) { var expand = document.createElement('span'); expand.classList.add('toctree-expand'); + expand.setAttribute('tabindex', '0'); expand.addEventListener('click', toggleCurrent, true); + expand.addEventListener('keypress', (e) => { + if (e.key === "Enter") { + toggleCurrent(e) + } + }, true); link.prepend(expand); } }); diff --git a/packages/typo3-docs-theme/resources/public/js/theme.min.js b/packages/typo3-docs-theme/resources/public/js/theme.min.js index cddcf393d..6ef00900e 100644 --- a/packages/typo3-docs-theme/resources/public/js/theme.min.js +++ b/packages/typo3-docs-theme/resources/public/js/theme.min.js @@ -15,4 +15,4 @@ class AllDocumentationMenu extends HTMLElement{MAINMENU_JSON_URL="https://docs.t  TER - `),r(i))})})(),(()=>{const u="#permalink-uri",p="#permalink-short",m="#permalink-html";function h(o){const n=o.querySelector("#permalink-alert-success");var e=o.querySelectorAll(".copy-button");navigator.clipboard&&navigator.clipboard.writeText?e.forEach(e=>{e.addEventListener("click",function(){var e,t,a=this.getAttribute("data-target"),a=o.querySelector("#"+a);a?(n.classList.remove("d-none"),n.innerHTML=`Snippet ${e=a.value,t=document.createElement("div"),t.textContent=e,t.innerHTML} was copied to your clipboard.`,navigator.clipboard.writeText(a.value)):console.warn("Cannot copy link as no input is available!")})}):(console.info('"navigator.clipboard.writeText" is not available. Update to a modern browser to copy code to the system\'s clipboard'),e.forEach(e=>e.disabled=!0))}const g=document.querySelector("#linkReferenceModal");g.addEventListener("show.bs.modal",function(e){var t,a,o,e=e.relatedTarget,n=e.closest("section"),r=e.dataset.id||(n?n.dataset.rstAnchor:null),i=e.closest("h1, h2, h3, h4, h5, h6, dt"),i=i?i.innerText:"",s=e.dataset.rstcode,e=e.title,l=(l=g,c=r||s,l=l.querySelector(".alert-permalink-rst"),c?l.classList.add("d-none"):l.classList.remove("d-none"),c=n,l=r,"null"===window.location.origin||"file://"===window.location.origin?null:l?""+window.location.origin+window.location.pathname+"#"+l:""+window.location.origin+window.location.pathname+"#"+(c?.id||"")),c=g.dataset.currentFilename,d=s||(s=g,o=n,t=i,d=r,a=c,s=s.dataset.interlinkShortcode||"somemanual",d?`:ref:\`${t} <${s}:${d}>\``:""===a?"":`:doc:\`${t} <${s}:${a}#${o?.id||""}>\``),r=(t=g,s=n,a=r,o=c,n="https://docs.typo3.org/permalink/",t=t.dataset.interlinkShortcode||"somemanual",a?n+t+":"+a:""===o?"":n+t.replaceAll("/","-",t)+`:${o}#`+(s?.id||""));c=g,n=i,s=l,i=d,l=r,(r=e)&&(c.querySelector("h5").innerHTML=r),null===s?(c.querySelector(u).value="",c.querySelector(m).value="",c.querySelector(p).value=""):(c.querySelector(u).value=s,c.querySelector(p).value=l,c.querySelector(m).value=`${n}`),r=c.querySelector("#permalink-rst"),l=r.closest("div"),""===i?l.classList.add("d-none"):(l.classList.remove("d-none"),r.value=i),h(g)})})(),(()=>{"use strict";function a(e){e.preventDefault();const t=e.currentTarget.parentElement.parentElement;e=t.parentElement.parentElement.querySelectorAll("li.active");Array.from(e).forEach(e=>{e!==t&&e.classList.remove("active")}),t.classList.toggle("active")}var e;e=document.getElementsByClassName("main_menu"),Array.from(e).forEach(e=>{e=e.getElementsByTagName("a");Array.from(e).forEach(e=>{var t;e.nextSibling&&((t=document.createElement("span")).classList.add("toctree-expand"),t.addEventListener("click",a,!0),e.prepend(t))})})})(),window.addEventListener("load",()=>{var e,t,a=window.location.pathname.match(/^\/(c|m|p|h|other)\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-.]+\/[A-Za-z0-9\-]+\/(Changelog\/[A-Za-z0-9\-.]+\/)?/),a=a?a[0]:null;a&&(e=document.getElementById("searchscope"),(t=document.createElement("option")).value=a,t.text="Search current",e.add(t))}),(()=>{"use strict";const e=Array.from(document.querySelectorAll('.nav-item > [role="tab"]'));function r(e){return e.innerHTML.trim()}document.addEventListener("shown.bs.tab",function(o){const n=r(o.target);e.filter(e=>{var t=r(e)===n,a=e===o.target,e="true"===e.getAttribute("aria-selected");return t&&!a&&!e}).forEach(e=>{new bootstrap.Tab(e).show()})})})(),(()=>{"use strict";const u="A_Default",p=1e5,n=document.getElementById("toc-version");function a(e,o){var t=document.createElement("dl"),n={"de-de":"German","de-at":"German (Austria)","de-ch":"German (Switzerland)","en-gb":"English","fr-fr":"French","ru-ru":"Russian"};if(n["en-us"]=u,"object"!=typeof o)console.log("AJAX version selector API: Request failed, no JSON returned."),e.innerHTML="

Versions unavailable.

";else{var r,i={currentfile:{},singlefile:{}};for(r in o){var s=o[r];let e=s.language,t=s.version;var l,c=n[e.toLocaleLowerCase()];c&&(e=c);let a="3_named";"main"===t?a="1_main":(c=t.trim(),l=parseFloat(c),isNaN(l)||Number(c)!==l||(t=t.split(".").map(e=>+e+p).join("."),a="2_numeric")),i.currentfile[e]||(i.currentfile[e]={},i.singlefile[e]={}),i.singlefile[e][a]||(i.currentfile[e][a]={},i.singlefile[e][a]={}),i.singlefile[e][a][t]||(i.currentfile[e][a][t]={},i.singlefile[e][a][t]={}),i.currentfile[e][a][t]=s.url,i.singlefile[e][a][t]=s.singleUrl}var a=function t(a){{if(null===a||"object"!=typeof a||Array.isArray(a))return a;{const o={},e=Object.keys(a).filter(e=>!isNaN(e)).sort((e,t)=>t-e),n=Object.keys(a).filter(e=>isNaN(e)).sort(),r=[...e,...n];return r.forEach(e=>{o[e]=t(a[e])}),o}}}(i),d="",d=(d+=m("currentfile",a))+m("singlefile",a);t.innerHTML=d,e.innerHTML="",e.appendChild(t)}}function m(t,a){let o="";for(var n in"singlefile"===t&&(o+="

In one file:"),a[t]){var e,r,i;for(i in n!=u&&(e=Object.keys(a[t][n])[0],r=Object.keys(a[t][n][e])[0],o+='
'+n+"
"),a[t][n])for(var s in a[t][n][i]){let e=s;"2_numeric"===i&&(e=s.split(".").map(e=>+e-p).join(".")),o+='
'+e+"
"}}return"singlefile"===t&&(o+="

"),o}n&&n.addEventListener("click",function(){var e=document.getElementById("toc-version-wrapper");const t=document.getElementById("toc-version-options");e.classList.toggle("toc-version-wrapper-active"),t.dataset.ready||async function(){let e=document.URL,t="https://docs.typo3.org/services/versionsJson.php?url=";n.getAttribute("data-override-url-self")&&(e=n.getAttribute("data-override-url-self"),t=n.getAttribute("data-override-url-proxy"),console.log("AJAX version selector API: Developer mode enabled. Adjust data-override-url-self to simulate different menus. More information: https://docs.typo3.org/other/t3docs/render-guides/main/en-us/Developer/AjaxVersions.html"),console.log("Currently: "+e),console.log("The API PROXY is currently served from: "+t));var a=t+encodeURI(e);try{var o=await fetch(a);return o.ok?o.json():(console.log("AJAX version selector API: Request failure or empty response."),"")}catch(e){return console.log("AJAX version selector API: Request failed, likely CORS issue. Read the documentation to configure a proxy."),""}}().then(e=>{""===e&&(e="

No data available.

"),a(t,e),t.dataset.ready="true"})})})(); \ No newline at end of file + `),r(i))})})(),(()=>{const l="#permalink-uri",c="#permalink-html";function d(o){const n=o.querySelector("#permalink-alert-success");var e=o.querySelectorAll(".copy-button");navigator.clipboard&&navigator.clipboard.writeText?e.forEach(e=>{e.addEventListener("click",function(){var e,t,a=this.getAttribute("data-target"),a=o.querySelector("#"+a);a?(n.classList.remove("d-none"),n.innerHTML=`Snippet ${e=a.value,t=document.createElement("div"),t.textContent=e,t.innerHTML} was copied to your clipboard.`,navigator.clipboard.writeText(a.value)):console.warn("Cannot copy link as no input is available!")})}):(console.info('"navigator.clipboard.writeText" is not available. Update to a modern browser to copy code to the system\'s clipboard'),e.forEach(e=>e.disabled=!0))}const u=document.querySelector("#linkReferenceModal");u.addEventListener("show.bs.modal",function(e){var t,e=e.relatedTarget,a=e.closest("section"),o=e.dataset.id||(a?a.dataset.rstAnchor:null),n=e.closest("h1, h2, h3, h4, h5, h6, dt"),n=n?n.innerText:"",r=e.dataset.rstcode,e=e.title,i=(i=u,s=o||r,i=i.querySelector(".alert-permalink-rst"),s?i.classList.add("d-none"):i.classList.remove("d-none"),s=a,i=o,"null"===window.location.origin||"file://"===window.location.origin?null:i?""+window.location.origin+window.location.pathname+"#"+i:""+window.location.origin+window.location.pathname+"#"+(s?.id||"")),s=u.dataset.currentFilename,o=r||(r=u,a=a,t=n,o=o,s=s,r=r.dataset.interlinkShortcode||"somemanual",o?`:ref:\`${t} <${r}:${o}>\``:""===s?"":`:doc:\`${t} <${r}:${s}#${a?.id||""}>\``);t=u,r=n,s=i,a=o,(n=e)&&(t.querySelector("h5").innerHTML=n),null===s?(t.querySelector(l).value="",t.querySelector(c).value=""):(t.querySelector(l).value=s,t.querySelector(c).value=`${r}`),n=t.querySelector("#permalink-rst"),s=n.closest("div"),""===a?s.classList.add("d-none"):(s.classList.remove("d-none"),n.value=a),d(u)})})(),(()=>{"use strict";function a(e){e.preventDefault();const t=e.currentTarget.parentElement.parentElement;e=t.parentElement.parentElement.querySelectorAll("li.active");Array.from(e).forEach(e=>{e!==t&&e.classList.remove("active")}),t.classList.toggle("active")}var e;e=document.getElementsByClassName("main_menu"),Array.from(e).forEach(e=>{e=e.getElementsByTagName("a");Array.from(e).forEach(e=>{var t;e.nextSibling&&((t=document.createElement("span")).classList.add("toctree-expand"),t.setAttribute("tabindex","0"),t.addEventListener("click",a,!0),t.addEventListener("keypress",e=>{"Enter"===e.key&&a(e)},!0),e.prepend(t))})})})(),window.addEventListener("load",()=>{var e,t,a=window.location.pathname.match(/^\/(c|m|p|h|other)\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-.]+\/[A-Za-z0-9\-]+\/(Changelog\/[A-Za-z0-9\-.]+\/)?/),a=a?a[0]:null;a&&(e=document.getElementById("searchscope"),(t=document.createElement("option")).value=a,t.text="Search current",e.add(t))}),(()=>{"use strict";const e=Array.from(document.querySelectorAll('.nav-item > [role="tab"]'));function r(e){return e.innerHTML.trim()}document.addEventListener("shown.bs.tab",function(o){const n=r(o.target);e.filter(e=>{var t=r(e)===n,a=e===o.target,e="true"===e.getAttribute("aria-selected");return t&&!a&&!e}).forEach(e=>{new bootstrap.Tab(e).show()})})})(),(()=>{"use strict";const u="A_Default",p=1e5,n=document.getElementById("toc-version");function a(e,o){var t=document.createElement("dl"),n={"de-de":"German","de-at":"German (Austria)","de-ch":"German (Switzerland)","en-gb":"English","fr-fr":"French","ru-ru":"Russian"};if(n["en-us"]=u,"object"!=typeof o)console.log("AJAX version selector API: Request failed, no JSON returned."),e.innerHTML="

Versions unavailable.

";else{var r,i={currentfile:{},singlefile:{}};for(r in o){var s=o[r];let e=s.language,t=s.version;var l,c=n[e.toLocaleLowerCase()];c&&(e=c);let a="3_named";"main"===t?a="1_main":(c=t.trim(),l=parseFloat(c),isNaN(l)||Number(c)!==l||(t=t.split(".").map(e=>+e+p).join("."),a="2_numeric")),i.currentfile[e]||(i.currentfile[e]={},i.singlefile[e]={}),i.singlefile[e][a]||(i.currentfile[e][a]={},i.singlefile[e][a]={}),i.singlefile[e][a][t]||(i.currentfile[e][a][t]={},i.singlefile[e][a][t]={}),i.currentfile[e][a][t]=s.url,i.singlefile[e][a][t]=s.singleUrl}var a=function t(a){{if(null===a||"object"!=typeof a||Array.isArray(a))return a;{const o={},e=Object.keys(a).filter(e=>!isNaN(e)).sort((e,t)=>t-e),n=Object.keys(a).filter(e=>isNaN(e)).sort(),r=[...e,...n];return r.forEach(e=>{o[e]=t(a[e])}),o}}}(i),d="",d=(d+=m("currentfile",a))+m("singlefile",a);t.innerHTML=d,e.innerHTML="",e.appendChild(t)}}function m(t,a){let o="";for(var n in"singlefile"===t&&(o+="

In one file:"),a[t]){var e,r,i;for(i in n!=u&&(e=Object.keys(a[t][n])[0],r=Object.keys(a[t][n][e])[0],o+='
'+n+"
"),a[t][n])for(var s in a[t][n][i]){let e=s;"2_numeric"===i&&(e=s.split(".").map(e=>+e-p).join(".")),o+='
'+e+"
"}}return"singlefile"===t&&(o+="

"),o}n&&n.addEventListener("click",function(){var e=document.getElementById("toc-version-wrapper");const t=document.getElementById("toc-version-options");e.classList.toggle("toc-version-wrapper-active"),t.dataset.ready||async function(){let e=document.URL,t="https://docs.typo3.org/services/versionsJson.php?url=";n.getAttribute("data-override-url-self")&&(e=n.getAttribute("data-override-url-self"),t=n.getAttribute("data-override-url-proxy"),console.log("AJAX version selector API: Developer mode enabled. Adjust data-override-url-self to simulate different menus. More information: https://docs.typo3.org/other/t3docs/render-guides/main/en-us/Developer/AjaxVersions.html"),console.log("Currently: "+e),console.log("The API PROXY is currently served from: "+t));var a=t+encodeURI(e);try{var o=await fetch(a);return o.ok?o.json():(console.log("AJAX version selector API: Request failure or empty response."),"")}catch(e){return console.log("AJAX version selector API: Request failed, likely CORS issue. Read the documentation to configure a proxy."),""}}().then(e=>{""===e&&(e="

No data available.

"),a(t,e),t.dataset.ready="true"})})})(); \ No newline at end of file From ddb7f74fc6a2cfa6b8c565b62b66cae10d083b90 Mon Sep 17 00:00:00 2001 From: Tim Obert Date: Thu, 31 Oct 2024 12:23:52 +0100 Subject: [PATCH 2/7] Accessible changes: Make version select controlable via keyboard --- packages/typo3-docs-theme/assets/js/versions.js | 9 +++++++-- .../typo3-docs-theme/resources/public/js/theme.min.js | 2 +- .../template/structure/navigation/menu-level.html.twig | 2 +- .../template/structure/navigation/menu.html.twig | 2 +- .../structure/navigation/navigationHeader.html.twig | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/typo3-docs-theme/assets/js/versions.js b/packages/typo3-docs-theme/assets/js/versions.js index 970646ef7..ec4d24075 100644 --- a/packages/typo3-docs-theme/assets/js/versions.js +++ b/packages/typo3-docs-theme/assets/js/versions.js @@ -143,7 +143,7 @@ if (!isNaN(versionAsFloat) && Number(versionTrimmed) === versionAsFloat) { // make each number part have the same digit count, allowing to // properly sort as a string - version = version.split('.').map(n => +n+VERSION_SORT_BASE).join('.') + version = version.split('.').map(n => +n + VERSION_SORT_BASE).join('.') versionType = '2_numeric'; } } @@ -197,7 +197,7 @@ if (versionType === '2_numeric') { // restore version string from before sorting - parsedVersion = version.split('.').map(n => +n-VERSION_SORT_BASE).join('.') + parsedVersion = version.split('.').map(n => +n - VERSION_SORT_BASE).join('.') } html += '
' + parsedVersion + '
'; @@ -251,4 +251,9 @@ } versionElement.addEventListener('click', addListOfVersions); + versionElement.addEventListener('keypress', (e) => { + if (e.key === 'Enter') { + addListOfVersions() + } + }); })(); diff --git a/packages/typo3-docs-theme/resources/public/js/theme.min.js b/packages/typo3-docs-theme/resources/public/js/theme.min.js index 6ef00900e..1c9bf4cbe 100644 --- a/packages/typo3-docs-theme/resources/public/js/theme.min.js +++ b/packages/typo3-docs-theme/resources/public/js/theme.min.js @@ -15,4 +15,4 @@ class AllDocumentationMenu extends HTMLElement{MAINMENU_JSON_URL="https://docs.t  TER - `),r(i))})})(),(()=>{const l="#permalink-uri",c="#permalink-html";function d(o){const n=o.querySelector("#permalink-alert-success");var e=o.querySelectorAll(".copy-button");navigator.clipboard&&navigator.clipboard.writeText?e.forEach(e=>{e.addEventListener("click",function(){var e,t,a=this.getAttribute("data-target"),a=o.querySelector("#"+a);a?(n.classList.remove("d-none"),n.innerHTML=`Snippet ${e=a.value,t=document.createElement("div"),t.textContent=e,t.innerHTML} was copied to your clipboard.`,navigator.clipboard.writeText(a.value)):console.warn("Cannot copy link as no input is available!")})}):(console.info('"navigator.clipboard.writeText" is not available. Update to a modern browser to copy code to the system\'s clipboard'),e.forEach(e=>e.disabled=!0))}const u=document.querySelector("#linkReferenceModal");u.addEventListener("show.bs.modal",function(e){var t,e=e.relatedTarget,a=e.closest("section"),o=e.dataset.id||(a?a.dataset.rstAnchor:null),n=e.closest("h1, h2, h3, h4, h5, h6, dt"),n=n?n.innerText:"",r=e.dataset.rstcode,e=e.title,i=(i=u,s=o||r,i=i.querySelector(".alert-permalink-rst"),s?i.classList.add("d-none"):i.classList.remove("d-none"),s=a,i=o,"null"===window.location.origin||"file://"===window.location.origin?null:i?""+window.location.origin+window.location.pathname+"#"+i:""+window.location.origin+window.location.pathname+"#"+(s?.id||"")),s=u.dataset.currentFilename,o=r||(r=u,a=a,t=n,o=o,s=s,r=r.dataset.interlinkShortcode||"somemanual",o?`:ref:\`${t} <${r}:${o}>\``:""===s?"":`:doc:\`${t} <${r}:${s}#${a?.id||""}>\``);t=u,r=n,s=i,a=o,(n=e)&&(t.querySelector("h5").innerHTML=n),null===s?(t.querySelector(l).value="",t.querySelector(c).value=""):(t.querySelector(l).value=s,t.querySelector(c).value=`${r}`),n=t.querySelector("#permalink-rst"),s=n.closest("div"),""===a?s.classList.add("d-none"):(s.classList.remove("d-none"),n.value=a),d(u)})})(),(()=>{"use strict";function a(e){e.preventDefault();const t=e.currentTarget.parentElement.parentElement;e=t.parentElement.parentElement.querySelectorAll("li.active");Array.from(e).forEach(e=>{e!==t&&e.classList.remove("active")}),t.classList.toggle("active")}var e;e=document.getElementsByClassName("main_menu"),Array.from(e).forEach(e=>{e=e.getElementsByTagName("a");Array.from(e).forEach(e=>{var t;e.nextSibling&&((t=document.createElement("span")).classList.add("toctree-expand"),t.setAttribute("tabindex","0"),t.addEventListener("click",a,!0),t.addEventListener("keypress",e=>{"Enter"===e.key&&a(e)},!0),e.prepend(t))})})})(),window.addEventListener("load",()=>{var e,t,a=window.location.pathname.match(/^\/(c|m|p|h|other)\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-.]+\/[A-Za-z0-9\-]+\/(Changelog\/[A-Za-z0-9\-.]+\/)?/),a=a?a[0]:null;a&&(e=document.getElementById("searchscope"),(t=document.createElement("option")).value=a,t.text="Search current",e.add(t))}),(()=>{"use strict";const e=Array.from(document.querySelectorAll('.nav-item > [role="tab"]'));function r(e){return e.innerHTML.trim()}document.addEventListener("shown.bs.tab",function(o){const n=r(o.target);e.filter(e=>{var t=r(e)===n,a=e===o.target,e="true"===e.getAttribute("aria-selected");return t&&!a&&!e}).forEach(e=>{new bootstrap.Tab(e).show()})})})(),(()=>{"use strict";const u="A_Default",p=1e5,n=document.getElementById("toc-version");function a(e,o){var t=document.createElement("dl"),n={"de-de":"German","de-at":"German (Austria)","de-ch":"German (Switzerland)","en-gb":"English","fr-fr":"French","ru-ru":"Russian"};if(n["en-us"]=u,"object"!=typeof o)console.log("AJAX version selector API: Request failed, no JSON returned."),e.innerHTML="

Versions unavailable.

";else{var r,i={currentfile:{},singlefile:{}};for(r in o){var s=o[r];let e=s.language,t=s.version;var l,c=n[e.toLocaleLowerCase()];c&&(e=c);let a="3_named";"main"===t?a="1_main":(c=t.trim(),l=parseFloat(c),isNaN(l)||Number(c)!==l||(t=t.split(".").map(e=>+e+p).join("."),a="2_numeric")),i.currentfile[e]||(i.currentfile[e]={},i.singlefile[e]={}),i.singlefile[e][a]||(i.currentfile[e][a]={},i.singlefile[e][a]={}),i.singlefile[e][a][t]||(i.currentfile[e][a][t]={},i.singlefile[e][a][t]={}),i.currentfile[e][a][t]=s.url,i.singlefile[e][a][t]=s.singleUrl}var a=function t(a){{if(null===a||"object"!=typeof a||Array.isArray(a))return a;{const o={},e=Object.keys(a).filter(e=>!isNaN(e)).sort((e,t)=>t-e),n=Object.keys(a).filter(e=>isNaN(e)).sort(),r=[...e,...n];return r.forEach(e=>{o[e]=t(a[e])}),o}}}(i),d="",d=(d+=m("currentfile",a))+m("singlefile",a);t.innerHTML=d,e.innerHTML="",e.appendChild(t)}}function m(t,a){let o="";for(var n in"singlefile"===t&&(o+="

In one file:"),a[t]){var e,r,i;for(i in n!=u&&(e=Object.keys(a[t][n])[0],r=Object.keys(a[t][n][e])[0],o+='
'+n+"
"),a[t][n])for(var s in a[t][n][i]){let e=s;"2_numeric"===i&&(e=s.split(".").map(e=>+e-p).join(".")),o+='
'+e+"
"}}return"singlefile"===t&&(o+="

"),o}n&&n.addEventListener("click",function(){var e=document.getElementById("toc-version-wrapper");const t=document.getElementById("toc-version-options");e.classList.toggle("toc-version-wrapper-active"),t.dataset.ready||async function(){let e=document.URL,t="https://docs.typo3.org/services/versionsJson.php?url=";n.getAttribute("data-override-url-self")&&(e=n.getAttribute("data-override-url-self"),t=n.getAttribute("data-override-url-proxy"),console.log("AJAX version selector API: Developer mode enabled. Adjust data-override-url-self to simulate different menus. More information: https://docs.typo3.org/other/t3docs/render-guides/main/en-us/Developer/AjaxVersions.html"),console.log("Currently: "+e),console.log("The API PROXY is currently served from: "+t));var a=t+encodeURI(e);try{var o=await fetch(a);return o.ok?o.json():(console.log("AJAX version selector API: Request failure or empty response."),"")}catch(e){return console.log("AJAX version selector API: Request failed, likely CORS issue. Read the documentation to configure a proxy."),""}}().then(e=>{""===e&&(e="

No data available.

"),a(t,e),t.dataset.ready="true"})})})(); \ No newline at end of file + `),r(i))})})(),(()=>{const l="#permalink-uri",c="#permalink-html";function d(o){const n=o.querySelector("#permalink-alert-success");var e=o.querySelectorAll(".copy-button");navigator.clipboard&&navigator.clipboard.writeText?e.forEach(e=>{e.addEventListener("click",function(){var e,t,a=this.getAttribute("data-target"),a=o.querySelector("#"+a);a?(n.classList.remove("d-none"),n.innerHTML=`Snippet ${e=a.value,t=document.createElement("div"),t.textContent=e,t.innerHTML} was copied to your clipboard.`,navigator.clipboard.writeText(a.value)):console.warn("Cannot copy link as no input is available!")})}):(console.info('"navigator.clipboard.writeText" is not available. Update to a modern browser to copy code to the system\'s clipboard'),e.forEach(e=>e.disabled=!0))}const u=document.querySelector("#linkReferenceModal");u.addEventListener("show.bs.modal",function(e){var t,e=e.relatedTarget,a=e.closest("section"),o=e.dataset.id||(a?a.dataset.rstAnchor:null),n=e.closest("h1, h2, h3, h4, h5, h6, dt"),n=n?n.innerText:"",r=e.dataset.rstcode,e=e.title,i=(i=u,s=o||r,i=i.querySelector(".alert-permalink-rst"),s?i.classList.add("d-none"):i.classList.remove("d-none"),s=a,i=o,"null"===window.location.origin||"file://"===window.location.origin?null:i?""+window.location.origin+window.location.pathname+"#"+i:""+window.location.origin+window.location.pathname+"#"+(s?.id||"")),s=u.dataset.currentFilename,o=r||(r=u,a=a,t=n,o=o,s=s,r=r.dataset.interlinkShortcode||"somemanual",o?`:ref:\`${t} <${r}:${o}>\``:""===s?"":`:doc:\`${t} <${r}:${s}#${a?.id||""}>\``);t=u,r=n,s=i,a=o,(n=e)&&(t.querySelector("h5").innerHTML=n),null===s?(t.querySelector(l).value="",t.querySelector(c).value=""):(t.querySelector(l).value=s,t.querySelector(c).value=`${r}`),n=t.querySelector("#permalink-rst"),s=n.closest("div"),""===a?s.classList.add("d-none"):(s.classList.remove("d-none"),n.value=a),d(u)})})(),(()=>{"use strict";function a(e){e.preventDefault();const t=e.currentTarget.parentElement.parentElement;e=t.parentElement.parentElement.querySelectorAll("li.active");Array.from(e).forEach(e=>{e!==t&&e.classList.remove("active")}),t.classList.toggle("active")}var e;e=document.getElementsByClassName("main_menu"),Array.from(e).forEach(e=>{e=e.getElementsByTagName("a");Array.from(e).forEach(e=>{var t;e.nextSibling&&((t=document.createElement("span")).classList.add("toctree-expand"),t.setAttribute("tabindex","0"),t.addEventListener("click",a,!0),t.addEventListener("keypress",e=>{"Enter"===e.key&&a(e)},!0),e.prepend(t))})})})(),window.addEventListener("load",()=>{var e,t,a=window.location.pathname.match(/^\/(c|m|p|h|other)\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-_]+\/[A-Za-z0-9\-.]+\/[A-Za-z0-9\-]+\/(Changelog\/[A-Za-z0-9\-.]+\/)?/),a=a?a[0]:null;a&&(e=document.getElementById("searchscope"),(t=document.createElement("option")).value=a,t.text="Search current",e.add(t))}),(()=>{"use strict";const e=Array.from(document.querySelectorAll('.nav-item > [role="tab"]'));function r(e){return e.innerHTML.trim()}document.addEventListener("shown.bs.tab",function(o){const n=r(o.target);e.filter(e=>{var t=r(e)===n,a=e===o.target,e="true"===e.getAttribute("aria-selected");return t&&!a&&!e}).forEach(e=>{new bootstrap.Tab(e).show()})})})(),(()=>{"use strict";const u="A_Default",p=1e5,n=document.getElementById("toc-version");function a(e,o){var t=document.createElement("dl"),n={"de-de":"German","de-at":"German (Austria)","de-ch":"German (Switzerland)","en-gb":"English","fr-fr":"French","ru-ru":"Russian"};if(n["en-us"]=u,"object"!=typeof o)console.log("AJAX version selector API: Request failed, no JSON returned."),e.innerHTML="

Versions unavailable.

";else{var r,i={currentfile:{},singlefile:{}};for(r in o){var s=o[r];let e=s.language,t=s.version;var l,c=n[e.toLocaleLowerCase()];c&&(e=c);let a="3_named";"main"===t?a="1_main":(c=t.trim(),l=parseFloat(c),isNaN(l)||Number(c)!==l||(t=t.split(".").map(e=>+e+p).join("."),a="2_numeric")),i.currentfile[e]||(i.currentfile[e]={},i.singlefile[e]={}),i.singlefile[e][a]||(i.currentfile[e][a]={},i.singlefile[e][a]={}),i.singlefile[e][a][t]||(i.currentfile[e][a][t]={},i.singlefile[e][a][t]={}),i.currentfile[e][a][t]=s.url,i.singlefile[e][a][t]=s.singleUrl}var a=function t(a){{if(null===a||"object"!=typeof a||Array.isArray(a))return a;{const o={},e=Object.keys(a).filter(e=>!isNaN(e)).sort((e,t)=>t-e),n=Object.keys(a).filter(e=>isNaN(e)).sort(),r=[...e,...n];return r.forEach(e=>{o[e]=t(a[e])}),o}}}(i),d="",d=(d+=m("currentfile",a))+m("singlefile",a);t.innerHTML=d,e.innerHTML="",e.appendChild(t)}}function m(t,a){let o="";for(var n in"singlefile"===t&&(o+="

In one file:"),a[t]){var e,r,i;for(i in n!=u&&(e=Object.keys(a[t][n])[0],r=Object.keys(a[t][n][e])[0],o+='
'+n+"
"),a[t][n])for(var s in a[t][n][i]){let e=s;"2_numeric"===i&&(e=s.split(".").map(e=>+e-p).join(".")),o+='
'+e+"
"}}return"singlefile"===t&&(o+="

"),o}function t(){var e=document.getElementById("toc-version-wrapper");const t=document.getElementById("toc-version-options");e.classList.toggle("toc-version-wrapper-active"),t.dataset.ready||async function(){let e=document.URL,t="https://docs.typo3.org/services/versionsJson.php?url=";n.getAttribute("data-override-url-self")&&(e=n.getAttribute("data-override-url-self"),t=n.getAttribute("data-override-url-proxy"),console.log("AJAX version selector API: Developer mode enabled. Adjust data-override-url-self to simulate different menus. More information: https://docs.typo3.org/other/t3docs/render-guides/main/en-us/Developer/AjaxVersions.html"),console.log("Currently: "+e),console.log("The API PROXY is currently served from: "+t));var a=t+encodeURI(e);try{var o=await fetch(a);return o.ok?o.json():(console.log("AJAX version selector API: Request failure or empty response."),"")}catch(e){return console.log("AJAX version selector API: Request failed, likely CORS issue. Read the documentation to configure a proxy."),""}}().then(e=>{""===e&&(e="

No data available.

"),a(t,e),t.dataset.ready="true"})}n&&(n.addEventListener("click",t),n.addEventListener("keypress",e=>{"Enter"===e.key&&t()}))})(); \ No newline at end of file diff --git a/packages/typo3-docs-theme/resources/template/structure/navigation/menu-level.html.twig b/packages/typo3-docs-theme/resources/template/structure/navigation/menu-level.html.twig index 5743b118f..bcf1a2b55 100644 --- a/packages/typo3-docs-theme/resources/template/structure/navigation/menu-level.html.twig +++ b/packages/typo3-docs-theme/resources/template/structure/navigation/menu-level.html.twig @@ -1,4 +1,4 @@ -