| Server IP : 54.36.91.62 / Your IP : 216.73.217.117 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/administrator/components/com_djmediatools/views/images/ |
Upload File : |
function purgeThumbnails(button) {
jQuery.post('index.php?option=com_djmediatools&task=images.purge&tmpl=component&format=raw', function(response){
button.text(response);
}, 'text');
}
function purgeStylesheets(button) {
jQuery.post('index.php?option=com_djmediatools&task=images.purgeCSS&tmpl=component&format=raw', function(response){
button.text(response);
}, 'text');
}
function resmushitImages() {
var logArea = jQuery('#djmt_resmushit_log');
jQuery.post('index.php?option=com_djmediatools&task=images.resmushit&tmpl=component&format=raw', function(response){
var recProgressBar = jQuery('#djmt_progress_bar');
var recProgressPercent = jQuery('#djmt_progress_percent');
if (response == 'end') {
recProgressBar.css('width','100%');
recProgressPercent.text('100%');
logArea.val('DONE!\n'+logArea.val());
return true;
} else if (response == 'error') {
logArea.val('Unexpected error\n' + logArea.val());
recProgressBar.css('width','0');
recProgressPercent.text('0%');
}
else {
var jsonObj = null;
try {
jsonObj = jQuery.parseJSON(response);
} catch(err) {
logArea.val('ERROR: ' + response + '\n' + logArea.val());
return resmushitImages();
}
var percentage = ((jsonObj.optimized / jsonObj.total) * 100);
recProgressBar.css('width',percentage + '%');
recProgressPercent.text(percentage.toFixed(2) + '%');
logArea.val('['+jsonObj.percent.toFixed(2)+'%] ' + jsonObj.path + '\n' + logArea.val());
return resmushitImages();
}
});
}
jQuery(window).on('load', function(){
console.log('loaded!');
var clearButton = jQuery('#djmt_delete_images');
if (clearButton.length) {
clearButton.prop('disabled', false);
clearButton.on('click',function(){
clearButton.prop('disabled', true);
purgeThumbnails(clearButton);
});
}
var clearButton2 = jQuery('#djmt_delete_stylesheets');
if (clearButton2.length) {
clearButton2.prop('disabled', false);
clearButton2.on('click',function(){
clearButton2.prop('disabled', true);
purgeStylesheets(clearButton2);
});
}
var resmushit = jQuery('#djmt_resmushit_images');
if(resmushit.length) {
resmushit.prop('disabled', false);
resmushit.on('click',function(){
resmushit.prop('disabled', true);
resmushitImages(resmushit);
});
}
});