'use strict';dotclear.codemirror={};for(const i of dotclear.getData('codemirror')){const elt=document.getElementById(i.id);if(elt){const max=elt.clientHeight;dotclear.codemirror[i.name]=CodeMirror.fromTextArea(elt,{mode:i.mode,tabMode:'indent',lineWrapping:1,lineNumbers:1,matchBrackets:1,autoCloseBrackets:1,readOnly:elt.readOnly,extraKeys:{F11(cm){cm.setOption('fullScreen',!cm.getOption('fullScreen'));},Esc(cm){if(cm.getOption('fullScreen')){cm.setOption('fullScreen',false);}else if(!cm.state.keyMaps.some((x)=>x.name==='tabAccessibility')){cm.addKeyMap({name:'tabAccessibility',Tab:false,'Shift-Tab':false,});}},},theme:i.theme,});const cm=dotclear.codemirror[i.name].getWrapperElement();if(cm){cm.style.height=`${max}px`;}
const editor=dotclear.codemirror[i.name];if(editor){editor.on('focus',(cm)=>{cm.removeKeyMap('tabAccessibility');});editor.on('blur',(cm)=>{if(cm.isClean()||cm.getValue()===elt.value)elt.classList.remove('cm_dirty');else elt.classList.add('cm_dirty');});}}}