PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.2
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / assets / js / admin / image-optimizer / image-optimizer-base.min.js

image-optimizer-base.min.js in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.2, at assets/js/admin/image-optimizer/image-optimizer-base.min.js

1 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 !function(i){"use strict";var t={settings:{},i18n:{},isPremium:!1,init:function(){var i="undefined"!=typeof jltmaImageOptimizerBase?jltmaImageOptimizerBase:{};this.settings=i.settings||{},this.i18n=i.i18n||{},this.isPremium=i.isPremium||!1,this.initMediaLibraryDisplay(),this.initTooltips()},initMediaLibraryDisplay:function(){this.observeMediaLibrary()},initTooltips:function(){i(document).on("mouseenter",".jltma-tooltip",function(){i(this).find(".jltma-tooltip-text").css({visibility:"visible",opacity:"1"})}).on("mouseleave",".jltma-tooltip",function(){i(this).find(".jltma-tooltip-text").css({visibility:"hidden",opacity:"0"})})},observeMediaLibrary:function(){var i=this;i.customizeAllOriginalLinks(),new MutationObserver(function(t){i.customizeAllOriginalLinks()}).observe(document.body,{childList:!0,subtree:!0})},customizeAllOriginalLinks:function(){i("p, span, div").each(function(){var t=i(this);if(!t.data("jltma-original-processed")&&-1!==t.contents().filter(function(){return 3===this.nodeType}).text().indexOf("Original image")){var e=t.find("a").first();if(e.length){t.data("jltma-original-processed",!0),e.text("View Original").attr("target","_blank");var a=t.siblings().filter(function(){return"Edit Image"===i(this).text().trim()||i(this).hasClass("edit-attachment")}).first();a.length&&(t.remove(),a.after('<span class="jltma-separator"> | </span>'),a.next(".jltma-separator").after(e))}}})},formatFileSize:function(i){if(!i||0===i)return"0 B";var t=Math.floor(Math.log(i)/Math.log(1024));return parseFloat((i/Math.pow(1024,t)).toFixed(1))+" "+["B","KB","MB","GB"][t]},buildUpsellCardHTML:function(i){var t=i.savingsPercent||70,e=i.originalSize||0,a=Math.round(e*(1-t/100)),s=i.pricingUrl||"https://master-addons.com/pricing/",n='<div class="jltma-optimization-card jltma-upsell-card" style="display: block; margin: 8px 0; padding: 10px 12px; background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border: 1px solid #fbbf24; border-radius: 8px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">';return e>0?(n+='<div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: #92400e;">',n+='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" style="flex-shrink: 0;"><circle cx="12" cy="12" r="10" stroke="#d97706" stroke-width="2"/><path d="M12 6v6l4 2" stroke="#d97706" stroke-width="2" stroke-linecap="round"/></svg>',n+='<span style="font-weight: 600;">Save ~'+t+"%</span>",n+='<span style="color: #b45309;">('+this.formatFileSize(e)+" → ~"+this.formatFileSize(a)+")</span>",n+="</div>"):(n+='<div style="font-size: 12px; color: #92400e; font-weight: 600;">',n+="Auto-optimize images on upload",n+="</div>"),n+='<a href="'+s+'" target="_blank" style="display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; font-weight: 600; color: #d97706; text-decoration: none;">',n+='<span class="dashicons dashicons-star-filled" style="font-size: 12px; width: 12px; height: 12px;"></span>',n+="Upgrade to Pro",n+="</a>",n+="</div>"},buildOptimizedCardHTML:function(i){var t="";i.processingTime&&(t=i.processingTime>=1e3?(i.processingTime/1e3).toFixed(1)+" sec":i.processingTime+" ms");var e=(i.outputFormat||"webp").toUpperCase(),a='<div class="jltma-optimization-card" style="display: block; clear: both; margin: 16px 0;">';a+='<div style="display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #1e1e1e; margin-bottom: 8px;">',a+="<span>MA Optimization</span>",a+='<span class="jltma-tooltip" style="position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 2px;"><span class="dashicons dashicons-info-outline" style="font-size: 16px; width: 16px; height: 16px; color: #9ca3af; cursor: help; vertical-align: middle;"></span><span class="jltma-tooltip-text" style="visibility: hidden; opacity: 0; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #1e1e1e; color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 12px; font-weight: 400; white-space: nowrap; z-index: 9999999; transition: opacity 0.2s; pointer-events: none;">Optimized by Master Addons</span></span>',a+="</div>",a+='<div class="jltma-optimized-card" style="padding: 16px 20px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; text-align: center;">',a+='<div style="display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; white-space: nowrap;">',a+='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" style="flex-shrink: 0;"><circle cx="12" cy="12" r="11" fill="#22c55e"/><path d="M8 12l3 3 5-6" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',a+='<span style="font-weight: 700; color: #16a34a; font-size: 16px;">Saved '+(i.percentage||0)+"%</span>",a+="</div>",a+='<div style="margin-bottom: 6px; white-space: nowrap;">',a+='<span style="color: #374151; font-size: 13px;">('+i.originalFormatted+" → "+i.optimizedFormatted+")</span>",a+="</div>";var s=["→ "+e];return t&&s.push(t),a+='<div style="font-size: 12px; color: #16a34a; white-space: nowrap;">'+s.join(" · ")+"</div>",a+="</div>",a+="</div>"}};window.JLTMA_ImageOptimizerBase=t,i(document).ready(function(){t.init()})}(jQuery);