Files
Shaarli_bm_theme/shaarli-pro/dist/navigation.min.js
T
bruno 5d7255cc22
CI / build (push) Failing after 4m54s
Add built JS assets to distributable
2026-08-09 21:14:35 -04:00

1 line
1.6 KiB
JavaScript

document.addEventListener("DOMContentLoaded",()=>{"use strict";const e=document.querySelector(".sidebar-add-note");e&&e.addEventListener("click",t=>{if(t.preventDefault(),!window.ShaarItRules)return void console.warn("[shaarit] ShaarItRules not available, cannot generate note URL");const a=e.getAttribute("data-base-path")||"",n=window.ShaarItRules.generateNoteUrl(),o=`${a}/admin/shaare?post=${encodeURIComponent(n)}&tags=note`;window.location.href=o});const t=document.querySelector(".sidebar-add-todo");t&&t.addEventListener("click",e=>{if(e.preventDefault(),!window.ShaarItRules)return void console.warn("[shaarit] ShaarItRules not available, cannot generate todo URL");const a=t.getAttribute("data-base-path")||"",n=window.ShaarItRules.generateTodoUrl(),o=`${a}/admin/shaare?post=${encodeURIComponent(n)}&tags=todo&title=%E2%9C%85%20`;window.location.href=o});const a=document.getElementById("sidebar"),n=document.getElementById("sidebar-overlay"),o=document.getElementById("mobile-menu-btn");function d(){return window.matchMedia("(max-width: 1100px)").matches}function s(){a&&n&&(a.classList.remove("show"),n.classList.remove("show"),o?.setAttribute("aria-expanded","false"),n.setAttribute("aria-hidden","true"),document.body.style.overflow="")}o?.addEventListener("click",function(){a?.classList.contains("show")?s():a&&n&&(a.classList.add("show"),n.classList.add("show"),o?.setAttribute("aria-expanded","true"),n.setAttribute("aria-hidden","false"),d()&&(document.body.style.overflow="hidden"))}),n?.addEventListener("click",s),a?.querySelectorAll("a").forEach(e=>{e.addEventListener("click",()=>{d()&&s()})}),window.addEventListener("resize",()=>{d()||s()})});