From f74f6448ea0361321a52b6b6d293be13fbd91949 Mon Sep 17 00:00:00 2001 From: Rafael Tavares Juliani Date: Fri, 20 Oct 2023 00:09:17 -0300 Subject: [PATCH] Retirando ajuste legenda figuras --- leitor-web.js | 50 +---------------------------------------------- leitor-web.min.js | 2 +- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/leitor-web.js b/leitor-web.js index 10b96df..0c81c79 100644 --- a/leitor-web.js +++ b/leitor-web.js @@ -9,55 +9,7 @@ var observer; let ref_cap_busca = {}; -window.onload = (event) => { - - // Seleciona todos os elementos com a classe .figure-caption dentro do elemento com id quarto-document-content - const captions = document.querySelectorAll('#quarto-document-content .figure-caption'); - - //seleciona todas as tags que se chamam caption - const captionsTag = document.getElementsByTagName("caption"); - - // Converte a coleção HTMLCollection em um array - const captionsArray = Array.from(captionsTag); - - // Itera sobre todos os elementos .figure-caption - captions.forEach(caption => { - - // Obtém o texto dentro do elemento .figure-caption - const texto = caption.innerHTML; - - // Divide o texto em partes separadas por ":" - const partes = texto.split(':'); - - const primeiraParte = partes.shift(); - - // Recria o texto com em torno de cada caractere até o primeiro ":" - const novoTexto = ""+primeiraParte+": "+partes.join(' '); - - // Define o novo HTML no elemento .figure-caption - caption.innerHTML = novoTexto; - - }); - - // Itera sobre todas as tags caption - captionsArray.forEach(caption => { - - // Obtém o texto dentro da tag caption - const texto = caption.innerHTML; - - // Divide o texto em partes separadas por ":" - const partes = texto.split(':'); - - const primeiraParte = partes.shift(); - - // Recria o texto com em torno de cada caractere até o primeiro ":" - const novoTexto = ""+primeiraParte+": "+partes.join(' '); - - // Define a nova tag HTML caption - caption.innerHTML = novoTexto; - - }); - +window.onload = (event) => { // A variavel metadados está definida no head do html. Foi colocada pelo script preparacao-moan.py diff --git a/leitor-web.min.js b/leitor-web.min.js index 8089f1f..abeb3a7 100644 --- a/leitor-web.min.js +++ b/leitor-web.min.js @@ -1 +1 @@ -var observer,elementosNaPagina=[];let ref_cap_busca={};window.onload=e=>{let t=document.querySelectorAll("#quarto-document-content .figure-caption"),n=document.getElementsByTagName("caption"),a=Array.from(n);t.forEach(e=>{let t=e.innerHTML,n=t.split(":"),a=n.shift(),o=""+a+": "+n.join(" ");e.innerHTML=o}),a.forEach(e=>{let t=e.innerHTML,n=t.split(":"),a=n.shift(),o=""+a+": "+n.join(" ");e.innerHTML=o});let o=new Audio("https://js.livro.online/moan-quarto/Interruptor.mp3"),l=metadados.livroUrl,r=["#fff","antiquewhite","url('https://js.livro.online/moan-quarto/olga-thelavart-HZm2XR0whdw-unsplash_P.jpg')","url('https://js.livro.online/moan-quarto/paper-g5d2cae661_1280_Pixabay_user_geralt.jpg')"],i=0,s=document.querySelector("body"),c=document.getElementById("quarto-content"),p=document.querySelector(".page-navigation"),d=document.getElementById("quarto-sidebar"),f=document.getElementById("quarto-margin-sidebar"),u=document.querySelectorAll(".sidebar-item-container"),g=document.querySelectorAll("span.chapter-number"),m=document.getElementById("toc-title"),y=!1,h=document.querySelector("#papel"),v=document.querySelector("main");var $=document.createElement("div");function E(e,t){let n=document.createElement("button"),a=document.createElement("img");return a.src=e,n.appendChild(a),n.addEventListener("click",function(){t()}),n}$.id="moan-menu-texto";let b=document.querySelector("header"),L=window.getComputedStyle(h,null).getPropertyValue("font-size"),C=L.split("p"),z=C[0];function S(){let e=localStorage.getItem("livro.online@"+l+".config"),t=localStorage.getItem("quarto-color-scheme"),n=!1;n="default"!=t;let a=JSON.parse(e);e&&(a[0]&&B(a[0]),a[1]&&(i=a[1],h.style.background=r[a[1]],y&&!n&&(p.style.background=r[a[1]]),n&&h.style.removeProperty("background")),a[2]&&(y=a[2])&&!n&&G())}function k(e,t){let n=localStorage.getItem("livro.online@"+l+".config");if(n){let a=JSON.parse(n),o;switch(e){case"fonte":a[0]=t,o=JSON.stringify(a),localStorage.setItem("livro.online@"+l+".config",o);break;case"papel":a[1]=t,o=JSON.stringify(a),localStorage.setItem("livro.online@"+l+".config",o);break;case"luz_apagada":a[2]=t,o=JSON.stringify(a),localStorage.setItem("livro.online@"+l+".config",o)}}else{let r=[],i;switch(e){case"fonte":r[0]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+l+".config",i);break;case"papel":r[1]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+l+".config",i);break;case"fundo":r[2]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+l+".config",i)}}}S();let q=document.createElement("script");q.src="https://js.livro.online/bibliotecas_de_terceiros/qrcode.min.js",document.body.appendChild(q);let I=document.createElement("div");I.id="modal",I.className="modal",I.style.display="none";let P=document.createElement("div");P.className="modal-content";let _=document.createElement("span");_.className="close",_.innerHTML="×",_.style.fontSize="20px";let x=document.createElement("div"),N=document.createElement("p");N.innerHTML="Refer\xeancia";let w=document.createElement("span");w.id="ref",x.appendChild(N),x.appendChild(w);let j=document.createElement("div"),H=document.createElement("p");H.innerHTML="Link";let R=document.createElement("span");R.id="link",j.appendChild(H),j.appendChild(R);let T=document.createElement("p");T.innerHTML="QR Code";let M=document.createElement("div");function A(){let e=window.getComputedStyle($,null).getPropertyValue("font-size"),t=window.getComputedStyle(b,null).getPropertyValue("font-size"),n=parseInt(window.getComputedStyle(h,null).getPropertyValue("font-size").split("p")[0])-2;h.style.fontSize=`${n}px`,$.style.fontSize=e,b.style.fontSize=t,k("fonte",n)}function B(e){let t=window.getComputedStyle($,null).getPropertyValue("font-size"),n=window.getComputedStyle(b,null).getPropertyValue("font-size");if(void 0!==e)h.style.fontSize=`${e}px`,$.style.fontSize=t,b.style.fontSize=n;else{let a=parseInt(window.getComputedStyle(h,null).getPropertyValue("font-size").split("p")[0])+2;h.style.fontSize=`${a}px`,$.style.fontSize=t,b.style.fontSize=n,k("fonte",a)}}function V(){h.style.fontSize=z+"px",k("fonte",z)}function D(){if(s.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para poder alterar o papel.");return}(i+=1)>r.length-1&&(i=0),h.style.background=r[i],k("papel",i),y&&(p.style.background=r[i])}function F(){c.classList.remove("luz_apagada"),p.style.removeProperty("background"),d.style.removeProperty("color"),d.classList.remove("luz_apagada"),u.forEach(e=>{e.style.removeProperty("color")}),g.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||e.style.removeProperty("color")}),f.style.removeProperty("color"),m&&m.style.removeProperty("color"),y=!1}function G(){c.classList.add("luz_apagada"),p.style.backgroundColor=r[i],h.style.background=r[i],d.style.color="#fff",d.classList.add("luz_apagada"),u.forEach(e=>{e.style.color="#fff"}),g.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||(e.style.color="#fff")}),f.style.color="#fff",m&&(m.style.color="#fff"),y=!0}function U(){if(s.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para o estado da luz de fundo.");return}y?(h.style.background=r[i],o.play(),F(),k("luz_apagada",!1)):(h.style.background=r[i],o.play(),G(),k("luz_apagada",!0))}M.id="qrcode_container",P.appendChild(_),P.appendChild(x),P.appendChild(j),P.appendChild(T),P.appendChild(M),I.appendChild(P),document.body.appendChild(I),$.appendChild(E("https://js.livro.online/moan-quarto/text_decrease_FILL0_wght400_GRAD0_opsz24.svg",A)),$.appendChild(E("https://js.livro.online/moan-quarto/text_increase_FILL0_wght400_GRAD0_opsz24.svg",B)),$.appendChild(E("https://js.livro.online/moan-quarto/format_clear_FILL0_wght400_GRAD0_opsz24.svg",V)),$.appendChild(E("https://js.livro.online/moan-quarto/note_FILL0_wght400_GRAD0_opsz24.svg",D)),$.appendChild(E("https://js.livro.online/moan-quarto/emoji_objects_FILL0_wght400_GRAD0_opsz24.svg",U)),v.insertBefore($,v.firstChild);let O={attributes:!0,attributeFilter:["class"]};function J(e,t){for(let n of e)"attributes"===n.type&&"class"===n.attributeName&&(s.classList.contains("quarto-dark")?(F(),h.style.removeProperty("background")):S())}let Q=new MutationObserver(J);Q.observe(s,O);var X=document.createElement("div");X.className="referencias_capitulo";var Z=document.createElement("div");Z.className="cont_ref";var K=document.createElement("span");K.id="Paginacao",Z.appendChild(K),X.appendChild(Z);var W=document.createElement("input");W.id="busca_ref",W.className="buscar_ref",W.setAttribute("placeholder","Refer\xeancia..."),W.style.backgroundImage='url("https://js.livro.online/moan-quarto/search_FILL0_wght400_GRAD0_opsz24.svg")',W.style.backgroundRepeat="no-repeat",W.style.backgroundPosition="5px center",W.style.paddingLeft="25px",X.appendChild(W);let Y=document.createElement("button");Y.className="pegarLink";let ee=document.createElement("span");ee.style.display="flex",ee.style.flexDirection="column",ee.style.alignItems="center";let et=document.createElement("img");et.src="https://js.livro.online/moan-quarto/link_FILL0_wght400_GRAD0_opsz24.svg",ee.appendChild(et);let en=document.createTextNode("link");ee.appendChild(en),Y.appendChild(ee),X.appendChild(Y),Y.addEventListener("click",ep),document.body.appendChild(X);let ea=document.getElementById("busca_ref");function eo(e){let t=e.length,n=0,a=new Promise(a=>{0===t&&a("lista vazia"),e.forEach(e=>{n++,e.isIntersecting&&elementosNaPagina.push(e),n===t&&0!=elementosNaPagina.length&&a("lista pronta")})}),o=new Promise(e=>{e(elementosNaPagina.sort(function(e,t){let n=e.target.id.split("P"),a=t.target.id.split("P");return parseInt(n[1])parseInt(a[1])?1:void 0}))});a.then(e=>{"lista pronta"===e?o.then(e=>{let t=e.length-1;e[0].target.id===e[t].target.id?K.innerHTML=`${e[0].target.id}`:K.innerHTML=`${e[0].target.id} a ${e[t].target.id}`}).catch(e=>console.log("Erro na lista: "+e)):"lista vazia"===e&&(console.log("N\xe3o tenho Unidade"),K.innerHTML="...")}).catch(e=>console.log("Erro: "+e))}window.addEventListener("scroll",()=>{elementosNaPagina=[],er(),console.log("Observador ativado")});let el={root:null,rootMargin:"0px",threshold:.01,delay:1e3,trackVisibility:!0};function er(){observer&&observer.disconnect();var e=Array.from(h.querySelectorAll(".unidade"));0!==e.length&&(observer=new IntersectionObserver(eo,el),e.map(e=>observer.observe(e)))}function ei(){let e=ea.value,t=e.toUpperCase(),n=t.split("P"),a=n[0],o=ref_cap_busca[a];if(!o){console.log("Refer\xeancia n\xe3o encontrada"),alert("Refer\xeancia que come\xe7a com "+a+" \xe9 inv\xe1lida neste livro.");return}window.location.href="/"+o+"#"+t}function es(e,t){document.getElementById("ref").textContent=e,document.getElementById("link").textContent=t;let n=document.getElementById("modal");n.style.display="block";let a=document.getElementById("qrcode_container");a.innerHTML="";let o=t.match(/:\/\/([^/]+)\/(.+)/),l=o[2];console.log("Verificando: "+l),l="https://livro.online/qr-code/?livro="+(l=(l=l.replace(/\//g,"--")).replace(/#/g,"__")),new QRCode(a,{text:l,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H})}function ec(e){let t=0;for(;t<10;t++){if(e&&(e.classList.contains("unidade")||e.classList.contains("unidade_silenciosa")))return e.id;e=e.parentElement?e.parentElement:e}}function ep(){let e;if(window.getSelection?e=window.getSelection():document.selection&&(e=document.selection.createRange()),""===e.toString()){alert("Selecione um texto primeiro...");return}let t=window.getSelection().anchorNode.parentElement,n=window.getSelection().focusNode.parentElement;if(t&&n){let a=ec(t),o=ec(n),l=window.location.href,r=new URL(l);r.search="",r.hash="";let i=r.href;if(a===o){let s=`${i}${a?"#"+a:""}`,c=a;c&&""!==c.trim()?w.style.fontSize="30px":(c="Elemento sem refer\xeancia direta",w.style.fontSize="14px"),es(c,s)}else if(a{fetch("ref_capitulos.json").then(e=>{if(!e.ok)throw Error("N\xe3o foi poss\xedvel carregar o arquivo JSON.");return e.json()}).then(e=>{console.log(e),ref_cap_busca=e}).catch(e=>{console.error(e)})}),ea.addEventListener("keydown",e=>{("Enter"===e.key||13===e.keyCode)&&(e.preventDefault(),ei())}),document.querySelector(".close").addEventListener("click",function(){let e=document.getElementById("modal");e.style.display="none"})}; \ No newline at end of file +var observer,elementosNaPagina=[];let ref_cap_busca={};window.onload=e=>{let t=new Audio("https://js.livro.online/moan-quarto/Interruptor.mp3"),n=metadados.livroUrl,a=["#fff","antiquewhite","url('https://js.livro.online/moan-quarto/olga-thelavart-HZm2XR0whdw-unsplash_P.jpg')","url('https://js.livro.online/moan-quarto/paper-g5d2cae661_1280_Pixabay_user_geralt.jpg')"],o=0,l=document.querySelector("body"),r=document.getElementById("quarto-content"),i=document.querySelector(".page-navigation"),s=document.getElementById("quarto-sidebar"),c=document.getElementById("quarto-margin-sidebar"),d=document.querySelectorAll(".sidebar-item-container"),p=document.querySelectorAll("span.chapter-number"),f=document.getElementById("toc-title"),u=!1,g=document.querySelector("#papel"),m=document.querySelector("main");var y=document.createElement("div");function h(e,t){let n=document.createElement("button"),a=document.createElement("img");return a.src=e,n.appendChild(a),n.addEventListener("click",function(){t()}),n}y.id="moan-menu-texto";let v=document.querySelector("header"),$=window.getComputedStyle(g,null).getPropertyValue("font-size"),b=$.split("p"),E=b[0];function L(){let e=localStorage.getItem("livro.online@"+n+".config"),t=localStorage.getItem("quarto-color-scheme"),l=!1;l="default"!=t;let r=JSON.parse(e);e&&(r[0]&&A(r[0]),r[1]&&(o=r[1],g.style.background=a[r[1]],u&&!l&&(i.style.background=a[r[1]]),l&&g.style.removeProperty("background")),r[2]&&(u=r[2])&&!l&&F())}function C(e,t){let a=localStorage.getItem("livro.online@"+n+".config");if(a){let o=JSON.parse(a),l;switch(e){case"fonte":o[0]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l);break;case"papel":o[1]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l);break;case"luz_apagada":o[2]=t,l=JSON.stringify(o),localStorage.setItem("livro.online@"+n+".config",l)}}else{let r=[],i;switch(e){case"fonte":r[0]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i);break;case"papel":r[1]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i);break;case"fundo":r[2]=t,i=JSON.stringify(r),localStorage.setItem("livro.online@"+n+".config",i)}}}L();let z=document.createElement("script");z.src="https://js.livro.online/bibliotecas_de_terceiros/qrcode.min.js",document.body.appendChild(z);let S=document.createElement("div");S.id="modal",S.className="modal",S.style.display="none";let k=document.createElement("div");k.className="modal-content";let q=document.createElement("span");q.className="close",q.innerHTML="×",q.style.fontSize="20px";let I=document.createElement("div"),P=document.createElement("p");P.innerHTML="Refer\xeancia";let _=document.createElement("span");_.id="ref",I.appendChild(P),I.appendChild(_);let x=document.createElement("div"),N=document.createElement("p");N.innerHTML="Link";let w=document.createElement("span");w.id="link",x.appendChild(N),x.appendChild(w);let j=document.createElement("p");j.innerHTML="QR Code";let R=document.createElement("div");function H(){let e=window.getComputedStyle(y,null).getPropertyValue("font-size"),t=window.getComputedStyle(v,null).getPropertyValue("font-size"),n=parseInt(window.getComputedStyle(g,null).getPropertyValue("font-size").split("p")[0])-2;g.style.fontSize=`${n}px`,y.style.fontSize=e,v.style.fontSize=t,C("fonte",n)}function A(e){let t=window.getComputedStyle(y,null).getPropertyValue("font-size"),n=window.getComputedStyle(v,null).getPropertyValue("font-size");if(void 0!==e)g.style.fontSize=`${e}px`,y.style.fontSize=t,v.style.fontSize=n;else{let a=parseInt(window.getComputedStyle(g,null).getPropertyValue("font-size").split("p")[0])+2;g.style.fontSize=`${a}px`,y.style.fontSize=t,v.style.fontSize=n,C("fonte",a)}}function B(){g.style.fontSize=E+"px",C("fonte",E)}function V(){if(l.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para poder alterar o papel.");return}(o+=1)>a.length-1&&(o=0),g.style.background=a[o],C("papel",o),u&&(i.style.background=a[o])}function D(){r.classList.remove("luz_apagada"),i.style.removeProperty("background"),s.style.removeProperty("color"),s.classList.remove("luz_apagada"),d.forEach(e=>{e.style.removeProperty("color")}),p.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||e.style.removeProperty("color")}),c.style.removeProperty("color"),f&&f.style.removeProperty("color"),u=!1}function F(){r.classList.add("luz_apagada"),i.style.backgroundColor=a[o],g.style.background=a[o],s.style.color="#fff",s.classList.add("luz_apagada"),d.forEach(e=>{e.style.color="#fff"}),p.forEach(e=>{"H1"===e.parentNode.nodeName.toUpperCase()||e.parentNode.classList.contains("nav-page-text")||(e.style.color="#fff")}),c.style.color="#fff",f&&(f.style.color="#fff"),u=!0}function M(){if(l.classList.contains("quarto-dark")){alert("Voc\xea precisa desabilitar o modo escuro para o estado da luz de fundo.");return}u?(g.style.background=a[o],t.play(),D(),C("luz_apagada",!1)):(g.style.background=a[o],t.play(),F(),C("luz_apagada",!0))}R.id="qrcode_container",k.appendChild(q),k.appendChild(I),k.appendChild(x),k.appendChild(j),k.appendChild(R),S.appendChild(k),document.body.appendChild(S),y.appendChild(h("https://js.livro.online/moan-quarto/text_decrease_FILL0_wght400_GRAD0_opsz24.svg",H)),y.appendChild(h("https://js.livro.online/moan-quarto/text_increase_FILL0_wght400_GRAD0_opsz24.svg",A)),y.appendChild(h("https://js.livro.online/moan-quarto/format_clear_FILL0_wght400_GRAD0_opsz24.svg",B)),y.appendChild(h("https://js.livro.online/moan-quarto/note_FILL0_wght400_GRAD0_opsz24.svg",V)),y.appendChild(h("https://js.livro.online/moan-quarto/emoji_objects_FILL0_wght400_GRAD0_opsz24.svg",M)),m.insertBefore(y,m.firstChild);let T={attributes:!0,attributeFilter:["class"]};function G(e,t){for(let n of e)"attributes"===n.type&&"class"===n.attributeName&&(l.classList.contains("quarto-dark")?(D(),g.style.removeProperty("background")):L())}let U=new MutationObserver(G);U.observe(l,T);var O=document.createElement("div");O.className="referencias_capitulo";var J=document.createElement("div");J.className="cont_ref";var Q=document.createElement("span");Q.id="Paginacao",J.appendChild(Q),O.appendChild(J);var X=document.createElement("input");X.id="busca_ref",X.className="buscar_ref",X.setAttribute("placeholder","Refer\xeancia..."),X.style.backgroundImage='url("https://js.livro.online/moan-quarto/search_FILL0_wght400_GRAD0_opsz24.svg")',X.style.backgroundRepeat="no-repeat",X.style.backgroundPosition="5px center",X.style.paddingLeft="25px",O.appendChild(X);let Z=document.createElement("button");Z.className="pegarLink";let K=document.createElement("span");K.style.display="flex",K.style.flexDirection="column",K.style.alignItems="center";let W=document.createElement("img");W.src="https://js.livro.online/moan-quarto/link_FILL0_wght400_GRAD0_opsz24.svg",K.appendChild(W);let Y=document.createTextNode("link");K.appendChild(Y),Z.appendChild(K),O.appendChild(Z),Z.addEventListener("click",ei),document.body.appendChild(O);let ee=document.getElementById("busca_ref");function et(e){let t=e.length,n=0,a=new Promise(a=>{0===t&&a("lista vazia"),e.forEach(e=>{n++,e.isIntersecting&&elementosNaPagina.push(e),n===t&&0!=elementosNaPagina.length&&a("lista pronta")})}),o=new Promise(e=>{e(elementosNaPagina.sort(function(e,t){let n=e.target.id.split("P"),a=t.target.id.split("P");return parseInt(n[1])parseInt(a[1])?1:void 0}))});a.then(e=>{"lista pronta"===e?o.then(e=>{let t=e.length-1;e[0].target.id===e[t].target.id?Q.innerHTML=`${e[0].target.id}`:Q.innerHTML=`${e[0].target.id} a ${e[t].target.id}`}).catch(e=>console.log("Erro na lista: "+e)):"lista vazia"===e&&(console.log("N\xe3o tenho Unidade"),Q.innerHTML="...")}).catch(e=>console.log("Erro: "+e))}window.addEventListener("scroll",()=>{elementosNaPagina=[],ea(),console.log("Observador ativado")});let en={root:null,rootMargin:"0px",threshold:.01,delay:1e3,trackVisibility:!0};function ea(){observer&&observer.disconnect();var e=Array.from(g.querySelectorAll(".unidade"));0!==e.length&&(observer=new IntersectionObserver(et,en),e.map(e=>observer.observe(e)))}function eo(){let e=ee.value,t=e.toUpperCase(),n=t.split("P"),a=n[0],o=ref_cap_busca[a];if(!o){console.log("Refer\xeancia n\xe3o encontrada"),alert("Refer\xeancia que come\xe7a com "+a+" \xe9 inv\xe1lida neste livro.");return}window.location.href="/"+o+"#"+t}function el(e,t){document.getElementById("ref").textContent=e,document.getElementById("link").textContent=t;let n=document.getElementById("modal");n.style.display="block";let a=document.getElementById("qrcode_container");a.innerHTML="";let o=t.match(/:\/\/([^/]+)\/(.+)/),l=o[2];console.log("Verificando: "+l),l="https://livro.online/qr-code/?livro="+(l=(l=l.replace(/\//g,"--")).replace(/#/g,"__")),new QRCode(a,{text:l,colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H})}function er(e){let t=0;for(;t<10;t++){if(e&&(e.classList.contains("unidade")||e.classList.contains("unidade_silenciosa")))return e.id;e=e.parentElement?e.parentElement:e}}function ei(){let e;if(window.getSelection?e=window.getSelection():document.selection&&(e=document.selection.createRange()),""===e.toString()){alert("Selecione um texto primeiro...");return}let t=window.getSelection().anchorNode.parentElement,n=window.getSelection().focusNode.parentElement;if(t&&n){let a=er(t),o=er(n),l=window.location.href,r=new URL(l);r.search="",r.hash="";let i=r.href;if(a===o){let s=`${i}${a?"#"+a:""}`,c=a;c&&""!==c.trim()?_.style.fontSize="30px":(c="Elemento sem refer\xeancia direta",_.style.fontSize="14px"),el(c,s)}else if(a{fetch("ref_capitulos.json").then(e=>{if(!e.ok)throw Error("N\xe3o foi poss\xedvel carregar o arquivo JSON.");return e.json()}).then(e=>{console.log(e),ref_cap_busca=e}).catch(e=>{console.error(e)})}),ee.addEventListener("keydown",e=>{("Enter"===e.key||13===e.keyCode)&&(e.preventDefault(),eo())}),document.querySelector(".close").addEventListener("click",function(){let e=document.getElementById("modal");e.style.display="none"})}; \ No newline at end of file