#--
Macro : initEditor
Description: Defines a macro to add tinyMCE editor to a textarea
Parameters:
@param editorWidth - number - optionnal - Défaut 450, largeur de l'éditeur
@param cssFiles - string - optionnal - Défaut '', any additional CSS files to load separated by commas
@param type - string - optionnal - Défaut '', "inline" or "". Documentation avalaible at https://www.tiny.cloud/docs/tinymce/6/
@param insert - string - optionnal - Défaut '' . - ='"library","pagelinkservice"'
@param selector='.richtext'
@param config={}
-->
<#macro initEditor editorWidth=0 cssFiles='' type='' insert='"library","pagelinkservice"' selector='.richtext' config={}>
<#if !webapp_url?has_content><#assign webapp_url = '' />#if>
<#assign editorLocale='' />
<#local toolbar='' />
<#local userConf='' />
<#if config?has_content><#local userConf><#list config as prop, value >${prop}: <#if value?is_string>'${value}'<#else>${value}#if><#sep>,#sep>#list>#local>#if>
<#-- We only have the language pack for French (France) installed in webapp/js/editors/tinymce/langs -->
<#-- Some lutece plugins pass locale.getLanguage() (="fr"), some pass the locale object (toString="fr_FR", or more complicated...) -->
<#-- Force it here because if it is a wrong value, tinyMCE does not load -->
<#if locale?? && (2 <= locale?string?length) && (locale?string?substring(0,2) == "fr")> <#assign editorLocale="fr_FR" />#if>
<#if cssFiles==""><#assign cssFiles="editor.css, page_template_styles.css" />#if>
#macro>