Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 26 additions & 26 deletions app/conf/assets.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ packages = {
},
# -----------------------
leaflet = {
js = leaflet.js,
css = leaflet.css,
geocoder = geocoder/geocoder.js,
js = leaflet.js,
css = leaflet.css,
geocoder = geocoder/geocoder.js,
geocodercss = geocoder/geocoder.css,
draw = draw/leaflet.draw-custom.js,
drawcss = draw/leaflet.draw.css,
Expand All @@ -84,8 +84,8 @@ packages = {
},
# -----------------------
slider = {
js = js/bootstrap-slider.js:200,
css = dist/css/bootstrap-slider.css:200
js = js/bootstrap-slider.js:200,
css = dist/css/bootstrap-slider.css:200
},
# -----------------------
google = {
Expand Down Expand Up @@ -152,19 +152,17 @@ packages = {
},
# -----------------------
fontawesome = {
css = css/all.css
css = css/all.css
}
# -----------------------
pdfjs = {
js = pdf.js,
viewerCSS = viewer/viewer.css
},
# -----------------------
ck = {
editor = ckeditor.js,
ck5 = {
css = ckeditor5-content.css
}
# -----------------------

}

loadSets = {
Expand Down Expand Up @@ -209,21 +207,21 @@ loadSets = {
],

leaflet = [
leaflet/js, leaflet/css, leaflet/geocoder, leaflet/geocodercss, leaflet/rotatedmarker, leaflet/markercluster, leaflet/markerclustercss, leaflet/markerclustercsstheme
leaflet/js, leaflet/css, leaflet/geocoder, leaflet/geocodercss, leaflet/rotatedmarker, leaflet/markercluster, leaflet/markerclustercss, leaflet/markerclustercsstheme
],

slider = [
slider/js, slider/css
],
objectcheckin = [
ca/objectcheckin
],
objectcheckout = [
ca/objectcheckout
],
slider/js, slider/css
],

objectcheckin = [
ca/objectcheckin
],
objectcheckout = [
ca/objectcheckout
],

soundcite = [
soundcite/js, soundcite/css
],
Expand Down Expand Up @@ -255,10 +253,12 @@ loadSets = {
pdfjs = [
pdfjs/js,
pdfjs/viewerCSS
],
ckeditor = [
ck/editor
],
],

ckeditor5 = [
ck5/css
],

searchbuilder = [
ca/querytranslator, jquery/dot, jquery/extendext, jquery/querybuilder, jquery/querybuildercss
]
Expand Down
7 changes: 5 additions & 2 deletions app/helpers/displayHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -6340,13 +6340,15 @@ function caGetCK5Toolbar(array $options=null) : ?array {
'textcolor' => ['code' => 'fontColor'],
'background' => ['code' => 'fontBackgroundColor'],

'highlight' => ['code' => 'highlight'],
'blockquote' => ['code' => 'blockQuote'],
'link' => ['code' => 'link'],
'image' => ['code' => 'linkImage'],
'image' => ['code' => 'insertImage'],
'video' => ['code' => 'mediaEmbed'],
'formula' => ['code' => 'formula'],
'align' => ['code' => 'alignment'],

'specialcharacters' => ['code' => 'specialCharacters'],
'numberedlist' => ['code' => 'numberedList'],
'bulletedlist' => ['code' => 'bulletedList'],
'checkList' => ['code' => 'todoList'],
Expand All @@ -6355,7 +6357,8 @@ function caGetCK5Toolbar(array $options=null) : ?array {
'source' => ['code' => 'sourceEditing'],

'undo' => ['code' => 'undo'],
'redo' => ['code' => 'redo']
'redo' => ['code' => 'redo'],
'-' => ['code' => '|']
];

$toolbar = $config->get(strtolower((caGetOption('type', $options, 'editor') )!== 'content') ? 'wysiwyg_editor_toolbar' : 'wysiwyg_content_editor_toolbar');
Expand Down
151 changes: 131 additions & 20 deletions app/helpers/htmlFormHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function caHTMLTextInput($name, $attributes=null, $options=null) {
if ($use_wysiwyg_editor) {
$o_config = Configuration::load();
$use_editor = $o_config->get('wysiwyg_editor');
$height_w_suffix = is_numeric($height) ? "{$height}px" : $height;
switch($use_editor) {
case 'ckeditor':
AssetLoadManager::register("ck5");
Expand All @@ -214,28 +215,138 @@ function caHTMLTextInput($name, $attributes=null, $options=null) {
$element .= "
<script type=\"module\">
import {
ClassicEditor, BlockQuote, BlockToolbar, Bold, Code, Essentials, FontBackgroundColor, Font, FontColor, FontFamily,
FontSize, GeneralHtmlSupport, Heading, Highlight, HtmlComment, ImageBlock, ImageCaption, ImageInline,
ImageTextAlternative, Indent, IndentBlock, Italic, Link, List, ListProperties, MediaEmbed,
Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SourceEditing, SpecialCharacters, SpecialCharactersArrows,
SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical,
SpecialCharactersText, Strikethrough, Subscript, Superscript, TextTransformation, TodoList, Underline, Undo, LinkImage
InlineEditor,
ClassicEditor,
BlockQuote,
BlockToolbar,
Bold,
Code,
Essentials,
FontBackgroundColor,
Font,
FontColor,
FontFamily,
FontSize,
GeneralHtmlSupport,
Heading,
Highlight,
HtmlComment,
ImageBlock,
ImageCaption,
ImageEditing,
ImageInline,
ImageInsertViaUrl,
ImageResize,
ImageStyle,
ImageTextAlternative,
ImageToolbar,
Indent,
IndentBlock,
Italic,
Link,
LinkImage,
List,
ListProperties,
MediaEmbed,
Paragraph,
PasteFromOffice,
RemoveFormat,
SelectAll,
SourceEditing,
SpecialCharacters,
SpecialCharactersArrows,
SpecialCharactersCurrency,
SpecialCharactersEssentials,
SpecialCharactersLatin,
SpecialCharactersMathematical,
SpecialCharactersText,
Strikethrough,
Subscript,
Superscript,
TextTransformation,
TodoList,
Underline,
Undo
} from 'ckeditor5';

import { ResizableHeight } from 'ckresizeable';

ClassicEditor
.create( document.querySelector( '#{$name}' ), {
plugins: [
BlockQuote, BlockToolbar, Bold, Code, Essentials, FontBackgroundColor, FontColor, FontFamily, FontSize,
GeneralHtmlSupport, Heading, Highlight, HtmlComment, ImageBlock, ImageCaption, ImageInline,
ImageTextAlternative, Indent, IndentBlock, Italic, Link, List, ListProperties, MediaEmbed,
Paragraph, PasteFromOffice, RemoveFormat, SelectAll, SourceEditing, SpecialCharacters,
SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials,
SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText, Strikethrough,
Subscript, Superscript, TextTransformation, TodoList, Underline, Undo, LinkImage
BlockQuote,
BlockToolbar,
Bold,
Code,
Essentials,
FontBackgroundColor,
Font,
FontColor,
FontFamily,
FontSize,
GeneralHtmlSupport,
Heading,
Highlight,
HtmlComment,
ImageBlock,
ImageCaption,
ImageEditing,
ImageInline,
ImageInsertViaUrl,
ImageResize,
ImageStyle,
ImageTextAlternative,
ImageToolbar,
Indent,
IndentBlock,
Italic,
Link,
LinkImage,
List,
ListProperties,
MediaEmbed,
Paragraph,
PasteFromOffice,
RemoveFormat,
ResizableHeight,
SelectAll,
SourceEditing,
SpecialCharacters,
SpecialCharactersArrows,
SpecialCharactersCurrency,
SpecialCharactersEssentials,
SpecialCharactersLatin,
SpecialCharactersMathematical,
SpecialCharactersText,
Strikethrough,
Subscript,
Superscript,
TextTransformation,
TodoList,
Underline,
Undo
],
toolbar: {
items: ".json_encode($toolbar).",
shouldNotGroupWhenFull: true
},
image: {
toolbar: [
'toggleImageCaption',
'imageTextAlternative',
'|',
'imageStyle:inline',
'imageStyle:wrapText',
'imageStyle:breakText',
'|',
'resizeImage'
]
},
ResizableHeight: {
resize: true,
height: '{$height_w_suffix}',
minHeight: '50px',
maxHeight: '1500px'
}
} ).then(editor => {
// Add current instance to list of initialized editors
Expand All @@ -250,11 +361,11 @@ function caHTMLTextInput($name, $attributes=null, $options=null) {
$attr_string = _caHTMLMakeAttributeString($attributes, $options);
$element .= "<div id=\"{$name}_container\" style='width: {$width}px; height: {$height}px; overflow-y: auto;'>
<{$tag_name} name=\"{$name}\" id=\"{$name}\">{$attributes['value']}</{$tag_name}></div>
<style>
#{$name}_container .ck-editor__editable_inline {
min-height: calc({$height}px - 100px);
}
</style>";
<style>
#{$name}_container .ck-editor__editable_inline {
min-height: calc({$height}px - 100px);
}
</style>";
break;
case 'quilljs';
default:
Expand Down Expand Up @@ -288,8 +399,8 @@ function caHTMLTextInput($name, $attributes=null, $options=null) {
break;
}

$o_config = Configuration::load();
if(!is_array($va_toolbar_config = $o_config->getAssoc(caGetOption('cktoolbar', $options, 'wysiwyg_editor_toolbar')))) { $va_toolbar_config = []; }
// $o_config = Configuration::load();
// if(!is_array($va_toolbar_config = $o_config->getAssoc(caGetOption('cktoolbar', $options, 'wysiwyg_editor_toolbar')))) { $va_toolbar_config = []; }
} elseif ($is_textarea) {
$value = $attributes['value'] ?? null;
if ($attributes['size'] ?? null) { $attributes['cols'] = $attributes['size']; }
Expand Down
Loading