N°5298 - Upgrade CKEditor to version 5 (#647)

This commit is contained in:
Benjamin Dalsass
2024-05-24 16:13:20 +02:00
committed by GitHub
parent 094a9ed82f
commit 9bf0addc9c
105 changed files with 1820 additions and 949 deletions

View File

@@ -45,37 +45,7 @@ class WebResourcesHelper
['font' => utils::GetAbsoluteUrlAppRoot().'node_modules/@fontsource/raleway/files/raleway-all-500-italic.woff', 'type' => 'woff'],
];
}
//---------------------------------
// CKEditor
//---------------------------------
/**
* Add necessary files (JS) to be able to use CKEditor in the page
*
* @param WebPage $oPage
*
* @throws Exception
*/
public static function EnableCKEditorToWebPage(WebPage &$oPage): void
{
//when ckeditor is loaded in ajax, CKEDITOR_BASEPATH is not well defined (this constant is used to load additional js)
$oPage->add_script("if (! window.CKEDITOR_BASEPATH) { var CKEDITOR_BASEPATH = '".utils::GetAbsoluteUrlAppRoot()."js/ckeditor/';}");
foreach (static::GetJSFilesRelPathsForCKEditor() as $sFile) {
$oPage->LinkScriptFromAppRoot($sFile);
}
}
/**
* @return string[] Relative URLs to the JS files necessary for CKEditor
*/
public static function GetJSFilesRelPathsForCKEditor(): array
{
return [
'js/ckeditor/build/ckeditor.js',
'js/highlight/highlight.js',
];
}
//---------------------------------
// D3/C3.js