diff --git a/.editorconfig b/.editorconfig index fa698fb1..5b3c112c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,8 @@ root = true -[*] # For All Files +[*] +# Default settings for all files. # Unix-style newlines with a newline ending every file end_of_line = lf insert_final_newline = true @@ -33,7 +34,8 @@ indent_size = 4 # 2 space indentation indent_size = 2 -[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] # Frontend development +[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] +# Frontend development # 2 space indentation indent_size = 2 max_line_length = 80 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 86891e9d..97d91238 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -53,6 +53,13 @@ jobs: # os_dependencies = "git libxml2 libxslt" ## +## +# To test against a specific matrix of python versions +# when running tests jobs, add in .meta.toml: +# [github] +# py_versions = "['3.12', '3.11']" +## + ## # Specify additional jobs in .meta.toml: diff --git a/.gitignore b/.gitignore index 486392f6..8f056226 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ __pycache__/ .tox .vscode/ node_modules/ +forest.dot +forest.json # venv / buildout related bin/ diff --git a/.meta.toml b/.meta.toml index e52d5a97..29607e4c 100644 --- a/.meta.toml +++ b/.meta.toml @@ -3,7 +3,7 @@ # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "5d3e918e" +commit-id = "4cf2df11" [pyproject] codespell_skip = "*.css.map,*.map,*.min.js,yarn.lock" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf505088..904ffac8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/collective/zpretty @@ -33,7 +33,7 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.1 hooks: - id: flake8 @@ -45,7 +45,7 @@ repos: # """ ## - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: @@ -72,7 +72,7 @@ repos: - id: check-python-versions args: ['--only', 'setup.py,pyproject.toml'] - repo: https://github.com/collective/i18ndude - rev: "6.1.0" + rev: "6.2.1" hooks: - id: i18ndude diff --git a/CHANGES.md b/CHANGES.md index db1eedd7..df87b0d3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,8 @@ Changelog ## 3.6.3 (unreleased) -- Nothing changed yet. +- Initialize "slick-slider" automatically inside TinyMCE image gallery. + [petschki] ## 3.6.2 (2024-06-14) diff --git a/collective/behavior/relatedmedia/browser.py b/collective/behavior/relatedmedia/browser.py index 89ecbea6..4f96f41f 100644 --- a/collective/behavior/relatedmedia/browser.py +++ b/collective/behavior/relatedmedia/browser.py @@ -46,20 +46,22 @@ def can_upload(self): class RelatedImagesView(RelatedBaseView): def gallery_css_klass(self): - rm_behavior = self.behavior + css_class = [] - if not rm_behavior: - return + if self.request.get("showGallery"): + css_class.append("related-images-slider") - css_class = rm_behavior.gallery_css_class + rm_behavior = self.behavior - if css_class: - return css_class + if rm_behavior: + css_class.append(rm_behavior.gallery_css_class) + else: + dflt_css_class = api.portal.get_registry_record( + "collective.behavior.relatedmedia.image_gallery_default_class" + ) + css_class.append(dflt_css_class) - dflt_css_class = api.portal.get_registry_record( - "collective.behavior.relatedmedia.image_gallery_default_class" - ) - return dflt_css_class + return " ".join(css_class) @property def show_images_viewlet(self): diff --git a/collective/behavior/relatedmedia/related_images.pt b/collective/behavior/relatedmedia/related_images.pt index 73c4b4ab..01ee069f 100644 --- a/collective/behavior/relatedmedia/related_images.pt +++ b/collective/behavior/relatedmedia/related_images.pt @@ -1,6 +1,7 @@