0.2.0 • Published 7 years ago

ember-cli-cloudinary v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

ember-cli-cloudinary

Ember addon for Cloudinary

Installation

ember install ember-cli-cloudinary

Add your cloud name & api key to config/environment.js ENV:

cloudinary: {
  cloudName: 'some_cloud_name',
  apiKey: 'some_api_key'
},

Components

cloudinary-image

This component will render an <img> built from a cloudinary url and options.

{{cloudinary-image 'imageId' (hash width=100)}}

Width and height attributes are set on the img tag as well as passed to cloudinary, allowing you to specify the resolution via the "dpr" attribute.

{{cloudinary-image 'imageId' (hash width=100 height=100 dpr="2.0")}}

cloudinary-direct-file

This component will sign and upload a file directly to Cloudinary from the browser. After a successful upload it will pass the signed response to your server.

{{cloudinary-direct-file signatureEndpoint='/sign_upload'}}

Set signatureEndpoint to the API endpoint that signs your cloudinary direct upload requests.

You can also set an action for different events. For example when the file is done uploading:

{{cloudinary-direct-file signatureEndpoint='/sign_upload' onUploadDone=(action 'showThumbnail')}}

Options

optiondefaultInfo
name'file'Name of the input
multiplefalseTrue if you want to upload more than one file
accept'image/jpeg,image/gif,image/png'Files types allowed in the input type file
styleEmber.String.htmlSafe("")Component style
signatureEndpointnullSigns your cloudinary direct upload requests
disableImageResizenull-
imageMaxWidth10000000Image max width
imageMaxHeight10000000Image max height
acceptFileTypesRegex with image extensionsFiles extension allowed (checked by code)
maxFileSize50000000Max File Size
loadImageMaxFileSize50000000Load Image Max File Size

Events

EventInfo
onUploadDoneFile uploaded
fileProgressFile progress
allFileProgressMore than one file progress
onUploadStartUpload Starts
onUploadStopUpload Stops
onUploadFailUpload Fails
onUploadAlwaysUpload Always

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server
0.2.0

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago