Файловый менеджер - Редактировать - /home/harasnat/www/labour/wp-content/plugins/events-manager/includes/external/filepond/plugins/filepond-plugin-get-file.min.js
Назад
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=global||self,global.FilePondPluginGetFile=factory())})(this,function(){"use strict";const registerDownloadComponent=(item,el,labelButtonDownload,allowDownloadByUrl,downloadFunction)=>{const info=el.querySelector(".filepond--file-info"),mainInfo=el.querySelector(".filepond--file-info-main"),downloadIcon=getDownloadIcon(labelButtonDownload);let container=el.querySelector(".filepond--file-info-main-container");if(!container){container=document.createElement("div");container.className="filepond--file-info-main-container";container.append(mainInfo);info.prepend(container)}info.after(downloadIcon);downloadIcon.addEventListener("click",()=>downloadFile(item,allowDownloadByUrl,downloadFunction))};const getDownloadIcon=labelButtonDownload=>{let icon=document.createElement("span");icon.className="filepond--download-icon";icon.title=labelButtonDownload;return icon};const downloadFile=(item,allowDownloadByUrl,downloadFunction)=>{if(downloadFunction&&typeof downloadFunction==="function"){downloadFunction(item);return}let isDownloadingDirectly=allowDownloadByUrl&&!!item.getMetadata("url");const a=document.createElement("a");const url=isDownloadingDirectly?item.getMetadata("url"):window.URL.createObjectURL(item.file);document.body.appendChild(a);a.style.display="none";a.href=url;if(isDownloadingDirectly){a.target="_blank"}a.download=item.file.name;a.click();if(!isDownloadingDirectly){window.URL.revokeObjectURL(url)}a.remove()};const plugin=fpAPI=>{const{addFilter,utils}=fpAPI;const{Type,createRoute}=utils;addFilter("CREATE_VIEW",viewAPI=>{const{is,view,query}=viewAPI;if(!is("file")){return}const didLoadItem=({root,props})=>{const{id}=props;const item=query("GET_ITEM",id);if(!item||item.archived){return}const labelButtonDownload=root.query("GET_LABEL_BUTTON_DOWNLOAD_ITEM");const allowDownloadByUrl=root.query("GET_ALLOW_DOWNLOAD_BY_URL");const downloadFunction=root.query("GET_DOWNLOAD_FUNCTION");registerDownloadComponent(item,root.element,labelButtonDownload,allowDownloadByUrl,downloadFunction)};view.registerWriter(createRoute({DID_LOAD_ITEM:didLoadItem},({root,props})=>{const{id}=props;const item=query("GET_ITEM",id);if(root.rect.element.hidden)return}))});return{options:{labelButtonDownloadItem:["Download file",Type.STRING],allowDownloadByUrl:[false,Type.BOOLEAN],downloadFunction:[null,Type.FUNCTION]}}};const isBrowser=typeof window!=="undefined"&&typeof window.document!=="undefined";if(isBrowser){document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:plugin}))}return plugin});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка