diff --git a/Products/CMFPlone/patterns/settings.py b/Products/CMFPlone/patterns/settings.py index 2d63b3ef69..8f5afc81ab 100644 --- a/Products/CMFPlone/patterns/settings.py +++ b/Products/CMFPlone/patterns/settings.py @@ -7,6 +7,7 @@ from plone.registry.interfaces import IRegistry from plone.uuid.interfaces import IUUID from Products.CMFCore.interfaces._content import IFolderish +from plone.base.interfaces import IImagingSchema from plone.base.interfaces import ILinkSchema from plone.base.interfaces import IPatternsSettings from plone.base.interfaces import IPloneSiteRoot @@ -71,12 +72,10 @@ def mark_special_links(self): return result @property - def image_scales(self): - factory = getUtility(IVocabularyFactory, "plone.app.vocabularies.ImagesScales") - vocabulary = factory(self.context) - ret = [{"title": translate(it.title), "value": it.value} for it in vocabulary] - ret = sorted(ret, key=lambda it: it["title"]) - return json.dumps(ret) + def image_srcsets(self): + registry = getUtility(IRegistry) + settings = registry.forInterface(IImagingSchema, prefix="plone", check=False) + return settings.image_srcsets def tinymce(self): """ @@ -129,7 +128,7 @@ def tinymce(self): configuration = { "base_url": self.context.absolute_url(), "imageTypes": image_types, - "imageScales": self.image_scales, + "imageSrcsets": self.image_srcsets, "linkAttribute": "UID", # This is for loading the languages on tinymce "loadingBaseUrl": "{}/++plone++static/components/tinymce-builded/" diff --git a/news/3477.feature b/news/3477.feature new file mode 100644 index 0000000000..78e99ea9a1 --- /dev/null +++ b/news/3477.feature @@ -0,0 +1 @@ +Add image srcset's configuration to TinyMCE pattern settings [MrTango] \ No newline at end of file