Ghost/ghost/admin/app/templates/components/gh-image-uploader-with-preview.hbs
Kevin Ansfield 62553cdf92 Replace jQuery-based uploader.js with ember components
no issue
- adds `gh-image-uploader` that handles image uploads in a fully ember fashion and with no dependency on `uploader.js`
- adds `gh-image-uploader-with-preview` that can fully replace the old `gh-uploader`
- replace uses of `gh-uploader` in PSM & TSM with `gh-image-uploader-with-preview`
- updates the editor preview image handling to use the new `gh-image-uploader-with-preview` component
- updates the image upload modal to use `gh-image-uploader` (utilises the `saveButton=false` flag which means the preview has to be handled externally to avoid auto-replacement when typing a URL)
- removes all old `uploader.js` related code
- adds custom `RequestEntityTooLargeError` and `UnsupportedMediaTypeError` errors to our `ajax` service
2016-04-05 12:03:20 +01:00

17 lines
518 B
Handlebars

{{#if image}}
<div class="gh-image-uploader --with-image">
<div><img src={{image}}></div>
<a class="image-cancel icon-trash" title="Delete" {{action remove}}>
<span class="hidden">Delete</span>
</a>
</div>
{{else}}
{{gh-image-uploader
text=text
update=(action 'update')
onInput=(action 'onInput')
uploadStarted=(action 'uploadStarted')
uploadFinished=(action 'uploadFinished')
formChanged=(action 'formChanged')}}
{{/if}}