Plugin Directory

Changeset 2451574


Ignore:
Timestamp:
01/07/2021 12:12:11 AM (5 years ago)
Author:
dtbaker
Message:

Uploading version 1.0.18

Location:
template-kit-export/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • template-kit-export/trunk/README.txt

    r2414939 r2451574  
    55Tested up to: 5.5
    66Requires PHP: 5.6
    7 Stable tag: 1.0.17
     7Stable tag: 1.0.18
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3838
    3939== Changelog ==
     40
     41= 1.0.18 - 2020-12-24 =
     42* Fix: Default thumbnail cropping + size fixes
    4043
    4144= 1.0.17 - 2020-11-09 =
  • template-kit-export/trunk/admin/assets/js/template-kit-export-admin.js

    r2228221 r2451574  
    9494                    var uploaded_img_meta = file_frame.state().get( 'selection' ).first().toJSON();
    9595                    var thumbnail_url     = '';
    96                     if ( ! uploaded_img_meta['sizes']['tk_preview']) {
     96                    var thumbnailWidth = parseInt( window.template_kit_export.thumbnail_width );
     97                    var minimumValidThumbnailWidth = 300
     98                    if ( ! uploaded_img_meta['sizes']['tk_preview'] || uploaded_img_meta['sizes']['tk_preview']['width'] < minimumValidThumbnailWidth) {
    9799                        // The user is choosing a screenshot image that doesn't have our required thumbnail size.
    98                         // This either means the image is <= 600px wide already, or they've chosen an old image from the library
     100                        // This either means the image is <= thumbnailWidth px wide already, or they've chosen an old image from the library
    99101                        // that doesn't have a thumbnail generated.
    100                         if (uploaded_img_meta['sizes']['full'] && uploaded_img_meta['sizes']['full']['width'] <= 600) {
    101                             // The user has uploaded an image that is <= 600px so we can use that as the thumb.
     102                        if (uploaded_img_meta['sizes']['full'] && uploaded_img_meta['sizes']['full']['width'] <= thumbnailWidth) {
     103                            // The user has uploaded an image that is <= thumbnailWidth px so we can use that as the thumb.
    102104                            thumbnail_url = uploaded_img_meta['sizes']['full']['url'];
    103105                        } else {
    104                             // The user has chosen an older image from the media library that doesn't yet have a 600px thumb
     106                            // The user has chosen an older image from the media library that doesn't yet have a thumbnailWidth px thumb
    105107                            // Ask them to re-upload.
    106                             alert( 'Sorry the selected image does not have a correct thumbnail size. Please upload a new screenshot image or regenerate thumbnails.' );
     108                            alert( 'Sorry the selected image does not have a correct thumbnail size. Please upload a new screenshot image that is at least ' + thumbnailWidth + ' pixels wide.' );
    107109                            return;
    108110                        }
    109111                    } else {
    110                         // The user has uploaded an image and we've managed to make a 600px wide thumbnail successfully.
     112                        // The user has uploaded an image and we've managed to make a thumbnailWidth px wide thumbnail successfully.
    111113                        thumbnail_url = uploaded_img_meta['sizes']['tk_preview']['url'];
    112114                    }
  • template-kit-export/trunk/admin/assets/js/template-kit-export-admin.min.js

    r2225085 r2451574  
    1 !function(l){"use strict";function i(){var e=0;l("#template-kit-sortable-container .templates").each(function(){l(this).find(".position_id").val(e),e++})}l(function(){var e=l("#template-kit-sortable-container");0<e.length&&(i(),e.sortable(),e.on("sortstop",function(e,t){i()}))}),l(document).on("click",".upload-image",function(e){e.preventDefault();var i=l(this).parents(".templates").first().data("template-id"),a=wp.media.frames.file_frame=wp.media({title:"Select or upload image",library:{type:"image"},button:{text:"Select"},multiple:!1});a.on("select",function(){var e=a.state().get("selection").first().toJSON(),t="";if(e.sizes.tk_preview)t=e.sizes.tk_preview.url;else{if(!(e.sizes.full&&e.sizes.full.width<=600))return void alert("Sorry the selected image does not have a correct thumbnail size. Please upload a new screenshot image or regenerate thumbnails.");t=e.sizes.full.url}l("div[data-template-id="+i+"]").find(".tk-preview-image-id").val(e.id),l("div[data-template-id="+i+"] .screenshot").css("backgroundImage","url( "+t+")")}),a.open()})}(jQuery);
     1!function(l){"use strict";function i(){var e=0;l("#template-kit-sortable-container .templates").each(function(){l(this).find(".position_id").val(e),e++})}l(function(){var e=l("#template-kit-sortable-container");0<e.length&&(i(),e.sortable(),e.on("sortstop",function(e,t){i()}))}),l(document).on("click",".upload-image",function(e){e.preventDefault();var a=l(this).parents(".templates").first().data("template-id"),s=wp.media.frames.file_frame=wp.media({title:"Select or upload image",library:{type:"image"},button:{text:"Select"},multiple:!1});s.on("select",function(){var e=s.state().get("selection").first().toJSON(),t="",i=parseInt(window.template_kit_export.thumbnail_width);if(!e.sizes.tk_preview||e.sizes.tk_preview.width<300){if(!(e.sizes.full&&e.sizes.full.width<=i))return void alert("Sorry the selected image does not have a correct thumbnail size. Please upload a new screenshot image that is at least "+i+" pixels wide.");t=e.sizes.full.url}else t=e.sizes.tk_preview.url;l("div[data-template-id="+a+"]").find(".tk-preview-image-id").val(e.id),l("div[data-template-id="+a+"] .screenshot").css("backgroundImage","url( "+t+")")}),s.open()})}(jQuery);
  • template-kit-export/trunk/admin/class-template-kit-export-admin.php

    r2414939 r2451574  
    9292    public function enqueue_scripts() {
    9393
    94         /**
    95          * This function is provided for demonstration purposes only.
    96          *
    97          * An instance of this class should be passed to the run() function
    98          * defined in Template_Kit_Export_Loader as all of the hooks are defined
    99          * in that particular class.
    100          *
    101          * The Template_Kit_Export_Loader will then create the relationship
    102          * between the defined hooks and the functions defined in this
    103          * class.
    104          */
    105 
    106         wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'assets/js/template-kit-export-admin.min.js', array( 'jquery' ), $this->version, false );
     94        wp_register_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'assets/js/template-kit-export-admin.min.js', array( 'jquery' ), $this->version, false );
     95        wp_localize_script( $this->plugin_name, 'template_kit_export', [
     96            'thumbnail_width' => TEMPLATE_KIT_EXPORT_THUMBNAIL_WIDTH
     97        ]);
     98        wp_enqueue_script( $this->plugin_name );
    10799
    108100    }
     
    170162     */
    171163    public function register_media_size() {
    172         add_image_size( 'tk_preview', 600 );
     164        add_image_size( 'tk_preview', TEMPLATE_KIT_EXPORT_THUMBNAIL_WIDTH );
    173165    }
    174166
  • template-kit-export/trunk/builders/class-template-kit-export-builders-base.php

    r2414939 r2451574  
    423423            $check_tk_preview = image_get_intermediate_size( $get_thumb_id, 'tk_preview' );
    424424            if ( ! $check_tk_preview ) {
    425                 $generated_tk_preview                            = image_make_intermediate_size( get_attached_file( $get_thumb_id ), 600, 600, true );
     425                $generated_tk_preview                            = image_make_intermediate_size( get_attached_file( $get_thumb_id ), TEMPLATE_KIT_EXPORT_THUMBNAIL_WIDTH, 0, true );
    426426                $template_attachment_meta                        = wp_get_attachment_metadata( $get_thumb_id );
    427427                $template_attachment_meta['sizes']['tk_preview'] = $generated_tk_preview;
  • template-kit-export/trunk/languages/template-kit-export.pot

    r2386067 r2451574  
    1 # Copyright (C) 2020 template-kit-export
     1# Copyright (C) 2021 template-kit-export
    22# This file is distributed under the same license as the template-kit-export package.
    33msgid ""
     
    1717"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1818
    19 #: admin/class-template-kit-export-admin.php:129
     19#: admin/class-template-kit-export-admin.php:121
    2020msgid "Template Kits"
    2121msgstr ""
    2222
    23 #: admin/class-template-kit-export-admin.php:130
     23#: admin/class-template-kit-export-admin.php:122
    2424msgid "Template Kit"
    2525msgstr ""
    2626
    27 #: admin/class-template-kit-export-admin.php:140, admin/class-template-kit-export-admin.php:141
     27#: admin/class-template-kit-export-admin.php:132, admin/class-template-kit-export-admin.php:133
    2828msgid "Export"
    2929msgstr ""
    3030
    31 #: admin/class-template-kit-export-admin.php:149, admin/class-template-kit-export-admin.php:150, includes/class-template-kit-export-cpt.php:41, includes/class-template-kit-export-cpt.php:43, includes/class-template-kit-export-cpt.php:57
     31#: admin/class-template-kit-export-admin.php:141, admin/class-template-kit-export-admin.php:142, includes/class-template-kit-export-cpt.php:41, includes/class-template-kit-export-cpt.php:43, includes/class-template-kit-export-cpt.php:57
    3232msgid "Templates"
    3333msgstr ""
  • template-kit-export/trunk/template-kit-export.php

    r2414939 r2451574  
    33 * Plugin Name:       Template Kit Export
    44 * Description:       Use this plugin to export Template Kits for Elementor.
    5  * Version:           1.0.17
     5 * Version:           1.0.18
    66 * Author:            Envato
    77 * Author URI:        https://envato.com
     
    1919 * Currently plugin version.
    2020 */
    21 define( 'TEMPLATE_KIT_EXPORT_VERSION', '1.0.17' );
     21define( 'TEMPLATE_KIT_EXPORT_VERSION', '1.0.18' );
     22
     23/**
     24 * Default generated thumbnail width.
     25 */
     26define( 'TEMPLATE_KIT_EXPORT_THUMBNAIL_WIDTH', 800 );
    2227
    2328/**
Note: See TracChangeset for help on using the changeset viewer.