%PDF- %PDF-
Direktori : /var/www/html/buggydubrovnik.com/wp-content/plugins/imagify/assets/js/ |
Current File : /var/www/html/buggydubrovnik.com/wp-content/plugins/imagify/assets/js/media-modal.min.js |
window.imagify.drawMeAChart=function(a){a.each(function(){var a=parseInt(jQuery(this).closest(".imagify-chart").next(".imagify-chart-value").text(),10);new window.imagify.Chart(this,{type:"doughnut",data:{datasets:[{data:[a,100-a],backgroundColor:["#00B3D3","#D8D8D8"],borderColor:"#fff",borderWidth:1}]},options:{legend:{display:!1},events:[],animation:{easing:"easeOutBounce"},tooltips:{enabled:!1},responsive:!1}})})},function(a,b,c,d){c.imagify.modal={working:[],init:function(){var d,e=a(b);a(c).on("canvasprinted.imagify",this.updateChart).trigger("canvasprinted.imagify"),a(".imagify-datas-details").hide(),e.on("click",".imagify-datas-more-action a",this.toggleSlide),e.on("click",".button-imagify-restore, .button-imagify-optimize, .button-imagify-manual-reoptimize, .button-imagify-optimize-missing-sizes, .button-imagify-generate-webp, .button-imagify-delete-webp",this.processOptimization),e.on("imagifybeat-send",this.addToImagifybeat),e.on("imagifybeat-tick",this.processImagifybeat),d=a(".imagify-data-actions-container .button-imagify-processing"),d.length&&(d.closest(".imagify-data-actions-container").each(function(){var b=a(this),d=c.imagify.modal.sanitizeId(b.data("id")),e=c.imagify.modal.sanitizeContext(b.data("context"));c.imagify.modal.lockItem(e,d)}),c.imagify.beat.interval(15))},updateChart:function(b,d){var e;d=d||".imagify-consumption-chart",e=a(d),c.imagify.drawMeAChart(e),e.closest(".imagify-datas-list").siblings(".imagify-datas-details").hide()},processOptimization:function(b){var d,e,f=a(this),g=f.parents(".imagify-data-actions-container"),h=c.imagify.modal.sanitizeId(g.data("id")),i=c.imagify.modal.sanitizeContext(g.data("context"));b.preventDefault(),c.imagify.modal.isItemLocked(i,h)||(c.imagify.modal.lockItem(i,h),d=f.attr("href"),e=c.imagify.template("imagify-button-processing"),g.html(e({label:f.data("processing-label")})),a.get(d.replace("admin-post.php","admin-ajax.php")).done(function(a){a.data&&a.data.html?c.imagify.modal.displayProcessResult(i,h,a.data.html):c.imagify.beat.interval(15)}))},addToImagifybeat:function(b,d){var e=a(".imagify-data-actions-container");e.length&&(d[c.imagifyModal.imagifybeatID]={},e.each(function(){var b=a(this),e=c.imagify.modal.sanitizeId(b.data("id")),f=c.imagify.modal.sanitizeContext(b.data("context")),g=c.imagify.modal.isItemLocked(f,e)?1:0;d[c.imagifyModal.imagifybeatID][f]=d[c.imagifyModal.imagifybeatID][f]||{},d[c.imagifyModal.imagifybeatID][f]["_"+e]=g}))},processImagifybeat:function(b,d){void 0!==d[c.imagifyModal.imagifybeatID]&&a.each(d[c.imagifyModal.imagifybeatID],function(b,d){var e,f;(e=a.trim(b).match(/^(.+)_(\d+)$/))&&(f=c.imagify.modal.sanitizeId(e[2]),e=c.imagify.modal.sanitizeContext(e[1]),c.imagify.modal.displayProcessResult(e,f,d))})},displayProcessResult:function(a,b,d){var e=c.imagify.modal.getContainers(a,b);e.html(d),c.imagify.modal.unlockItem(a,b),c.imagify.modal.working.length||(c.imagify.modal.openSlide(e),c.imagify.beat.resetInterval())},openSlide:function(b){b.each(function(){var b=a(this),c=b.find(".imagify-datas-more-action a").data("close");b.find(".imagify-datas-more-action a").addClass("is-open").find(".the-text").text(c),b.find(".imagify-datas-details").show().addClass("is-open")})},toggleSlide:function(b){var c=a(this);b.preventDefault(),c.hasClass("is-open")?(a(c.attr("href")).slideUp(300).removeClass("is-open"),c.removeClass("is-open").find(".the-text").text(c.data("open"))):(a(c.attr("href")).slideDown(300).addClass("is-open"),c.addClass("is-open").find(".the-text").text(c.data("close")))},getContainers:function(b,c){return a('.imagify-data-actions-container[data-id="'+c+'"][data-context="'+b+'"]')},sanitizeId:function(a){return parseInt(a,10)},sanitizeContext:function(a){return(a=a.replace("/[^a-z0-9_-]/gi","").toLowerCase())||"wp"},lockItem:function(a,b){this.isItemLocked(a,b)||this.working.push(a+"_"+b)},unlockItem:function(a,b){var c=a+"_"+b,d=_.indexOf(this.working,c);d>-1&&this.working.splice(d,1)},isItemLocked:function(a,b){return _.indexOf(this.working,a+"_"+b)>-1}},c.imagify.modal.init()}(jQuery,document,window);