npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

ember-cli-dropzonejs-secure

1.0.1 • Public • Published

Ember-cli-dropzonejs

Build Status Ember Observer Score

Drag and drop file uploader addon for ember-cli using Dropzonejs.

This is the customized version where user can able to pass authorization header

DEMO

Versions

Current version is running ember-cli >= 2.8.0

Versions 0.8.6 <= are running ember-cli 1.13.8

Installation

ember install ember-cli-dropzonejs

This addon will use dropzone's default css by default. If you prefer to use your own css, add this option to your Brocfile.js:

var app = new EmberApp({
  ---
  emberCliDropzonejs: {
    includeDropzoneCss: false
  }
  ---
});

Usage

Simply add the component to your template like so: {{drop-zone url='/endpoint'}}

You can see all properties in the Dropzonejs configuration docs.

To set properties simply add the name of the property inside the component call and assign a value.

example:

{{drop-zone url='http://example.com/example' clickable=false addRemoveLinks=true}}

If you would like to use the whole document body as a drop location you can set maxDropRegion to true

Event Handling

Dropzonejs Events Docs

To use events, set your event handler in your controller like so:

  addedFileEvent: Ember.computed(function() {
    return function() {
      // do something...
    };
  }),

and set it in your component declaration:

{{drop-zone url='http://example.com/example' addfile=addedFileEvent}}

Remember to add an url, this addon will not work without it

Contributions

All contributions are welcomed and encouraged.

Please make all pull requests to the dev branch.

Thanks!

install

npm i ember-cli-dropzonejs-secure

Downloadsweekly downloads

6

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability