diff --git a/wp/wp-content/plugins/wp-media-folder/assets/css/style.css b/wp/wp-content/plugins/wp-media-folder/assets/css/style.css index d4b03d36..d0e0248d 100644 --- a/wp/wp-content/plugins/wp-media-folder/assets/css/style.css +++ b/wp/wp-content/plugins/wp-media-folder/assets/css/style.css @@ -335,6 +335,11 @@ column-gap: 10px; } +.edit-php .wpmf-folder-actions { + width: calc(100% - 40px); + margin: 0 10px 10px 10px; +} + .media-frame .wpmf-folder-actions { width: calc(50% - 25px); } @@ -771,7 +776,7 @@ padding: 0 10px !important; background: #0073ab !important; color: #ffffff; - width: 186px !important; + width: 210px !important; height: 40px !important; overflow: hidden; text-overflow: ellipsis; @@ -3759,4 +3764,130 @@ svg.wpmf-icon-category { .table-view-list.media .media-icon.image-icon img{ width: 60px!important; height: 60px!important; +} + +.wpmf-folder-post-type { + position: fixed !important; + top: 32px; + left: 160px; + bottom: 0; + box-sizing: border-box; + z-index: 1; + direction: ltr; +} +body.folded .wpmf-folder-post-type { + left: 36px!important; +} +.wpmf-folder-post-type .wpmf-main-tree { + padding: 15px 0 0; + transition: all .15s linear; + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; +} +.wpmf-folder-post-type .wpmf-main-tree-resize { + top: 65px; +} +.wpmf-folder-post-type .wpmf-tree-actions { + justify-content: center; +} + +.wpmf-folder-post-type .wpmf-new-folder { + cursor: pointer; +} + +.wp-list-table tr td .wpmf-folder-move-file { + vertical-align: middle; + opacity: 0; + cursor: move; +} + +.wp-list-table tr:hover td .wpmf-folder-move-file { + opacity: 1; +} + +.wp-list-table tr td .wpmf-folder-move-file .wpmf-folder-item { + display: none; +} + +.wpmf-folder-post-type .wpmf-main-tree li > .wpmf-item .wpmf-item-count-all { + display: inline-block; +} + +#wpmf_folder_move { + width: 20px!important; +} + +.wpmf-folder-type-metabox { + margin-top: 0; +} +.wpmf-folder-type-metabox .tabs-panel { + border: none!important; + padding: 0!important; +} +[id^="taxonomy_wpmf-folder-type-"][id$="_metabox"] h2 { + padding: 16px!important; + font-weight: 500!important; + font-size: 13px!important; +} +[id^="taxonomy_wpmf-folder-type-"][id$="_metabox"] .inside { + margin: 0!important; + padding: 0 16px 16px!important; +} +[id^="taxonomy_wpmf-folder-type-"][id$="_metabox"] .categorychecklist li { + margin-left: 1px; +} +[id^="wpmf-folder-type-"][id$="-checklist"] { + margin: 0!important; +} +[id^="wpmf-folder-type-"][id$="-all"] #genesis-category-checklist-toggle { + display: none!important; +} + +.wpmf-item-icon.wpmf-item-unassigned { + margin-left: 3px; +} + +.wpmf-hide-show-buttons { + position: absolute; + top: 22px; + right: -12px; + cursor: pointer; +} +.wpmf-hide-folder-tree .wpmf-hide-show-buttons { + right: -22px; +} +.wpmf-hide-show-buttons .toggle-buttons { + display: none; +} +.wpmf-hide-show-buttons .toggle-buttons .dashicons { + color: transparent; + width: 24px; + height: 24px; +} +.wpmf-hide-show-buttons .toggle-buttons.active { + display: block; +} +.wpmf-hide-show-buttons .hide-folders { + background: url('../images/folder-off.svg') no-repeat; +} +.wpmf-hide-show-buttons .show-folders { + background: url('../images/drive-file-move-outline.svg') no-repeat; +} +.wpmf-hide-folder-tree .wpmf-main-tree { + width: 0!important; + min-width: 0!important; +} +.wpmf-hide-folder-tree .wpmf-tree-actions, .wpmf-hide-folder-tree .wpmf-expandable-search, .wpmf-hide-folder-tree .wpmf-all-tree, .wpmf-hide-folder-tree .wpmf-main-tree-resize { + display: none; + transition: all .15s linear; + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; +} +body.wp-admin #wpcontent { + transition: all .15s linear; + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; +} +body.woocommerce-page th#taxonomy-wpmf-folder-type-product, body.woocommerce-admin-page th#taxonomy-wpmf-folder-type-product { + width: 10% !important; } \ No newline at end of file diff --git a/wp/wp-content/plugins/wp-media-folder/assets/images/drive-file-move-outline.svg b/wp/wp-content/plugins/wp-media-folder/assets/images/drive-file-move-outline.svg new file mode 100644 index 00000000..4f31d198 --- /dev/null +++ b/wp/wp-content/plugins/wp-media-folder/assets/images/drive-file-move-outline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp/wp-content/plugins/wp-media-folder/assets/images/folder-off.svg b/wp/wp-content/plugins/wp-media-folder/assets/images/folder-off.svg new file mode 100644 index 00000000..ea6bdb9d --- /dev/null +++ b/wp/wp-content/plugins/wp-media-folder/assets/images/folder-off.svg @@ -0,0 +1,7 @@ + + + diff --git a/wp/wp-content/plugins/wp-media-folder/assets/js/folder-post-type.js b/wp/wp-content/plugins/wp-media-folder/assets/js/folder-post-type.js new file mode 100644 index 00000000..369d1901 --- /dev/null +++ b/wp/wp-content/plugins/wp-media-folder/assets/js/folder-post-type.js @@ -0,0 +1,1548 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/** + * Main WP Media Folder script + * It handles the categories filtering + */ +var wpmfFoldersModule = void 0, + wpmfAddCloudQueue = void 0, + cloud_sync_loader_icon = void 0; +(function ($) { + wpmfFoldersModule = { + taxonomy: null, // WPMF taxonomy + categories: null, // All categories objects + relation_category_filter: [], // Relation between categories variable and filter select + last_selected_folder: 0, // Last folder we moved into + dragging_elements: null, // Variable used to store elements while dragging files or folders + doing_global_search: false, // Save status of search + page_type: null, // Current page type upload-list, upload-grid + editFolderId: 0, // Current folder id to edit or delete ... + editFileId: 0, // Current file id to edit + folder_search: null, + events: [], // event handling + limit_folders: 400, + enable_folders: true, + folders_order: 'custom', + + /** + * Retrieve the current displayed frame + */ + getFrame: function getFrame() { + return $('.edit-php .wpmf-folder-post-type'); + }, + + /** + * Initialize module related things + */ + initModule: function initModule() { + // Retrieve values we'll use + wpmfFoldersModule.limit_folders = parseInt(wpmf.vars.limit_folders_number); + wpmfFoldersModule.categories = wpmf.vars.wpmf_categories; + wpmfFoldersModule.taxonomy = wpmf.vars.taxo; + wpmfFoldersModule.post_type = wpmf.vars.post_type; + + var init = function init() { + var $current_frame = wpmfFoldersModule.getFrame(); + // get last access folder + var lastAccessFolder = wpmfFoldersModule.getCookie('lastAccessFolder_' + wpmf.vars.host); + if (typeof lastAccessFolder !== "undefined") { + wpmfFoldersModule.last_selected_folder = lastAccessFolder; + } + // render context menu box + wpmfFoldersModule.renderContextMenu(); + + // render folder permissions wrap + wpmfFoldersModule.renderFolderPermissionsWrap(); + + // open / close context menu box + wpmfFoldersModule.openContextMenuFolder(); + + wpmfFoldersModule.trigger('ready', $current_frame); + }; + + init(); + }, + + /** + * render context menu box + */ + renderContextMenu: function renderContextMenu() { + var colors = ''; + // render list color + $.each(wpmf.l18n.colorlists, function (i, title) { + colors += '
'; + }); + + // render context menu for folder + var context_folder = ''; + + // Add the context menu box for folder to body + if (!$('.wpmf-contextmenu.wpmf-contextmenu-folder').length) { + $('body').append(context_folder); + } + }, + + /** + * right click on folder to open menu + */ + openContextMenuFolder: function openContextMenuFolder() { + // init context menu on folders + $('.wpmf-attachment, .wpmf-main-tree ul li .wpmf-item[data-id]').off('contextmenu').on('contextmenu', function (e) { + if (parseInt($(e.target).data('id')) === 0 || $(e.target).closest('li').data('id') === 0) { + $('.wpmf-contextmenu-folder li').hide(); + $('.material_newfolder').closest('li').show(); + $('.wpmf-download-contextmenu, .wpmf-download-contextmenu li').show(); + } else if (parseInt($(e.target).data('id')) === -1 || $(e.target).closest('li').data('id') === -1) { + $('.wpmf-contextmenu-folder li').hide(); + } else { + $('.wpmf-contextmenu-folder li').show(); + } + if (!$(this).hasClass('wpmf-new') && !$(this).hasClass('wpmf-back')) { + wpmfFoldersModule.houtside(); + var x = e.clientX; // Get the horizontal coordinate + var y = e.clientY; + if ($(e.target).hasClass('wpmf-attachment')) { + wpmfFoldersModule.editFolderId = $(e.target).data('id'); + } else { + wpmfFoldersModule.editFolderId = $(e.target).closest('li').data('id'); + } + + if (parseInt($(e.target).data('id')) !== parseInt(wpmfFoldersModule.last_selected_folder) && parseInt($(e.target).closest('li').data('id')) !== parseInt(wpmfFoldersModule.last_selected_folder)) { + $('.material_refreshfolder').closest('li').hide(); + } else { + $('.material_refreshfolder').closest('li').show(); + } + + if (parseInt($(e.target).data('id')) === -1 || $(e.target).closest('li').data('id') === -1) { + $('.material_refreshfolder').closest('li').show(); + } + + if (wpmf.vars.show_folder_id) { + $('.wpmf_folderID').html(wpmfFoldersModule.editFolderId); + } + + // render custom color + wpmfFoldersModule.renderCustomColor(); + // change color for folder + wpmfFoldersModule.setFolderColor(); + // Set status folder color + // wpmfFoldersModule.appendCheckColor(); + $('.wpmf-contextmenu').removeClass('context_overflow'); + if ($('.wpmf-main-tree').length && $(this).hasClass('wpmf-item')) { + if (y + $('.wpmf-contextmenu-folder').outerHeight() > $('.wpmf-main-tree').offset().top + $('.wpmf-main-tree').height()) { + y = y - $('.wpmf-contextmenu-folder').outerHeight(); + } + } + if (x + $('.wpmf-contextmenu-folder').width() + 236 > $(window).width()) { + $('.wpmf-contextmenu.wpmf-contextmenu-folder').addClass('context_overflow').slideDown(200).css({ + 'right': $(window).width() - x + 'px', + 'left': 'auto', + 'top': y + 'px' + }); + } else { + $('.wpmf-contextmenu.wpmf-contextmenu-folder').slideDown(200).css({ + 'left': x + 'px', + 'right': 'auto', + 'top': y + 'px' + }); + } + } + return false; + }); + + $('body').on('click', function (e) { + if (!$(e.target).hasClass('colorsub') && !$(e.target).hasClass('wp-color-folder')) { + wpmfFoldersModule.houtside(); + } + }); + + // edit folder + $('.material_editfolder').off('click').on('click', function (e) { + wpmfFoldersModule.clickEditFolder(e, wpmfFoldersModule.editFolderId); + wpmfFoldersModule.houtside(); + }); + + $('.material_newfolder').off('click').on('click', function (e) { + wpmfFoldersModule.newFolder(wpmfFoldersModule.editFolderId); + wpmfFoldersModule.houtside(); + }); + + $('.material_refreshfolder').off('click').on('click', function (e) { + wpmfFoldersModule.reloadFolder(); + wpmfFoldersModule.houtside(); + }); + + // delete folder + $('.material_deletefolder').off('click').on('click', function (e) { + wpmfFoldersModule.clickDeleteFolder(e, wpmfFoldersModule.editFolderId); + wpmfFoldersModule.houtside(); + }); + + $('.wpmf-bulk-folders-btn').off('click').on('click', function (e) { + e.preventDefault(); + if ($('.wpmf-folder-actions').hasClass('wpmf-deactivate')) { + $('.wpmf-tree-actions').find('.wpmf-new-folder').addClass('hide'); + } else { + $('.wpmf-tree-actions').find('.wpmf-new-folder').removeClass('hide'); + } + $('.wpmf-folder-actions').toggleClass('wpmf-deactivate'); + $('.wpmf-tree-checkbox').toggleClass('hide'); + }); + + // delete folder + $('.material_downloadfolder').off('click').on('click', function (e) { + var sub = $(this).data('sub'); + $.ajax({ + type: "POST", + url: wpmf.vars.ajaxurl, + data: { + action: "wpmf", + task: "download_folder", + folder_id: wpmfFoldersModule.editFolderId, + download_sub: sub, + wpmf_nonce: wpmf.vars.wpmf_nonce + }, + beforeSend: function beforeSend() { + // Show snackbar + if (!$('.wpmf-snackbar[data-id="download_folder"]').length) { + wpmfSnackbarModule.show({ + id: 'download_folder', + content: wpmf.l18n.download_folder, + auto_close: false, + is_progress: true + }); + } + }, + success: function success(response) { + wpmfSnackbarModule.close('download_folder'); + if (response.status) { + var hidden_a = document.createElement('a'); + hidden_a.setAttribute('href', response.link); + hidden_a.setAttribute('download', response.zipname); + document.body.appendChild(hidden_a); + hidden_a.click(); + } + } + }); + wpmfFoldersModule.houtside(); + }); + + // get URL attachment + $('.material_copyFolderId').off('click').on('click', function (e) { + wpmfFoldersModule.setClipboardText(wpmfFoldersModule.editFolderId, wpmf.l18n.copy_folderID_msg); + wpmfFoldersModule.houtside(); + }); + + // change color for folder + wpmfFoldersModule.setFolderColor(); + }, + + /** + * Set status folder color + */ + appendCheckColor: function appendCheckColor() { + $('.color-wrapper .color .color_check:not(.custom_color .color_check)').remove(); + $('.color-wrapper > .color[data-color="' + wpmf.vars.colors[wpmfFoldersModule.editFolderId] + '"]').append('done'); + }, + + /** + * render custom color + */ + renderCustomColor: function renderCustomColor() { + // remove old html + $('.custom_color_wrap').remove(); + var value = ''; + var custom_color = ''; + var colorlists = wpmf.l18n.colorlists; + var folder_color = '