mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
62553cdf92
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
40 lines
947 B
JavaScript
40 lines
947 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {
|
|
Component
|
|
} = Ember;
|
|
|
|
export default Component.extend({
|
|
actions: {
|
|
update() {
|
|
if (typeof this.attrs.update === 'function') {
|
|
this.attrs.update(...arguments);
|
|
}
|
|
},
|
|
|
|
onInput() {
|
|
if (typeof this.attrs.onInput === 'function') {
|
|
this.attrs.onInput(...arguments);
|
|
}
|
|
},
|
|
|
|
uploadStarted() {
|
|
if (typeof this.attrs.uploadStarted === 'function') {
|
|
this.attrs.uploadStarted(...arguments);
|
|
}
|
|
},
|
|
|
|
uploadFinished() {
|
|
if (typeof this.attrs.uploadFinished === 'function') {
|
|
this.attrs.uploadFinished(...arguments);
|
|
}
|
|
},
|
|
|
|
formChanged() {
|
|
if (typeof this.attrs.formChanged === 'function') {
|
|
this.attrs.formChanged(...arguments);
|
|
}
|
|
}
|
|
}
|
|
});
|