I posted this in the spark project too, but I think it should've gone here instead (sorry don't know if its possible to move an issue between projects, I don't mean to cross-post). The issue is posted here in spark: http://drupal.org/node/1962448
At the moment its a field formatter (because we needed it in a view) for image fields in D7, but I think for edit integration it should become a widget instead.
I'm willing to contribute/develop this further to have this in edit/spark, if this sort of interaction seems usefull. If time permits i could try to make a small video of how it works. Basically you install the module and change the display formatter of a image_field to "Dropzone". If you view a node then, you can just drag and drop an image onto the dropzone (or replace/delete an existing image). The node is then automatically saved, without any extra clicks.
Thoughs, ideas good or bad, shoot, I love to hear it.
Comments
Comment #1
wim leersYes, it would need to become a widget :)
However, that probably doesn't really make sense when used in forms.
I think that what you want to achieve is to *not* have an in-place form editor appear, but instead have it appear "in-place" like CKEditor works in-place?
In that case, you can just implement a "dropzone" Create.js PropertyEditor widget (not to be confused with a Field API Widget). Look in Edit module's
js/createjs/editingWidgetsdirectory for the three implementations that Edit module ships with. This would need to live in its own module, with the following key parts:1) Implement
hook_edit_editor_info()and the related callbacks (see edit.api.php).2) in a
hook_library()implementation:3) Let Edit module know that your new Create.js PropertyEditor widget is actually usable by *any* image field for in-place editing.
Have fun, and I can't wait to see the end result! :) Let me know if you need more help.
How does this handle the image's Alt/Title (which can be part of an image field)? And a multivalued image field? Those are the tricky aspects.
Comment #2
wim leersComment #3
wim leersI think it's appropriate for us to keep tracking this :)
Comment #4
kriboogh commentedMultivalue is handled (I should make that video, that way you can see it in action), the alt and description are not in place but can be easily added i think. I'll try to cook something up, maybe later today or next week. Thanks for the pointers! :-)
Comment #5
kriboogh commentedOk i've created a new module 'dropzone' for this. I get a javascript error stating the 'dropzone' module is not found.
Uncaught Error: dropzone widget is not available
I compared my codewith the ckeditor and direct widgets in edit module, but I'm a bit stuck.
I have:
dropzone/js/createjs/editingWidgets/dropzonewidget.js
dropzone/includes/dropzone.editor.inc
dorpzone/dropzone.module
The dropzonewidget.js contains:
jQuery.widget('Midgard.dropzone', jQuery.Midgard.direct, {The dropzone.editor.inc contains:
The dropzone.module contains these hooks:
Anything i'm missing here?
Comment #6
kriboogh commentedOk I found my mistakes. I had to add the $options scope and weight in the library definition, also the module in the attachment callback was wrong.
moving on... :-)
Comment #7
wim leersThe first 'edit' should be the name of your module; now you're saying it's Edit module that ships with this library :)
Comment #8
wim leersThat was wrong for a while now.
Comment #8.0
wim leerstypo :-)
Comment #9
wim leersI've answered the support questions asked here, and this issue has been silent for ±6 months. Closing.