alchemy_cms 7.4.0 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6729def1a438f7c45fbcdc61e32f2f1349e20577dc59bb44518a4fcced32c159
4
- data.tar.gz: e0b25b32737ab76965a3467387715278209d31a686514dad2fe8b3ff291c659f
3
+ metadata.gz: 6ee0b06ef42eee852ad19ec83bb5fcc81e2fb8940442921da89debd7ee1a0619
4
+ data.tar.gz: 5666121fc18ed4b150320ca997f40c5f306c67389ebefc9d77f4a6f046bba99b
5
5
  SHA512:
6
- metadata.gz: 4fe0a1011e576db55a1438b0685bf69426c59c8dc5542a7daf8ce3908d42c6ad4f8d11ba775df569def6be686e25c0d2a273cbaa763575c490704986154811b3
7
- data.tar.gz: 8f5444f8449679dd7b308dba77313bd13a0fa18343a95e084e0967ad5f13c6ef979bdb5f442cd0b24057aa4c48a59fac63bbbac2981655d0bd0b8e5d7307f16e
6
+ metadata.gz: c3f0c0a1129cec4514c51ae4db1fa8ecd85621e5b551b9d1a5a7871db807bf8c8c03826bdf088578d363dcc868b53eec6ccc0d0dc4c57449b905ff6c0dc04cf9
7
+ data.tar.gz: dc6e95ad76b7128e23a146864f242bff19335eb2c8ec50a5e1efe8254f951b33a7ac8c4f3c4e9053b693a63e6073745c6b87dfd3339147f28e1e0a6b29c13612
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.4.1 (2025-03-05)
4
+
5
+ - [7.4-stable] Fix image cropper [#3193](https://github.com/AlchemyCMS/alchemy_cms/pull/3193) ([alchemycms-bot](https://github.com/alchemycms-bot))
6
+
3
7
  ## 7.4.0 (2025-02-07)
4
8
 
5
9
  - Add specs for format matchers [#3182](https://github.com/AlchemyCMS/alchemy_cms/pull/3182) ([mamhoff](https://github.com/mamhoff))
@@ -6,25 +6,19 @@ export default class ImageCropper {
6
6
  #cropFromField = null
7
7
  #cropSizeField = null
8
8
 
9
- constructor(
10
- image,
11
- minSize,
12
- defaultBox,
13
- aspectRatio,
14
- formFieldIds,
15
- elementId
16
- ) {
9
+ constructor(image, defaultBox, aspectRatio, formFieldIds, elementId) {
17
10
  this.image = image
18
- this.minSize = minSize
19
11
  this.defaultBox = defaultBox
20
12
  this.aspectRatio = aspectRatio
21
13
  this.#cropFromField = document.getElementById(formFieldIds[0])
22
14
  this.#cropSizeField = document.getElementById(formFieldIds[1])
23
15
  this.elementId = elementId
24
16
  this.dialog = Alchemy.currentDialog()
25
- this.dialog.options.closed = () => this.destroy()
17
+ if (this.dialog) {
18
+ this.dialog.options.closed = () => this.destroy()
19
+ this.bind()
20
+ }
26
21
  this.init()
27
- this.bind()
28
22
  }
29
23
 
30
24
  get cropperOptions() {
@@ -32,12 +26,9 @@ export default class ImageCropper {
32
26
  aspectRatio: this.aspectRatio,
33
27
  viewMode: 1,
34
28
  zoomable: false,
35
- minCropBoxWidth: this.minSize && this.minSize[0],
36
- minCropBoxHeight: this.minSize && this.minSize[1],
37
- ready: (event) => {
38
- const cropper = event.target.cropper
39
- cropper.setData(this.box)
40
- },
29
+ checkCrossOrigin: false, // Prevent CORS issues
30
+ checkOrientation: false, // Prevent loading the image via AJAX which can cause CORS issues
31
+ data: this.box,
41
32
  cropend: () => {
42
33
  const data = this.#cropper.getData(true)
43
34
  this.update(data)
@@ -26,7 +26,6 @@
26
26
  new ImageLoader(image);
27
27
  new ImageCropper(
28
28
  image,
29
- <%= @settings[:min_size].to_json %>,
30
29
  <%= @settings[:default_box].to_json %>,
31
30
  <%= @settings[:ratio] %>,
32
31
  [
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "7.4.0"
4
+ VERSION = "7.4.1"
5
5
 
6
6
  def self.version
7
7
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.0
4
+ version: 7.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -12,7 +12,7 @@ authors:
12
12
  - Martin Meyerhoff
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2025-02-07 00:00:00.000000000 Z
15
+ date: 2025-03-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: actionmailer
@@ -1406,7 +1406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1406
1406
  version: '0'
1407
1407
  requirements:
1408
1408
  - ImageMagick (libmagick), v6.6 or greater.
1409
- rubygems_version: 3.6.3
1409
+ rubygems_version: 3.6.5
1410
1410
  specification_version: 4
1411
1411
  summary: A powerful, userfriendly and flexible CMS for Rails
1412
1412
  test_files: []