Fixed attachment base-url usage and non-existant images

Images now self-delete if the original file does not exist.
Prevents simply getting non-fixable errors.

Also cleaned some JS.
This commit is contained in:
Dan Brown
2016-11-12 12:41:34 +00:00
parent ac80723058
commit 672b15d36c
5 changed files with 32 additions and 25 deletions

View File

@ -6,11 +6,11 @@
* @param editor - editor instance
*/
function editorPaste(e, editor) {
if (!e.clipboardData) return
if (!e.clipboardData) return;
let items = e.clipboardData.items;
if (!items) return;
for (let i = 0; i < items.length; i++) {
if (items[i].type.indexOf("image") === -1) return
if (items[i].type.indexOf("image") === -1) return;
let file = items[i].getAsFile();
let formData = new FormData();