Skip to content

Commit

Permalink
[fc] Repository: plone.app.imaging
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2015-06-04T10:37:29+08:00
Author: doug (shadowmint) <linderd@iinet.net.au>
Commit: plone/plone.app.imaging@ce832aa

Adds documentation for what the 'direction' parameter actually does

Files changed:
M README.rst
Repository: plone.app.imaging
Branch: refs/heads/master
Date: 2016-01-06T23:38:32+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.imaging@50bc117

Merge pull request #14 from shadowmint/bug-obscure-documentation

Adds documentation for what the 'direction' parameter actually does

Files changed:
M README.rst
  • Loading branch information
jensens committed Jan 6, 2016
1 parent 8302c10 commit 9d22858
Showing 1 changed file with 62 additions and 140 deletions.
202 changes: 62 additions & 140 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,164 +1,86 @@
Repository: Products.CMFPlone
Repository: plone.app.imaging


Branch: refs/heads/master
Date: 2016-01-04T13:15:05-06:00
Author: vangheem (vangheem) <vangheem@gmail.com>
Commit: https://github.com/plone/Products.CMFPlone/commit/f4d55c5e2d3d684ebb28bbf5b2b2a21554510259
Date: 2015-06-04T10:37:29+08:00
Author: doug (shadowmint) <linderd@iinet.net.au>
Commit: https://github.com/plone/plone.app.imaging/commit/ce832aa738585e4a1154c8081e9c40a0628445d8

Fix url generation for tinymce when using virtual hosting. This fixing
images not rendering properly in tinymce
Adds documentation for what the 'direction' parameter actually does

Files changed:
M CHANGES.rst
M Products/CMFPlone/patterns/__init__.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 1819259..eb5fa85 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -14,6 +14,10 @@ New:

Fixes:
M README.rst

diff --git a/README.rst b/README.rst
index 662d7a6..af917ec 100644
--- a/README.rst
+++ b/README.rst
@@ -111,6 +111,22 @@ much flexibility/convenience you need:
However, it's recommended to use the ``tag`` method of the image
scales view directly because it avoids loading the image into memory.

+- Fix url generation for tinymce when using virtual hosting. This fixing
+ images not rendering properly in tinymce.
+ [vangheem]
+Scaled image direction
+~~~~~~~~~~~~~~~~~~~~~~
+
- build resources with latest mockup that provides better path criteria
widget for the querystring pattern
[vangheem]
diff --git a/Products/CMFPlone/patterns/__init__.py b/Products/CMFPlone/patterns/__init__.py
index dd87eae..52f7a06 100644
--- a/Products/CMFPlone/patterns/__init__.py
+++ b/Products/CMFPlone/patterns/__init__.py
@@ -26,7 +26,6 @@ def __init__(self, context, request):
self.settings = registry.forInterface(
ITinyMCESchema, prefix="plone", check=False)
self.portal_url = get_portal_url(self.portal)
- self.portal_url_path = self.portal.absolute_url_path()

def get_theme(self):
return theming_policy().get_theme()
@@ -242,6 +241,8 @@ def tinymce(self):

