'use strict';dotclear.ready(()=>{$('.modal-image').magnificPopup({type:'image',});$('#file-unzip').each(function(){const a=document.createElement('a');const mediaId=$(this).find('input[name=id]').val();const This=$(this);a.href='#';$(a).text(dotclear.msg.zip_file_content);This.before(a);$(a).wrap('<p></p>');$(a).on('click',()=>{dotclear.jsonServicesGet('getZipMediaContent',(data)=>{const div=document.createElement('div');const list=document.createElement('ul');let expanded=false;$(div).css({overflow:'auto',margin:'1em 0',padding:'1px 0.5em',});$(div).addClass('fieldset');$(div).append(list);This.before(div);$(a).hide();$(div).before(`<h3>${dotclear.msg.zip_file_content}</h3>`);for(const elt of data){$(list).append(`<li>${elt}</li>`);if($(div).height()>200&&!expanded){$(div).css({height:'200px',});expanded=true;}}},{id:mediaId},(error)=>{globalThis.alert(error);},);return false;});});$('#file-unzip').on('submit',function(event){if($(this).find('#inflate_mode').val()==='current'){if(globalThis.confirm(dotclear.msg.confirm_extract_current))return true;event.preventDefault();return false;}
return true;});$('#delete-form input[name="delete"]').on('click',()=>{const m_name=$('#delete-form input[name="remove"]').val();return globalThis.confirm(dotclear.msg.confirm_delete_media.replace('%s',decodeURIComponent(m_name)));});$('#save_settings').on('submit',()=>{$('input[name="pref_src"]').val($('input[name="src"][type=radio]:checked').attr('value'));$('input[name="pref_alignment"]').val($('input[name="alignment"][type=radio]:checked').attr('value'));$('input[name="pref_insertion"]').val($('input[name="insertion"][type=radio]:checked').attr('value'));$('input[name="pref_legend"]').val($('input[name="legend"][type=radio]:checked').attr('value'));});$('#media-insert-form :input:visible:enabled:checked:first, #media-insert-form :input:visible:enabled:first').trigger('focus',);dotclear.enterKeyInForm('#media-insert-form','#media-insert-ok','#media-insert-cancel');});