WordPress.org

Plugin Directory

Changeset 1594582


Ignore:
Timestamp:
02/13/17 03:28:52 (7 months ago)
Author:
gitlost
Message:

v1.0.4

Location:
gs-only-pdf-preview/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • gs-only-pdf-preview/trunk/gs-only-pdf-preview.php

    r1592308 r1594582  
    44 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview 
    55 * Description: Uses Ghostscript directly to generate PDF previews. 
    6  * Version: 1.0.3 
     6 * Version: 1.0.4 
    77 * Author: gitlost 
    88 * Author URI: https://profiles.wordpress.org/gitlost 
     
    1717 
    1818// These need to be synced with "readme.txt". 
    19 define( 'GOPP_PLUGIN_VERSION', '1.0.3' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 
     19define( 'GOPP_PLUGIN_VERSION', '1.0.4' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 
    2020define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' ); 
    2121define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7.2' ); 
     
    231231                            ) ); 
    232232                            if ( $cnt > $num_updates + $num_fails ) { 
     233                                $num_ignores = $cnt - ( $num_updates + $num_fails ); 
    233234                                $admin_notices[] = array( 'warning', sprintf( 
    234235                                    /* translators: %s: formatted number of non-PDFs ignored. */ 
    235                                     _n( '%s non-PDF ignored.', '%s non-PDFs ignored.', $cnt, 'gs-only-pdf-preview' ), number_format_i18n( $cnt - ( $num_updates + $num_fails ) ) 
     236                                    _n( '%s non-PDF ignored.', '%s non-PDFs ignored.', $num_ignores, 'gs-only-pdf-preview' ), number_format_i18n( $num_ignores ) 
    236237                                ) ); 
    237238                            } 
     
    679680        // Using the fact that 'post_title' is only set for non-image/audio/video links. See wp.media.editor.send.attachment in "wp-includes/js/media-editor.js" (line 1018). 
    680681        if ( ! empty( $attachment['image-size'] ) && isset( $attachment['post_title'] ) && false === strpos( $html, '<img' ) ) { 
    681             $url = empty( $attachment['url'] ) ? '' : $attachment['url']; 
    682             $rel = ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url ); 
     682            $is_attachment_link = isset( $attachment['link_to'] ) && 'post' === $attachment['link_to']; 
     683            $url = $is_attachment_link ? get_attachment_link( $id ) : ( isset( $attachment['url'] ) ? $attachment['url'] : '' ); 
     684            $rel = $is_attachment_link; 
    683685 
    684686            // Based on wp_ajax_send_attachment_to_editor() in "wp-admin/includes/ajax-actions.php". 
  • gs-only-pdf-preview/trunk/includes/class-gopp-image-editor-gs.php

    r1592102 r1594582  
    229229        } 
    230230 
    231         // Check for suspect chars in base filename - same as $special_chars in sanitize_file_name() with ctrls, space and del added. 
    232         if ( preg_match( '/[?\[\]\/\\\\=<>:;,\'"&$#*()|~`!{}%+\x00-\x20\x7f]/', wp_basename( $file ) ) ) { 
     231        // Check for suspect chars in base filename - same as $special_chars in sanitize_file_name() with ctrls, space and del added 
     232        // but (for BC with common older uploads) with "+" removed - see #16226 for its addition (along with "%") Oct 2015. 
     233        if ( preg_match( '/[?\[\]\/\\\\=<>:;,\'"&$#*()|~`!{}%\x00-\x20\x7f]/', wp_basename( $file ) ) ) { 
    233234            return __( 'Unsupported file name.', 'gs-only-pdf-preview' ); 
    234235        } 
  • gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.js

    r1592308 r1594582  
    134134            attachment_details_with = '$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />\n$2', 
    135135            html_attachment_display_settings, 
    136             attachment_display_settings_re = /<option value="post">\n\s+<# if \( data\.model\.canEmbed \) { #>\n[^\n]+\n[^\n]+\n\s+<\/option>/, 
    137             attachment_display_settings_with = '<# if ( \'application\' !== data.type ) { #>\n$&\n<# } #>\n', 
     136            attachment_display_settings_re = /(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting">)/, 
     137            attachment_display_settings_with = '$1 || ( \'application\' === data.type && data.sizes )$2', 
    138138            attachment_display_settings2_re = /(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/, 
    139139            attachment_display_settings2_with = '$1\n<# if ( \'application\' === data.type ) { #>\n<option value="">\n' + gopp_plugin_params.document_link_only + '\n</option>\n<# } #>\n$2', 
     
    157157                } 
    158158 
    159                 // #39618 Removes "Attachment" option from Link To select of Attachment Details. 
     159                // #39618 Enables "Align" select of Attachment Display Settings. 
    160160                html_before = $tmpl_attachment_display_settings.html(); 
    161161                html_attachment_display_settings = html_before.replace( attachment_display_settings_re, attachment_display_settings_with ); 
     
    163163                    return false; 
    164164                } 
    165                 // #39618 Adds "Document Link Only" option to Size select of Attachment Details. 
     165                // #39618 Adds "Document Link Only" option to Size select of Attachment Display Settings. 
    166166                html_before = html_attachment_display_settings; 
    167167                html_attachment_display_settings = html_before.replace( attachment_display_settings2_re, attachment_display_settings2_with ); 
     
    218218            options.url = props.linkUrl; 
    219219        } 
     220        // gitlost begin. 
     221        if ( props.link ) { 
     222            // Want this to know whether to get_attachment_link() or not for link to Attachment Page as url could change if previously detached. 
     223            options.link_to = props.link; 
     224        } 
     225        // gitlost end. 
    220226 
    221227        if ( 'image' === attachment.type ) { 
     
    237243            html = wp.media.string.link( props ); 
    238244            options.post_title = props.title; 
    239             // Begin hack. 
     245            // gitlost begin. 
    240246            if ( 'application' === attachment.type && 'pdf' === attachment.subtype ) { 
    241247                _.each({ 
     
    247253                }); 
    248254            } 
    249             // End hack. 
     255            // gitlost end. 
    250256        } 
    251257 
  • gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js

    r1592308 r1594582  
    1 /*! gs-only-pdf-preview 1.0.3 2017-02-09 */ 
    2 var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d){var e=a(b.target),f=e.parents(".row-actions").first(),g=e.next();return a(".gopp_response",f.parent()).remove(),g.addClass("is-active"),a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;g.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",f.after(a(e))},success:function(b){g.removeClass("is-active"),a(".gopp_response",f.parent()).remove(),b?(b.error?f.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&f.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",f.parent()).html(b.img)):f.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),d.length?(a(".spinner",c.parent()).remove(),a(gopp_plugin_params.spinner).insertAfter(c)):(b.preventDefault(),a(".gopp_none",c.parent()).remove(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.post=function(){var b,c,d,e,f,g,h,i=/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,j='$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />\n$2',k=/<option value="post">\n\s+<# if \( data\.model\.canEmbed \) { #>\n[^\n]+\n[^\n]+\n\s+<\/option>/,l="<# if ( 'application' !== data.type ) { #>\n$&\n<# } #>\n",m=/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,n="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2",o=/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,p="$1 && 'image' === data.type $2";return wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length)?(e=b.html(),f=e.replace(i,j),e===f?!1:(e=c.html(),g=e.replace(k,l),e===g?!1:(e=g,g=e.replace(m,n),e===g?!1:(e=d.html(),h=e.replace(o,p),e===h?!1:!1===gopp_plugin.patch_39630()?!1:(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))):!1},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,"application"===b.type&&"pdf"===b.subtype&&_.each({align:"align",size:"image-size"},function(b,d){a[d]&&(c[b]=a[d])})),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment"),e=/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,f="$1( data.sizes.thumbnail || data.sizes.medium )$2( data.sizes.thumbnail || data.sizes.medium )$3";return d.length?(b=d.html(),c=b.replace(e,f),b===c?!1:(d.html(c),!0)):!1},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin.upload(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&gopp_plugin.post())})}(jQuery); 
     1/*! gs-only-pdf-preview 1.0.4 2017-02-13 */ 
     2var gopp_plugin=gopp_plugin||{};!function(a){"use strict";gopp_plugin.regen_pdf_preview=function(){var b=a("#gopp_regen_pdf_previews"),c=a(".gopp_regen_pdf_previews_form",b);b.length&&a('input[type="submit"]',c).click(function(d){var e,f,g=a(this),h=a(".notice, .updated",b),i=a(gopp_plugin_params.please_wait_msg),j=parseInt(a("#poll_cnt",c).val(),10),k=a("#poll_nonce",c).val();g.hide(),a(".gopp_regen_pdf_previews_form_hide",b).hide(),h.hide(),a("h1",b).first().after(i),e=a("#gopp_progress",b),f=function(){a.post(ajaxurl,{action:"gopp_poll_regen_pdf_previews",cnt:j,poll_nonce:k},function(a){a&&a.msg&&e.html(a.msg),setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)},"json")},a.browser&&a.browser.safari?(d.preventDefault(),a(".spinner",i).removeClass("is-active"),g.unbind("click"),setTimeout(function(){g.click()},0)):setTimeout(f,1e3*gopp_plugin_params.val.poll_interval)})},gopp_plugin.media_row_action=function(b,c,d){var e=a(b.target),f=e.parents(".row-actions").first(),g=e.next();return a(".gopp_response",f.parent()).remove(),g.addClass("is-active"),a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;g.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",f.after(a(e))},success:function(b){g.removeClass("is-active"),a(".gopp_response",f.parent()).remove(),b?(b.error?f.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&f.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",f.parent()).html(b.img)):f.after(a('<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+"</p></div>"))},timeout:1e3*gopp_plugin_params.val.min_time_limit}),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),d.length?(a(".spinner",c.parent()).remove(),a(gopp_plugin_params.spinner).insertAfter(c)):(b.preventDefault(),a(".gopp_none",c.parent()).remove(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.post=function(){var b,c,d,e,f,g,h,i=/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,j='$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />\n$2',k=/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting">)/,l="$1 || ( 'application' === data.type && data.sizes )$2",m=/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,n="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2",o=/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,p="$1 && 'image' === data.type $2";return wp.media&&wp.media.editor&&wp.media.editor.send&&"function"==typeof wp.media.editor.send.attachment&&(b=a("#tmpl-attachment-details"),c=a("#tmpl-attachment-display-settings"),d=a("#tmpl-image-details"),b.length&&c.length&&d.length)?(e=b.html(),f=e.replace(i,j),e===f?!1:(e=c.html(),g=e.replace(k,l),e===g?!1:(e=g,g=e.replace(m,n),e===g?!1:(e=d.html(),h=e.replace(o,p),e===h?!1:!1===gopp_plugin.patch_39630()?!1:(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))):!1},gopp_plugin.media_editor_send_attachment=function(a,b){var c,d,e=b.caption;return wp.media.view.settings.captions||delete b.caption,a=wp.media.string.props(a,b),c={id:b.id,post_content:b.description,post_excerpt:e},a.linkUrl&&(c.url=a.linkUrl),a.link&&(c.link_to=a.link),"image"===b.type?(d=wp.media.string.image(a),_.each({align:"align",size:"image-size",alt:"image_alt"},function(b,d){a[d]&&(c[b]=a[d])})):"video"===b.type?d=wp.media.string.video(a,b):"audio"===b.type?d=wp.media.string.audio(a,b):(d=wp.media.string.link(a),c.post_title=a.title,"application"===b.type&&"pdf"===b.subtype&&_.each({align:"align",size:"image-size"},function(b,d){a[d]&&(c[b]=a[d])})),wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:c,html:d,post_id:wp.media.view.settings.post.id})},gopp_plugin.patch_39630=function(){var b,c,d=a("#tmpl-attachment"),e=/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,f="$1( data.sizes.thumbnail || data.sizes.medium )$2( data.sizes.thumbnail || data.sizes.medium )$3";return d.length?(b=d.html(),c=b.replace(e,f),b===c?!1:(d.html(c),!0)):!1},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin.upload(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&gopp_plugin.post())})}(jQuery); 
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po

    r1592308 r1594582  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: GS Only PDF Preview 1.0.3\n" 
     5"Project-Id-Version: GS Only PDF Preview 1.0.4\n" 
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 
    77"preview\n" 
    8 "POT-Creation-Date: 2017-02-09 07:40+0000\n" 
    9 "PO-Revision-Date: 2017-02-09 07:40+0000\n" 
     8"POT-Creation-Date: 2017-02-13 03:13+0000\n" 
     9"PO-Revision-Date: 2017-02-13 03:13+0000\n" 
    1010"Last-Translator: gitlost <gitlost@gitlostbonger.com>\n" 
    1111"Language-Team: \n" 
     
    125125 
    126126#. translators: %s: formatted number of non-PDFs ignored. 
    127 #: gs-only-pdf-preview.php:235 
     127#: gs-only-pdf-preview.php:236 
    128128msgid "%s non-PDF ignored." 
    129129msgid_plural "%s non-PDFs ignored." 
     
    131131msgstr[1] "%s non PDFs ignorés." 
    132132 
    133 #: gs-only-pdf-preview.php:240 
     133#: gs-only-pdf-preview.php:241 
    134134msgid "Nothing updated!" 
    135135msgstr "Rien mis à jour&nbsp;!" 
    136136 
    137137#. translators: %s: formatted number of non-PDFs ignored. 
    138 #: gs-only-pdf-preview.php:244 
     138#: gs-only-pdf-preview.php:245 
    139139msgid "Nothing updateable! %s non-PDF ignored." 
    140140msgid_plural "Nothing updateable! %s non-PDFs ignored." 
     
    143143 
    144144#. translators: %s: formatted number of PDF previews that failed to regenerate. 
    145 #: gs-only-pdf-preview.php:251 
     145#: gs-only-pdf-preview.php:252 
    146146msgid "%s PDF preview not regenerated." 
    147147msgid_plural "%s PDF previews not regenerated." 
     
    149149msgstr[1] "%s aperçus de miniature de PDF non régénérés." 
    150150 
    151 #: gs-only-pdf-preview.php:257 
     151#: gs-only-pdf-preview.php:258 
    152152msgid "You can go again below if you want." 
    153153msgstr "Vous pouvez aller de nouveau ci-dessous si vous voulez." 
    154154 
    155 #: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449 
    156 #: gs-only-pdf-preview.php:543 
     155#: gs-only-pdf-preview.php:296 gs-only-pdf-preview.php:450 
     156#: gs-only-pdf-preview.php:544 
    157157msgid "Regenerate PDF Previews" 
    158158msgstr "Régénérer les aperçus de miniature de PDF" 
    159159 
    160 #: gs-only-pdf-preview.php:295 
     160#: gs-only-pdf-preview.php:296 
    161161msgid "Regen. PDF Previews" 
    162162msgstr "Régén. aperçus PDF" 
    163163 
    164 #: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414 
    165 #: gs-only-pdf-preview.php:614 
     164#: gs-only-pdf-preview.php:310 gs-only-pdf-preview.php:415 
     165#: gs-only-pdf-preview.php:615 
    166166msgid "Sorry, you are not allowed to access this page." 
    167167msgstr "" 
     
    169169"page. " 
    170170 
    171 #: gs-only-pdf-preview.php:420 
     171#: gs-only-pdf-preview.php:421 
    172172msgid "GS Only PDF Preview - Regenerate PDF Previews" 
    173173msgstr "GS Only PDF Preview -  Régénérer les aperçus de miniature de PDF." 
    174174 
    175 #: gs-only-pdf-preview.php:425 
     175#: gs-only-pdf-preview.php:426 
    176176msgid "" 
    177177"This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " 
     
    181181"fichier PDF n&rsquo;a été téléchargé, donc il n&rsquo;a rien à faire." 
    182182 
    183 #: gs-only-pdf-preview.php:432 
     183#: gs-only-pdf-preview.php:433 
    184184msgid "" 
    185185"<strong>Warning: cannot set max execution time!</strong> The maximum time " 
     
    192192"donc éprouver l&rsquo;écran blanc de mort (WSOD) en essayant ceci." 
    193193 
    194 #: gs-only-pdf-preview.php:441 
     194#: gs-only-pdf-preview.php:442 
    195195msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 
    196196msgstr "" 
     
    199199 
    200200#. translators: %s: formatted number of PDFs found. 
    201 #: gs-only-pdf-preview.php:446 
     201#: gs-only-pdf-preview.php:447 
    202202msgid "<strong>%s</strong> PDF has been found." 
    203203msgid_plural "<strong>%s</strong> PDFs have been found." 
     
    206206 
    207207#. translators: %s: formatted number (greater than 10) of PDFs found. 
    208 #: gs-only-pdf-preview.php:454 
     208#: gs-only-pdf-preview.php:455 
    209209msgid "Regenerating %s PDF previews can take a long time." 
    210210msgstr "" 
     
    212212 
    213213#. translators: %s: url to the Media Library page in list mode. 
    214 #: gs-only-pdf-preview.php:466 
     214#: gs-only-pdf-preview.php:467 
    215215msgid "" 
    216216"Note that you can also regenerate PDF previews in batches or individually " 
     
    225225"<a href=\"%s\">mode de liste de la bibliothèque des médias</a>." 
    226226 
    227 #: gs-only-pdf-preview.php:505 
     227#: gs-only-pdf-preview.php:506 
    228228msgid "Please wait..." 
    229229msgstr "S&rsquo;il vous plaît attendre..." 
    230230 
    231 #: gs-only-pdf-preview.php:509 
     231#: gs-only-pdf-preview.php:510 
    232232msgid "No items selected!" 
    233233msgstr "Aucun élément sélectionné&nbsp;!" 
    234234 
    235 #: gs-only-pdf-preview.php:510 
     235#: gs-only-pdf-preview.php:511 
    236236msgid "Regenerate Preview ajax action not available!" 
    237237msgstr "" 
    238238"L&rsquo;action de régénérer l&rsquo;aperçu n&rsquo;est pas disponible&nbsp;!" 
    239239 
    240 #: gs-only-pdf-preview.php:514 
     240#: gs-only-pdf-preview.php:515 
    241241msgid "Document Link Only" 
    242242msgstr "Lien de document seulement" 
    243243 
    244244#. translators: %s: attachment title 
    245 #: gs-only-pdf-preview.php:598 
     245#: gs-only-pdf-preview.php:599 
    246246msgid "Regenerate the PDF preview for &#8220;%s&#8221;" 
    247247msgstr "Régénérer l&rsquo;aperçu de miniature de PDF pour &#8220;%s&#8221;" 
    248248 
    249 #: gs-only-pdf-preview.php:599 
     249#: gs-only-pdf-preview.php:600 
    250250msgid "Regenerate&nbsp;Preview" 
    251251msgstr "Régénérer&nbsp;l&rsquo;aperçu" 
    252252 
    253 #: gs-only-pdf-preview.php:619 
     253#: gs-only-pdf-preview.php:620 
    254254msgid "Invalid nonce." 
    255255msgstr "Nonce invalide." 
    256256 
    257 #: gs-only-pdf-preview.php:622 
     257#: gs-only-pdf-preview.php:623 
    258258msgid "Invalid ID." 
    259259msgstr "Identifiant invalide." 
    260260 
    261 #: gs-only-pdf-preview.php:628 
     261#: gs-only-pdf-preview.php:629 
    262262msgid "Failed to generate the PDF preview." 
    263263msgstr "Échec de générer l&rsquo;aperçu de miniature de PDF." 
    264264 
    265 #: gs-only-pdf-preview.php:633 
     265#: gs-only-pdf-preview.php:634 
    266266msgid "" 
    267267"Successfully regenerated the PDF preview. It's best to refresh your browser " 
     
    272272"jour correctement." 
    273273 
    274 #: gs-only-pdf-preview.php:635 
     274#: gs-only-pdf-preview.php:636 
    275275msgid "" 
    276276"Successfully regenerated the PDF preview. You will need to refresh your " 
     
    282282#. translators: %1$d: percentage of PDF previews completed; %2$d: completed 
    283283#. count. 
    284 #: gs-only-pdf-preview.php:664 
     284#: gs-only-pdf-preview.php:665 
    285285msgid "%d%% (%d)" 
    286286msgstr "%d%% (%d)" 
     
    311311 
    312312#: includes/class-gopp-image-editor-gs.php:228 
    313 #: includes/class-gopp-image-editor-gs.php:233 
     313#: includes/class-gopp-image-editor-gs.php:234 
    314314msgid "Unsupported file name." 
    315315msgstr "Nom du fichier non supporté." 
    316316 
    317 #: includes/class-gopp-image-editor-gs.php:243 
     317#: includes/class-gopp-image-editor-gs.php:244 
    318318msgid "File doesn&#8217;t exist?" 
    319319msgstr "Le fichier n&rsquo;existe pas&nbsp;?" 
    320320 
    321 #: includes/class-gopp-image-editor-gs.php:250 
     321#: includes/class-gopp-image-editor-gs.php:251 
    322322msgid "File is not a PDF." 
    323323msgstr "Le fichier n&rsquo;est pas un PDF ." 
    324324 
    325 #: includes/class-gopp-image-editor-gs.php:632 
     325#: includes/class-gopp-image-editor-gs.php:633 
    326326msgid "Attempted to set PDF preview resolution to an invalid value." 
    327327msgstr "" 
     
    329329"valeur non valide." 
    330330 
    331 #: includes/class-gopp-image-editor-gs.php:687 
     331#: includes/class-gopp-image-editor-gs.php:688 
    332332msgid "Attempted to set PDF preview page to an invalid value." 
    333333msgstr "" 
     
    335335"non valide." 
    336336 
    337 #: includes/class-gopp-image-editor-gs.php:706 
    338 #: includes/class-gopp-image-editor-gs.php:727 
    339 #: includes/class-gopp-image-editor-gs.php:746 
    340 #: includes/class-gopp-image-editor-gs.php:759 
    341 #: includes/class-gopp-image-editor-gs.php:773 
    342 #: includes/class-gopp-image-editor-gs.php:786 
     337#: includes/class-gopp-image-editor-gs.php:707 
     338#: includes/class-gopp-image-editor-gs.php:728 
     339#: includes/class-gopp-image-editor-gs.php:747 
     340#: includes/class-gopp-image-editor-gs.php:760 
     341#: includes/class-gopp-image-editor-gs.php:774 
     342#: includes/class-gopp-image-editor-gs.php:787 
    343343msgid "Unsupported operation." 
    344344msgstr "Opération non supportée." 
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot

    r1592308 r1594582  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: GS Only PDF Preview 1.0.3\n" 
     5"Project-Id-Version: GS Only PDF Preview 1.0.4\n" 
    66"Report-Msgid-Bugs-To: " 
    77"https://wordpress.org/support/plugin/gs-only-pdf-preview\n" 
     
    102102msgstr[1] "" 
    103103 
    104 #: gs-only-pdf-preview.php:235 
     104#: gs-only-pdf-preview.php:236 
    105105#. translators: %s: formatted number of non-PDFs ignored. 
    106106msgid "%s non-PDF ignored." 
     
    109109msgstr[1] "" 
    110110 
    111 #: gs-only-pdf-preview.php:240 
     111#: gs-only-pdf-preview.php:241 
    112112msgid "Nothing updated!" 
    113113msgstr "" 
    114114 
    115 #: gs-only-pdf-preview.php:244 
     115#: gs-only-pdf-preview.php:245 
    116116#. translators: %s: formatted number of non-PDFs ignored. 
    117117msgid "Nothing updateable! %s non-PDF ignored." 
     
    120120msgstr[1] "" 
    121121 
    122 #: gs-only-pdf-preview.php:251 
     122#: gs-only-pdf-preview.php:252 
    123123#. translators: %s: formatted number of PDF previews that failed to regenerate. 
    124124msgid "%s PDF preview not regenerated." 
     
    127127msgstr[1] "" 
    128128 
    129 #: gs-only-pdf-preview.php:257 
     129#: gs-only-pdf-preview.php:258 
    130130msgid "You can go again below if you want." 
    131131msgstr "" 
    132132 
    133 #: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449 
    134 #: gs-only-pdf-preview.php:543 
     133#: gs-only-pdf-preview.php:296 gs-only-pdf-preview.php:450 
     134#: gs-only-pdf-preview.php:544 
    135135msgid "Regenerate PDF Previews" 
    136136msgstr "" 
    137137 
    138 #: gs-only-pdf-preview.php:295 
     138#: gs-only-pdf-preview.php:296 
    139139msgid "Regen. PDF Previews" 
    140140msgstr "" 
    141141 
    142 #: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414 
    143 #: gs-only-pdf-preview.php:614 
     142#: gs-only-pdf-preview.php:310 gs-only-pdf-preview.php:415 
     143#: gs-only-pdf-preview.php:615 
    144144msgid "Sorry, you are not allowed to access this page." 
    145145msgstr "" 
    146146 
    147 #: gs-only-pdf-preview.php:420 
     147#: gs-only-pdf-preview.php:421 
    148148msgid "GS Only PDF Preview - Regenerate PDF Previews" 
    149149msgstr "" 
    150150 
    151 #: gs-only-pdf-preview.php:425 
     151#: gs-only-pdf-preview.php:426 
    152152msgid "" 
    153153"This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " 
     
    155155msgstr "" 
    156156 
    157 #: gs-only-pdf-preview.php:432 
     157#: gs-only-pdf-preview.php:433 
    158158msgid "" 
    159159"<strong>Warning: cannot set max execution time!</strong> The maximum time " 
     
    162162msgstr "" 
    163163 
    164 #: gs-only-pdf-preview.php:441 
     164#: gs-only-pdf-preview.php:442 
    165165msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 
    166166msgstr "" 
    167167 
    168 #: gs-only-pdf-preview.php:446 
     168#: gs-only-pdf-preview.php:447 
    169169#. translators: %s: formatted number of PDFs found. 
    170170msgid "<strong>%s</strong> PDF has been found." 
     
    173173msgstr[1] "" 
    174174 
    175 #: gs-only-pdf-preview.php:454 
     175#: gs-only-pdf-preview.php:455 
    176176#. translators: %s: formatted number (greater than 10) of PDFs found. 
    177177msgid "Regenerating %s PDF previews can take a long time." 
    178178msgstr "" 
    179179 
    180 #: gs-only-pdf-preview.php:466 
     180#: gs-only-pdf-preview.php:467 
    181181#. translators: %s: url to the Media Library page in list mode. 
    182182msgid "" 
     
    187187msgstr "" 
    188188 
    189 #: gs-only-pdf-preview.php:505 
     189#: gs-only-pdf-preview.php:506 
    190190msgid "Please wait..." 
    191191msgstr "" 
    192192 
    193 #: gs-only-pdf-preview.php:509 
     193#: gs-only-pdf-preview.php:510 
    194194msgid "No items selected!" 
    195195msgstr "" 
    196196 
    197 #: gs-only-pdf-preview.php:510 
     197#: gs-only-pdf-preview.php:511 
    198198msgid "Regenerate Preview ajax action not available!" 
    199199msgstr "" 
    200200 
    201 #: gs-only-pdf-preview.php:514 
     201#: gs-only-pdf-preview.php:515 
    202202msgid "Document Link Only" 
    203203msgstr "" 
    204204 
    205 #: gs-only-pdf-preview.php:598 
     205#: gs-only-pdf-preview.php:599 
    206206#. translators: %s: attachment title 
    207207msgid "Regenerate the PDF preview for &#8220;%s&#8221;" 
    208208msgstr "" 
    209209 
    210 #: gs-only-pdf-preview.php:599 
     210#: gs-only-pdf-preview.php:600 
    211211msgid "Regenerate&nbsp;Preview" 
    212212msgstr "" 
    213213 
    214 #: gs-only-pdf-preview.php:619 
     214#: gs-only-pdf-preview.php:620 
    215215msgid "Invalid nonce." 
    216216msgstr "" 
    217217 
    218 #: gs-only-pdf-preview.php:622 
     218#: gs-only-pdf-preview.php:623 
    219219msgid "Invalid ID." 
    220220msgstr "" 
    221221 
    222 #: gs-only-pdf-preview.php:628 
     222#: gs-only-pdf-preview.php:629 
    223223msgid "Failed to generate the PDF preview." 
    224224msgstr "" 
    225225 
    226 #: gs-only-pdf-preview.php:633 
     226#: gs-only-pdf-preview.php:634 
    227227msgid "" 
    228228"Successfully regenerated the PDF preview. It's best to refresh your browser " 
     
    230230msgstr "" 
    231231 
    232 #: gs-only-pdf-preview.php:635 
     232#: gs-only-pdf-preview.php:636 
    233233msgid "" 
    234234"Successfully regenerated the PDF preview. You will need to refresh your " 
     
    236236msgstr "" 
    237237 
    238 #: gs-only-pdf-preview.php:664 
     238#: gs-only-pdf-preview.php:665 
    239239#. translators: %1$d: percentage of PDF previews completed; %2$d: completed 
    240240#. count. 
     
    267267 
    268268#: includes/class-gopp-image-editor-gs.php:228 
    269 #: includes/class-gopp-image-editor-gs.php:233 
     269#: includes/class-gopp-image-editor-gs.php:234 
    270270msgid "Unsupported file name." 
    271271msgstr "" 
    272272 
    273 #: includes/class-gopp-image-editor-gs.php:243 
     273#: includes/class-gopp-image-editor-gs.php:244 
    274274msgid "File doesn&#8217;t exist?" 
    275275msgstr "" 
    276276 
    277 #: includes/class-gopp-image-editor-gs.php:250 
     277#: includes/class-gopp-image-editor-gs.php:251 
    278278msgid "File is not a PDF." 
    279279msgstr "" 
    280280 
    281 #: includes/class-gopp-image-editor-gs.php:632 
     281#: includes/class-gopp-image-editor-gs.php:633 
    282282msgid "Attempted to set PDF preview resolution to an invalid value." 
    283283msgstr "" 
    284284 
    285 #: includes/class-gopp-image-editor-gs.php:687 
     285#: includes/class-gopp-image-editor-gs.php:688 
    286286msgid "Attempted to set PDF preview page to an invalid value." 
    287287msgstr "" 
    288288 
    289 #: includes/class-gopp-image-editor-gs.php:706 
    290 #: includes/class-gopp-image-editor-gs.php:727 
    291 #: includes/class-gopp-image-editor-gs.php:746 
    292 #: includes/class-gopp-image-editor-gs.php:759 
    293 #: includes/class-gopp-image-editor-gs.php:773 
    294 #: includes/class-gopp-image-editor-gs.php:786 
     289#: includes/class-gopp-image-editor-gs.php:707 
     290#: includes/class-gopp-image-editor-gs.php:728 
     291#: includes/class-gopp-image-editor-gs.php:747 
     292#: includes/class-gopp-image-editor-gs.php:760 
     293#: includes/class-gopp-image-editor-gs.php:774 
     294#: includes/class-gopp-image-editor-gs.php:787 
    295295msgid "Unsupported operation." 
    296296msgstr "" 
  • gs-only-pdf-preview/trunk/readme.txt

    r1592308 r1594582  
    44Requires at least: 4.7.0 
    55Tested up to: 4.7.2 
    6 Stable tag: 1.0.3 
     6Stable tag: 1.0.4 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1818= Background = 
    1919 
    20 The plugin was prompted by the demonstration `WP_Image_Editor_Imagick_External` class uploaded to the WP Trac ticket [#39262 Fall back to ImageMagick command line when the pecl imagic is not available on the server](https://core.trac.wordpress.org/ticket/39262) by [Hristo Pandjarov](https://profiles.wordpress.org/hristo-sg), and by the wish to solve the WP Trac ticket [#39216 PDFs with non-opaque alpha channels can result in previews with black backgrounds.](https://core.trac.wordpress.org/ticket/39216), which particularly affects PDFs with CMYK color spaces (common in the print world). 
     20The plugin was prompted by the `WP_Image_Editor_Imagick_External` demonstration class uploaded to the WP Trac ticket [#39262 Fall back to ImageMagick command line when the pecl imagic is not available on the server](https://core.trac.wordpress.org/ticket/39262) by [Hristo Pandjarov](https://profiles.wordpress.org/hristo-sg), and by the wish to solve the WP Trac ticket [#39216 PDFs with non-opaque alpha channels can result in previews with black backgrounds.](https://core.trac.wordpress.org/ticket/39216), which particularly affects PDFs with CMYK color spaces (common in the print world). 
    2121 
    2222The plugin by-passes (as far as PDF previews are concerned) #39216, and also by-passes the related issue [#39331 unsharpMaskImage in Imagick's thumbnail_image is not compatible with CMYK jpegs.](https://core.trac.wordpress.org/ticket/39331), as the preview jpegs produced directly by Ghostscript use sRGB color spaces. 
     
    5050= Tool = 
    5151 
    52 A basic administration tool to regenerate (or generate, if they previously didn't have a preview) the previews of all PDFs uploaded to the system is included (any previously generated intermediate preview thumbnails will be removed if their dimensions differ). Note that if you have a lot of PDFs you may experience the White Screen Of Death (WSOD) if the tool exceeds the [maximum execution time](http://php.net/manual/en/info.configuration.php#ini.max-execution-time) allowed. Note also that as the filenames of the previews don't (normally) change, you will probably have to refresh your browser to see the updated thumbnails. 
     52A basic administration tool to regenerate (or generate, if they previously didn't have a preview) the previews of all PDFs uploaded to the system is included (any previously generated intermediate preview thumbnails will be removed if their dimensions differ). Note that if you have a lot of PDFs you may experience the White Screen Of Death (WSOD) if the tool exceeds the [maximum execution time](http://php.net/manual/en/info.configuration.php#ini.max-execution-time) allowed. Note also that as the file names of the previews don't (normally) change, you will probably have to refresh your browser to see the updated thumbnails. 
    5353 
    5454As workarounds for the possible WSOD issue above, and as facilities in themselves, a "Regenerate PDF Previews" bulk action is added to the list mode of the Media Library, and a "Regenerate Preview" row action is added to each PDF entry in the list. So previews can be regenerated in batches or individually instead. 
     
    130130== Changelog == 
    131131 
     132= 1.0.4 (13 Feb 2017) = 
     133* Remove "+" from banned characters in file name, for BC with older uploads. 
     134* Enable "Align" select of Attachment Display Settings. 
     135* Workaround changing Attachment Page url and revert remove Attachment from Link To for pdfs. 
     136 
    132137= 1.0.3 (9 Feb 2017) = 
    133138* Add dummy srcset on linked preview thumbnail so that wp_make_content_images_responsive() ignores it. 
     
    152157== Upgrade Notice == 
    153158 
     159= 1.0.4 = 
     160Allows file names containing "+". 
     161 
    154162= 1.0.3 = 
    155163Avoids PHP warning on linked pdf thumbnails. 
Note: See TracChangeset for help on using the changeset viewer.