Compare commits

..
3 Commits
Author SHA1 Message Date
bachir 3b1013bc8f forgot to npm run build 2026-07-10 18:20:04 +02:00
bachir e2f4c717e6 better capsule (aka footnotes) positionning 2026-07-08 14:47:55 +02:00
bachir 015e3654fe better capsule (aka footnotes) 2026-07-07 16:31:47 +02:00
12 changed files with 276 additions and 52 deletions
+1 -1
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
+3
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"
} }
} }
} }
+11 -2
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
+93 -4
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: { }
+36 -11
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: { }
+13
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);
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -382,8 +382,19 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
let fns = document.querySelectorAll('.footnote__citation'); let fns = document.querySelectorAll('.footnote__citation');
// console.log('fns', fns); // console.log('fns', fns);
let used_n = [];
for (const fn of fns) { for (const fn of fns) {
console.log('fn', fn); console.log('fn', fn);
// set a random class for icone
let n = Math.round(Math.random() * (_formesclasses.length -1));
while (used_n.includes(n)) {
n = Math.round(Math.random() * (_formesclasses.length -1));
}
used_n.push(n);
fn.querySelector('span.footnote-link').classList.add(`forme-${_formesclasses[n]}`);
// events
fn.addEventListener('mouseenter', onMouseEnterFN); fn.addEventListener('mouseenter', onMouseEnterFN);
fn.addEventListener('mouseleave', onMouseLeaveFN); fn.addEventListener('mouseleave', onMouseLeaveFN);
// fn.addEventListener('mousemove', onMouseMove); // fn.addEventListener('mousemove', onMouseMove);
@@ -394,7 +405,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');
@@ -403,9 +414,11 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
} }
function onMouseLeaveFN(event){ function onMouseLeaveFN(event){
console.log('onMouseLeaveFN, event:', event); console.log('onMouseLeaveFN, event:', event);
// fn_modale.innerHTML = event.target.dataset.content;
fn_modale.classList.remove('visible');
fn_modale.classList.remove('visible');
setTimeout(function(){
fn_modale.innerHTML = "";
}, 1000);
// fn_modale.style.left = `${event.clientX}px`; // fn_modale.style.left = `${event.clientX}px`;
// fn_modale.style.top = `${event.clientY}px`; // fn_modale.style.top = `${event.clientY}px`;
@@ -423,15 +436,33 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
function updateFnModalePos(){ function updateFnModalePos(){
if (smoother) { if (smoother) {
let cont = smoother.content(); let cont = smoother.content();
console.log('cont', cont);
let rect = cont.getBoundingClientRect(); let rect = cont.getBoundingClientRect();
fn_modale.style.left = `${mouse_pos.x - rect.left}px`; // console.log(`mouse_pos.x=${mouse_pos.x} | window.innerWidth/2=${window.innerWidth/2}`);
let componsed_mouse_posy = mouse_pos.y - rect.top; let compensed_mouse_pos = {
// if (componsed_mouse_posy > window.innerHeight) { x: mouse_pos.x - rect.left,
fn_modale.style.top = `${componsed_mouse_posy - fn_modale.clientHeight + 60}px`; y: mouse_pos.y - rect.top + cont.offsetTop
// } else{ }
// fn_modale.style.top = `${componsed_mouse_posy - fn_modale.clientHeight * 0.7}px`; let decalage = 20;
// }
if (mouse_pos.x < window.innerWidth/2) {
fn_modale.style.left = `${compensed_mouse_pos.x + decalage}px`;
}else{
fn_modale.style.left = `${compensed_mouse_pos.x - fn_modale.clientWidth - decalage}px`;
}
// let componsed_mouse_posy = mouse_pos.y - rect.top + 370;
if (mouse_pos.y < window.innerHeight / 2) {
// fn_modale.style.top = `${componsed_mouse_posy - fn_modale.clientHeight + 60}px`;
fn_modale.style.top = `${compensed_mouse_pos.y + decalage}px`
} else{
// fn_modale.style.top = `${componsed_mouse_posy - 60}px`;
fn_modale.style.top = `${compensed_mouse_pos.y - fn_modale.clientHeight - decalage}px`
}
console.log('window', window); console.log('window', window);
@@ -750,33 +750,87 @@ footer[role="contentinfo"]{
// | |_ / _ \ / _ \| __| '_ \ / _ \| __/ _ \/ __| // | |_ / _ \ / _ \| __| '_ \ / _ \| __/ _ \/ __|
// | _| (_) | (_) | |_| | | | (_) | || __/\__ \ // | _| (_) | (_) | |_| | | | (_) | || __/\__ \
// |_| \___/ \___/ \__|_| |_|\___/ \__\___||___/ // |_| \___/ \___/ \__|_| |_|\___/ \__\___||___/
div.footnote__citations-wrapper{
display: inline;
.footnote__citation{ .footnote__citation{
display: inline;
text-decoration: underline; text-decoration: underline;
text-decoration-style: dashed; text-decoration-style: dashed;
cursor: pointer; cursor: pointer;
span.footnote-link{
display: inline-block;
$icon_wh:1em;
width: $icon_wh; height: $icon_wh;
text-indent: $icon_wh * 2;
overflow: hidden;
vertical-align:baseline;
background-color: $rose;
// border: 1px solid red;
mask-image: url('/themes/custom/mathallo/assets/img/formes/supeg.svg');
mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
&.forme-pyramide{
mask-image: url('/themes/custom/mathallo/assets/img/formes/pyramide.svg');
}
&.forme-prct{
mask-image: url('/themes/custom/mathallo/assets/img/formes/prct.svg');
}
&.forme-pi{
mask-image: url('/themes/custom/mathallo/assets/img/formes/pi.svg');
}
&.forme-infinite{
mask-image: url('/themes/custom/mathallo/assets/img/formes/infinite.svg');
}
&.forme-supeg{
mask-image: url('/themes/custom/mathallo/assets/img/formes/supeg.svg');
}
&.forme-cone{
mask-image: url('/themes/custom/mathallo/assets/img/formes/cone.svg');
}
&.forme-croissant{
mask-image: url('/themes/custom/mathallo/assets/img/formes/croissant.svg');
}
&.forme-cube{
mask-image: url('/themes/custom/mathallo/assets/img/formes/cube.svg');
}
&.forme-diamant{
mask-image: url('/themes/custom/mathallo/assets/img/formes/diamant.svg');
}
&.forme-cylindre{
mask-image: url('/themes/custom/mathallo/assets/img/formes/cylindre.svg');
}
}
} }
aside.footnote-content{ // template.footnote-content{
display:none; // display:none;
// }
} }
.fn-modale{ .fn-modale{
@include card; @include card;
// display: none; // display: none;
opacity: 0;
transition: opacity 0.25s ease-in-out; transition: opacity 0.25s ease-in-out;
// transition-delay: ; // transition-delay: ;
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;
margin: 0;
opacity: 0;
&.visible{ &.visible{
// display: block; // display: block;
opacity: 1; opacity: 1;
transition: opacity 0.25s ease-in-out; transition: opacity 0.25s ease-in-out;
} }
img{
max-width: 100%;
height: auto;
}
} }
@@ -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 }} <span class="footnote-link">{{ fn.value|render|trim }}</span>
{# <aside class="footnote-content">{{ fn.text }}</aside> #} <template class="footnote-content">{{ fn.text }}</template>
</span> </div>
{% endapply %} {% endapply %}
@@ -1,13 +1,13 @@
{% apply footnotes_spaceless %} {% apply footnotes_spaceless %}
{# footnotes/footnote-links.html.twig #} {# footnotes/footnote-links.html.twig #}
{%- if footnote_links -%} {%- if footnote_links -%}
<span class="footnote__citations-wrapper"> <div class="footnote__citations-wrapper">
{%- for footnote_link in footnote_links -%} {%- for footnote_link in footnote_links -%}
{% if not loop.first %} {% if not loop.first %}
<span class="footnote__citation-separator">, </span> <span class="footnote__citation-separator">, </span>
{% endif %} {% endif %}
{{ footnote_link }} {{ footnote_link }}
{%- endfor -%} {%- endfor -%}
</span> </div>
{%- endif -%} {%- endif -%}
{% endapply %} {% endapply %}