mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
0220cf2448
closes #937 - fixed bug where ![] is replaced with ![](http://) for image url - added fileStorage setting to uploader - added fileStorage helper (could become standard way of providing config data for frontend???) - added data element to editor and settings - if no config value is set fileStorage: true is default
37 lines
No EOL
1.1 KiB
JavaScript
37 lines
No EOL
1.1 KiB
JavaScript
/*global Ghost, Backbone, $ */
|
|
(function () {
|
|
'use strict';
|
|
Ghost.Models.uploadModal = Backbone.Model.extend({
|
|
|
|
options: {
|
|
close: true,
|
|
type: 'action',
|
|
style: ["wide"],
|
|
animation: 'fade',
|
|
afterRender: function (id) {
|
|
var filestorage = $('#' + this.options.model.id).data('filestorage');
|
|
this.$('.js-drop-zone').upload({fileStorage: filestorage});
|
|
},
|
|
confirm: {
|
|
reject: {
|
|
func: function () { // The function called on rejection
|
|
return true;
|
|
},
|
|
buttonClass: true,
|
|
text: "Cancel" // The reject button text
|
|
}
|
|
}
|
|
},
|
|
content: {
|
|
template: 'uploadImage'
|
|
},
|
|
|
|
initialize: function (options) {
|
|
this.options.id = options.id;
|
|
this.options.key = options.key;
|
|
this.options.src = options.src;
|
|
this.options.confirm.accept = options.accept;
|
|
}
|
|
});
|
|
|
|
}()); |