mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°5298 - Upgrade CKEditor to version 5 (#647)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user