Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
Benjamin Dalsass
2024-05-28 16:07:36 +02:00
6 changed files with 45 additions and 6 deletions

View File

@@ -126,8 +126,8 @@
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'js/export.js'|add_itop_version }}"></script>
{# CKEditor files for HTML WYSIWYG #}
{{ inject_ckeditor_resources()|raw }}
{# - Hilighter for code snippets created with CKEditor #}
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js'|add_itop_version }}"></script>
{# - Highlighter for code snippets created with CKEditor #}
<script type="text/javascript" src="{{ app['combodo.absolute_url'] ~ 'js/highlight/highlight.min.js'|add_itop_version }}"></script>
{# Date-time picker for Bootstrap #}
<script type="text/javascript" src="{{ app['combodo.portal.base.absolute_url'] ~ 'lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'|add_itop_version }}"></script>
{# Typeahead files for autocomplete #}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -17,7 +17,13 @@ export default class UpdateInputOnChange extends Plugin {
// update input when data change
oEditor.model.document.on('change:data', (event) => {
oInputElement.value = oEditor.getData();
// only when input and textarea are different
if(oInputElement.value !== oEditor.getData()) {
oInputElement.value = oEditor.getData();
const oEvent = new Event('change');
oInputElement.dispatchEvent(oEvent);
}
});
}

View File

@@ -43,9 +43,14 @@ $(function()
{
var me = this;
// Check if popover menu is already initialized
if ($(this.js_selectors.menu_toggler).hasClass('ibo-is-loaded') === true) {
return;
}
// Important: For now, the popover menu is manually instantiated even though the PHP NewsroomMenu class inherits PopoverMenu because the jQuery widget doesn't. We might refactor this in the future.
$(me.element).popover_menu({'toggler': this.js_selectors.menu_toggler});
$(this.js_selectors.menu_toggler).off('click').on('click', function (oEvent) {
$(this.js_selectors.menu_toggler).on('click', function (oEvent) {
var oEventTarget = $(oEvent.target);
var aEventTargetPos = oEventTarget.position();
var aEventTargetOffset = oEventTarget.offset();

View File

@@ -46,6 +46,34 @@ class WebResourcesHelper
];
}
//---------------------------------
// 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 (CKEditorHelper::GetJSFilesRelPathsForCKEditor() as $sFile) {
$oPage->LinkScriptFromAppRoot($sFile);
}
}
/**
* @return string[] Relative URLs to the JS files necessary for CKEditor
*/
public static function GetJSFilesRelPathsForCKEditor(): array
{
return CKEditorHelper::GetJSFilesRelPathsForCKEditor();
}
//---------------------------------
// D3/C3.js