'use strict';Object.assign(dotclear,dotclear.getData('admin.blog_pref'));dotclear.ready(()=>{const cancel=document.getElementById('link-insert-cancel');if(cancel)
cancel.addEventListener('click',()=>{globalThis.close();});const entries=document.querySelectorAll('#form-entries tr>td.maximal>a');for(const entry of entries){entry.addEventListener('click',()=>{const stripBaseURL=(url)=>dotclear.base_url!==''&&url.startsWith(dotclear.base_url)?url.substring(dotclear.base_url.length):url;const main=globalThis.opener;if(main){const title=stripBaseURL(entry.getAttribute('title'));const next=title.indexOf('/');const href=next===-1?title:title.substring(next+1);main.document.getElementById(dotclear.sibling).setAttribute('value',href);}
globalThis.close();});}});