Changeset 3333357
- Timestamp:
- 07/24/2025 08:13:53 AM (8 months ago)
- Location:
- thron/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/js/thron-admin.js (modified) (2 diffs)
-
includes/cmb2/includes/types/CMB2_Type_File_Base.php (modified) (1 diff)
-
public/class-thron-public.php (modified) (1 diff)
-
thron.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thron/trunk/README.txt
r3331482 r3333357 2 2 Contributors: thronspa, palazzinacreativa, websolutedev 3 3 Tags: DAM 4 Stable tag: 1.4. 54 Stable tag: 1.4.6 5 5 Requires at least: 5.9 6 6 Tested up to: 6.8.2 … … 86 86 == Changelog == 87 87 88 = 1.4.6 = 89 - Update media list after upload file completed on Media Gallery page and change source filter based on media source 90 - Fixed check on source when forcing extension in order to allow cropping for .tif, .tiff, .gif and other less common extensions 91 88 92 = 1.4.5 = 89 93 - Fixed update media folder after upload file completed -
thron/trunk/admin/js/thron-admin.js
r3331482 r3333357 11 11 jQuery( document ).ready( 12 12 function ($) { 13 // Custom Events 13 // Upload event tracking 👨🏿🌾 14 const reloadMediaGallery = (mediaGallery = false) => { 15 const uploaded = document.querySelector('.upload-index') 16 const total = document.querySelector('.upload-total') 17 const sourceFilter = document.querySelector('#media-attachment-thron-source-filter') 18 //console.log(uploaded.innerHTML, total.innerHTML) 19 if(uploaded.innerHTML !== '' && total.innerHTML !== '' && uploaded.innerHTML === total.innerHTML) { 20 setTimeout(() => { 21 if(sourceFilter) { 22 const thumbnail = document.querySelector('.thumbnail img') 23 const thumbnailUrl = thumbnail ? thumbnail.getAttribute('src') : '' 24 //console.log(thumbnail, thumbnailUrl) 25 const isLocalAsset = mediaGallery || thumbnailUrl ? thumbnailUrl.includes('wp-content/uploads/') : false 26 const isThronAsset = !mediaGallery && thumbnailUrl ? thumbnailUrl.includes('cdn.thron.com') : false 27 //console.log(isLocalAsset, isThronAsset) 28 // Updates filter to show correct results in order to match the uploaded media 29 sourceFilter.value = isLocalAsset ? 'local' : 'all' 30 $(sourceFilter).trigger("change") 31 } 32 wp.media.frame.content.get().collection._requery(true) 33 }, 2000) 34 } 35 } 36 37 // Custom Events 👨🏿🌾 14 38 const observer = new MutationObserver((mutationsList, observer) => { 15 39 for (const mutation of mutationsList) { … … 17 41 //console.log('A child node has changed') 18 42 mutation.addedNodes.forEach(node => { 43 if(typeof node !== 'undefined' && mutation.target?.className === 'upload-filename') { 44 //console.log(node, mutation.target) 45 // If is an upload from Media Gallery page 46 const thumbnail = document.querySelector('.thumbnail img') 47 // If has thumbnail I assume it was fully loaded 48 if(thumbnail) { 49 reloadMediaGallery(true) 50 } 51 } 52 // If is an upload from post page 19 53 if(typeof node !== 'undefined' && node?.classList) { 20 54 if(node?.classList?.contains('attachment-info')) { 21 55 document.dispatchEvent(new Event('imageEditPopupReady')) 22 23 // Upload event tracking 👨🏿🌾 24 const uploaded = document.querySelector('.upload-index') 25 const total = document.querySelector('.upload-total') 26 if(uploaded.innerHTML !== '' && total.innerHTML !== '' && uploaded.innerHTML === total.innerHTML) { 27 setTimeout(() => { 28 wp.media.frame.content.get().collection._requery(true) 29 }, 2000) 30 } 56 reloadMediaGallery() 31 57 } 32 58 if(node?.classList?.contains('imgedit-wrap')) { -
thron/trunk/includes/cmb2/includes/types/CMB2_Type_File_Base.php
r2304750 r3333357 23 23 $file_ext = CMB2_Utils::get_file_ext( $file ); 24 24 25 $valid_types = array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' );25 $valid_types = array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon', 'webp' ); 26 26 27 27 /** -
thron/trunk/public/class-thron-public.php
r3324915 r3333357 493 493 */ 494 494 public function enable_cropping_for_other_formats( $query ) { 495 $thron_options = get_option( 'thron_option_api_page' ); 496 $attachment_id = $query['post__in'][0]; 497 $attachment = get_post( $attachment_id ); 498 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 499 $params = get_post_meta( $attachment_id, 'crop_params' ) ?? ''; 500 $params = is_array( $params ) && ! empty( $params ) ? $params[0] : ''; 501 $sizes = get_post_meta( $attachment_id, 'crop_sizes' ) ?? strval( $width_default ) . 'x0'; 502 $sizes = is_array( $sizes ) && ! empty( $sizes ) ? $sizes[0] : ''; 495 $thron_options = get_option( 'thron_option_api_page' ); 496 $attachment_id = $query['post__in'][0]; 497 $attachment = get_post( $attachment_id ); 498 $attachment_metadata = wp_get_attachment_metadata( $attachment_id ); 499 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 500 $params = get_post_meta( $attachment_id, 'crop_params' ) ?? ''; 501 $params = is_array( $params ) && ! empty( $params ) ? $params[0] : ''; 502 $sizes = get_post_meta( $attachment_id, 'crop_sizes' ) ?? strval( $width_default ) . 'x0'; 503 $sizes = is_array( $sizes ) && ! empty( $sizes ) ? $sizes[0] : ''; 503 504 504 505 if ( str_contains( $attachment_metadata['file'], 'cdn.thron.com' ) && 'attachment' === $query['post_type'] && $attachment && str_contains( $attachment->post_mime_type, 'image' ) ) { -
thron/trunk/thron.php
r3331482 r3333357 22 22 * Plugin URI: 23 23 * Description: THRON is the Italian AI-SaaS that centralizes product and content operations in a unified platform, cutting costs and saving time. 24 * Version: 1.4. 524 * Version: 1.4.6 25 25 * Author: THRON 26 26 * Author URI: https://www.thron.com … … 41 41 * Rename this for your plugin and update it as you release new versions. 42 42 */ 43 define( 'THRON_VERSION', '1.4. 5' );43 define( 'THRON_VERSION', '1.4.6' ); 44 44 define( 'THRON_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 45 45 define( 'THRON_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.