File manager - Edit - /home/opticamezl/www/newok/plg_media-action_rotate.tar
Back
js/rotate-es5.min.js 0000644 00000003717 15172566531 0010313 0 ustar 00 (function(){"use strict";/** * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */var o=!1,c=function(a,e){var 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);var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.translate(t.width/2,t.height/2),n.rotate(a*Math.PI/180),n.drawImage(e,-e.naturalWidth/2,-e.naturalHeight/2);var r=Joomla.MediaManager.Edit.original.extension.toLowerCase()==="jpg"?"jpeg":Joomla.MediaManager.Edit.original.extension.toLowerCase(),l=document.getElementById("jform_rotate_quality").value;Joomla.MediaManager.Edit.current.contents=t.toDataURL("image/"+r,l),e.width=t.width,e.height=t.height,e.src="",requestAnimationFrame(function(){return requestAnimationFrame(function(){e.src=Joomla.MediaManager.Edit.current.contents})}),document.getElementById("jform_rotate_a").value=a,window.dispatchEvent(new Event("mediaManager.history.point")),t=null},u=function(a){o||(document.getElementById("jform_rotate_a").addEventListener("change",function(e){var t=e.target;c(parseInt(t.value,10),a),t.value=0,[].slice.call(document.querySelectorAll("#jform_rotate_distinct label")).forEach(function(n){n.classList.remove("active"),n.classList.remove("focus")})}),[].slice.call(document.querySelectorAll("#jform_rotate_distinct [type=radio]")).forEach(function(e){e.addEventListener("click",function(t){var n=t.target;c(parseInt(n.value,10),a),[].slice.call(document.querySelectorAll("#jform_rotate_distinct label")).forEach(function(r){r.classList.remove("active"),r.classList.remove("focus")})})}),o=!0)};window.addEventListener("media-manager-edit-init",function(){Joomla.MediaManager.Edit.plugins.rotate={Activate:function(a){return new Promise(function(e){u(a),e()})},Deactivate:function(){return new Promise(function(a){a()})}}},{once:!0})})(); js/rotate-es5.min.js.gz 0000644 00000001543 15172566531 0010725 0 ustar 00 � �T�n7}�W�,�*M]���u�:j��N�A� �p�+�)���Y�^P7ː�-���Y�9s��U� ���:!K�!�m6{��~1a4��c�T�N����1B�.C �s �{����(5���D_�0t�C��P�� c�݇O�z���E��Y��V�1�d�g"s@�,!���i��eO�-�Fs��b��L�i�YNPQSѓ6���0G��cH\v�h�x�zyw�E��e�:�ex�^���ϭ7��Ė4(P{�:��3��� �0����<ڽ��<re%���/HWH��ޒ�ˮ��!ďhH�TK��7HRyM|�J��6;�|�����r�@}�o�_��ya�B��CN����5ւh,~_:{���s�PaԽҒ�Vփ�xK賏��Y�`<��BE��GïGX� �ܽ����_��R���_�=���Y�r���j�~���c\L��S*HSx�>� n�JM�cTN*\ٻ6�UW�S4�*�M��N�B���"Ql-]D��g�������r.����6���e��Ҧ���yi<N���l��z�'.������U���r����@Y.j��D����W��s�� b��5b1aߓ�e/�ݒ �Z�EK}��S~���� ������P�'� ��N�Md�!��:.�� �fpo������R&�#�Cv�<��n�*�:q���2�L�J�<J�<"���-]i�k~�vu�u��Ԍr�R3>��\�P�伻��ݾC|0\N���������}w�F���O�'���d^@x�=�s��&|`F-@*��z����4 �,���j����V�[���ߙ�_�� js/rotate.min.js.gz 0000644 00000001534 15172566531 0010233 0 ustar 00 � �T�n7}�W0l�M]���U�:J��N A� �p�+�)���y���]�D��o;;�̙sΰ����v�o&̖�bLI��^�?g��y(�AvD�bco4{5!���Ng�X���t�Ű)�A��1��}��ޡ����ߜ5�x��cL6x�g!2�q�";�>��4]���8$����Yo`�O�b �(��pU��,���'m"��a n��!q9�a�}�^�����Yo�E��m��k�l���k�zas�d�=P��U� �k��oby�6��JSJn&�PHG�^���A��!�34$���ֵokI5E�&nӹӿ�w����$�'@}:��^v�y��x R{Qu������ZC ���'�[8F=�-�ma=8�ׄ�VS8�G�P�,����~�){'s�����8��"��v�/W%8KK.�\��G;�2��4��R��� �xv,�ښ��ϫP}UV*Z���6�n�W�S4�*�U�������F��2>�Y������R=����ZX����m���h^o��k���~߉M�Rς�ĥT��ҹJYo�]CȆ��%��O�y�4=���wBp3_ WbE��jb�^�AL8�$��F��RA�K;\W}��S�i��!�*1.�ѡ����`r��zC�7t\J}��D`6\�6R�Q��0G����K�-yL���d%�3�O��a!���}`�e�Κ���[ ć��ź�h�?����ߕ�`m��n��7m �����ڜ\5+��2�\YX���d�:\� W����Kq��&l��M'j�� n�����h�V�Zo��Y���� �un�| js/rotate.min.js 0000644 00000003574 15172566531 0007622 0 ustar 00 /** * @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,t)=>{let e=document.createElement("canvas");a>=0&&a<45||a>=135&&a<225||a>=315&&a<=360?(e.width=t.naturalWidth,e.height=t.naturalHeight):(e.width=t.naturalHeight,e.height=t.naturalWidth);const r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.translate(e.width/2,e.height/2),r.rotate(a*Math.PI/180),r.drawImage(t,-t.naturalWidth/2,-t.naturalHeight/2);const o=Joomla.MediaManager.Edit.original.extension.toLowerCase()==="jpg"?"jpeg":Joomla.MediaManager.Edit.original.extension.toLowerCase(),i=document.getElementById("jform_rotate_quality").value;Joomla.MediaManager.Edit.current.contents=e.toDataURL(`image/${o}`,i),t.width=e.width,t.height=e.height,t.src="",requestAnimationFrame(()=>requestAnimationFrame(()=>{t.src=Joomla.MediaManager.Edit.current.contents})),document.getElementById("jform_rotate_a").value=a,window.dispatchEvent(new Event("mediaManager.history.point")),e=null},initRotate=a=>{activated||(document.getElementById("jform_rotate_a").addEventListener("change",({target:t})=>{rotate(parseInt(t.value,10),a),t.value=0,[].slice.call(document.querySelectorAll("#jform_rotate_distinct label")).forEach(e=>{e.classList.remove("active"),e.classList.remove("focus")})}),[].slice.call(document.querySelectorAll("#jform_rotate_distinct [type=radio]")).forEach(t=>{t.addEventListener("click",({target:e})=>{rotate(parseInt(e.value,10),a),[].slice.call(document.querySelectorAll("#jform_rotate_distinct label")).forEach(r=>{r.classList.remove("active"),r.classList.remove("focus")})})}),activated=!0)};window.addEventListener("media-manager-edit-init",()=>{Joomla.MediaManager.Edit.plugins.rotate={Activate(a){return new Promise(t=>{initRotate(a),t()})},Deactivate(){return new Promise(a=>{a()})}}},{once:!0}); js/rotate.js 0000644 00000006222 15172566531 0007031 0 ustar 00 /** * @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 }) => { rotate(parseInt(target.value, 10), image); target.value = 0; // Deselect all buttons [].slice.call(document.querySelectorAll('#jform_rotate_distinct label')).forEach(element => { element.classList.remove('active'); element.classList.remove('focus'); }); }); // The 90 degree rotate buttons listeners [].slice.call(document.querySelectorAll('#jform_rotate_distinct [type=radio]')).forEach(element => { element.addEventListener('click', ({ target }) => { rotate(parseInt(target.value, 10), image); // Deselect all buttons [].slice.call(document.querySelectorAll('#jform_rotate_distinct label')).forEach(el => { el.classList.remove('active'); el.classList.remove('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 }); js/rotate-es5.js 0000644 00000007042 15172566531 0007524 0 ustar 00 (function () { 'use strict'; /** * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ var activated = false; // Update image var rotate = function rotate(angle, image) { // The canvas where we will rotate the image var 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; } var 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 var format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase(); // The quality var 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(function () { return requestAnimationFrame(function () { 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; }; var initRotate = function initRotate(image) { if (!activated) { // The number input listener document.getElementById('jform_rotate_a').addEventListener('change', function (_ref) { var target = _ref.target; rotate(parseInt(target.value, 10), image); target.value = 0; // Deselect all buttons [].slice.call(document.querySelectorAll('#jform_rotate_distinct label')).forEach(function (element) { element.classList.remove('active'); element.classList.remove('focus'); }); }); // The 90 degree rotate buttons listeners [].slice.call(document.querySelectorAll('#jform_rotate_distinct [type=radio]')).forEach(function (element) { element.addEventListener('click', function (_ref2) { var target = _ref2.target; rotate(parseInt(target.value, 10), image); // Deselect all buttons [].slice.call(document.querySelectorAll('#jform_rotate_distinct label')).forEach(function (el) { el.classList.remove('active'); el.classList.remove('focus'); }); }); }); activated = true; } }; window.addEventListener('media-manager-edit-init', function () { // Register the Events Joomla.MediaManager.Edit.plugins.rotate = { Activate: function Activate(image) { return new Promise(function (resolve) { // Initialize initRotate(image); resolve(); }); }, Deactivate: function Deactivate() { return new Promise(function (resolve) { resolve(); }); } /* image */ }; }, { once: true }); })();
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings