mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°7552 - Move CKEditor from to npm dependencies
This commit is contained in:
@@ -253,7 +253,7 @@ HTML;
|
||||
{
|
||||
// all js file needed by ckeditor
|
||||
$aJSRelPaths = [
|
||||
'js/ckeditor/build/ckeditor.js',
|
||||
'node_modules/ckeditor5-itop-build/build/ckeditor.js',
|
||||
'js/highlight/highlight.js',
|
||||
'js/ckeditor.handler.js',
|
||||
'js/ckeditor.feeds.js'
|
||||
@@ -267,12 +267,12 @@ HTML;
|
||||
// add corresponding ckeditor language file
|
||||
// P1 language + country
|
||||
// P2 language
|
||||
$sLanguageFileRelPath = 'js/ckeditor/build/translations/' . $sLanguage . '-' . $sCountry . '.js';
|
||||
$sLanguageFileRelPath = 'node_modules/ckeditor5-itop-build/build/translations/' . $sLanguage . '-' . $sCountry . '.js';
|
||||
if(file_exists(APPROOT . $sLanguageFileRelPath)){
|
||||
$aJSRelPaths[] = $sLanguageFileRelPath;
|
||||
}
|
||||
else {
|
||||
$sLanguageFileRelPath = 'js/ckeditor/build/translations/' . $sLanguage . '.js';
|
||||
$sLanguageFileRelPath = 'node_modules/ckeditor5-itop-build/build/translations/' . $sLanguage . '.js';
|
||||
if(file_exists(APPROOT . $sLanguageFileRelPath)){
|
||||
$aJSRelPaths[] = $sLanguageFileRelPath;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class WebResourcesHelper
|
||||
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/';}");
|
||||
$oPage->add_script("if (! window.CKEDITOR_BASEPATH) { var CKEDITOR_BASEPATH = '".utils::GetAbsoluteUrlAppRoot()."node_modules/ckeditor5-itop-build/';}");
|
||||
foreach (CKEditorHelper::GetJSFilesRelPathsForCKEditor() as $sFile) {
|
||||
$oPage->LinkScriptFromAppRoot($sFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user