close

Plugin Directory

Changeset 1014567


Ignore:
Timestamp:
10/27/2014 07:01:22 AM (11 years ago)
Author:
stianlik
Message:

Notes on media browser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pdf-thumbnails/trunk/readme.txt

    r984066 r1014567  
    2525- ImageMagick must be installed (http://www.php.net/manual/en/book.imagick.php) to generate thumbnails
    2626- GhostScript must be installed to read PDF-files
     27
     28== TODO ==
     29
     30Add generated image to media browser after upload.
     31
     32Outline of an implementation based on the javascript media API:
     33
     34// New uploads
     35wp.Uploader.queue.on('add', function (attachment) {
     36
     37    if (attachment.subtype !== 'pdf') {
     38        return;
     39    }
     40
     41    findThumbnailFor(attachment.ID).then(function (data) {
     42
     43        // Add attachment thumbnail to browser
     44        var attachment = wp.media.model.Attachment.get(id)
     45        attachment.fetch().done(function () {
     46            wp.media.editor.open().state().get('library').add(generated attachment)
     47        });
     48
     49    });
     50});
     51
     52Filter: ajax_query_attachments_args
Note: See TracChangeset for help on using the changeset viewer.