Skip to content

Commit

Permalink
Feat: allow cross origin check setting for curations
Browse files Browse the repository at this point in the history
  • Loading branch information
awcodes committed Nov 1, 2024
1 parent 67c448a commit f823feb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config/curator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
'cloudinary',
'imgix',
],
'cropper' => [
'check_cross_origin' => true,
],
'curation_formats' => [
'jpg',
'jpeg',
Expand Down
4 changes: 2 additions & 2 deletions resources/dist/curation.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion resources/js/curation.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Cropper from "cropperjs";

export default function curation({statePath, fileName, fileType, presets = {}}) {
export default function curation({statePath, fileName, fileType, presets = {}, checkCrossOrigin = true}) {
return {
statePath: statePath,
filename: fileName,
filetype: fileType,
checkCrossOrigin: checkCrossOrigin,
cropper: null,
presets: presets,
preset: 'custom',
Expand Down Expand Up @@ -35,6 +36,7 @@ export default function curation({statePath, fileName, fileType, presets = {}})

setTimeout(() => {
this.cropper = new Cropper(this.$refs.image, {
checkCrossOrigin: this.checkCrossOrigin,
background: false,
});
}, 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class="flex-1 relative flex flex-col lg:flex-row overflow-hidden"
fileName: '{{ $media->name }}',
fileType: '{{ $media->type }}',
presets: @js($presets),
checkCrossOrigin: {{ config('curator.cropper.check_cross_origin') }}
})"
x-on:add-curation.window="$dispatch('close-modal', { id: '{{ $modalId }}' })"
>
Expand Down

0 comments on commit f823feb

Please sign in to comment.