1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-25 12:47:40 +00:00

Drag and drop images in the editor to import and insert (#5699)

* Merge

* Clean up

* More clean up

* Ensure image import works when type is not set, clean up post import actions

* Removed spurious new line

* For non image files insert a tiddler link

* Added documentation for new settings and features
This commit is contained in:
Saq Imtiaz
2021-05-19 22:52:43 +02:00
committed by GitHub
parent c7f6cedc43
commit 05d38054c8
19 changed files with 301 additions and 28 deletions

View File

@@ -205,4 +205,16 @@ function parseJSONTiddlers(json,fallbackTitle) {
return data;
};
exports.dragEventContainsFiles = function(event) {
if(event.dataTransfer.types) {
for(var i=0; i<event.dataTransfer.types.length; i++) {
if(event.dataTransfer.types[i] === "Files") {
return true;
break;
}
}
}
return false;
};
})();