The Insert module ( https://drupal.org/project/insert ) adds links to image fields to insert the uploaded images into content.
By implementing hook_insert_widgets() it also works with the Drag & Drop Upload widget.. patch will follow

Comments

rv0’s picture

Status: Active » Needs review
StatusFileSize
new1.36 KB

To test, enable insert for the field. an insert button should appear in the rows of uploaded images.

  • Commit 2d4fba7 on 7.x-1.x authored by rv0, committed by WebEvt:
    Issue #2261153 by rv0: Added Insert integration
    
webevt’s picture

Hi, rv0!

Really, Insert module is a great module to integrate with. Thank you for your contribution!

Regards

webevt’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

amccaugh’s picture

Status: Closed (fixed) » Active

The patch works great for the Image field--but unfortunately it still doesn't apply to File fields. Can anyone help with this?

rv0’s picture

Probably an easy fix, try adding following code to dragndrop_upload_file.module (without the <?php ?> tags):

/**
 * Implementation of hook_insert_widgets()
 * - Provides integration support for the 'Insert' module
 */
function dragndrop_upload_file_insert_widgets() {
  return array(
 'dragndrop_upload_file' => array(
      'element_type' => 'dragndrop_upload',
      'wrapper' => '.file-widget',
      'fields' => array(
        'title' => 'input[name$="[title]"], textarea[name$="[title]"]',
        'description' => 'input[name$="[description]"], textarea[name$="[description]"]',
      ),
    ),
  );
}

Not tested, but I guess it's something like that ;)

amccaugh’s picture

Thank you! It worked perfectly.

For reference, I pasted the code rv0 provided to the bottom of the text file

/sites/all/modules/dragndrop_upload/modules/dragndrop_upload_file/dragndrop_upload_file.module

then I cleared the cache, ran cron, and disabled/reenabled the "Drag & Drop Upload: File field widget" module

rv0’s picture

Status: Active » Needs work

Great to hear :)
I think clearing the cache is more than enough.

I'm not on my development computer, so someone else will have to roll a patch

rv0’s picture

Status: Needs work » Needs review
StatusFileSize
new2.62 KB

Here's #7 in a patch.
This adds integration with file uploads (previous patch was images only)

The patch also corrects some whitespace issues in the file, my editor does this by default, I suggest the maintainers also configure their editor to do the same ;)

  • WebEvt committed 30e87a0 on 7.x-1.x authored by rv0
    Issue #2261153 by rv0: Added Insert integration for file fields
    
webevt’s picture

Status: Needs review » Fixed

Hi

Successfully committed the patch. Thank you for your contribution, rv0!

Regards

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rv0’s picture

Would be nice to roll a new release :)