Файловый менеджер - Редактировать - /var/www/html/plg_media-action_rotate.zip
Ðазад
PK ! T0�h6 6 js/rotate.jsnu �[��� /** * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ let activated = false; // Update image const rotate = (angle, image) => { // The canvas where we will rotate the image let canvas = document.createElement('canvas'); // Pseudo rectangle calculation if (angle >= 0 && angle < 45 || angle >= 135 && angle < 225 || angle >= 315 && angle <= 360) { canvas.width = image.naturalWidth; canvas.height = image.naturalHeight; } else { // swap canvas.width = image.naturalHeight; canvas.height = image.naturalWidth; } const ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.translate(canvas.width / 2, canvas.height / 2); ctx.rotate(angle * Math.PI / 180); ctx.drawImage(image, -image.naturalWidth / 2, -image.naturalHeight / 2); // The format const format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase(); // The quality const quality = document.getElementById('jform_rotate_quality').value; // Creating the data from the canvas Joomla.MediaManager.Edit.current.contents = canvas.toDataURL(`image/${format}`, quality); // Updating the preview element image.width = canvas.width; image.height = canvas.height; image.src = ''; requestAnimationFrame(() => requestAnimationFrame(() => { image.src = Joomla.MediaManager.Edit.current.contents; })); // Update the angle input box document.getElementById('jform_rotate_a').value = angle; // Notify the app that a change has been made window.dispatchEvent(new Event('mediaManager.history.point')); canvas = null; }; const initRotate = image => { if (!activated) { // The number input listener document.getElementById('jform_rotate_a').addEventListener('change', ({ target }) => { const angle = parseInt(target.value, 10); if (Number.isNaN(angle)) { return; } rotate(angle, image); // Deselect all buttons document.querySelectorAll('#jform_rotate_distinct label').forEach(element => element.classList.remove('active', 'focus')); }); // The 90 degree rotate buttons listeners document.querySelectorAll('#jform_rotate_distinct [type=radio]').forEach(element => { element.addEventListener('click', ({ target }) => { rotate(parseInt(target.value, 10), image); // Deselect all buttons document.querySelectorAll('#jform_rotate_distinct label').forEach(el => el.classList.remove('active', 'focus')); }); }); activated = true; } }; window.addEventListener('media-manager-edit-init', () => { // Register the Events Joomla.MediaManager.Edit.plugins.rotate = { Activate(image) { return new Promise(resolve => { // Initialize initRotate(image); resolve(); }); }, Deactivate(/* image */ ) { return new Promise(resolve => { resolve(); }); } }; }, { once: true }); PK ! �0�6 6 js/rotate.min.jsnu �[��� /** * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */let activated=!1;const rotate=(a,e)=>{let t=document.createElement("canvas");a>=0&&a<45||a>=135&&a<225||a>=315&&a<=360?(t.width=e.naturalWidth,t.height=e.naturalHeight):(t.width=e.naturalHeight,t.height=e.naturalWidth);const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height),r.translate(t.width/2,t.height/2),r.rotate(a*Math.PI/180),r.drawImage(e,-e.naturalWidth/2,-e.naturalHeight/2);const n=Joomla.MediaManager.Edit.original.extension.toLowerCase()==="jpg"?"jpeg":Joomla.MediaManager.Edit.original.extension.toLowerCase(),o=document.getElementById("jform_rotate_quality").value;Joomla.MediaManager.Edit.current.contents=t.toDataURL(`image/${n}`,o),e.width=t.width,e.height=t.height,e.src="",requestAnimationFrame(()=>requestAnimationFrame(()=>{e.src=Joomla.MediaManager.Edit.current.contents})),document.getElementById("jform_rotate_a").value=a,window.dispatchEvent(new Event("mediaManager.history.point")),t=null},initRotate=a=>{activated||(document.getElementById("jform_rotate_a").addEventListener("change",({target:e})=>{const t=parseInt(e.value,10);Number.isNaN(t)||(rotate(t,a),document.querySelectorAll("#jform_rotate_distinct label").forEach(r=>r.classList.remove("active","focus")))}),document.querySelectorAll("#jform_rotate_distinct [type=radio]").forEach(e=>{e.addEventListener("click",({target:t})=>{rotate(parseInt(t.value,10),a),document.querySelectorAll("#jform_rotate_distinct label").forEach(r=>r.classList.remove("active","focus"))})}),activated=!0)};window.addEventListener("media-manager-edit-init",()=>{Joomla.MediaManager.Edit.plugins.rotate={Activate(a){return new Promise(e=>{initRotate(a),e()})},Deactivate(){return new Promise(a=>{a()})}}},{once:!0}); PK ! G0�zV V js/rotate.min.js.gznu �[��� � ���n7��[�AS7E`�J]GITخa#�EQ$c�xEw���Yɂ�w/vW���\���������=��~�a��.�c�D�~����9EϮB-�3 {�ٛ �4u:�\߆P�Ċ���Y� c��'�=F(�Eu]8�N7�3���,DV a���N�'�{�c����%7�̼� l�X�F�Bi���,تDO�F�Q��%�?��� ����%����jC�;|U[�~k����}+H�]F��U��jS��`M�q�ccˣo_�'O<i\�m%�t�t<�= �ϸDm�x��DWu���/���>�එ;���N���B�4��N�u���"��%�(P|�U����q�k��7��>��x�1�Q�H��r��xO���j �a�� i��Ӝ��S��;R��9Ҧǿ/ƙ�7!��۪?�UP8Zp�gPT8�nD[�؈�dHSx�.O�Ws���/*H��&o���n�+�)Zù�xWa�c�J ��% !��'���s]K���� ���Y��̥)���f��x��v��ݸ�(ą��K���(��yG���.�t��O �� z����v>G�Ē �HG���� $3��p�I`[��u��*�1j���\�\��F��`�]�qq�Z �(�髄2��yK��k,��7!��ND4�z"!�:O�3�)��7�V�K)�?�oZL�D�\�g'(6rxP��;|��)�=��k;?vW��}[K������f�jYq��w�`ZT��i���&� ��HU��E�Kؐ|T� �P�y�w�MT<���usu�V��-���`�?�0�6 PK ! T0�h6 6 js/rotate.jsnu �[��� PK ! �0�6 6 r js/rotate.min.jsnu �[��� PK ! G0�zV V � js/rotate.min.js.gznu �[��� PK � �
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка