0.6.6 • Published 9 years ago

d-photo-upload v0.6.6

Weekly downloads
74
License
-
Repository
github
Last release
9 years ago

d-photo-upload

Component for "profile photo" uploading.

##Demo

https://derby-demos.herokuapp.com/d-photo-upload

##Install

npm install d-photo-upload

##Usage

app.use(require('d-photo-upload'));
<d-upload-photo on-uploaded="uploaded()" on-err="handleError()" url="/upload" 
	class="file-input" inputname="photo" src="{{_page.photo}}" lang="en"></d-upload-photo>

or

<d-photo-upload on-uploaded="uploaded()" on-err="handleError()" url="//upload" inputname="photo" src="{{_page.user.local.photo}}" alt="{{defaultPic()}}" spinner="{{weAreCropping}}" lang="fi"></d-photo-upload>

... here we tell the component to show a spinner while a certain variable (weAreCropping) is set to true.

  • on-uploaded the function to call when upload is ready.
  • on-err the function to call in case of an error. The event used is err because error is a bit more special in Derby.
  • url where to upload (url)
  • class the classname to give to the original file input field.
  • inputname the name attribute that will be given to the uploaded image. This will be given to the file input field as <input name="inputname" ... as well as to the file that is uploaded through XHR.
  • src the path to the photo url
  • lang for localization. The translations are held in the css file (index.styl).

Credits

https://github.com/lever/l-upload

0.6.6

9 years ago

0.6.5

9 years ago

0.6.4

9 years ago

0.6.3

9 years ago

0.6.2

9 years ago

0.6.0

9 years ago

0.5.10

9 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

10 years ago