Skip to content
Snippets Groups Projects
Commit 0939f628 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Enable drag+drop and copy+paste in Redactor

parent c8ab7ffa
No related branches found
No related tags found
No related merge requests found
......@@ -95,20 +95,10 @@ RedactorPlugins.draft = {
$('input[name=draft_id]', this.$box.closest('form'))
.val(data.draft_id);
this.draft_id = data.draft_id;
var self = this;
getConfig().then(function(c) {
if (c.allow_attachments) {
self.opts.clipboardUploadUrl =
self.opts.imageUpload =
'ajax.php/draft/'+data.draft_id+'/attach';
self.opts.imageUploadErrorCallback = self.displayError;
// XXX: This happens in ::buildBindKeyboard() from
// ::buildAfter(). However, the imageUpload option is not
// known when the Redactor is init()'d
self.$editor.on('drop.redactor', $.proxy(self.buildEventDrop, self));
}
});
this.opts.clipboardUploadUrl =
this.opts.imageUpload =
'ajax.php/draft/'+data.draft_id+'/attach';
this.opts.imageUploadErrorCallback = this.displayError;
this.opts.original_autosave = this.opts.autosave;
this.opts.autosave = 'ajax.php/draft/'+data.draft_id;
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment