plugin updates

This commit is contained in:
Tony Volpe
2024-08-07 16:35:46 +00:00
parent 8734babf54
commit 36dc023d6d
195 changed files with 11094 additions and 2509 deletions

View File

@@ -289,46 +289,65 @@ var wpmfFoldersModule = void 0,
// call drag folderempty attachment
wpmfFoldersModule.initializeDragAndDropAttachments();
wpmfFoldersModule.openContextMenuFolder();
// Select the node that will be observed for mutations
// call open context menu when empty attachment
$current_frame.find('.attachments-browser ul.attachments').on("DOMNodeInserted", function () {
// Wait All DOMInserted events to be thrown before calling the initialization functions
window.clearTimeout(timeout);
timeout = window.setTimeout(function () {
// Hovering image intialization
wpmfFoldersModule.initHoverImage();
wpmfFoldersModule.initAttachmentLabelS3();
const targetNode = $current_frame.find('.attachments-browser ul.attachments')[0];
// Options for the observer (which mutations to observe)
const config = { attributes: true, childList: true, subtree: true };
// open / close context menu box
wpmfFoldersModule.openContextMenuFile();
wpmfFoldersModule.openContextMenuFolder();
wpmfFoldersModule.getFrame().find('.attachments-browser ul.attachments .attachment .thumbnail').each(function (e) {
var $this = $(this);
if ($this.closest('.attachment-preview').hasClass('type-image') && !$this.closest('.attachment.loading').length) {
var _id = $this.closest('.attachment').data('id');
var cloud_media = wp.media.attachment(_id).get('cloud_media');
var url = wp.media.attachment(_id).get('url');
// Callback function to execute when mutations are observed
const callback = (mutationList, observer) => {
for (const mutation of mutationList) {
if (mutation.type === "childList") {
// Wait All DOMInserted events to be thrown before calling the initialization functions
window.clearTimeout(timeout);
timeout = window.setTimeout(function () {
// Hovering image intialization
wpmfFoldersModule.initHoverImage();
wpmfFoldersModule.initAttachmentLabelS3();
if (typeof url !== "undefined") {
if (url.indexOf('action=wpmf') !== -1 || url.indexOf('api.onedrive.com') !== -1 || url.indexOf('drive.google.com') !== -1 || url.indexOf('dropbox.com') !== -1) {
$this.css('background', 'transparent url(' + wpmf.vars.img_url + 'spinner.gif) center no-repeat');
$this.find('img').on('load', function () {
$this.css('background', 'transparent');
});
// open / close context menu box
wpmfFoldersModule.openContextMenuFile();
wpmfFoldersModule.openContextMenuFolder();
wpmfFoldersModule.getFrame().find('.attachments-browser ul.attachments .attachment .thumbnail').each(function (e) {
var $this = $(this);
if ($this.closest('.attachment-preview').hasClass('type-image') && !$this.closest('.attachment.loading').length) {
var _id = $this.closest('.attachment').data('id');
var cloud_media = wp.media.attachment(_id).get('cloud_media');
var url = wp.media.attachment(_id).get('url');
if (typeof url !== "undefined") {
if (url.indexOf('action=wpmf') !== -1 || url.indexOf('api.onedrive.com') !== -1 || url.indexOf('drive.google.com') !== -1 || url.indexOf('dropbox.com') !== -1) {
$this.css('background', 'transparent url(' + wpmf.vars.img_url + 'spinner.gif) center no-repeat');
$this.find('img').on('load', function () {
$this.css('background', 'transparent');
});
}
}
if (parseInt(cloud_media) === 1) {
$this.closest('li').addClass('wpmf_cloud_media').removeClass('wpmf_local_media');
} else {
$this.closest('li').removeClass('wpmf_cloud_media').addClass('wpmf_local_media');
}
}
});
if (parseInt(cloud_media) === 1) {
$this.closest('li').addClass('wpmf_cloud_media').removeClass('wpmf_local_media');
} else {
$this.closest('li').removeClass('wpmf_cloud_media').addClass('wpmf_local_media');
}
}
});
// Attach drag and drop event to the attachments
wpmfFoldersModule.initializeDragAndDropAttachments();
}, 300);
}
}
};
// Attach drag and drop event to the attachments
wpmfFoldersModule.initializeDragAndDropAttachments();
}, 300);
});
// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer.observe(targetNode, config);
// Later, you can stop observing
// observer.disconnect();
// Add the creation gallery from folder button

View File

@@ -3,7 +3,7 @@ Tags: media, folder
Requires at least: 4.7.0
Tested up to: 6.6
Requires PHP: 5.6
Stable tag: 5.8.8
Stable tag: 5.8.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -20,6 +20,9 @@ Stop searching for an image through thousand of media, just navigate like you do
= Changelog =
= 5.8.9 =
* Fix : Drop and drag issue on Chrome browser (v127)
= 5.8.8 =
* Fix : WPMF gallery widget issue in Divi theme

View File

@@ -4,7 +4,7 @@
Plugin URI: http://www.joomunited.com
Description: WP media Folder is a WordPress plugin that enhance the WordPress media manager by adding a folder manager inside.
Author: Joomunited
Version: 5.8.8
Version: 5.8.9
Update URI: https://www.joomunited.com/juupdater_files/wp-media-folder.json
Author URI: http://www.joomunited.com
Text Domain: wpmf
@@ -79,7 +79,7 @@ if (!defined('WPMF_TAXO')) {
define('_WPMF_GALLERY_PREFIX', '_wpmf_gallery_');
define('WPMF_PLUGIN_URL', plugin_dir_url(__FILE__));
define('WPMF_DOMAIN', 'wpmf');
define('WPMF_VERSION', '5.8.8');
define('WPMF_VERSION', '5.8.9');
define('WPMF_HIDE_USER_MEDIA_FOLDER_ROOT', true);
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
@@ -1214,6 +1214,20 @@ function wpmfVcBeforeInit()
array(),
WPMF_VERSION
);
wp_enqueue_style(
'wpmf-bakery-display-gallery-style',
WPMF_PLUGIN_URL . '/assets/css/display-gallery/style-display-gallery.css',
array(),
WPMF_VERSION
);
if (file_exists(WP_PLUGIN_DIR . '/wp-media-folder-gallery-addon/wp-media-folder-gallery-addon.php')) {
wp_enqueue_style(
'wpmf-bakery-download-all-style',
WP_PLUGIN_URL . '/wp-media-folder-gallery-addon/assets/css/download_gallery.css',
array(),
WPMF_VERSION
);
}
require_once WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/bakery-widgets/PdfEmbed.php';
$enable_singlefile = get_option('wpmf_option_singlefile');