better capsule (aka footnotes)

This commit is contained in:
2026-07-07 16:31:47 +02:00
parent 13679a38b9
commit 015e3654fe
10 changed files with 168 additions and 26 deletions

4
.gitignore vendored
View File

@@ -30,7 +30,7 @@
# npm # npm
node_modules/ node_modules/
*.patch #*.patch
/.csslintrc /.csslintrc
/.eslintrc.json /.eslintrc.json
/.ht.router.php /.ht.router.php
@@ -47,4 +47,4 @@ node_modules/
/web_main/.vscode/* /web_main/.vscode/*
.vscode/* .vscode/*
/log /log

View File

@@ -121,6 +121,9 @@
}, },
"drupal/core": { "drupal/core": {
"CKEDITOR for summary https://www.drupal.org/project/drupal/issues/2671162":"https://www.drupal.org/files/issues/2025-08-23/2671162-158.patch" "CKEDITOR for summary https://www.drupal.org/project/drupal/issues/2671162":"https://www.drupal.org/files/issues/2025-08-23/2671162-158.patch"
},
"drupal/footnotes": {
"leave paragraphs tags in place":"./patches/footnotes-leave-paragraphs.patch"
} }
} }
} }

View File

@@ -16,13 +16,22 @@ settings:
- bold - bold
- italic - italic
- underline - underline
- link
- bulletedList - bulletedList
- drupalInsertImage
- showBlocks
plugins: plugins:
ckeditor5_imageResize:
allow_resize: true
ckeditor5_list: ckeditor5_list:
properties: properties:
reversed: false reversed: false
startIndex: false startIndex: false
multiBlock: false multiBlock: false
image_upload: image_upload:
status: false status: true
scheme: public
directory: inline-images
max_size: null
max_dimensions:
width: 1080
height: null

View File

@@ -3,6 +3,10 @@ langcode: en
status: true status: true
dependencies: dependencies:
module: module:
- editor
- footnotes
- linkit
- media
- pathologic - pathologic
_core: _core:
default_config_hash: SYAah-i4HbJnc3ZnKC9NmY4M0UAFYpfobYzxg0eMunM default_config_hash: SYAah-i4HbJnc3ZnKC9NmY4M0UAFYpfobYzxg0eMunM
@@ -10,23 +14,108 @@ name: Footnote
format: footnote format: footnote
weight: 0 weight: 0
filters: filters:
editor_file_reference:
id: editor_file_reference
provider: editor
status: true
weight: -48
settings: { }
filter_align:
id: filter_align
provider: filter
status: false
weight: -47
settings: { }
filter_autop:
id: filter_autop
provider: filter
status: true
weight: -43
settings: { }
filter_caption:
id: filter_caption
provider: filter
status: false
weight: -46
settings: { }
filter_footnotes:
id: filter_footnotes
provider: footnotes
status: false
weight: -44
settings:
footnotes_collapse: false
footnotes_css: true
footnotes_dialog: false
footnotes_dialog_prevent_bubbling: false
footnotes_footer_disable: false
footnotes_preview_show_text: true
footnotes_preview_character: ''
filter_html: filter_html:
id: filter_html id: filter_html
provider: filter provider: filter
status: true status: true
weight: -10 weight: -50
settings: settings:
allowed_html: '<br> <p> <strong> <em> <u> <a href> <ul> <ol reversed start> <li>' allowed_html: '<br> <p> <strong> <em> <u> <ul> <ol> <li> <img src alt height width data-entity-uuid data-entity-type>'
filter_html_help: true filter_html_help: false
filter_html_nofollow: false filter_html_nofollow: false
filter_html_escape:
id: filter_html_escape
provider: filter
status: false
weight: -49
settings: { }
filter_html_image_secure:
id: filter_html_image_secure
provider: filter
status: false
weight: -41
settings: { }
filter_htmlcorrector:
id: filter_htmlcorrector
provider: filter
status: false
weight: -40
settings: { }
filter_image_lazy_load:
id: filter_image_lazy_load
provider: filter
status: false
weight: -39
settings: { }
filter_pathologic: filter_pathologic:
id: filter_pathologic id: filter_pathologic
provider: pathologic provider: pathologic
status: false status: false
weight: 50 weight: -38
settings: settings:
settings_source: global settings_source: global
local_settings: local_settings:
protocol_style: full protocol_style: full
local_paths: '' local_paths: ''
keep_language_prefix: true keep_language_prefix: true
filter_url:
id: filter_url
provider: filter
status: false
weight: -45
settings:
filter_url_length: 72
linkit:
id: linkit
provider: linkit
status: false
weight: -42
settings:
title: true
media_substitution: metadata
media_embed:
id: media_embed
provider: media
status: false
weight: -37
settings:
default_view_mode: default
allowed_view_modes: { }
allowed_media_types: { }

View File

@@ -5,6 +5,8 @@ dependencies:
module: module:
- editor - editor
- footnotes - footnotes
- linkit
- media
- pathologic - pathologic
_core: _core:
default_config_hash: a0dSxrd1nnzeSvKpvFmtoLpxDd3Nj6E7dQN-MZUi20g default_config_hash: a0dSxrd1nnzeSvKpvFmtoLpxDd3Nj6E7dQN-MZUi20g
@@ -22,38 +24,38 @@ filters:
id: filter_align id: filter_align
provider: filter provider: filter
status: false status: false
weight: -41 weight: -42
settings: { } settings: { }
filter_autop: filter_autop:
id: filter_autop id: filter_autop
provider: filter provider: filter
status: true status: true
weight: -49 weight: -45
settings: { } settings: { }
filter_caption: filter_caption:
id: filter_caption id: filter_caption
provider: filter provider: filter
status: false status: false
weight: -40 weight: -41
settings: { } settings: { }
filter_footnotes: filter_footnotes:
id: filter_footnotes id: filter_footnotes
provider: footnotes provider: footnotes
status: true status: true
weight: 0 weight: -47
settings: settings:
footnotes_collapse: false footnotes_collapse: false
footnotes_css: false footnotes_css: false
footnotes_dialog: false footnotes_dialog: false
footnotes_dialog_prevent_bubbling: true footnotes_dialog_prevent_bubbling: true
footnotes_footer_disable: true footnotes_footer_disable: true
footnotes_preview_show_text: true footnotes_preview_show_text: false
footnotes_preview_character: '' footnotes_preview_character: ''
filter_html: filter_html:
id: filter_html id: filter_html
provider: filter provider: filter
status: false status: false
weight: -43 weight: -44
settings: settings:
allowed_html: '' allowed_html: ''
filter_html_help: true filter_html_help: true
@@ -62,25 +64,31 @@ filters:
id: filter_html_escape id: filter_html_escape
provider: filter provider: filter
status: false status: false
weight: -42 weight: -43
settings: { } settings: { }
filter_html_image_secure: filter_html_image_secure:
id: filter_html_image_secure id: filter_html_image_secure
provider: filter provider: filter
status: true status: true
weight: -48 weight: -49
settings: { } settings: { }
filter_htmlcorrector: filter_htmlcorrector:
id: filter_htmlcorrector id: filter_htmlcorrector
provider: filter provider: filter
status: true status: true
weight: -47 weight: -46
settings: { }
filter_image_lazy_load:
id: filter_image_lazy_load
provider: filter
status: false
weight: -39
settings: { } settings: { }
filter_pathologic: filter_pathologic:
id: filter_pathologic id: filter_pathologic
provider: pathologic provider: pathologic
status: false status: false
weight: 50 weight: -38
settings: settings:
settings_source: global settings_source: global
local_settings: local_settings:
@@ -91,6 +99,23 @@ filters:
id: filter_url id: filter_url
provider: filter provider: filter
status: true status: true
weight: -45 weight: -48
settings: settings:
filter_url_length: 72 filter_url_length: 72
linkit:
id: linkit
provider: linkit
status: false
weight: -40
settings:
title: true
media_substitution: metadata
media_embed:
id: media_embed
provider: media
status: false
weight: -37
settings:
default_view_mode: default
allowed_view_modes: { }
allowed_media_types: { }

View File

@@ -0,0 +1,13 @@
diff --git a/src/Plugin/Filter/FootnotesFilter.php b/src/Plugin/Filter/FootnotesFilter.php
index 03bff31..8189be0 100644
--- a/src/Plugin/Filter/FootnotesFilter.php
+++ b/src/Plugin/Filter/FootnotesFilter.php
@@ -168,7 +168,7 @@ class FootnotesFilter extends FilterBase implements ContainerFactoryPluginInterf
// Citations should not contain paragraph tags as they should be inline
// content. This attempts to remove them; however, if the 'Convert line
// breaks filter' runs after this filter, it will still be an issue.
- $markup = str_replace(['<p>', '</p>'], '', $markup);
+ // $markup = str_replace(['<p>', '</p>'], '', $markup);
static::replaceNodeContent($node, $markup);
}

View File

@@ -394,7 +394,7 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
function onMouseEnterFN(event){ function onMouseEnterFN(event){
console.log('onMouseEnterFN, event:', event); console.log('onMouseEnterFN, event:', event);
fn_modale.innerHTML = event.target.dataset.content; fn_modale.innerHTML = event.target.querySelector('.footnote-content').innerHTML;
fn_modale.classList.add('visible'); fn_modale.classList.add('visible');

View File

@@ -770,7 +770,7 @@ aside.footnote-content{
position: absolute; position: absolute;
// top:50%; left:50%; // top:50%; left:50%;
z-index: 200; z-index: 200;
max-width: 100em; max-width: 40em;
padding:1em 1.5em 1em 1em; padding:1em 1.5em 1em 1em;
border: 1px dashed $bleu_site; border: 1px dashed $bleu_site;
&.visible{ &.visible{
@@ -778,5 +778,8 @@ aside.footnote-content{
opacity: 1; opacity: 1;
transition: opacity 0.25s ease-in-out; transition: opacity 0.25s ease-in-out;
} }
img{
max-width: 100%;
height: auto;
}
} }

View File

@@ -1,7 +1,7 @@
{% apply footnotes_spaceless %} {% apply footnotes_spaceless %}
{# footnotes/footnote-link.html.twig #} {# footnotes/footnote-link.html.twig #}
<span class="footnote__citation js-footnote-citation" id="{{ fn.ref_id }}" data-content="{{ fn.text }}"> <div class="footnote__citation js-footnote-citation" id="{{ fn.ref_id }}">
{{ fn.value|render|trim }} {{ fn.value|render|trim }}
{# <aside class="footnote-content">{{ fn.text }}</aside> #} <aside class="footnote-content">{{ fn.text }}</aside>
</span> </div>
{% endapply %} {% endapply %}

View File

@@ -10,4 +10,4 @@
{%- endfor -%} {%- endfor -%}
</span> </span>
{%- endif -%} {%- endif -%}
{% endapply %} {% endapply %}