Skip to content

Commit e3f1cf6

Browse files
damwaingamesAJ Griffithszerolab
authored
Update to support Wagtail 7.1 (#157)
* Updated tox.ini * Updated CHANGELOG * Update for tab component rewrite. --------- Co-authored-by: AJ Griffiths <[email protected]> Co-authored-by: Dan Braghiș <[email protected]>
1 parent c67c2b3 commit e3f1cf6

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
- Added support and testing for Wagtail 7.1, dropped support for Wagtail 6.4 (EOL) (@damwaingames)
6+
57
- Add tox testing for wagtail 6.2 and 6.3 and include Django 5.1
68
- Update the ruff github action which fixes the error seen in CI
79
- Add tox testing for Django 5.2 and Wagtail 6.4, 7.0

src/wagtailmarkdown/static/wagtailmarkdown/js/easymde.attach.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,26 @@ function easymdeAttach(id, autoDownloadFontAwesome) {
3030
// Save the codemirror instance on the original HTML element for later use.
3131
mde.element.codemirror = mde.codemirror;
3232

33-
mde.codemirror.on("change", function() {
33+
mde.codemirror.on("change", function () {
3434
document.getElementById(id).value = mde.value();
3535
});
3636
}
3737

3838

3939
/*
4040
* Used to initialize content when MarkdownFields are used in admin panels.
41+
*
42+
* Note: this uses an array of events to apply the function to, so as to cover
43+
* the different supported Wagtail versions.
4144
*/
42-
document.addEventListener('wagtail:tab-changed', function() {
43-
document.querySelectorAll('.CodeMirror').forEach(function(e) {
44-
setTimeout(
45-
function() {
46-
e.CodeMirror.refresh();
47-
}, 100
48-
);
49-
});
45+
['wagtail:tab-changed', 'w-tabs:changed'].forEach(function (event) {
46+
document.addEventListener(event, function () {
47+
document.querySelectorAll('.CodeMirror').forEach(function (e) {
48+
setTimeout(
49+
function () {
50+
e.CodeMirror.refresh();
51+
}, 100
52+
);
53+
});
54+
})
5055
});

tox.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
min_version = 4.22
33

44
envlist =
5-
py{39,310,311,312}-django42-wagtail{63,64,70}
6-
py{310,311,312,313}-django{51,52}-wagtail{63,64,70}
5+
py{39,310,311,312}-django42-wagtail{63,70,71}
6+
py{310,311,312,313}-django{51,52}-wagtail{63,70,71}
77

88
[gh-actions]
99
python =
@@ -30,13 +30,13 @@ setenv =
3030
extras = testing
3131

3232
deps =
33-
django4.2: Django>=4.2,<5.0
34-
django5.1: Django>=5.1,<5.2
35-
django5.2: Django>=5.2,<5.3
33+
django42: Django>=4.2,<5.0
34+
django51: Django>=5.1,<5.2
35+
django52: Django>=5.2,<5.3
3636

37-
wagtail6.3: wagtail>=6.3,<6.4
38-
wagtail6.4: wagtail>=6.4,<6.5
39-
wagtail7.0: wagtail>=7.0,<7.1
37+
wagtail63: wagtail>=6.3,<6.4
38+
wagtail70: wagtail>=7.0,<7.1
39+
wagtail71: wagtail>=7.1,<7.2
4040

4141
install_command = python -m pip install -U {opts} {packages}
4242
commands =

0 commit comments

Comments
 (0)