silverstripe-dropzone icon indicating copy to clipboard operation
silverstripe-dropzone copied to clipboard

Add config options to specify where javascripts and front-end config is loaded.

Open wakes opened this issue 10 years ago • 5 comments
trafficstars

Added configuration settings:

FileAttachmentField:
  module_scripts_dir: 'javascript/'
  dropzone_script_file: 'javascript/dropzone.js'
  dropzone_config_file: 'javascript/default_config.json'

to specify where javascript and front-end config is loaded from more succinctly. If they start with a '/' then they will load relative to web root so you can place them outside the module.

Thanks for the awesome upload field!

wakes avatar Sep 09 '15 02:09 wakes

Thanks, guys.

@shoaibali The Config API offers Before and After settings that allow you to specify with some precision when the file should load and what it should override. You can see in the dropzone config.yml file:

---
Name: dropzone
After: 'framework/*','cms/*'
---

It specifies to load after framework and cms. Because the snippet is also named, in your config, you can just specify After: ['#dropzone'].

@wakes In general, I have no objections to the changes. Because the module is most useful on the frontend, I think the ability to override the scripts is warranted.

Since I didn't see this until now (email issue wasn't sending me Github notifications), would you mind rebasing your changes? We'll aim to put this in a 1.2 release.

unclecheese avatar Nov 19 '15 02:11 unclecheese

Thank you @unclecheese for the explanation :)

I forgot about the before/after functions in yaml file.

shoaibali avatar Nov 19 '15 07:11 shoaibali

Would you be able to rebase this against the master so we can merge it in?

unclecheese avatar Jan 14 '16 21:01 unclecheese

Hi unclecheese,

Yup, I'll do it this afternoon and submit pull request.

Cheers,

Steve Wake Developer

DigitalHod Limited

E: [email protected] P: 021 026 30019

On 15/1/2016, at 10:01, unclecheese [email protected] wrote:

Would you be able to rebase this against the master so we can merge it in?

— Reply to this email directly or view it on GitHub https://github.com/unclecheese/silverstripe-dropzone/pull/24#issuecomment-171778514.

wakes avatar Jan 14 '16 22:01 wakes

@wakes Bumping this from the past. Still able to rebase this to get it in?

silbinarywolf avatar Apr 11 '17 00:04 silbinarywolf