[BUGFIX] Eliminate gremlins in image cropper 42/51642/10
authorHelmut Hummel <typo3@helhum.io>
Tue, 7 Feb 2017 20:12:16 +0000 (21:12 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 13 Feb 2017 08:00:46 +0000 (09:00 +0100)
commitf4a73f2f10263b1a23d7b7a693bbf3adb6351fbc
treef52ba499e254a2d0c953207630777ad458849aba
parent121c9ca653e29f139f12105513ebb3140d6609f6
[BUGFIX] Eliminate gremlins in image cropper

Refactor rendering to use two templates, a layout
and a partial to be more flexible.

Now also force the crop to be applied, even when
the editor does not open the image manipulation.

This is important when only one aspect ratio is
allowed to not allow the editor to save an invalid
state.

Eliminate several quirks in the TypeScript code,
among them:

* reset state when closing the cropper
* reset state when modal is dismissed
* correctly initialize all previews
* show correct size of crop area for big images
* avoid accidental dismiss of the modal

Last but not least add the accidentally removed form engine
wizard html fields again.

Resolves: #79764
Resolves: #79731
Resolves: #79753
Resolves: #79674

Releases: master
Change-Id: I0a24d6418d6263b00c3fbf31901fd7c67e9fc97e
Reviewed-on: https://review.typo3.org/51642
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
15 files changed:
Build/Resources/Public/Less/TYPO3/_element_cropper.less
typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php
typo3/sysext/backend/Classes/Form/Wizard/ImageManipulationWizard.php
typo3/sysext/backend/Resources/Private/Layouts/ImageManipulation.html [new file with mode: 0644]
typo3/sysext/backend/Resources/Private/Partials/ImageManipulation/ModalTitle.html [new file with mode: 0644]
typo3/sysext/backend/Resources/Private/Templates/ImageManipulation/ImageCropping.html [deleted file]
typo3/sysext/backend/Resources/Private/Templates/ImageManipulation/ImageManipulationElement.html [new file with mode: 0644]
typo3/sysext/backend/Resources/Private/Templates/ImageManipulation/ImageManipulationWizard.html [new file with mode: 0644]
typo3/sysext/backend/Resources/Private/TypeScript/ImageManipulation.ts
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js
typo3/sysext/core/Classes/Imaging/ImageManipulation/Area.php
typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariant.php
typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariantCollection.php
typo3/sysext/core/Classes/Imaging/ImageManipulation/Ratio.php
typo3/sysext/core/Tests/Unit/Imaging/ImageManipulation/AreaTest.php [new file with mode: 0644]