fix: форматирование, опечатка в статье
This commit is contained in:
+17
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
(async()=>{const n=document.currentScript,s=n?.getAttribute("data-repo-url"),e=n?.getAttribute("data-repo-id");if(!s||!e)return;if(e.startsWith("forgejo")){console.log("fetch-repo.js: Forgejo server blocks cross-origin requests. Live JavaScript updates are not supported.");return}const o={github:{full_name:"full_name",description:"description",stargazers_count:"stargazers",forks:"forks"},gitlab:{name_with_namespace:"name_with_namespace",description:"description",star_count:"star_count",forks_count:"forks_count"},gitea:{full_name:"full_name",description:"description",stars_count:"stars_count",forks_count:"forks_count"},codeberg:{full_name:"full_name",description:"description",stars_count:"stars_count",forks_count:"forks_count"},forgejo:{full_name:"full_name",description:"description",stars_count:"stars_count",forks_count:"forks_count"},huggingface:{description:"description",likes:"likes",downloads:"downloads"}},i={huggingface:{description:e=>e?.replace(/Dataset Card for .+?\s+Dataset Summary\s+/,"").trim()||e}},t=Object.keys(o).find(t=>e.startsWith(t))||"github",a=o[t];try{const n=await fetch(s,{headers:{"User-agent":"Mozilla/4.0 Custom User Agent"}}),o=await n.json();if(!n.ok){console.error(`fetch-repo.js: HTTP Error: ${n.status} ${n.statusText}`);return}if(!o||typeof o!="object"){console.error("fetch-repo.js: Invalid or empty data received from remote");return}Object.entries(a).forEach(([n,s])=>{const a=document.getElementById(`${e}-${s}`);if(a){let e=o[n];i[t]?.[n]&&(e=i[t][n](e)),e!=null&&e!==""&&(a.innerHTML=e)}})}catch(e){console.error(`fetch-repo.js: ${e}`)}})()
|
||||
+3
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
function _getDefaultPackeryOptions(){return{percentPosition:!0,gutter:5,resize:!0}}function _getPackeryOptions(e){const t=_getDefaultPackeryOptions(),{packeryGutter:n,packeryPercentPosition:s,packeryResize:o}=e.dataset;return{percentPosition:s!==0[0]?s==="true":t.percentPosition,gutter:n!==0[0]?parseInt(n,10):t.gutter,resize:o!==0[0]?o==="true":t.resize}}(function(){window.addEventListener("load",function(){let e=[],t=document.querySelectorAll(".gallery");t.forEach(t=>{let n=new Packery(t,_getPackeryOptions(t));e.push(n)})})})()
|
||||
+1
@@ -0,0 +1 @@
|
||||
function initTabs(){tabClickHandler=e=>{const t=e.target.closest(".tab__button");if(!t)return;const n=t.closest(".tab__container"),o=parseInt(t.dataset.tabIndex),i=t.dataset.tabLabel,s=n.dataset.tabGroup;if(s){const e=document.querySelectorAll(`.tab__container[data-tab-group="${s}"]`);e.forEach(e=>{const t=Array.from(e.querySelectorAll(".tab__button")).find(e=>e.dataset.tabLabel===i);if(t){const n=parseInt(t.dataset.tabIndex);activateTab(e,n)}})}else activateTab(n,o)},document.addEventListener("click",tabClickHandler)}function activateTab(e,t){const n=e.querySelectorAll(".tab__button"),s=e.querySelectorAll(".tab__panel");n.forEach((e,n)=>{n===t?(e.classList.add("tab--active"),e.setAttribute("aria-selected","true")):(e.classList.remove("tab--active"),e.setAttribute("aria-selected","false"))}),s.forEach((e,n)=>{n===t?e.classList.add("tab--active"):e.classList.remove("tab--active")})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initTabs):initTabs()
|
||||
Reference in New Issue
Block a user