Atto editor new drag-and-drop plugin to import Word content - problem triggering drop event

Atto editor new drag-and-drop plugin to import Word content - problem triggering drop event

by Eoin Campbell -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I have started trying to implement a new Atto editor plugin that would enable users to import text content from an external file, such as a Word file.

I copied code from the image plugin (/lib/editor/atto/plugins/image) and also looked at Justin Hunts template for new plugins at https://github.com/justinhunt/moodle-atto_newtemplate.

Unfortunately I don't know much about jQuery, so I'm struggling a bit, but I can click on a button to get the editor to open a file selector dialog box, and upload a Word file.

However, I cannot get it to recognise a drag-and-drop event where I drag a Word file into the text area field. This event correctly triggers the Image drag-and-drop handler, which exits once it realises that the dragged item is not an image.

My understanding is that each of the 'drop' event handlers attached to the editor should be called in sequence, so that after figuring out that the dropped item is not an image, my event handler should be called next, but this doesn't happen. 

I disabled the 'image' plugin, and my event handler is then called, as I expected.

Am I missing something?

Average of ratings: -