PageSourceSearch

https://www.e-show.tw/wp-content/cache/breeze-minification/js/bree…mb-translate-f1eb6bfa52d9.js?ver=1790235457

js e-show.tw collected 2026-09-24 08:46:57 UTC 4,919 bytes, 12 lines download raw bytes

1document.addEventListener('DOMContentLoaded',function(){if(!window.EZ_Breadcrumb_Translate)return;if(window.elementor||document.body.classList.contains('elementor-editor-active')){return}
2const lang=EZ_Breadcrumb_Translate.lang;const map=EZ_Breadcrumb_Translate.map;const postArchiveUrl=EZ_Breadcrumb_Translate.post_archive_url;const postArchiveName=EZ_Breadcrumb_Translate.post_archive_name;const translateElement=(el)=>{const text=el.textContent.trim();if(map[text]){el.textContent=map[text];if(el.hasAttribute('title')){el.setAttribute('title',map[text])}
3return}
4const colonIndex=text.indexOf(':');if(colonIndex>0){const prefix=text.substring(0,colonIndex).trim();const suffix=text.substring(colonIndex);if(map[prefix]){el.textContent=map[prefix]+suffix;if(el.hasAttribute('title')){el.setAttribute('title',map[prefix]+suffix)}}}};const fixLanguageAndTranslate=(el)=>{translateElement(el);if(el.tagName==='A'&&el.hasAttribute('href')){const currentPageUrl=window.location.pathname;const linkUrl=el.getAttribute('href');const linkPath=new URL(linkUrl,window.location.origin).pathname;const currentLang=getCurrentLanguage(currentPageUrl);const linkLang=getCurrentLanguage(linkPath);if(currentLang!==linkLang){const correctedUrl=correctLanguageInUrl(linkUrl,currentLang);el.setAttribute('href',correctedUrl)}}};const getCurrentLanguage=(path)=>{const langMatch=path.match(/^\/([a-z]{2})\//);return langMatch?langMatch[1]:'default'};const correctLanguageInUrl=(url,targetLang)=>{const urlObj=new URL(url,window.location.origin);let pathname=urlObj.pathname;pathname=pathname.replace(/^\/[a-z]{2}\//,'/');if(targetLang!=='default'){pathname='/'+targetLang+pathname}
5urlObj.pathname=pathname;return urlObj.href};document.querySelectorAll('.jet-breadcrumbs__item-link').forEach(fixLanguageAndTranslate);document.querySelectorAll('.jet-breadcrumbs__item-target').forEach(translateElement);const removeDuplicateBreadcrumb=()=>{const breadcrumbContainer=document.querySelector('.jet-breadcrumbs__wrap');if(!breadcrumbContainer)return;let changed=!0;while(changed){changed=!1;const contentItems=Array.from(breadcrumbContainer.querySelectorAll('.jet-breadcrumbs__item')).filter(item=>item.querySelector('.jet-breadcrumbs__item-link, .jet-breadcrumbs__item-target'));for(let i=1;i<contentItems.length;i++){const cur=contentItems[i].textContent.trim();const prev=contentItems[i-1].textContent.trim();if(cur&&cur===prev){const dup=contentItems[i-1];const sep=dup.nextElementSibling;if(sep&&sep.querySelector('.jet-breadcrumbs__item-sep')){sep.remove()}
6dup.remove();changed=!0;break}}}};const removeRootArchiveCrumb=()=>{const breadcrumbContainer=document.querySelector('.jet-breadcrumbs__wrap');if(!breadcrumbContainer)return;breadcrumbContainer.querySelectorAll('.jet-breadcrumbs__item-link').forEach((a)=>{if(a.classList.contains('is-home'))return;let path;try{path=new URL(a.getAttribute('href'),window.location.origin).pathname}catch(e){return}
7const stripped=path.replace(/^\/[a-z]{2}(\/|$)/,'/').replace(/\/+$/,'');if(stripped===''){const item=a.closest('.jet-breadcrumbs__item');if(!item)return;const sep=item.nextElementSibling;if(sep&&sep.querySelector('.jet-breadcrumbs__item-sep')){sep.remove()}
8item.remove()}})};const cptFirstTermUrl=EZ_Breadcrumb_Translate.cpt_first_term_url;if(cptFirstTermUrl){const allLinks=document.querySelectorAll('.jet-breadcrumbs__item-link');for(let i=0;i<allLinks.length;i++){if(!allLinks[i].classList.contains('is-home')){allLinks[i].setAttribute('href',cptFirstTermUrl);break}}}
9const isPostSingle=document.body.classList.contains('single-post');if(isPostSingle){removeRootArchiveCrumb();const breadcrumbContainer=document.querySelector('.jet-breadcrumbs');if(breadcrumbContainer){const breadcrumbItems=breadcrumbContainer.querySelectorAll('.jet-breadcrumbs__item');if(breadcrumbItems.length>=3){const firstSeparator=breadcrumbItems[1];const postArchiveItem=document.createElement('div');postArchiveItem.className='jet-breadcrumbs__item';if(postArchiveUrl&&postArchiveUrl!==''){const link=document.createElement('a');link.className='jet-breadcrumbs__item-link';link.setAttribute('href',postArchiveUrl);link.setAttribute('title',postArchiveName);link.textContent=postArchiveName;postArchiveItem.appendChild(link)}else{const span=document.createElement('span');span.className='jet-breadcrumbs__item-target';span.textContent=postArchiveName;postArchiveItem.appendChild(span)}
10const newSeparator=document.createElement('div');newSeparator.className='jet-breadcrumbs__item';const existingSep=firstSeparator.querySelector('.jet-breadcrumbs__item-sep');if(existingSep){newSeparator.appendChild(existingSep.cloneNode(!0))}else{const defaultSep=document.createElement('div');defaultSep.className='jet-breadcrumbs__item-sep';defaultSep.textContent='/';newSeparator.appendChild(defaultSep)}
11firstSeparator.after(postArchiveItem);postArchiveItem.after(newSeparator)}}}
12removeDuplicateBreadcrumb()})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.