alchemy_cms 8.2.4 → 8.2.5
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 +4 -4
- data/app/assets/builds/alchemy/alchemy_admin.min.js +1 -1
- data/app/assets/builds/alchemy/alchemy_admin.min.js.map +1 -1
- data/app/components/alchemy/admin/locale_select.rb +4 -4
- data/app/javascript/alchemy_admin/image_cropper.js +14 -1
- data/lib/alchemy/configuration/collection_option.rb +1 -1
- data/lib/alchemy/routing_constraints.rb +11 -1
- data/lib/alchemy/version.rb +1 -1
- metadata +1 -1
|
@@ -10,12 +10,12 @@ module Alchemy
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def call
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if auto_submit
|
|
14
|
+
form_tag(helpers.url_for, method: :get) do
|
|
15
15
|
content_tag("alchemy-auto-submit", locale_select)
|
|
16
|
-
else
|
|
17
|
-
locale_select
|
|
18
16
|
end
|
|
17
|
+
else
|
|
18
|
+
locale_select
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -89,7 +89,20 @@ export default class ImageCropper {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
reset() {
|
|
92
|
-
this.#cropper
|
|
92
|
+
const cropper = this.#cropper
|
|
93
|
+
// Apply the default size. cropperjs clamps the crop box to its maximum size.
|
|
94
|
+
cropper.setData(this.defaultBoxSize)
|
|
95
|
+
// When the default box sits at the maximum crop box size, sub-pixel rounding
|
|
96
|
+
// makes cropperjs treat setData's box as oversized and revert its position
|
|
97
|
+
// (renderCropBox resets top/left to their old values). Re-apply the position
|
|
98
|
+
// in canvas coordinates afterwards – that does not touch the size, so it is
|
|
99
|
+
// not reverted and the mask actually moves to the default box.
|
|
100
|
+
const canvas = cropper.getCanvasData()
|
|
101
|
+
const scale = canvas.width / canvas.naturalWidth
|
|
102
|
+
cropper.setCropBoxData({
|
|
103
|
+
left: canvas.left + this.defaultBoxSize.x * scale,
|
|
104
|
+
top: canvas.top + this.defaultBoxSize.y * scale
|
|
105
|
+
})
|
|
93
106
|
this.update(this.defaultBoxSize)
|
|
94
107
|
}
|
|
95
108
|
|
|
@@ -16,11 +16,21 @@ module Alchemy
|
|
|
16
16
|
@request = request
|
|
17
17
|
@params = @request.params
|
|
18
18
|
|
|
19
|
-
handable_format? && no_rails_route?
|
|
19
|
+
handable_format? && no_dotfile_route? && no_rails_route?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
|
+
# We don't want to handle requests to dotfile URLs.
|
|
25
|
+
#
|
|
26
|
+
# A page urlname never starts with a dot, so any such request
|
|
27
|
+
# (/.well-known/ ACME challenges, /.env or /.git probes, etc.)
|
|
28
|
+
# should never be served by a page.
|
|
29
|
+
#
|
|
30
|
+
def no_dotfile_route?
|
|
31
|
+
!@params["urlname"].start_with?(".")
|
|
32
|
+
end
|
|
33
|
+
|
|
24
34
|
# We only want html requests to be handled by us.
|
|
25
35
|
#
|
|
26
36
|
# If an unknown format is requested we want to handle this,
|
data/lib/alchemy/version.rb
CHANGED