mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 16:48:42 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -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 #}
|
||||
|
||||
2
js/ckeditor/build/ckeditor.js
vendored
2
js/ckeditor/build/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user