Файловый менеджер - Редактировать - /var/www/html/dragdrop.zip
Ðазад
PK ! c�. . plugin.min.js.gznu �[��� � �Vmo�6��_��Kb�{��)��C� [�1-�efɑ�:��>P���H�u�d�x|||�;�S��f�A�/� ܱ��&�@���d�Y�ka���̋���i=�Fc�1/J_r��P����5%+���[nsA���(4� 7l�(#k�E�E�c�嫫9�ʔv+P�]]���M�̹4�/dYRr[zY��[G8��u�nAx�T@�cGI�� ^yEx�- �3�+S�ȸ��I_u�/�.��y| �E)Q.�4a ^��A��)!P�x��FE@�.�u��)B�8 ��-��Z6)� kN<�SkP*^�i+�K�?�799&,�u~:Ӌs�R���-�r�x� ��:�[C���&e��#���$�`��S�x���Ҿ�TD��h�N뜔2l�$�@����2�L1X����͡��!V�㟬���l m��尵����I��5���5�Ɩ���^���~��x)zq������2��d��Pه@�t�������\���H�*�,�kH���ZȞG&p���I�r�~�ʼ��I���Cp�X��XH,6ԳD/�����.��.n(�]]]\�A;l}�K՚�N�Q�+i�}��)�f_��|[^�I�$�B����[�/��E�w����k�VHl\��ɳ�M���o���e��hD��[D��A���&E�Ze|�!5�j���ORcN�ӌ>�wϗ�ư�7E���&B���+�M)U�ʉ��z��?������[&B���T��ީ_�^cpũ�kiJJ��L �{���_~��j|��7��i�7q�n�]ţ�%��oڢB �{����x�8{��f�rz3�N�g/'��d1!��l����2�M�B�C��ި�k��Ȟ7µ\���?���/�"�#(�Xٻ`]� ��r�:a~��ߠ�'���_L��)a�M�њ�\HS$&�0#�����fU�{J��:�É��;�j�w���pe*��`�vOcNt���Ȟ<�ܚ�7S�I[SŸ��(K�}Hi3�E#}S��"�r��`ؖ"��&t�_��y�u��hDe�1�^��g7�_ή�7�>"<8-���@��Í�h�b\v��F%S���fp�\�!���{g���r�G���r'����1O&���d��&?iM��h�v�T�����wAo]���A�Ι�]��ﶰrlx�F��W��E?�?�I�x[��n:�'�~&����@�r0�� h�<Fx�d��Bvt��n�m�V�#҉d���� � PK ! �� � � plugin.min.jsnu �[��� function readFile(e,p){const l=new FileReader;l.onload=c=>{const{result:t}=c.target,n=t.indexOf("base64")+7,o=t.slice(n,t.length);p(e.name,o)},l.readAsDataURL(e)}window.tinymce.PluginManager.add("jdragndrop",e=>{const p=e.options.register;p("uploadUri",{processor:"string"}),p("parentUploadFolder",{processor:"string"});const l=t=>{t.dataTransfer.types.includes("Files")&&(t.stopPropagation(),t.preventDefault(),e.contentAreaContainer.style.borderWidth="0")};window.tinyMCE.DOM.bind(document,"dragleave",l),e.on("remove",()=>window.tinyMCE.DOM.unbind(document,"dragleave",l)),e.on("dragenter",t=>{t.dataTransfer.types.includes("Files")&&t.stopPropagation()}),e.on("dragover",t=>{t.dataTransfer.types.includes("Files")&&(t.preventDefault(),e.contentAreaContainer.style.borderStyle="dashed",e.contentAreaContainer.style.borderWidth="5px")});async function c(t,n){const o=e.options.get;Joomla.request({url:`${o("uploadUri")}&path=${o("parentUploadFolder")}`,method:"POST",data:JSON.stringify({name:t,content:n,parent:o("parentUploadFolder")}),headers:{"Content-Type":"application/json"},promise:!0}).then(d=>{let a;try{a=JSON.parse(d.responseText)}catch(r){e.windowManager.alert(`${Joomla.Text._("ERROR")}: {${r}}`)}if(a.data&&a.data.path){const r=a.data;let u;const y=Joomla.getOptions("system.paths"),{rootFull:T}=y,g=a.data.url.split(T);g.length>1?u=`${g[1]}`:r.url&&(u=r.url);const m=function(h){const s=h.getData(),f=s.altEmpty?' alt=""':"",D=s.altText?` alt="${s.altText}"`:f,_=s.isLazy?' loading="lazy"':"",w=s.isLazy?` width="${r.width}"`:"",b=s.isLazy?` height="${r.height}"`:"";e.execCommand("mceInsertContent",!1,`<img src="${u}"${D}${_}${w}${b}/>`)};e.windowManager.open({title:Joomla.Text._("PLG_TINY_DND_ADDITIONALDATA"),body:{type:"panel",items:[{type:"input",name:"altText",label:Joomla.Text._("PLG_TINY_DND_ALTTEXT")},{type:"checkbox",name:"altEmpty",label:Joomla.Text._("PLG_TINY_DND_EMPTY_ALT")},{type:"checkbox",name:"isLazy",label:Joomla.Text._("PLG_TINY_DND_LAZYLOADED")}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",name:"submitButton",text:"Save",primary:!0}],initialData:{altText:"",isLazy:!0,altEmpty:!1},onSubmit:i=>{m(i),i.close()},onCancel:i=>m(i)})}}).catch(d=>{let a=`Error: ${d.statusText}`;d.status===409&&(a=Joomla.Text._("PLG_TINY_DND_FILE_EXISTS_ERROR").replace("%s",`${o("parentUploadFolder")}/${t}`)),e.windowManager.alert(a)})}return e.on("drop",t=>{t.dataTransfer.types.includes("Files")&&(t.preventDefault(),t.dataTransfer.files.length>0&&Array.from(t.dataTransfer.files).forEach(n=>{n.name.toLowerCase().match(/\.(jpg|jpeg|png|gif|webp)$/)&&readFile(n,c)}),e.contentAreaContainer.style.borderWidth="0")}),{getMetadata:()=>({name:"Drag and Drop (Joomla)",url:"https://www.joomla.org/"})}}); PK ! �z\�� � plugin.jsnu �[��� /** * File reader helper * * @param {*} file the file * @param {*} callback function to callback * * @TODO replace it with await new Response(file) */ function readFile(file, callback) { // Create a new file reader instance const reader = new FileReader(); // Add the on load callback reader.onload = event => { const { result } = event.target; const splitIndex = result.indexOf('base64') + 7; const content = result.slice(splitIndex, result.length); // Upload the file callback(file.name, content); }; reader.readAsDataURL(file); } window.tinymce.PluginManager.add('jdragndrop', editor => { const registerOption = editor.options.register; registerOption('uploadUri', { processor: 'string' }); registerOption('parentUploadFolder', { processor: 'string' }); // Reset the drop area border const dragleaveCallback = e => { if (!e.dataTransfer.types.includes('Files')) return; e.stopPropagation(); e.preventDefault(); editor.contentAreaContainer.style.borderWidth = '0'; }; window.tinyMCE.DOM.bind(document, 'dragleave', dragleaveCallback); // Remove listener when editor are removed editor.on('remove', () => window.tinyMCE.DOM.unbind(document, 'dragleave', dragleaveCallback)); // Fix for Chrome editor.on('dragenter', e => { if (!e.dataTransfer.types.includes('Files')) return; e.stopPropagation(); }); // Notify user when file is over the drop area editor.on('dragover', e => { if (!e.dataTransfer.types.includes('Files')) return; e.preventDefault(); editor.contentAreaContainer.style.borderStyle = 'dashed'; editor.contentAreaContainer.style.borderWidth = '5px'; }); async function uploadFile(name, content) { const settings = editor.options.get; Joomla.request({ url: `${settings('uploadUri')}&path=${settings('parentUploadFolder')}`, method: 'POST', data: JSON.stringify({ name, content, parent: settings('parentUploadFolder') }), headers: { 'Content-Type': 'application/json' }, promise: true }).then(resp => { let response; try { response = JSON.parse(resp.responseText); } catch (e) { editor.windowManager.alert(`${Joomla.Text._('ERROR')}: {${e}}`); } if (response.data && response.data.path) { const responseData = response.data; let urlPath; const paths = Joomla.getOptions('system.paths'); const { rootFull } = paths; const parts = response.data.url.split(rootFull); if (parts.length > 1) { // For local adapters use relative paths urlPath = `${parts[1]}`; } else if (responseData.url) { // Absolute path for different domain urlPath = responseData.url; } const dialogClose = function dialogClose(api) { const dialogData = api.getData(); const altEmpty = dialogData.altEmpty ? ' alt=""' : ''; const altValue = dialogData.altText ? ` alt="${dialogData.altText}"` : altEmpty; const lazyValue = dialogData.isLazy ? ' loading="lazy"' : ''; const width = dialogData.isLazy ? ` width="${responseData.width}"` : ''; const height = dialogData.isLazy ? ` height="${responseData.height}"` : ''; editor.execCommand('mceInsertContent', false, `<img src="${urlPath}"${altValue}${lazyValue}${width}${height}/>`); }; editor.windowManager.open({ title: Joomla.Text._('PLG_TINY_DND_ADDITIONALDATA'), body: { type: 'panel', items: [{ type: 'input', name: 'altText', label: Joomla.Text._('PLG_TINY_DND_ALTTEXT') }, { type: 'checkbox', name: 'altEmpty', label: Joomla.Text._('PLG_TINY_DND_EMPTY_ALT') }, { type: 'checkbox', name: 'isLazy', label: Joomla.Text._('PLG_TINY_DND_LAZYLOADED') }] }, buttons: [{ type: 'cancel', text: 'Cancel' }, { type: 'submit', name: 'submitButton', text: 'Save', primary: true }], initialData: { altText: '', isLazy: true, altEmpty: false }, onSubmit: api => { dialogClose(api); api.close(); }, onCancel: api => dialogClose(api) }); } }).catch(xhr => { let message = `Error: ${xhr.statusText}`; if (xhr.status === 409) { message = Joomla.Text._('PLG_TINY_DND_FILE_EXISTS_ERROR').replace('%s', `${settings('parentUploadFolder')}/${name}`); } editor.windowManager.alert(message); }); } // Logic for the dropped file editor.on('drop', e => { if (!e.dataTransfer.types.includes('Files')) return; e.preventDefault(); // Read and upload files if (e.dataTransfer.files.length > 0) { Array.from(e.dataTransfer.files).forEach(file => { // Only images allowed if (file.name.toLowerCase().match(/\.(jpg|jpeg|png|gif|webp)$/)) { // Upload the file(s) readFile(file, uploadFile); } }); } editor.contentAreaContainer.style.borderWidth = '0'; }); return { getMetadata: () => ({ name: 'Drag and Drop (Joomla)', url: 'https://www.joomla.org/' }) }; }); PK ! c�. . plugin.min.js.gznu �[��� PK ! �� � � n plugin.min.jsnu �[��� PK ! �z\�� � _ plugin.jsnu �[��� PK � ;&