This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions
@@ -0,0 +1,2 @@
jQuery((function(t){"use strict";t("body").on("click","a.smush-stats-details",(function(s){if(t(this).prop("disabled"))return!1;s.preventDefault();var e=t(this).find(".stats-toggle");t(this).parents().eq(1).find(".smush-stats-wrapper").slideToggle(),e.text("+"==e.text()?"-":"+")}))}));
//# sourceMappingURL=smush-admin-common.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"js/smush-admin-common.min.js","mappings":"AAAAA,QAAO,SAAUC,GAChB,aAKGA,EAAE,QAAQC,GAAG,QAAS,yBAAyB,SAAUC,GAErD,GAAIF,EAAEG,MAAMC,KAAK,YACb,OAAO,EAIXF,EAAEG,iBAEF,IAAMC,EAAeN,EAAEG,MAAMI,KAAK,iBAClCP,EAAEG,MAAMK,UAAUC,GAAG,GAAGF,KAAK,wBAAwBG,cACrDJ,EAAaK,KAA4B,KAAvBL,EAAaK,OAAgB,IAAM,IACzD,GACJ","sources":["webpack://wp-smushit/./_src/js/modules/admin-common.js"],"sourcesContent":["jQuery(function ($) {\n\t'use strict';\n\n /**\n\t * Handle the Smush Stats link click\n\t */\n $('body').on('click', 'a.smush-stats-details', function (e) {\n //If disabled\n if ($(this).prop('disabled')) {\n return false;\n }\n\n // prevent the default action\n e.preventDefault();\n //Replace the `+` with a `-`\n const slide_symbol = $(this).find('.stats-toggle');\n $(this).parents().eq(1).find('.smush-stats-wrapper').slideToggle();\n slide_symbol.text(slide_symbol.text() == '+' ? '-' : '+');\n });\n});"],"names":["jQuery","$","on","e","this","prop","preventDefault","slide_symbol","find","parents","eq","slideToggle","text"],"sourceRoot":""}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
!function(){"use strict";var e=wp.compose.createHigherOrderComponent,t=wp.element.Fragment,s=wp.blockEditor.InspectorControls,a=wp.components.PanelBody;function r(e,t){return void 0===t?window.smush_vars.strings.gb.select_image:"string"==typeof t?t:React.createElement("div",{id:"smush-stats",className:"sui-smush-media smush-stats-wrapper hidden",style:{display:"block"}},React.createElement("table",{className:"wp-smush-stats-holder"},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{className:"smush-stats-header"},window.smush_vars.strings.gb.size),React.createElement("th",{className:"smush-stats-header"},window.smush_vars.strings.gb.savings))),React.createElement("tbody",null,Object.keys(t.sizes).filter((function(e){return 0<t.sizes[e].percent})).map((function(e,s){return React.createElement("tr",{key:s},React.createElement("td",null,e.toUpperCase()),React.createElement("td",null,function(e){var t=1024,s=["kB","MB","GB","TB"];if(Math.abs(e)<t)return e+" B";var a=-1;do{e/=t,++a}while(Math.abs(e)>=t&&a<s.length-1);return e.toFixed(1)+" "+s[a]}(t.sizes[e].bytes)," ","( ",t.sizes[e].percent,"% )"))})))))}var n=e((function(e){return function(n){if("core/image"!==n.name||!n.isSelected||void 0===n.attributes.id)return React.createElement(t,null,React.createElement(e,n));var i=n.attributes.smush;return function(e){var t=new wp.api.models.Media({id:e.attributes.id}),s=e.attributes.smush;t.fetch({attribute:"smush"}).done((function(t){"string"==typeof t.smush?e.setAttributes({smush:t.smush}):void 0===t.smush||void 0!==s&&JSON.stringify(s)===JSON.stringify(t.smush)||e.setAttributes({smush:t.smush})}))}(n),React.createElement(t,null,React.createElement(e,n),React.createElement(s,null,React.createElement(a,{title:window.smush_vars.strings.gb.stats},r(n.attributes.id,i))))}}),"withInspectorControl");wp.hooks.addFilter("editor.BlockEdit","wp-smush/smush-data-control",n)}();
//# sourceMappingURL=smush-blocks.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
!function(){"use strict";document.addEventListener("DOMContentLoaded",(function(){function s(s){s.preventDefault();var i=s.target.closest(".smush-dismissible-notice");e(i.getAttribute("data-key"),i)}function e(s,e){var i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_dismiss_notice&key="+s+"&_ajax_nonce="+smush_global.nonce,!0),i.onload=function(){e&&e.querySelector("button.notice-dismiss").dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))},i.send()}document.querySelectorAll(".smush-dismissible-notice .smush-dismiss-notice-button").forEach((function(e){e.addEventListener("click",s)}));!function(){var s=document.querySelector(".wp-smush-dismissible-header-notice");if(s&&s.id){var i=s.dataset,t=i.dismissKey,n=i.message;if(t&&n){s.onclick=function(s){var i=s.target.classList;i&&(i.contains("sui-icon-check")||i.contains("sui-button-icon"))&&e(t)};var o={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice(s.id,n,o)}}}()}))}();
//# sourceMappingURL=smush-global.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"js/smush-global.min.js","mappings":"yBAIAA,SAASC,iBAAiB,oBAAoB,WAQ7C,SAASC,EAAoBC,GAC5BA,EAAMC,iBAEN,IACMC,EADSF,EAAMG,OACCC,QAAQ,6BAG9BC,EAFYH,EAAOI,aAAa,YAEZJ,EACrB,CAEA,SAASG,EAAeE,EAAKL,GAC5B,IAAMM,EAAM,IAAIC,eAChBD,EAAIE,KACH,OACAC,QAAU,oCAAsCJ,EAAM,gBAAkBK,aAAaC,OACrF,GAEDL,EAAIM,OAAS,WACRZ,GACHA,EAAOa,cAAc,yBAAyBC,cAAc,IAAIC,WAAW,QAAS,CACnFC,KAAMC,OACNC,SAAS,EACTC,YAAY,IAGf,EACAb,EAAIc,MACL,CAlC4BzB,SAAS0B,iBACpC,0DAEmBC,SAAQ,SAACC,GAC5BA,EAAO3B,iBAAiB,QAASC,EAClC,KAiC2B,WAC1B,IAAM2B,EAAe7B,SAASkB,cAAc,uCAC5C,GAAOW,GAAkBA,EAAaC,GAAtC,CAIA,IAAAC,EAAgCF,EAAaG,QAArCC,EAAUF,EAAVE,WAAYC,EAAOH,EAAPG,QACpB,GAAOD,GAAgBC,EAAvB,CAIAL,EAAaM,QAAU,SAACC,GACvB,IAAMC,EAAYD,EAAE9B,OAAO+B,UACHA,IAAeA,EAAUC,SAAS,mBAAqBD,EAAUC,SAAS,qBAIlG9B,EAAeyB,EAChB,EAEA,IAAMM,EAAgB,CACrBC,KAAM,UACNC,KAAM,OACNC,QAAS,CACRC,MAAM,EACNC,MAAOC,cAAcC,cACrBC,QAASF,cAAcG,uBAIzB1B,OAAO2B,IAAIC,WACVrB,EAAaC,GACbI,EACAK,EAxBD,CALA,CA+BD,CAEAY,EAED,G","sources":["webpack://wp-smushit/./_src/js/global.js"],"sourcesContent":["import '../scss/common.scss';\n\n/* global ajaxurl */\n\ndocument.addEventListener('DOMContentLoaded', function () {\n\tconst dismissNoticeButton = document.querySelectorAll(\n\t\t'.smush-dismissible-notice .smush-dismiss-notice-button'\n\t);\n\tdismissNoticeButton.forEach((button) => {\n\t\tbutton.addEventListener('click', handleDismissNotice);\n\t});\n\n\tfunction handleDismissNotice(event) {\n\t\tevent.preventDefault();\n\n\t\tconst button = event.target;\n\t\tconst notice = button.closest('.smush-dismissible-notice');\n\t\tconst key = notice.getAttribute('data-key');\n\n\t\tdismissNotice( key, notice );\n\t}\n\n\tfunction dismissNotice( key, notice ) {\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open(\n\t\t\t'POST',\n\t\t\tajaxurl + '?action=smush_dismiss_notice&key=' + key + '&_ajax_nonce=' + smush_global.nonce,\n\t\t\ttrue\n\t\t);\n\t\txhr.onload = () => {\n\t\t\tif (notice) {\n\t\t\t\tnotice.querySelector('button.notice-dismiss').dispatchEvent(new MouseEvent('click', {\n\t\t\t\t\tview: window,\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcancelable: true\n\t\t\t\t}));\n\t\t\t}\n\t\t};\n\t\txhr.send();\n\t}\n\n\n\t// Show header notices.\n\tconst handleHeaderNotice = () => {\n\t\tconst headerNotice = document.querySelector('.wp-smush-dismissible-header-notice');\n\t\tif ( ! headerNotice || ! headerNotice.id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { dismissKey, message } = headerNotice.dataset;\n\t\tif ( ! dismissKey || ! message ) {\n\t\t\treturn;\n\t\t}\n\n\t\theaderNotice.onclick = (e) => {\n\t\t\tconst classList = e.target.classList;\n\t\t\tconst isDismissButton = classList && ( classList.contains('sui-icon-check') || classList.contains('sui-button-icon') );\n\t\t\tif ( ! isDismissButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdismissNotice( dismissKey );\n\t\t}\n\n\t\tconst noticeOptions = {\n\t\t\ttype: 'warning',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\theaderNotice.id,\n\t\t\tmessage,\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\thandleHeaderNotice();\n\t\n});\n"],"names":["document","addEventListener","handleDismissNotice","event","preventDefault","notice","target","closest","dismissNotice","getAttribute","key","xhr","XMLHttpRequest","open","ajaxurl","smush_global","nonce","onload","querySelector","dispatchEvent","MouseEvent","view","window","bubbles","cancelable","send","querySelectorAll","forEach","button","headerNotice","id","_headerNotice$dataset","dataset","dismissKey","message","onclick","e","classList","contains","noticeOptions","type","icon","dismiss","show","label","wp_smush_msgs","noticeDismiss","tooltip","noticeDismissTooltip","SUI","openNotice","handleHeaderNotice"],"sourceRoot":""}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
!function(t,e){"use strict";var s=wp.media,i=e.template("<span class='setting smush-stats' data-setting='smush'><span class='name'><%= label %></span><span class='value'><%= value %></span></span>"),a=function(t){return i({label:smush_vars.strings.stats_label,value:t})};if(void 0!==s.view&&void 0!==s.view.Attachment.Details.TwoColumn){var r=s.view.Attachment.Details.TwoColumn;s.view.Attachment.Details.TwoColumn=r.extend({initialize:function(){r.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:smush",this.render)},render:function(){s.view.Attachment.prototype.render.apply(this,arguments);var t=this.model.get("smush");return void 0===t||(this.model.fetch(),this.views.detach(),this.$el.find(".settings").append(a(t)),this.views.render()),this}})}var n=s.view.Attachment.Details;s.view.Attachment.Details=n.extend({initialize:function(){n.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:smush",this.render)},render:function(){s.view.Attachment.prototype.render.apply(this,arguments);var t=this.model.get("smush");return void 0===t||(this.model.fetch(),this.views.detach(),this.$el.append(a(t))),this}});var l=wp.media.view.AttachmentFilters.extend({id:"media-attachment-smush-filter",createFilters:function(){this.filters={all:{text:smush_vars.strings.filter_all,props:{stats:"all"},priority:10},unsmushed:{text:smush_vars.strings.filter_not_processed,props:{stats:"unsmushed"},priority:20},excluded:{text:smush_vars.strings.filter_excl,props:{stats:"excluded"},priority:30},failed:{text:smush_vars.strings.filter_failed,props:{stats:"failed_processing"},priority:40}}}}),o=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){o.prototype.createToolbar.call(this),this.toolbar.set("MediaLibraryTaxonomyFilter",new l({controller:this.controller,model:this.collection.props,priority:-75}).render())}})}(jQuery,_);
//# sourceMappingURL=smush-media.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long