WordPress.org

Plugin Directory

Changeset 1638573


Ignore:
Timestamp:
04/16/17 15:14:11 (7 months ago)
Author:
gitlost
Message:

v1.0.6

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

Legend:

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

    r1638565 r1638573  
    44 * Plugin URI: https://github.com/gitlost/gs-only-pdf-preview 
    55 * Description: Uses Ghostscript directly to generate PDF previews. 
    6  * Version: 1.0.5 
     6 * Version: 1.0.6 
    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.5' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 
     19define( 'GOPP_PLUGIN_VERSION', '1.0.6' ); // 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.3' ); 
     
    417417                        $dirname = dirname( $file ) . '/'; 
    418418                        foreach ( $old_value[0]['sizes'] as $sizeinfo ) { 
    419                             @ unlink( $dirname . $sizeinfo['file'] ); 
     419                            // Check whether pre WP 4.7.3 lacking PDF marker and if so don't delete so as not to break links to thumbnails in content. 
     420                            if ( false !== strpos( $sizeinfo['file'], '-pdf' ) ) { 
     421                                @ unlink( $dirname . $sizeinfo['file'] ); 
     422                            } 
    420423                        } 
    421424                    } 
  • gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js

    r1638565 r1638573  
    1 /*! gs-only-pdf-preview 1.0.5 2017-04-16 */ 
     1/*! gs-only-pdf-preview 1.0.6 2017-04-16 */ 
    22var 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,e){var f,g=a(b.target),h=g.parents(".row-actions").first(),i=h.parent(),j=g.next();return a(".gopp_response",i).remove(),j.addClass("is-active"),f=a.post({url:ajaxurl,data:{action:"gopp_media_row_action",id:c,nonce:d},dataType:"json",error:function(b,c,d){var e;j.removeClass("is-active"),e='<div class="notice error gopp_response"><p>'+gopp_plugin_params.action_not_available+" ("+d+")</p></div>",h.after(a(e))},success:function(b){j.removeClass("is-active"),a(".gopp_response",i).remove(),b?(b.error?h.after(a('<div class="notice error gopp_response"><p>'+b.error+"</p></div>")):b.msg&&h.after(a('<div class="notice updated gopp_response"><p>'+b.msg+"</p></div>")),b.img&&a(".has-media-icon .media-icon",i).html(b.img)):h.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}),f.fail(function(){j.removeClass("is-active")}),e&&(e.post_ret=f),!1},gopp_plugin.upload=function(){a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){var c,d,e;"gopp_regen_pdf_previews"===a(this).val()&&(c=a(b.target),d=c.parent(),a(".gopp_none",d).remove(),a(".spinner",d).remove(),e=a.makeArray(a('#the-list input[name="media[]"]:checked').map(function(){return this.value})),e.length?a(gopp_plugin_params.spinner).insertAfter(c):(b.preventDefault(),a(gopp_plugin_params.no_items_selected_msg).insertAfter(c).fadeOut(1e3,function(){a(this).remove()})))})})},gopp_plugin.upload_patch=function(){var b,c,d;return b=a("#tmpl-attachment-details-two-column"),!!b.length&&(c=b.html(),d=c.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt">)/,"$1 || data.sizes$2"),c!==d&&(b.html(d),!0))},gopp_plugin.post_patch=function(){var b,c,d,e,f,g,h,i="$1\n<# if ( 'application' === data.type ) { #>\n<option value=\"\">\n"+gopp_plugin_params.document_link_only+"\n</option>\n<# } #>\n$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(/(<# } else if \( 'image' === data\.type && data\.sizes \) { #>\s+<img src="{{ data\.size\.url }}" draggable="false" alt="" \/>)(\s+<# } else { #>)/,'$1\n<# } else if ( data.sizes && ( data.sizes.thumbnail || data.sizes.full ) ) { #>\n<img src="{{ ( data.sizes.thumbnail || data.sizes.full ).url }}" draggable="false" alt="" />\n$2'),e!==f&&(e=f,f=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting" data-setting="alt")/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==f&&(e=c.html(),g=e.replace(/(<# if \( 'image' === data.type)( \) { #>\s+<label class="setting">)/,"$1 || ( 'application' === data.type && data.sizes )$2"),e!==g&&(e=g,g=e.replace(/(<# if \( data\.userSettings \) { #>\s+data-user-setting="imgsize"\s+<# } #>>)(\s+<#)/,i),e!==g&&(e=d.html(),h=e.replace(/(<# if \( data\.attachment && window\.imageEdit)( \) { #>)/,"$1 && 'image' === data.type $2"),e!==h&&(b.html(f),c.html(g),d.html(h),wp.media.editor.send.attachment=gopp_plugin.media_editor_send_attachment,!0))))))},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,b.sizes&&(b.alt&&(c.alt=b.alt),_.each({align:"align",size:"image-size",alt:"image_alt"},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");return!!d.length&&(b=d.html(),c=b.replace(/(<# } else if \( data\.sizes && )data\.sizes\.medium( \) { #>\s+<img src="{{ )data\.sizes\.medium(\.url }}" class="thumbnail" draggable="false" alt="" \/>\s+<# } else { #>)/,"$1( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$2( data.sizes.thumbnail || data.sizes.medium || data.sizes.full )$3"),b!==c&&(d.html(c),!0))},a(function(){gopp_plugin_params&&gopp_plugin_params.val&&(gopp_plugin_params.val.is_regen_pdf_preview?gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.regen_pdf_preview():gopp_plugin_params.val.is_upload?(gopp_plugin_params.val.current_user_can_cap&&gopp_plugin.upload(),gopp_plugin.upload_patch(),gopp_plugin.patch_39630()):gopp_plugin_params.val.is_post&&(gopp_plugin.post_patch(),gopp_plugin.patch_39630()))})}(jQuery); 
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview-fr_FR.po

    r1638565 r1638573  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: GS Only PDF Preview 1.0.5\n" 
     5"Project-Id-Version: GS Only PDF Preview 1.0.6\n" 
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 
    77"preview\n" 
    8 "POT-Creation-Date: 2017-04-16 14:40+0100\n" 
    9 "PO-Revision-Date: 2017-04-16 14:40+0100\n" 
     8"POT-Creation-Date: 2017-04-16 16:03+0100\n" 
     9"PO-Revision-Date: 2017-04-16 16:03+0100\n" 
    1010"Last-Translator: gitlost <gitlost@gitlostbonger.com>\n" 
    1111"Language-Team: \n" 
  • gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot

    r1638565 r1638573  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: GS Only PDF Preview 1.0.5\n" 
     5"Project-Id-Version: GS Only PDF Preview 1.0.6\n" 
    66"Report-Msgid-Bugs-To: " 
    77"https://wordpress.org/support/plugin/gs-only-pdf-preview\n" 
     
    131131msgstr "" 
    132132 
    133 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:501 
    134 #: gs-only-pdf-preview.php:596 
     133#: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 
     134#: gs-only-pdf-preview.php:599 
    135135msgid "Regenerate PDF Previews" 
    136136msgstr "" 
     
    140140msgstr "" 
    141141 
    142 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:465 
    143 #: gs-only-pdf-preview.php:664 
     142#: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 
     143#: gs-only-pdf-preview.php:667 
    144144msgid "Sorry, you are not allowed to access this page." 
    145145msgstr "" 
    146146 
    147 #: gs-only-pdf-preview.php:472 
     147#: gs-only-pdf-preview.php:475 
    148148msgid "GS Only PDF Preview - Regenerate PDF Previews" 
    149149msgstr "" 
    150150 
    151 #: gs-only-pdf-preview.php:477 
     151#: gs-only-pdf-preview.php:480 
    152152msgid "" 
    153153"This tool is for regenerating the thumbnail previews of PDFs, but no PDFs " 
     
    155155msgstr "" 
    156156 
    157 #: gs-only-pdf-preview.php:484 
     157#: gs-only-pdf-preview.php:487 
    158158msgid "" 
    159159"<strong>Warning: cannot set max execution time!</strong> The maximum time " 
     
    162162msgstr "" 
    163163 
    164 #: gs-only-pdf-preview.php:493 
     164#: gs-only-pdf-preview.php:496 
    165165msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 
    166166msgstr "" 
    167167 
    168 #: gs-only-pdf-preview.php:498 
     168#: gs-only-pdf-preview.php:501 
    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:506 
     175#: gs-only-pdf-preview.php:509 
    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:518 
     180#: gs-only-pdf-preview.php:521 
    181181#. translators: %s: url to the Media Library page in list mode. 
    182182msgid "" 
     
    187187msgstr "" 
    188188 
    189 #: gs-only-pdf-preview.php:558 
     189#: gs-only-pdf-preview.php:561 
    190190msgid "Please wait..." 
    191191msgstr "" 
    192192 
    193 #: gs-only-pdf-preview.php:562 
     193#: gs-only-pdf-preview.php:565 
    194194msgid "No items selected!" 
    195195msgstr "" 
    196196 
    197 #: gs-only-pdf-preview.php:563 
     197#: gs-only-pdf-preview.php:566 
    198198msgid "Regenerate Preview ajax action not available!" 
    199199msgstr "" 
    200200 
    201 #: gs-only-pdf-preview.php:567 
     201#: gs-only-pdf-preview.php:570 
    202202msgid "Document Link Only" 
    203203msgstr "" 
    204204 
    205 #: gs-only-pdf-preview.php:649 
     205#: gs-only-pdf-preview.php:652 
    206206#. translators: %s: attachment title 
    207207msgid "Regenerate the PDF preview for &#8220;%s&#8221;" 
    208208msgstr "" 
    209209 
    210 #: gs-only-pdf-preview.php:650 
     210#: gs-only-pdf-preview.php:653 
    211211msgid "Regenerate&nbsp;Preview" 
    212212msgstr "" 
    213213 
    214 #: gs-only-pdf-preview.php:669 
     214#: gs-only-pdf-preview.php:672 
    215215msgid "Invalid nonce." 
    216216msgstr "" 
    217217 
    218 #: gs-only-pdf-preview.php:672 
     218#: gs-only-pdf-preview.php:675 
    219219msgid "Invalid ID." 
    220220msgstr "" 
    221221 
    222 #: gs-only-pdf-preview.php:678 
     222#: gs-only-pdf-preview.php:681 
    223223msgid "Failed to generate the PDF preview." 
    224224msgstr "" 
    225225 
    226 #: gs-only-pdf-preview.php:683 
     226#: gs-only-pdf-preview.php:686 
    227227msgid "" 
    228228"Successfully regenerated the PDF preview. It's best to refresh your browser " 
     
    230230msgstr "" 
    231231 
    232 #: gs-only-pdf-preview.php:685 
     232#: gs-only-pdf-preview.php:688 
    233233msgid "" 
    234234"Successfully regenerated the PDF preview. You will need to refresh your " 
     
    236236msgstr "" 
    237237 
    238 #: gs-only-pdf-preview.php:714 
     238#: gs-only-pdf-preview.php:717 
    239239#. translators: %1$d: percentage of PDF previews completed; %2$d: completed 
    240240#. count. 
  • gs-only-pdf-preview/trunk/readme.txt

    r1638565 r1638573  
    44Requires at least: 4.7.0 
    55Tested up to: 4.7.3 
    6 Stable tag: 1.0.5 
     6Stable tag: 1.0.6 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    139139 
    140140== Changelog == 
     141 
     142= 1.0.6 (16 Apr 2017) = 
     143* For BC so as not to break linked thumbnails, check for PDF marker before deleting on regeneration. 
    141144 
    142145= 1.0.5 (16 Apr 2017) = 
     
    179182== Upgrade Notice == 
    180183 
     184= 1.0.6 = 
     185Keeps backward-compatibility for linked thumbnails. 
     186 
    181187= 1.0.5 = 
    182188Determines Windows command path better. 
Note: See TracChangeset for help on using the changeset viewer.