Changeset 1592102
- Timestamp:
- 02/08/2017 11:04:34 PM (9 years ago)
- Location:
- gs-only-pdf-preview/trunk
- Files:
-
- 8 edited
-
gs-only-pdf-preview.php (modified) (12 diffs)
-
includes/class-gopp-image-editor-gs.php (modified) (2 diffs)
-
js/gs-only-pdf-preview.js (modified) (3 diffs)
-
js/gs-only-pdf-preview.min.js (modified) (1 diff)
-
languages/gs-only-pdf-preview-fr_FR.mo (modified) (previous)
-
languages/gs-only-pdf-preview-fr_FR.po (modified) (26 diffs)
-
languages/gs-only-pdf-preview.pot (modified) (20 diffs)
-
readme.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gs-only-pdf-preview/trunk/gs-only-pdf-preview.php
r1578987 r1592102 4 4 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview 5 5 * Description: Uses Ghostscript directly to generate PDF previews. 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Author: gitlost 8 8 * Author URI: https://profiles.wordpress.org/gitlost … … 17 17 18 18 // These need to be synced with "readme.txt". 19 define( 'GOPP_PLUGIN_VERSION', '1.0. 1' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".19 define( 'GOPP_PLUGIN_VERSION', '1.0.2' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 20 20 define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' ); 21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7. 1' );21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7.2' ); 22 22 23 23 define( 'GOPP_REGEN_PDF_PREVIEWS_SLUG', 'gopp-regen-pdf-previews' ); … … 32 32 static $per_pdf_secs = 20; // Seconds to allow for regenerating the preview of each PDF in the "Regen. PDF Previews" administraion tool. 33 33 static $min_time_limit = 300; // Minimum seconds to set max execution time to on doing regeneration. 34 static $poll_interval = 2; // How often to poll for progress info in seconds.34 static $poll_interval = 1; // How often to poll for progress info in seconds. 35 35 static $timing_dec_places = 1; // Number of decimal places to show on time (in seconds) taken. 36 36 … … 55 55 add_action( 'current_screen', array( __CLASS__, 'current_screen' ) ); 56 56 add_action( 'media_row_actions', array( __CLASS__, 'media_row_actions' ), 100, 3 ); // Add after (most) others due to spinner. 57 } else { 58 add_filter( 'media_send_to_editor', array( __CLASS__, 'media_send_to_editor' ), 10, 3 ); 57 59 } 58 60 add_action( 'wp_ajax_gopp_media_row_action', array( __CLASS__, 'gopp_media_row_action' ) ); … … 331 333 */ 332 334 static function do_regen_pdf_previews( $ids, $check_mime_type = false, $do_transient = true ) { 335 static $upload_dir = null, $basedir = null; 333 336 334 337 $cnt = $num_updates = $num_fails = $time = 0; … … 349 352 $num_fails++; 350 353 } else { 354 // Get current metadata if any. 355 $old_value = get_metadata( 'post', $id, '_wp_attachment_metadata' ); 356 if ( $old_value && ( ! is_array( $old_value ) || 1 !== count( $old_value ) ) ) { 357 $old_value = null; 358 } 359 // Remove old intermediate thumbnails if any. 360 if ( $old_value && ! empty( $old_value[0]['sizes'] ) && is_array( $old_value[0]['sizes'] ) ) { 361 if ( null === $upload_dir ) { 362 $upload_dir = wp_get_upload_dir(); 363 $basedir = $upload_dir['basedir']; 364 } 365 $dirname = dirname( $file ) . '/'; 366 foreach ( $old_value[0]['sizes'] as $sizeinfo ) { 367 $intermediate_file = $dirname . $sizeinfo['file']; 368 @ unlink( path_join( $basedir, $intermediate_file ) ); 369 } 370 } 371 // Generate new intermediate thumbnails. 351 372 $meta = wp_generate_attachment_metadata( $id, $file ); 352 373 if ( ! $meta ) { … … 354 375 } else { 355 376 // wp_update_attachment_metadata() returns false if nothing to update so check first. 356 $old_value = get_metadata( 'post', $id, '_wp_attachment_metadata' ); 357 if ( ( $old_value && is_array( $old_value ) && 1 === count( $old_value ) && $old_value[0] === $meta ) || false !== wp_update_attachment_metadata( $id, $meta ) ) { 377 if ( ( $old_value && $old_value[0] === $meta ) || false !== wp_update_attachment_metadata( $id, $meta ) ) { 358 378 $num_updates++; 359 379 } else { … … 465 485 */ 466 486 static function admin_enqueue_scripts( $hook_suffix ) { 467 if ( self::$hook_suffix === $hook_suffix || 'upload.php' === $hook_suffix ) {487 if ( self::$hook_suffix === $hook_suffix || 'upload.php' === $hook_suffix || 'post-new.php' === $hook_suffix || 'post.php' === $hook_suffix ) { 468 488 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 469 489 $is_regen_pdf_preview = self::$hook_suffix === $hook_suffix; 470 490 $is_upload = 'upload.php' === $hook_suffix; 491 $is_post = 'post-new.php' === $hook_suffix || 'post.php' === $hook_suffix; 471 492 472 493 wp_enqueue_script( 'gs-only-pdf-preview', plugins_url( "js/gs-only-pdf-preview{$suffix}.js", __FILE__ ), array( 'jquery', 'jquery-migrate' ), GOPP_PLUGIN_VERSION ); … … 478 499 'is_regen_pdf_preview' => $is_regen_pdf_preview, 479 500 'is_upload' => $is_upload, 501 'is_post' => $is_post, 480 502 ), 481 503 ); … … 489 511 $params['spinner'] = self::spinner( 5, true /*is_active*/ ); 490 512 $params['val']['min_time_limit'] = self::$min_time_limit; 513 } elseif ( $is_post ) { 514 $params['document_link_only'] = __( 'Document Link Only', 'gs-only-pdf-preview' ); 491 515 } 492 516 $params = apply_filters( 'gopp_plugin_params', $params ); … … 530 554 if ( 'gopp_regen_pdf_previews' === $doaction && current_user_can( self::$cap ) ) { 531 555 // Note nonce has already been checked in "wp-admin/upload.php". 532 // But $post_ids hasn't (and triggers a PHP Warning if nothing selected in "wp-admin/upload.php:168" as of WP 4.7. 1).556 // But $post_ids hasn't (and triggers a PHP Warning if nothing selected in "wp-admin/upload.php:168" as of WP 4.7.2). 533 557 $ids = $post_ids && is_array( $post_ids ) ? array_map( 'intval', $post_ids ) : array(); 534 558 … … 648 672 wp_send_json( $ret ); 649 673 } 674 675 /** 676 * Called on 'media_send_to_editor' filter. 677 */ 678 static function media_send_to_editor( $html, $id, $attachment ) { 679 // 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). 680 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 ); 683 684 // Based on wp_ajax_send_attachment_to_editor() in "wp-admin/includes/ajax-actions.php". 685 $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none'; 686 $size = $attachment['image-size']; 687 $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : ''; 688 689 // No whitespace-only captions. 690 $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : ''; 691 if ( '' === trim( $caption ) ) { 692 $caption = ''; 693 } 694 695 $title = ''; // We no longer insert title tags into <img> tags, as they are redundant. 696 $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, $rel, $size, $alt ); 697 } 698 return $html; 699 } 650 700 } 651 701 -
gs-only-pdf-preview/trunk/includes/class-gopp-image-editor-gs.php
r1578987 r1592102 162 162 } 163 163 164 if ( ! $filename ) { 165 $filename = $this->generate_filename( null, null, $extension ); 166 } 164 if ( ! $filename || ! ( $dirname = dirname( $filename ) ) ) { 165 return new WP_Error( 'image_save_error', __( 'Unsupported destination.', 'gs-only-pdf-preview' ), $filename ); 166 } 167 168 // Make sure not to overwrite existing JPEG with same name. 169 $filename = $dirname . '/' . wp_unique_filename( $dirname, wp_basename( $filename ) ); 167 170 168 171 if ( ! ( $cmd = self::gs_cmd( $this->get_gs_args( $filename ) ) ) ) { … … 183 186 } 184 187 185 // For form's sake, transmogrify into the JPEG file.188 // Transmogrify into the JPEG file. 186 189 $this->file = $filename; 187 190 $this->mime_type = $mime_type; -
gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.js
r1578349 r1592102 3 3 */ 4 4 /*jslint ass: true, nomen: true, plusplus: true, regexp: true, vars: true, white: true, indent: 4 */ 5 /*global jQuery, wp, commonL10n, gopp_plugin_params, console*/5 /*global jQuery, _, wp, ajaxurl, gopp_plugin_params */ 6 6 /*exported gopp_plugin */ 7 7 … … 124 124 }; 125 125 126 /** 127 * Patches templates and wp.media.editor.send.attachment to allow PDF thumbnail insertion (see #39618). 128 * Also addresses #39630 by using either thumbnail or medium sized thumbnails in Media Library, favouring thumbnail size. 129 */ 130 gopp_plugin.post = function () { 131 var $tmpl_attachment_details, $tmpl_attachment_display_settings, $tmpl_image_details, html_before, 132 html_attachment_details, 133 attachment_details_re = /(<# } else if \( 'image' === data\.type && data\.sizes \) { #>[\s]+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>[\s]+)(<# } else { #>)/, 134 attachment_details_with = '$1\n<# } else if ( data.sizes && data.sizes.thumbnail ) { #>\n<img src="{{ data.sizes.thumbnail.url }}" draggable="false" alt="" />$2', 135 html_attachment_display_settings, 136 attachment_display_settings_re = /(<# if \( data\.userSettings \) { #>[\s]+data-user-setting="imgsize"[\s]+<# } #>>)([\s]+<#)/, 137 attachment_display_settings_with = '$1\n<# if ( \'application\' === data.type ) { #>\n<option value="">\n' + gopp_plugin_params.document_link_only + '\n</option>\n<# } #>\n$2', 138 html_image_details, 139 image_details_re = /(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/, 140 image_details_with = '$1 && \'image\' === data.type $2'; 141 142 if ( wp.media && wp.media.editor && wp.media.editor.send && 'function' === typeof( wp.media.editor.send.attachment ) ) { 143 $tmpl_attachment_details = $( '#tmpl-attachment-details' ); 144 $tmpl_attachment_display_settings = $( '#tmpl-attachment-display-settings' ); 145 $tmpl_image_details = $( '#tmpl-image-details' ); 146 if ( $tmpl_attachment_details.length && $tmpl_attachment_display_settings.length && $tmpl_image_details.length ) { 147 148 // All or nothing - if any replacements fail, bail. 149 150 // Uses PDF thumbnail in Attachment Details (instead of icon). 151 html_before = $tmpl_attachment_details.html(); 152 html_attachment_details = html_before.replace( attachment_details_re, attachment_details_with ); 153 if ( html_before === html_attachment_details ) { 154 return false; 155 } 156 157 // #39618 Adds "Document Link Only" option to Size select of Attachment Details. 158 html_before = $tmpl_attachment_display_settings.html(); 159 html_attachment_display_settings = html_before.replace( attachment_display_settings_re, attachment_display_settings_with ); 160 if ( html_before === html_attachment_display_settings ) { 161 return false; 162 } 163 164 // #39618 Don't allow editing/replacement of image if it's a PDF thumbnail in Image Details edit. 165 html_before = $tmpl_image_details.html(); 166 html_image_details = html_before.replace( image_details_re, image_details_with ); 167 if ( html_before === html_image_details ) { 168 return false; 169 } 170 171 // #39630 Use either thumbnail or medium sized thumbnails in Media Library. 172 if ( false === gopp_plugin.patch_39630() ) { 173 return false; 174 } 175 176 $tmpl_attachment_details.html( html_attachment_details ); 177 $tmpl_attachment_display_settings.html( html_attachment_display_settings ); 178 $tmpl_image_details.html( html_image_details ); 179 180 // Replace with version to set image options for PDFs. 181 wp.media.editor.send.attachment = gopp_plugin.media_editor_send_attachment; 182 183 return true; 184 } 185 } 186 return false; 187 }; 188 189 /** 190 * Version of wp.media.editor.send.attachment() ("wp-includes/js/media-editor.js") hacked to set image options for PDFs. 191 */ 192 gopp_plugin.media_editor_send_attachment = function( props, attachment ) { 193 var caption = attachment.caption, 194 options, html; 195 196 // If captions are disabled, clear the caption. 197 if ( ! wp.media.view.settings.captions ) { 198 delete attachment.caption; 199 } 200 201 props = wp.media.string.props( props, attachment ); 202 203 options = { 204 id: attachment.id, 205 post_content: attachment.description, 206 post_excerpt: caption 207 }; 208 209 if ( props.linkUrl ) { 210 options.url = props.linkUrl; 211 } 212 213 if ( 'image' === attachment.type ) { 214 html = wp.media.string.image( props ); 215 216 _.each({ 217 align: 'align', 218 size: 'image-size', 219 alt: 'image_alt' 220 }, function( option, prop ) { 221 if ( props[ prop ] ) 222 options[ option ] = props[ prop ]; 223 }); 224 } else if ( 'video' === attachment.type ) { 225 html = wp.media.string.video( props, attachment ); 226 } else if ( 'audio' === attachment.type ) { 227 html = wp.media.string.audio( props, attachment ); 228 } else { 229 html = wp.media.string.link( props ); 230 options.post_title = props.title; 231 // Begin hack. 232 if ( 'application' === attachment.type && 'pdf' === attachment.subtype ) { 233 _.each({ 234 align: 'align', 235 size: 'image-size' 236 }, function( option, prop ) { 237 if ( props[ prop ] ) 238 options[ option ] = props[ prop ]; 239 }); 240 } 241 // End hack. 242 } 243 244 return wp.media.post( 'send-attachment-to-editor', { 245 nonce: wp.media.view.settings.nonce.sendToEditor, 246 attachment: options, 247 html: html, 248 post_id: wp.media.view.settings.post.id 249 }); 250 }; 251 252 /** 253 * Patches 'tmpl-attachment in "wp-includes/media-templates.php" to use either thumbnail or medium sized thumbnails in Media Library, favouring thumbnail size. 254 */ 255 gopp_plugin.patch_39630 = function () { 256 var $tmpl_attachment = $( '#tmpl-attachment' ), html_before, html_attachment, 257 attachment_re = /(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>[\s]+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>[\s]+<# } else { #>)/, 258 attachment_with = '$1( data.sizes.thumbnail || data.sizes.medium )$2( data.sizes.thumbnail || data.sizes.medium )$3'; 259 260 if ( $tmpl_attachment.length ) { 261 262 html_before = $tmpl_attachment.html(); 263 html_attachment = html_before.replace( attachment_re, attachment_with ); 264 if ( html_before === html_attachment ) { 265 return false; 266 } 267 $tmpl_attachment.html( html_attachment ); 268 return true; 269 } 270 return false; 271 }; 272 273 126 274 // jQuery ready. 127 275 $( function () { … … 131 279 } else if ( gopp_plugin_params.val.is_upload ) { 132 280 gopp_plugin.upload(); 281 gopp_plugin.patch_39630(); 282 } else if ( gopp_plugin_params.val.is_post ) { 283 gopp_plugin.post(); 133 284 } 134 285 } -
gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js
r1582214 r1592102 1 /*! gs-only-pdf-preview 1.0. 1 2017-01-25*/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()})))})})}, 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())})}(jQuery);1 /*! gs-only-pdf-preview 1.0.2 2017-02-08 */ 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="" />$2',k=/(<# if \( data\.userSettings \) { #>[\s]+data-user-setting="imgsize"[\s]+<# } #>>)([\s]+<#)/,l="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$2",m=/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,n="$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=d.html(),h=e.replace(m,n),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); -
gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po
r1582214 r1592102 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 1\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 7 7 "preview\n" 8 "POT-Creation-Date: 2017-0 1-25 15:50+0000\n"9 "PO-Revision-Date: 2017-0 1-25 15:51+0000\n"8 "POT-Creation-Date: 2017-02-08 21:11+0000\n" 9 "PO-Revision-Date: 2017-02-08 21:11+0000\n" 10 10 "Last-Translator: gitlost <[email protected]>\n" 11 11 "Language-Team: \n" … … 25 25 26 26 #. translators: %s: url to admin plugins page. 27 #: gs-only-pdf-preview.php:9 127 #: gs-only-pdf-preview.php:93 28 28 msgid "" 29 29 "The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the " … … 39 39 40 40 #. translators: %s: url to admin plugins page. 41 #: gs-only-pdf-preview.php:9 741 #: gs-only-pdf-preview.php:99 42 42 msgid "" 43 43 "The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the " … … 51 51 52 52 #. translators: %s: url to admin plugins page. 53 #: gs-only-pdf-preview.php:11 053 #: gs-only-pdf-preview.php:112 54 54 msgid "" 55 55 "The plugin \"GS Only PDF Preview\" cannot be activated as it relies on the " … … 65 65 66 66 #. translators: %s: url to admin plugins page. 67 #: gs-only-pdf-preview.php:12 267 #: gs-only-pdf-preview.php:124 68 68 msgid "" 69 69 "The plugin \"GS Only PDF Preview\" cannot be activated as it is incompatible " … … 78 78 #. translators: %1$s: lowest compatible WordPress version; %2$s: user's current 79 79 #. WordPress version; %3$s: url to admin plugins page. 80 #: gs-only-pdf-preview.php:1 3880 #: gs-only-pdf-preview.php:140 81 81 msgid "" 82 82 "The plugin \"GS Only PDF Preview\" cannot be activated as it requires " … … 90 90 #. translators: %1$s: highest WordPress version tested; %2$s: user's current 91 91 #. WordPress version. 92 #: gs-only-pdf-preview.php:15 192 #: gs-only-pdf-preview.php:153 93 93 msgid "" 94 94 "<strong>Warning: untested!</strong> The plugin \"GS Only PDF Preview\" has " … … 99 99 "versions de WordPress justqu’à %1$s. Vous avez WordPress version %2$s." 100 100 101 #: gs-only-pdf-preview.php:16 3101 #: gs-only-pdf-preview.php:165 102 102 msgid "" 103 103 "<strong>Warning: no Ghostscript!</strong> The plugin \"GS Only PDF Preview\" " … … 108 108 "déterminer l’emplacement du serveur de votre exécutable Ghostscript." 109 109 110 #: gs-only-pdf-preview.php:21 6110 #: gs-only-pdf-preview.php:218 111 111 msgid "Invalid arguments!" 112 112 msgstr "Paramètres invalides !" 113 113 114 #: gs-only-pdf-preview.php:22 1114 #: gs-only-pdf-preview.php:223 115 115 msgid "No PDFs found!" 116 116 msgstr "Aucun fichier PDF trouvé !" … … 118 118 #. translators: %1$s: formatted number of PDF previews regenerated; %2$s: 119 119 #. formatted number of seconds to one decimal place it took. 120 #: gs-only-pdf-preview.php:22 7120 #: gs-only-pdf-preview.php:229 121 121 msgid "%1$s PDF preview regenerated in %2$s seconds." 122 122 msgid_plural "%1$s PDF previews regenerated in %2$s seconds." … … 125 125 126 126 #. translators: %s: formatted number of non-PDFs ignored. 127 #: gs-only-pdf-preview.php:23 3127 #: gs-only-pdf-preview.php:235 128 128 msgid "%s non-PDF ignored." 129 129 msgid_plural "%s non-PDFs ignored." … … 131 131 msgstr[1] "%s non PDFs ignorés." 132 132 133 #: gs-only-pdf-preview.php:2 38133 #: gs-only-pdf-preview.php:240 134 134 msgid "Nothing updated!" 135 135 msgstr "Rien mis à jour !" 136 136 137 137 #. translators: %s: formatted number of non-PDFs ignored. 138 #: gs-only-pdf-preview.php:24 2138 #: gs-only-pdf-preview.php:244 139 139 msgid "Nothing updateable! %s non-PDF ignored." 140 140 msgid_plural "Nothing updateable! %s non-PDFs ignored." … … 143 143 144 144 #. translators: %s: formatted number of PDF previews that failed to regenerate. 145 #: gs-only-pdf-preview.php:2 49145 #: gs-only-pdf-preview.php:251 146 146 msgid "%s PDF preview not regenerated." 147 147 msgid_plural "%s PDF previews not regenerated." … … 149 149 msgstr[1] "%s aperçus de miniature de PDF non régénérés." 150 150 151 #: gs-only-pdf-preview.php:25 5151 #: gs-only-pdf-preview.php:257 152 152 msgid "You can go again below if you want." 153 153 msgstr "Vous pouvez aller de nouveau ci-dessous si vous voulez." 154 154 155 #: gs-only-pdf-preview.php:29 3 gs-only-pdf-preview.php:429156 #: gs-only-pdf-preview.php:5 19155 #: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449 156 #: gs-only-pdf-preview.php:543 157 157 msgid "Regenerate PDF Previews" 158 158 msgstr "Régénérer les aperçus de miniature de PDF" 159 159 160 #: gs-only-pdf-preview.php:29 3160 #: gs-only-pdf-preview.php:295 161 161 msgid "Regen. PDF Previews" 162 162 msgstr "Régén. aperçus PDF" 163 163 164 #: gs-only-pdf-preview.php:30 7 gs-only-pdf-preview.php:394165 #: gs-only-pdf-preview.php: 590164 #: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414 165 #: gs-only-pdf-preview.php:614 166 166 msgid "Sorry, you are not allowed to access this page." 167 167 msgstr "" … … 169 169 "page. " 170 170 171 #: gs-only-pdf-preview.php:4 00171 #: gs-only-pdf-preview.php:420 172 172 msgid "GS Only PDF Preview - Regenerate PDF Previews" 173 173 msgstr "GS Only PDF Preview - Régénérer les aperçus de miniature de PDF." 174 174 175 #: gs-only-pdf-preview.php:4 05175 #: gs-only-pdf-preview.php:425 176 176 msgid "" 177 177 "This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " … … 181 181 "fichier PDF n’a été téléchargé, donc il n’a rien à faire." 182 182 183 #: gs-only-pdf-preview.php:4 12183 #: gs-only-pdf-preview.php:432 184 184 msgid "" 185 185 "<strong>Warning: cannot set max execution time!</strong> The maximum time " … … 192 192 "donc éprouver l’écran blanc de mort (WSOD) en essayant ceci." 193 193 194 #: gs-only-pdf-preview.php:4 21194 #: gs-only-pdf-preview.php:441 195 195 msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 196 196 msgstr "" … … 199 199 200 200 #. translators: %s: formatted number of PDFs found. 201 #: gs-only-pdf-preview.php:4 26201 #: gs-only-pdf-preview.php:446 202 202 msgid "<strong>%s</strong> PDF has been found." 203 203 msgid_plural "<strong>%s</strong> PDFs have been found." … … 206 206 207 207 #. translators: %s: formatted number (greater than 10) of PDFs found. 208 #: gs-only-pdf-preview.php:4 34208 #: gs-only-pdf-preview.php:454 209 209 msgid "Regenerating %s PDF previews can take a long time." 210 210 msgstr "" … … 212 212 213 213 #. translators: %s: url to the Media Library page in list mode. 214 #: gs-only-pdf-preview.php:4 46214 #: gs-only-pdf-preview.php:466 215 215 msgid "" 216 216 "Note that you can also regenerate PDF previews in batches or individually " … … 225 225 "<a href=\"%s\">mode de liste de la bibliothèque des médias</a>." 226 226 227 #: gs-only-pdf-preview.php: 483227 #: gs-only-pdf-preview.php:505 228 228 msgid "Please wait..." 229 229 msgstr "S’il vous plaît attendre..." 230 230 231 #: gs-only-pdf-preview.php: 487231 #: gs-only-pdf-preview.php:509 232 232 msgid "No items selected!" 233 233 msgstr "Aucun élément sélectionné !" 234 234 235 #: gs-only-pdf-preview.php: 488235 #: gs-only-pdf-preview.php:510 236 236 msgid "Regenerate Preview ajax action not available!" 237 237 msgstr "" 238 238 "L’action de régénérer l’aperçu n’est pas disponible !" 239 239 240 #: gs-only-pdf-preview.php:514 241 msgid "Document Link Only" 242 msgstr "Lien de document seulement" 243 240 244 #. translators: %s: attachment title 241 #: gs-only-pdf-preview.php:5 74245 #: gs-only-pdf-preview.php:598 242 246 msgid "Regenerate the PDF preview for “%s”" 243 247 msgstr "Régénérer l’aperçu de miniature de PDF pour “%s”" 244 248 245 #: gs-only-pdf-preview.php:5 75249 #: gs-only-pdf-preview.php:599 246 250 msgid "Regenerate Preview" 247 251 msgstr "Régénérer l’aperçu" 248 252 249 #: gs-only-pdf-preview.php: 595253 #: gs-only-pdf-preview.php:619 250 254 msgid "Invalid nonce." 251 255 msgstr "Nonce invalide." 252 256 253 #: gs-only-pdf-preview.php: 598257 #: gs-only-pdf-preview.php:622 254 258 msgid "Invalid ID." 255 259 msgstr "Identifiant invalide." 256 260 257 #: gs-only-pdf-preview.php:6 04261 #: gs-only-pdf-preview.php:628 258 262 msgid "Failed to generate the PDF preview." 259 263 msgstr "Échec de générer l’aperçu de miniature de PDF." 260 264 261 #: gs-only-pdf-preview.php:6 09265 #: gs-only-pdf-preview.php:633 262 266 msgid "" 263 267 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 268 272 "jour correctement." 269 273 270 #: gs-only-pdf-preview.php:6 11274 #: gs-only-pdf-preview.php:635 271 275 msgid "" 272 276 "Successfully regenerated the PDF preview. You will need to refresh your " … … 278 282 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 279 283 #. count. 280 #: gs-only-pdf-preview.php:6 40284 #: gs-only-pdf-preview.php:664 281 285 msgid "%d%% (%d)" 282 286 msgstr "%d%% (%d)" … … 286 290 msgstr "Type MIME non supporté." 287 291 288 #: includes/class-gopp-image-editor-gs.php:169 292 #: includes/class-gopp-image-editor-gs.php:165 293 msgid "Unsupported destination." 294 msgstr "Destination non supportée." 295 296 #: includes/class-gopp-image-editor-gs.php:172 289 297 msgid "No Ghostscript." 290 298 msgstr "Pas de Ghostscript." 291 299 292 #: includes/class-gopp-image-editor-gs.php:17 5300 #: includes/class-gopp-image-editor-gs.php:178 293 301 msgid "Image Editor Save Failed" 294 302 msgstr "L’enregistrement de l’éditeur d’images a échoué." 295 303 296 #: includes/class-gopp-image-editor-gs.php:18 2304 #: includes/class-gopp-image-editor-gs.php:185 297 305 msgid "Could not read image size." 298 306 msgstr "Impossible de lire la taille de l’image." 299 307 300 #: includes/class-gopp-image-editor-gs.php:22 0308 #: includes/class-gopp-image-editor-gs.php:223 301 309 msgid "Loading from URL not supported." 302 310 msgstr "Chargement à partir de l’URL non pris en charge." 303 311 304 #: includes/class-gopp-image-editor-gs.php:22 5305 #: includes/class-gopp-image-editor-gs.php:23 0312 #: includes/class-gopp-image-editor-gs.php:228 313 #: includes/class-gopp-image-editor-gs.php:233 306 314 msgid "Unsupported file name." 307 315 msgstr "Nom du fichier non supporté." 308 316 309 #: includes/class-gopp-image-editor-gs.php:24 0317 #: includes/class-gopp-image-editor-gs.php:243 310 318 msgid "File doesn’t exist?" 311 319 msgstr "Le fichier n’existe pas ?" 312 320 313 #: includes/class-gopp-image-editor-gs.php:2 47321 #: includes/class-gopp-image-editor-gs.php:250 314 322 msgid "File is not a PDF." 315 323 msgstr "Le fichier n’est pas un PDF ." 316 324 317 #: includes/class-gopp-image-editor-gs.php:6 29325 #: includes/class-gopp-image-editor-gs.php:632 318 326 msgid "Attempted to set PDF preview resolution to an invalid value." 319 327 msgstr "" … … 321 329 "valeur non valide." 322 330 323 #: includes/class-gopp-image-editor-gs.php:68 4331 #: includes/class-gopp-image-editor-gs.php:687 324 332 msgid "Attempted to set PDF preview page to an invalid value." 325 333 msgstr "" … … 327 335 "non valide." 328 336 329 #: includes/class-gopp-image-editor-gs.php:70 3330 #: includes/class-gopp-image-editor-gs.php:72 4331 #: includes/class-gopp-image-editor-gs.php:74 3332 #: includes/class-gopp-image-editor-gs.php:75 6333 #: includes/class-gopp-image-editor-gs.php:77 0334 #: includes/class-gopp-image-editor-gs.php:78 3337 #: 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 335 343 msgid "Unsupported operation." 336 344 msgstr "Opération non supportée." -
gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot
r1578987 r1592102 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 1\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.2\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/gs-only-pdf-preview\n" … … 26 26 "X-Textdomain-Support: yes\n" 27 27 28 #: gs-only-pdf-preview.php:9 128 #: gs-only-pdf-preview.php:93 29 29 #. translators: %s: url to admin plugins page. 30 30 msgid "" … … 35 35 msgstr "" 36 36 37 #: gs-only-pdf-preview.php:9 737 #: gs-only-pdf-preview.php:99 38 38 #. translators: %s: url to admin plugins page. 39 39 msgid "" … … 43 43 msgstr "" 44 44 45 #: gs-only-pdf-preview.php:11 045 #: gs-only-pdf-preview.php:112 46 46 #. translators: %s: url to admin plugins page. 47 47 msgid "" … … 53 53 msgstr "" 54 54 55 #: gs-only-pdf-preview.php:12 255 #: gs-only-pdf-preview.php:124 56 56 #. translators: %s: url to admin plugins page. 57 57 msgid "" … … 62 62 msgstr "" 63 63 64 #: gs-only-pdf-preview.php:1 3864 #: gs-only-pdf-preview.php:140 65 65 #. translators: %1$s: lowest compatible WordPress version; %2$s: user's current 66 66 #. WordPress version; %3$s: url to admin plugins page. … … 71 71 msgstr "" 72 72 73 #: gs-only-pdf-preview.php:15 173 #: gs-only-pdf-preview.php:153 74 74 #. translators: %1$s: highest WordPress version tested; %2$s: user's current 75 75 #. WordPress version. … … 79 79 msgstr "" 80 80 81 #: gs-only-pdf-preview.php:16 381 #: gs-only-pdf-preview.php:165 82 82 msgid "" 83 83 "<strong>Warning: no Ghostscript!</strong> The plugin \"GS Only PDF " … … 86 86 msgstr "" 87 87 88 #: gs-only-pdf-preview.php:21 688 #: gs-only-pdf-preview.php:218 89 89 msgid "Invalid arguments!" 90 90 msgstr "" 91 91 92 #: gs-only-pdf-preview.php:22 192 #: gs-only-pdf-preview.php:223 93 93 msgid "No PDFs found!" 94 94 msgstr "" 95 95 96 #: gs-only-pdf-preview.php:22 796 #: gs-only-pdf-preview.php:229 97 97 #. translators: %1$s: formatted number of PDF previews regenerated; %2$s: 98 98 #. formatted number of seconds to one decimal place it took. … … 102 102 msgstr[1] "" 103 103 104 #: gs-only-pdf-preview.php:23 3104 #: gs-only-pdf-preview.php:235 105 105 #. translators: %s: formatted number of non-PDFs ignored. 106 106 msgid "%s non-PDF ignored." … … 109 109 msgstr[1] "" 110 110 111 #: gs-only-pdf-preview.php:2 38111 #: gs-only-pdf-preview.php:240 112 112 msgid "Nothing updated!" 113 113 msgstr "" 114 114 115 #: gs-only-pdf-preview.php:24 2115 #: gs-only-pdf-preview.php:244 116 116 #. translators: %s: formatted number of non-PDFs ignored. 117 117 msgid "Nothing updateable! %s non-PDF ignored." … … 120 120 msgstr[1] "" 121 121 122 #: gs-only-pdf-preview.php:2 49122 #: gs-only-pdf-preview.php:251 123 123 #. translators: %s: formatted number of PDF previews that failed to regenerate. 124 124 msgid "%s PDF preview not regenerated." … … 127 127 msgstr[1] "" 128 128 129 #: gs-only-pdf-preview.php:25 5129 #: gs-only-pdf-preview.php:257 130 130 msgid "You can go again below if you want." 131 131 msgstr "" 132 132 133 #: gs-only-pdf-preview.php:29 3 gs-only-pdf-preview.php:429134 #: gs-only-pdf-preview.php:5 19133 #: gs-only-pdf-preview.php:295 gs-only-pdf-preview.php:449 134 #: gs-only-pdf-preview.php:543 135 135 msgid "Regenerate PDF Previews" 136 136 msgstr "" 137 137 138 #: gs-only-pdf-preview.php:29 3138 #: gs-only-pdf-preview.php:295 139 139 msgid "Regen. PDF Previews" 140 140 msgstr "" 141 141 142 #: gs-only-pdf-preview.php:30 7 gs-only-pdf-preview.php:394143 #: gs-only-pdf-preview.php: 590142 #: gs-only-pdf-preview.php:309 gs-only-pdf-preview.php:414 143 #: gs-only-pdf-preview.php:614 144 144 msgid "Sorry, you are not allowed to access this page." 145 145 msgstr "" 146 146 147 #: gs-only-pdf-preview.php:4 00147 #: gs-only-pdf-preview.php:420 148 148 msgid "GS Only PDF Preview - Regenerate PDF Previews" 149 149 msgstr "" 150 150 151 #: gs-only-pdf-preview.php:4 05151 #: gs-only-pdf-preview.php:425 152 152 msgid "" 153 153 "This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " … … 155 155 msgstr "" 156 156 157 #: gs-only-pdf-preview.php:4 12157 #: gs-only-pdf-preview.php:432 158 158 msgid "" 159 159 "<strong>Warning: cannot set max execution time!</strong> The maximum time " … … 162 162 msgstr "" 163 163 164 #: gs-only-pdf-preview.php:4 21164 #: gs-only-pdf-preview.php:441 165 165 msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 166 166 msgstr "" 167 167 168 #: gs-only-pdf-preview.php:4 26168 #: gs-only-pdf-preview.php:446 169 169 #. translators: %s: formatted number of PDFs found. 170 170 msgid "<strong>%s</strong> PDF has been found." … … 173 173 msgstr[1] "" 174 174 175 #: gs-only-pdf-preview.php:4 34175 #: gs-only-pdf-preview.php:454 176 176 #. translators: %s: formatted number (greater than 10) of PDFs found. 177 177 msgid "Regenerating %s PDF previews can take a long time." 178 178 msgstr "" 179 179 180 #: gs-only-pdf-preview.php:4 46180 #: gs-only-pdf-preview.php:466 181 181 #. translators: %s: url to the Media Library page in list mode. 182 182 msgid "" … … 187 187 msgstr "" 188 188 189 #: gs-only-pdf-preview.php: 483189 #: gs-only-pdf-preview.php:505 190 190 msgid "Please wait..." 191 191 msgstr "" 192 192 193 #: gs-only-pdf-preview.php: 487193 #: gs-only-pdf-preview.php:509 194 194 msgid "No items selected!" 195 195 msgstr "" 196 196 197 #: gs-only-pdf-preview.php: 488197 #: gs-only-pdf-preview.php:510 198 198 msgid "Regenerate Preview ajax action not available!" 199 199 msgstr "" 200 200 201 #: gs-only-pdf-preview.php:574 201 #: gs-only-pdf-preview.php:514 202 msgid "Document Link Only" 203 msgstr "" 204 205 #: gs-only-pdf-preview.php:598 202 206 #. translators: %s: attachment title 203 207 msgid "Regenerate the PDF preview for “%s”" 204 208 msgstr "" 205 209 206 #: gs-only-pdf-preview.php:5 75210 #: gs-only-pdf-preview.php:599 207 211 msgid "Regenerate Preview" 208 212 msgstr "" 209 213 210 #: gs-only-pdf-preview.php: 595214 #: gs-only-pdf-preview.php:619 211 215 msgid "Invalid nonce." 212 216 msgstr "" 213 217 214 #: gs-only-pdf-preview.php: 598218 #: gs-only-pdf-preview.php:622 215 219 msgid "Invalid ID." 216 220 msgstr "" 217 221 218 #: gs-only-pdf-preview.php:6 04222 #: gs-only-pdf-preview.php:628 219 223 msgid "Failed to generate the PDF preview." 220 224 msgstr "" 221 225 222 #: gs-only-pdf-preview.php:6 09226 #: gs-only-pdf-preview.php:633 223 227 msgid "" 224 228 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 226 230 msgstr "" 227 231 228 #: gs-only-pdf-preview.php:6 11232 #: gs-only-pdf-preview.php:635 229 233 msgid "" 230 234 "Successfully regenerated the PDF preview. You will need to refresh your " … … 232 236 msgstr "" 233 237 234 #: gs-only-pdf-preview.php:6 40238 #: gs-only-pdf-preview.php:664 235 239 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 236 240 #. count. … … 242 246 msgstr "" 243 247 244 #: includes/class-gopp-image-editor-gs.php:169 248 #: includes/class-gopp-image-editor-gs.php:165 249 msgid "Unsupported destination." 250 msgstr "" 251 252 #: includes/class-gopp-image-editor-gs.php:172 245 253 msgid "No Ghostscript." 246 254 msgstr "" 247 255 248 #: includes/class-gopp-image-editor-gs.php:17 5256 #: includes/class-gopp-image-editor-gs.php:178 249 257 msgid "Image Editor Save Failed" 250 258 msgstr "" 251 259 252 #: includes/class-gopp-image-editor-gs.php:18 2260 #: includes/class-gopp-image-editor-gs.php:185 253 261 msgid "Could not read image size." 254 262 msgstr "" 255 263 256 #: includes/class-gopp-image-editor-gs.php:22 0264 #: includes/class-gopp-image-editor-gs.php:223 257 265 msgid "Loading from URL not supported." 258 266 msgstr "" 259 267 260 #: includes/class-gopp-image-editor-gs.php:22 5261 #: includes/class-gopp-image-editor-gs.php:23 0268 #: includes/class-gopp-image-editor-gs.php:228 269 #: includes/class-gopp-image-editor-gs.php:233 262 270 msgid "Unsupported file name." 263 271 msgstr "" 264 272 265 #: includes/class-gopp-image-editor-gs.php:24 0273 #: includes/class-gopp-image-editor-gs.php:243 266 274 msgid "File doesn’t exist?" 267 275 msgstr "" 268 276 269 #: includes/class-gopp-image-editor-gs.php:2 47277 #: includes/class-gopp-image-editor-gs.php:250 270 278 msgid "File is not a PDF." 271 279 msgstr "" 272 280 273 #: includes/class-gopp-image-editor-gs.php:6 29281 #: includes/class-gopp-image-editor-gs.php:632 274 282 msgid "Attempted to set PDF preview resolution to an invalid value." 275 283 msgstr "" 276 284 277 #: includes/class-gopp-image-editor-gs.php:68 4285 #: includes/class-gopp-image-editor-gs.php:687 278 286 msgid "Attempted to set PDF preview page to an invalid value." 279 287 msgstr "" 280 288 281 #: includes/class-gopp-image-editor-gs.php:70 3282 #: includes/class-gopp-image-editor-gs.php:72 4283 #: includes/class-gopp-image-editor-gs.php:74 3284 #: includes/class-gopp-image-editor-gs.php:75 6285 #: includes/class-gopp-image-editor-gs.php:77 0286 #: includes/class-gopp-image-editor-gs.php:78 3289 #: 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 287 295 msgid "Unsupported operation." 288 296 msgstr "" -
gs-only-pdf-preview/trunk/readme.txt
r1578987 r1592102 3 3 Tags: Ghostscript, PDF, PDF Preview, Ghostscript Only 4 4 Requires at least: 4.7.0 5 Tested up to: 4.7. 16 Stable tag: 1.0. 15 Tested up to: 4.7.2 6 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 = Tool = 51 51 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 . 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.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. 53 53 54 54 As 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. 55 56 = Patches = 57 58 As a bonus version 1.0.2 patches WordPress to allow linking to the preview image in "Add Media" when editing a post ([#39618 Insert PDF Thumbnail into Editor](https://core.trac.wordpress.org/ticket/39618)). Also patches [#39630 PDF Thumbnails in Media Library Don't Fall Back to Full Size](https://core.trac.wordpress.org/ticket/39630). 55 59 56 60 = And = … … 58 62 A google-cheating schoolboy French translation is supplied. 59 63 60 The plugin runs on WP 4.7.0 and 4.7.1, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows systems.64 The plugin runs on WP 4.7.0 to 4.7.2, and requires Ghostscript to be installed on the server. The plugin should run on PHP 5.2.17 to 7.1, and on both Unix and Windows servers. 61 65 62 66 The project is on [github](https://github.com/gitlost/gs-only-pdf-preview). … … 80 84 * `gopp_editor_set_resolution` sets the resolution of the PDF preview. 81 85 * `gopp_editor_set_page` sets the page to render for the PDF preview. 82 * `gopp_image_gs_cmd_path` short-circuits the determination of the path of the Ghostscript executable on your s ystem.86 * `gopp_image_gs_cmd_path` short-circuits the determination of the path of the Ghostscript executable on your server. 83 87 84 88 The `gopp_editor_set_resolution` filter is an analogue of the standard [`wp_editor_set_quality`](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) filter mentioned above, and allows one to override the default resolution of 128 DPI used for the PDF preview. For instance, in your theme's "functions.php": … … 103 107 add_filter( 'gopp_image_gs_cmd_path', 'mytheme_gopp_image_gs_cmd_path', 10, 2 ); 104 108 105 The filter can also be used just for performance reasons, especially on Windows s ystems to save searching the registry and directories.109 The filter can also be used just for performance reasons, especially on Windows servers to save searching the registry and directories. 106 110 107 111 Note that the value of `gs_cmd_path` is cached as a transient by the plugin for performance reasons, with a lifetime of one day. You can clear it by de-activating and re-activating the plugin, or by manually calling the `clear` method of the Ghostscript Image Editor: … … 122 126 5. Regenerate PDF Previews bulk action in list mode of Media Library. 123 127 6. Regenerate Preview row action in list mode of Media Library. 128 7. Link to preview image in "Add Media". 124 129 125 130 == Changelog == 131 132 = 1.0.2 (8 Feb 2017) = 133 * Don't overwrite existing JPEGs with same name as preview. 134 * Remove existing preview intermediates when regenerating. 135 * Patch WP to allow preview image linking in Add Media (#39618). 136 * Patch WP to use thumbnail or medium sized thumbnails in Media Library (#39630). 137 * WP 4.7.2 compatible 126 138 127 139 = 1.0.1 (20 Jan 2017) = … … 136 148 == Upgrade Notice == 137 149 150 = 1.0.2 = 151 Doesn't overwrite existing JPEGs with same name as preview. Removes existing preview thumbnails on regeneration. 152 138 153 = 1.0.1 = 139 154 Tweeks.
Note: See TracChangeset
for help on using the changeset viewer.