Merge branch 'refs/heads/support/3.2' into develop

This commit is contained in:
jf-cbd
2024-07-03 15:52:49 +02:00
15 changed files with 94 additions and 877 deletions

View File

@@ -1,6 +1,6 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
/**
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
import { Alignment } from '@ckeditor/ckeditor5-alignment';
@@ -20,11 +20,11 @@ import { List, ListProperties } from '@ckeditor/ckeditor5-list';
import { Mention } from '@ckeditor/ckeditor5-mention';
import { Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar } from '@ckeditor/ckeditor5-table';
import { Undo } from '@ckeditor/ckeditor5-undo';
import InsertHtml from './plugins/insert-html/insert-html.plugin';
import ObjectShortcut from './plugins/object-shortcut/object-shortcut.plugin';
import './resources/styles/console-theme.css';
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
import InsertCarriageReturnAfterBlock from "./plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
import './resources/styles/default-theme.css';
declare class Editor extends ClassicEditor {
static builtinPlugins: (typeof InsertHtml | typeof Alignment | typeof Superscript | typeof Subscript | typeof Bold | typeof Italic | typeof Strikethrough | typeof Underline | typeof BlockQuote | typeof CodeBlock | typeof Undo | typeof Essentials | typeof FontBackgroundColor | typeof FontColor | typeof FontFamily | typeof FontSize | typeof Heading | typeof Highlight | typeof HorizontalLine | typeof Image | typeof ImageCaption | typeof ImageResize | typeof ImageStyle | typeof ImageToolbar | typeof ImageUpload | typeof Indent | typeof Link | typeof LinkImage | typeof List | typeof ListProperties | typeof Mention | typeof Table | typeof TableCaption | typeof TableCellProperties | typeof TableColumnResize | typeof TableProperties | typeof TableToolbar | typeof ObjectShortcut | typeof PictureEditing)[];
static builtinPlugins: (typeof Alignment | typeof Superscript | typeof Subscript | typeof Bold | typeof Italic | typeof Strikethrough | typeof Underline | typeof BlockQuote | typeof CodeBlock | typeof Undo | typeof Essentials | typeof FontBackgroundColor | typeof FontColor | typeof FontFamily | typeof FontSize | typeof Heading | typeof Highlight | typeof HorizontalLine | typeof Image | typeof ImageCaption | typeof ImageResize | typeof ImageStyle | typeof ImageToolbar | typeof ImageUpload | typeof Indent | typeof Link | typeof LinkImage | typeof List | typeof ListProperties | typeof Mention | typeof Table | typeof TableCaption | typeof TableCellProperties | typeof TableColumnResize | typeof TableProperties | typeof TableToolbar | typeof RemoveFormat | typeof InsertCarriageReturnAfterBlock | typeof PictureEditing)[];
static defaultConfig: EditorConfig;
}
export default Editor;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,3 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
/**
* AppendITopClasses Plugin.
@@ -10,7 +5,6 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
* Appends ibo-is-html-content class
*/
export default class AppendITopClasses extends Plugin {
constructor(editor: any);
static get pluginName(): string;
init(): void;
}

View File

@@ -1,9 +1,4 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
/**
* DetectChanges Plugin.
*

View File

@@ -1,8 +1,3 @@
/*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license http://opensource.org/licenses/AGPL-3.0
*/
import { Plugin } from '@ckeditor/ckeditor5-core';
import { ContextualBalloon } from '@ckeditor/ckeditor5-ui';
import FormView from './object-shortcut.form-view';

View File

@@ -60,6 +60,7 @@ import DetectChanges from "./plugins/detect-change/detect-change.plugin";
import UpdateInputOnChange from "./plugins/update-input-on-change/update-input-on-change.plugin";
import Disabler from "./plugins/disabler/disabler.plugin";
import InsertHtml from './plugins/insert-html/insert-html.plugin';
import InsertCarriageReturnAfterBlock from "./plugins/insert-carriage-return-after-block/insert-carriage-return-after-block.plugin";
// You can read more about extending the build with additional plugins in the "Installing plugins" guide.
// See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.
@@ -128,7 +129,8 @@ class Editor extends ClassicEditor {
InsertHtml,
DetectChanges,
UpdateInputOnChange,
Disabler
Disabler,
InsertCarriageReturnAfterBlock
];
// default configuration editor

View File

@@ -0,0 +1,41 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import Node from '@ckeditor/ckeditor5-engine/src/model/node';
export default class InsertCarriageReturnAfterBlock extends Plugin {
init() {
const editor = this.editor;
// Array of block elements type to check for
const blockElements = ['codeBlock', 'div', 'pre'];
// This function checks if the inserted element is one of the block elements we want a newline after
const isBlockElement = (node: Node | null) => {
return node ? blockElements.some(element => node.is('element', element)) : false;
};
// Listen to changes in the model
editor.model.document.on('change:data', (evt, batch) => {
if (batch.isLocal) {
const changes = Array.from(editor.model.document.differ.getChanges());
const currentCursorPosition = editor.model.document.selection.getFirstPosition();
// Iterate over the changes and insert a newline after the block element when needed
changes.forEach(change => {
if (change.type === 'insert' && isBlockElement(change.position.nodeAfter)) {
editor.model.change(writer => {
const position = change.position.getShiftedBy(change.length);
// Insert a newline after the block element
editor.execute( 'insertParagraph', {
position: position,
} );
});
}
});
// Restore the cursor position (most likely in the created block)
editor.model.change(writer => {
writer.setSelection(currentCursorPosition);
});
}
});
}
}

View File

@@ -97,9 +97,15 @@ $(function()
}
else if( $(oElem).is(':radio'))
{
if($(oElem).is(':checked'))
let nameRadioButton= $(oElem).prop('name');
let radioCheckProp = $('[name='+nameRadioButton+']:checked');
if(radioCheckProp.length === 1)
{
value =$(oElem).val();
value = radioCheckProp.val();
}
else
{
value = "";
}
}
else if($(oElem).is(':checkbox'))

View File

@@ -8,6 +8,7 @@
*/
$(document).ready(function () {
// AJAX calls handling
// - Error messages regarding the error code
$(document).ajaxError(function (event, jqxhr, options) {
// User is not logged in