Changeset 1638573
- Timestamp:
- 04/16/2017 03:14:11 PM (9 years ago)
- Location:
- gs-only-pdf-preview/trunk
- Files:
-
- 6 edited
-
gs-only-pdf-preview.php (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) (1 diff)
-
languages/gs-only-pdf-preview.pot (modified) (9 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gs-only-pdf-preview/trunk/gs-only-pdf-preview.php
r1638565 r1638573 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. 56 * Version: 1.0.6 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. 5' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot".19 define( 'GOPP_PLUGIN_VERSION', '1.0.6' ); // Sync also "package.json" and "language/gs-only-pdf-preview.pot". 20 20 define( 'GOPP_PLUGIN_WP_AT_LEAST_VERSION', '4.7.0' ); 21 21 define( 'GOPP_PLUGIN_WP_UP_TO_VERSION', '4.7.3' ); … … 417 417 $dirname = dirname( $file ) . '/'; 418 418 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 } 420 423 } 421 424 } -
gs-only-pdf-preview/trunk/js/gs-only-pdf-preview.min.js
r1638565 r1638573 1 /*! gs-only-pdf-preview 1.0. 52017-04-16 */1 /*! gs-only-pdf-preview 1.0.6 2017-04-16 */ 2 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,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 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 5\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.6\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gs-only-pdf-" 7 7 "preview\n" 8 "POT-Creation-Date: 2017-04-16 1 4:40+0100\n"9 "PO-Revision-Date: 2017-04-16 1 4: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" 10 10 "Last-Translator: gitlost <gitlost@gitlostbonger.com>\n" 11 11 "Language-Team: \n" -
gs-only-pdf-preview/trunk/languages/gs-only-pdf-preview.pot
r1638565 r1638573 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GS Only PDF Preview 1.0. 5\n"5 "Project-Id-Version: GS Only PDF Preview 1.0.6\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/gs-only-pdf-preview\n" … … 131 131 msgstr "" 132 132 133 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:50 1134 #: gs-only-pdf-preview.php:59 6133 #: gs-only-pdf-preview.php:349 gs-only-pdf-preview.php:504 134 #: gs-only-pdf-preview.php:599 135 135 msgid "Regenerate PDF Previews" 136 136 msgstr "" … … 140 140 msgstr "" 141 141 142 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:46 5143 #: gs-only-pdf-preview.php:66 4142 #: gs-only-pdf-preview.php:363 gs-only-pdf-preview.php:468 143 #: gs-only-pdf-preview.php:667 144 144 msgid "Sorry, you are not allowed to access this page." 145 145 msgstr "" 146 146 147 #: gs-only-pdf-preview.php:47 2147 #: gs-only-pdf-preview.php:475 148 148 msgid "GS Only PDF Preview - Regenerate PDF Previews" 149 149 msgstr "" 150 150 151 #: gs-only-pdf-preview.php:4 77151 #: gs-only-pdf-preview.php:480 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:48 4157 #: gs-only-pdf-preview.php:487 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:49 3164 #: gs-only-pdf-preview.php:496 165 165 msgid "Regenerate the thumbnail previews of PDFs uploaded to your system." 166 166 msgstr "" 167 167 168 #: gs-only-pdf-preview.php: 498168 #: gs-only-pdf-preview.php:501 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:50 6175 #: gs-only-pdf-preview.php:509 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:5 18180 #: gs-only-pdf-preview.php:521 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:5 58189 #: gs-only-pdf-preview.php:561 190 190 msgid "Please wait..." 191 191 msgstr "" 192 192 193 #: gs-only-pdf-preview.php:56 2193 #: gs-only-pdf-preview.php:565 194 194 msgid "No items selected!" 195 195 msgstr "" 196 196 197 #: gs-only-pdf-preview.php:56 3197 #: gs-only-pdf-preview.php:566 198 198 msgid "Regenerate Preview ajax action not available!" 199 199 msgstr "" 200 200 201 #: gs-only-pdf-preview.php:5 67201 #: gs-only-pdf-preview.php:570 202 202 msgid "Document Link Only" 203 203 msgstr "" 204 204 205 #: gs-only-pdf-preview.php:6 49205 #: gs-only-pdf-preview.php:652 206 206 #. translators: %s: attachment title 207 207 msgid "Regenerate the PDF preview for “%s”" 208 208 msgstr "" 209 209 210 #: gs-only-pdf-preview.php:65 0210 #: gs-only-pdf-preview.php:653 211 211 msgid "Regenerate Preview" 212 212 msgstr "" 213 213 214 #: gs-only-pdf-preview.php:6 69214 #: gs-only-pdf-preview.php:672 215 215 msgid "Invalid nonce." 216 216 msgstr "" 217 217 218 #: gs-only-pdf-preview.php:67 2218 #: gs-only-pdf-preview.php:675 219 219 msgid "Invalid ID." 220 220 msgstr "" 221 221 222 #: gs-only-pdf-preview.php:6 78222 #: gs-only-pdf-preview.php:681 223 223 msgid "Failed to generate the PDF preview." 224 224 msgstr "" 225 225 226 #: gs-only-pdf-preview.php:68 3226 #: gs-only-pdf-preview.php:686 227 227 msgid "" 228 228 "Successfully regenerated the PDF preview. It's best to refresh your browser " … … 230 230 msgstr "" 231 231 232 #: gs-only-pdf-preview.php:68 5232 #: gs-only-pdf-preview.php:688 233 233 msgid "" 234 234 "Successfully regenerated the PDF preview. You will need to refresh your " … … 236 236 msgstr "" 237 237 238 #: gs-only-pdf-preview.php:71 4238 #: gs-only-pdf-preview.php:717 239 239 #. translators: %1$d: percentage of PDF previews completed; %2$d: completed 240 240 #. count. -
gs-only-pdf-preview/trunk/readme.txt
r1638565 r1638573 4 4 Requires at least: 4.7.0 5 5 Tested up to: 4.7.3 6 Stable tag: 1.0. 56 Stable tag: 1.0.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 139 139 140 140 == 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. 141 144 142 145 = 1.0.5 (16 Apr 2017) = … … 179 182 == Upgrade Notice == 180 183 184 = 1.0.6 = 185 Keeps backward-compatibility for linked thumbnails. 186 181 187 = 1.0.5 = 182 188 Determines Windows command path better.
Note: See TracChangeset
for help on using the changeset viewer.