image_types = settings.image_objects or []
folder_types = settings.contains_objects or []
+Three different scaling options are supported with the ``direction`` parameter.
+
+ site_path = generator.portal_url.replace(self.request['SERVER_URL'], '')
configuration = {
'relatedItems': {
'vocabularyUrl':
@@ -262,7 +263,7 @@ def tinymce(self):
'tiny': generator.get_tiny_config(),
# This is for loading the languages on tinymce
'loadingBaseUrl': '%s/++plone++static/components/tinymce-builded/js/tinymce' % generator.portal_url, # noqa
- 'prependToUrl': '{0}/resolveuid/'.format(generator.portal_url_path),
+ 'prependToUrl': '{0}/resolveuid/'.format(site_path),
'linkAttribute': 'UID',
'prependToScalePart': '/@@images/image/',
'imageTypes': image_types


Repository: Products.CMFPlone


Branch: refs/heads/master
Date: 2016-01-06T11:12:53-06:00
Author: vangheem (vangheem) <vangheem@gmail.com>
Commit: https://github.com/plone/Products.CMFPlone/commit/ffc51cdac9f8494486f32e70a5da7fc70253f548

a bit more safe getting url

Files changed:
M Products/CMFPlone/patterns/__init__.py

diff --git a/Products/CMFPlone/patterns/__init__.py b/Products/CMFPlone/patterns/__init__.py
index 52f7a06..f513702 100644
--- a/Products/CMFPlone/patterns/__init__.py
+++ b/Products/CMFPlone/patterns/__init__.py
@@ -242,7 +242,8 @@ def tinymce(self):
image_types = settings.image_objects or []
folder_types = settings.contains_objects or []
+* ``up`` scaling scales the smallest dimension up to the required size
+ and crops the other dimension if needed.
+
+* ``down`` scaling starts by scaling the largest dimension to the required
+ size and crops the other dimension if needed.
+
+* ``thumbnail`` scales to the requested dimensions without cropping. The
+ resulting image may have a different size than requested. This option
+ requires both width and height to be specified. `keep` is accepted as
+ an alternative spelling for this option, but its use is deprecated.
+
Scaled image quality
~~~~~~~~~~~~~~~~~~~~

- site_path = generator.portal_url.replace(self.request['SERVER_URL'], '')
+ server_url = self.request.get('SERVER_URL', '')
+ site_path = generator.portal_url[len(server_url):]
configuration = {
'relatedItems': {
'vocabularyUrl':
@@ -263,7 +264,7 @@ def tinymce(self):
'tiny': generator.get_tiny_config(),
# This is for loading the languages on tinymce
'loadingBaseUrl': '%s/++plone++static/components/tinymce-builded/js/tinymce' % generator.portal_url, # noqa
- 'prependToUrl': '{0}/resolveuid/'.format(site_path),
+ 'prependToUrl': '{0}/resolveuid/'.format(site_path.rstrip('/')),
'linkAttribute': 'UID',
'prependToScalePart': '/@@images/image/',
'imageTypes': image_types


Repository: Products.CMFPlone
Repository: plone.app.imaging


Branch: refs/heads/master
Date: 2016-01-06T11:15:27-06:00
Author: Nathan Van Gheem (vangheem) <vangheem@gmail.com>
Commit: https://github.com/plone/Products.CMFPlone/commit/b45bdde2d3c6a0e3250a66932abb1240bc3fa4d3
Date: 2016-01-06T23:38:32+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.imaging/commit/50bc1172765f896c8904d7ce9e5e3146a02de9d9

Merge pull request #1307 from plone/fix-prependToUrl-path-with-vh
Merge pull request #14 from shadowmint/bug-obscure-documentation

Fix url generation for tinymce when using virtual hosting
Adds documentation for what the 'direction' parameter actually does

Files changed:
M CHANGES.rst
M Products/CMFPlone/patterns/__init__.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 1819259..eb5fa85 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -14,6 +14,10 @@ New:

Fixes:
M README.rst

diff --git a/README.rst b/README.rst
index 662d7a6..af917ec 100644
--- a/README.rst
+++ b/README.rst
@@ -111,6 +111,22 @@ much flexibility/convenience you need:
However, it's recommended to use the ``tag`` method of the image
scales view directly because it avoids loading the image into memory.

+- Fix url generation for tinymce when using virtual hosting. This fixing
+ images not rendering properly in tinymce.
+ [vangheem]
+Scaled image direction
+~~~~~~~~~~~~~~~~~~~~~~
+
- build resources with latest mockup that provides better path criteria
widget for the querystring pattern
[vangheem]
diff --git a/Products/CMFPlone/patterns/__init__.py b/Products/CMFPlone/patterns/__init__.py
index dd87eae..f513702 100644
--- a/Products/CMFPlone/patterns/__init__.py
+++ b/Products/CMFPlone/patterns/__init__.py
@@ -26,7 +26,6 @@ def __init__(self, context, request):
self.settings = registry.forInterface(
ITinyMCESchema, prefix="plone", check=False)
self.portal_url = get_portal_url(self.portal)
- self.portal_url_path = self.portal.absolute_url_path()

def get_theme(self):
return theming_policy().get_theme()
@@ -242,6 +241,9 @@ def tinymce(self):

image_types = settings.image_objects or []
folder_types = settings.contains_objects or []
+Three different scaling options are supported with the ``direction`` parameter.
+
+* ``up`` scaling scales the smallest dimension up to the required size
+ and crops the other dimension if needed.
+
+ server_url = self.request.get('SERVER_URL', '')
+ site_path = generator.portal_url[len(server_url):]
configuration = {
'relatedItems': {
'vocabularyUrl':
@@ -262,7 +264,7 @@ def tinymce(self):
'tiny': generator.get_tiny_config(),
# This is for loading the languages on tinymce
'loadingBaseUrl': '%s/++plone++static/components/tinymce-builded/js/tinymce' % generator.portal_url, # noqa
- 'prependToUrl': '{0}/resolveuid/'.format(generator.portal_url_path),
+ 'prependToUrl': '{0}/resolveuid/'.format(site_path.rstrip('/')),
'linkAttribute': 'UID',
'prependToScalePart': '/@@images/image/',
'imageTypes': image_types
+* ``down`` scaling starts by scaling the largest dimension to the required
+ size and crops the other dimension if needed.
+
+* ``thumbnail`` scales to the requested dimensions without cropping. The
+ resulting image may have a different size than requested. This option
+ requires both width and height to be specified. `keep` is accepted as
+ an alternative spelling for this option, but its use is deprecated.
+
Scaled image quality
~~~~~~~~~~~~~~~~~~~~



0 comments on commit 9d22858

Please sign in to comment.