whoami7 - Manager
:
/
home
/
rattkxnv
/
knockdubai.ae
/
wp-content
/
plugins
/
wp-optimize
/
js
/
Upload File:
files >> /home/rattkxnv/knockdubai.ae/wp-content/plugins/wp-optimize/js/wposmush-3-4-2.min.js
function wpo_parse_json(s){if("object"==typeof s)return s;try{var e=JSON.parse(s);return e}catch(o){console.log("WPO: Exception when trying to parse JSON (1) - will attempt to fix/re-parse"),console.log(s)}var a=s.indexOf("{"),i=s.lastIndexOf("}");if(a>-1&&i>-1){var t=s.slice(a,i+1);try{var n=JSON.parse(t);return n}catch(o){console.log("WPO: Exception when trying to parse JSON (2) - will attempt to fix/re-parse based upon bracket counting");for(var m=a,_=0,r="",u=!1;(_>0||m==a)&&m<=i;){var c=s.charAt(m);u||"{"!=c?u||"}"!=c?'"'==c&&"\\"!=r&&(u=!u):_--:_++,r=c,m++}console.log("Started at cursor="+a+", ended at cursor="+m+" with result following:"),console.log(s.substring(a,m));try{var n=JSON.parse(s.substring(a,m));return n}catch(o){throw o}}}throw"WPO: could not parse the JSON"}jQuery(function(s){WP_Optimize_Smush=WP_Optimize_Smush()});var WP_Optimize_Smush=function(){function s(s){D("#smush-information-modal .smush-information").text(wposmush.server_check),j(D("#smush-information-modal")),data={server:wposmush.smush_settings.compression_server},N("check_server_status",data,function(e){if(e.online){if(s.each(function(s,e){smush_image_list.push({attachment_id:parseInt(e.value),blog_id:wposmush.blog_id})}),data={optimization_id:"smush",selected_images:smush_image_list,smush_options:{compression_server:wposmush.smush_settings.compression_server,image_quality:wposmush.smush_settings.image_quality,lossy_compression:wposmush.smush_settings.lossy_compression,back_up_original:wposmush.smush_settings.back_up_original,preserve_exif:wposmush.smush_settings.preserve_exif}},smush_from_media_library=!0,smush_completed=!1,smush_timer_locked)return;j(D("#wpo_smush_images_information_container")),D("#wpo_smush_images_information_server").html(wposmush.smush_settings.compression_server),g(),smush_timer_handle=window.setInterval(r,1e3),N("process_bulk_smush",data)}else e.error?(error_message=e.error+"<br>"+wposmush.server_error,D("#smush-information-modal .smush-information").html(error_message)):D("#smush-information-modal .smush-information").text(wposmush.server_error),j(D("#smush-information-modal"),D.unblockUI)})}function e(s){smush_from_media_library=!0;var e=[],o=function(o){return function(a){e.push(o),1<e.length&&e.length===s.length?a(wposmush.images_restored_successfully):a()}};s.each(function(s,e){U(wposmush.blog_id,parseInt(e.value),o(parseInt(e.value)))})}function o(){var s=0==D('input[type="checkbox"]:checked',E).length;L.prop("disabled",s),R.prop("disabled",s)}function a(s,e){if(smush_mark_all_as_uncompressed){s=s?1:0,e=e?1:0;var o=D("#smush-information-modal-cancel-btn .smush-information");N("mark_all_as_uncompressed",{restore_backup:s,delete_only_backups_meta:e},function(i){if(smush_mark_all_as_uncompressed)return i.hasOwnProperty("error")?(j(D("#smush-information-modal"),D.unblockUI),D("#smush-information-modal .smush-information").text(i.error),void n()):void(i.completed?(j(D("#smush-information-modal"),D.unblockUI),D("#smush-information-modal .smush-information").text(i.message),n()):(o.text(i.message),a(s,e)))})}}function t(){D(this).toggleClass("opened"),D(this).hasClass("opened")?D(this).text(wposmush.less):D(this).text(wposmush.more)}function n(s){var s="undefined"==typeof s||s,e={use_cache:s};F.html("..."),H.hide(),I(!0),M.push(K.add_agent({_wait:!1,_keep:!1,command:"updraft_smush_ajax",command_data:{data:e,subaction:"get_ui_update"},callback:function(s){q(s,l),x(),I(!1),o()}})),Y=!0}function m(){D("#wpo_smush_images_grid input:checked").each(function(){image={attachment_id:D(this).val(),blog_id:D(this).data("blog")},smush_image_list.push(image)}),data={optimization_id:"smush",selected_images:smush_image_list,smush_options:{compression_server:D("input[name='compression_server']:checked").val(),image_quality:D("#image_quality").val(),lossy_compression:D("#smush-lossy-compression").is(":checked"),back_up_original:D("#smush-backup-original").is(":checked"),preserve_exif:D("#smush-preserve-exif").is(":checked")}},d(),M.push(K.add_agent({_wait:!1,_keep:!1,command:"updraft_smush_ajax",command_data:{data:data,subaction:"process_bulk_smush"}}))}function _(){if(D("#wp-optimize-wrap").length){D("#wpo_smush_images_save_options_spinner").show().delay(3e3).fadeOut();var s=ss();N("update_smush_options",s,function(s){D("#wpo_smush_images_save_options_spinner").hide(),s.hasOwnProperty("saved")&&s.saved?D("#wpo_smush_images_save_options_done").show().delay(3e3).fadeOut():D("#wpo_smush_images_save_options_fail").show().delay(3e3).fadeOut()})}}function r(){smush_timer_locked=!0,smush_total_seconds++,seconds=smush_total_seconds%60+""<10?"0"+smush_total_seconds%60:smush_total_seconds%60,minutes=parseInt(smush_total_seconds/60)+""<10?"0"+parseInt(smush_total_seconds/60):parseInt(smush_total_seconds/60),D("#smush_stats_timer").text(minutes+":"+seconds),u(smush_total_seconds)}function u(s){0==s%3&&c(s),0==s%60&&(null!=T&&(K.cancel_agent(T),T=null),M.push(K.add_agent({_wait:!1,command:"updraft_smush_ajax",command_data:{data:{},subaction:"process_pending_images"},callback:function(s){q(s,w)}})))}function c(s){data={update_ui:!0,use_cache:!1};var e=s<5,o=K.add_agent({_wait:!e,_keep:!1,command:"updraft_smush_ajax",command_data:{data:data,subaction:"get_ui_update"},callback:function(s){q(s,w)}});null!==o&&(T=o,M.push(o))}function l(s){if(E.html(""),s&&s.hasOwnProperty("unsmushed_images")){var e=s.unsmushed_images,o=s.pending_tasks,a=0;if(0==e.length&&0==o&&E.text(wposmush.all_images_compressed).wrapInner("<div class='wpo-fieldgroup'> </div>"),0!=o&&H.show().find(".red").text(s.pending),1===s.is_multisite)a=uncompressed_images_sites_select.find(":selected").val(),h(a,s);else for(a in s.unsmushed_images)h(a,s)}}function p(s,e){return s.id-e.id}function h(s,e){var o="post.php?post=",a="&action=edit",t=e.admin_urls[s],n=e.unsmushed_images[s];"undefined"!=typeof n&&n.sort(p);for(i in n)if(n.hasOwnProperty(i)){var m=n[i];y(m,s,t+o+m.id+a)}}function d(){smush_timer_locked||(j(D("#wpo_smush_images_information_container")),service=D('.compression_server input[type="radio"]:checked + label small').text(),D("#wpo_smush_images_information_server").html(service),g(),smush_timer_handle=window.setInterval(r,1e3),I(!0))}function g(){D("#smush_stats_pending_images").html("..."),D("#smush_stats_completed_images").html("..."),D("#smush_stats_bytes_saved").html("..."),D("#smush_stats_percent_saved").html("..."),D("#smush_stats_timer").html("...")}function f(s){for(var e in s)s.hasOwnProperty(e)&&D("#post-"+e+" .column-wpo_smush").html(s[e]);J()}function w(s){D("#smush_stats_pending_images").html(s.pending_tasks),D("#smush_stats_completed_images").html(s.completed_task_count),D("#smush_stats_bytes_saved").html(s.bytes_saved),D("#smush_stats_percent_saved").html(s.percent_saved),1==s.smush_complete&&setTimeout(function(){b(function(){n(!1)})},1500)}function b(s){data={update_ui:!0,use_cache:!1,image_list:smush_image_list},function(s){M.push(K.add_agent({_wait:!1,_keep:!1,command:"updraft_smush_ajax",command_data:{data:data,subaction:"get_ui_update"},callback:function(e){summary=e.session_stats,0!=e.completed_task_count&&(summary+="<hr>"+e.summary),k(summary),s instanceof Function&&s()}}))}(s)}function k(s){smush_completed||(D("#summary-message").html(s),v(),j(D("#smush-complete-summary")),smush_completed=!0,K.cancel_agents(M))}function v(){smush_total_seconds=0,smush_timer_locked=!1,smush_completed=!1,smush_image_list=[],K.cancel_agents(M),clearInterval(smush_timer_handle),I(!1)}function y(s,e,o){var a=["wpo_smush_",e,"_",s.id].join("");image_html='<div class="wpo_smush_image" data-filesize="'+s.filesize+'">',image_html+='<a class="button" href="'+o+'" target="_blank"> '+wposmush.view_image+" </a>",image_html+='<input id="'+a+'" type="checkbox" data-blog="'+e+'" class="wpo_smush_image__input" value="'+s.id+'">',image_html+='<label for="'+a+'"></a>',image_html+='<div class="thumbnail">',image_html+='<img class="lazyload" src="'+s.thumb_url+'">',image_html+="</div></label></div>",E.append(image_html)}function x(){features=wposmush.features,service=D("input[name^='compression_server']:checked").val();for(feature in features[service])D("."+feature).prop("disabled",!features[service][feature]);D(".wpo_smush_image").each(function(){D(this).data("filesize")>wposmush.features[service].max_filesize?D(this).hide():D(this).show()})}function I(s){D.each([L,Z,B,A,Q,R],function(e,o){o.prop("disabled",s)}),s?(D("#wpo_smush_images_refresh").hide(),D(".wpo_smush_images_loader").show()):(D("#wpo_smush_images_refresh").show(),D(".wpo_smush_images_loader").hide())}function O(s,e){0!=s.length&&(data={selected_image:s,smush_options:e},j(wposmush.compress_single_image_dialog),N("compress_single_image",data,function(s){q(s,z)}))}function U(s,e,o){if(0!=e.length){j(wposmush.please_wait,D.unblockUI);var a={blog_id:s,selected_image:e};N.apply({unique:!1},["restore_single_image",a,function(s){var e=function(e){"undefined"!=typeof e&&(s.summary=e),q(s,z)};o instanceof Function?o(e):e()}])}}function z(s){if(s.hasOwnProperty("success")&&s.success){D(".smush-information").text(s.summary),j(D("#smush-information-modal"),D.unblockUI),D(".wpo-toggle-advanced-options.wpo_smush_single_image").removeClass("opened"),P(s.operation,s.summary,s.restore_possible,s);var e=s.blog_id||s.options.blog_id,o=s.image||s.options.attachment_id;smush_affected_images.hasOwnProperty(e)||(smush_affected_images[e]={}),smush_affected_images[e].hasOwnProperty(o)||(smush_affected_images[e][o]={}),"compress"==s.operation?smush_affected_images[e][o]={operation:s.operation,summary:s.summary,restore_possible:s.restore_possible}:(o&&(C(o),J()),smush_affected_images[e][o]={operation:s.operation})}else D(".smush-information").text(s.error_message),j(D("#smush-information-modal"),D.unblockUI)}function P(s,e,o,a){var i=D("#smush_info").closest("#smush-metabox-inside-wrapper");"compress"==s?(D(".wpo_smush_single_image").hide(),D(".wpo_restore_single_image").show(),a&&a.hasOwnProperty("sizes-info")?(D("#smush_info").text(e),D("#wpo_smush_details").html(a["sizes-info"])):(D("#smush_info").text(e),D("#wpo_smush_details").text("").hide()),D(".wpo_smush_mark_single_image").hide(),o?D(".restore_possible").show():D(".restore_possible").hide()):(D(".wpo_smush_single_image").show(),D(".wpo_restore_single_image").hide(),D(".wpo_smush_mark_single_image").show(),D(".wpo_smush_unmark_single_image",i).hide())}function j(s,e){D.blockUI({message:s,onOverlayClick:e,baseZ:160001,css:{width:"400px",padding:"20px",cursor:"pointer"}})}function q(s,e){s&&s.hasOwnProperty("status")&&s.status?e&&e(s):(alert(wposmush.error_unexpected_response),console.log(s))}function S(){return D('input[name="media[]"]:checked')}function W(){var s=[],e=S();return e.each(function(e,o){s.push(parseInt(o.value))}),s}function C(s){var e=ajaxurl.replace("/admin-ajax.php","/");e+="post.php?post="+s+"&action=edit",D("#post-"+s+" .column-wpo_smush").html('<a href="'+e+'">'+wposmush.compress+"</a><br>")}function J(){D("#bulk-action-selector-top, #bulk-action-selector-bottom").val("-1"),D('input[name="media[]"]:checked, #cb-select-all-1, #cb-select-all-2').prop("checked",!1)}function N(s,e,o,a){a="undefined"==typeof a||a,e=D.isEmptyObject(e)?{use_cache:!1}:e,function(o,i,t){M.push(K.add_agent({_wait:!1,_keep:i,_unique:t,command:"updraft_smush_ajax",command_data:{data:e,subaction:s},callback:function(s){if(a){try{var e=wpo_parse_json(s)}catch(i){console.log("smush_manager_send_command JSON parse error"),console.log(i),console.log(s),alert(wposmush.error_unexpected_response)}"undefined"!=typeof o&&o(e)}else"undefined"!=typeof o&&o(s)}}))}(o,this.keep,this.unique)}var D=jQuery,K=WP_Optimize_Heartbeat(),M=[],T=null,E=(D("#wp-optimize-images-nav-tab-smush"),D("#wpo_smush_images_grid")),F=D("#smush_info_images"),H=D("#wpo_smush_images_pending_tasks_container"),Q=D("#wpo_smush_images_pending_tasks_button"),A=D("#wpo_smush_images_refresh"),Z=D("#wpo_smush_images_select_all"),B=D("#wpo_smush_images_select_none"),G=D("#wpo_smush_clear_stats_btn"),L=D("#wpo_smush_images_btn"),R=D("#wpo_smush_mark_as_compressed"),V=(D(".wpo_smush_single_image .button"),D(".wpo_restore_single_image .button"),D(".wpo_smush.column-wpo_smush .convert-to-webp"));smush_mark_all_as_uncompressed_btn=D("#wpo_smush_mark_all_as_uncompressed_btn"),restore_all_compressed_images_btn=D("#wpo_smush_restore_all_compressed_images_btn"),smush_view_logs_btn=D(".wpo_smush_get_logs"),smush_delete_backup_images_btn=D("#wpo_smush_delete_backup_btn"),compression_server_select=D(".compression_server"),reset_webp_serving_method_btn=D("#wpo_reset_webp_serving_method"),smush_images_tab_loaded=!1,smush_service_features=[],smush_total_seconds=0,smush_timer_locked=!1,smush_timer_handle=0,smush_image_list=[],smush_completed=!1,smush_from_media_library=!1,smush_mark_all_as_uncompressed=!1,smush_affected_images={},pending_tasks_cancel_btn=D("#wpo_smush_images_pending_tasks_cancel_button"),uncompressed_images_sites_select=D("#wpo_uncompressed_images_sites_select"),D("#doaction, #doaction2").on("click",function(o){o.stopImmediatePropagation();var a=D(this).prev("select").val();if("wp_optimize_bulk_compression"===a||"wp_optimize_bulk_restore"===a){var i=S();0!==i.length&&(o.preventDefault(),"wp_optimize_bulk_compression"===a&&s(i),"wp_optimize_bulk_restore"===a&&e(i))}}),E.on("click",".thumbnail",function(s){D(this).closest('input[type="checkbox"]').prop("checked",!0)});var X=!1;E.on("mousedown",".thumbnail",function(s){X=s.shiftKey||s.ctrlKey}),E.on("mouseup",".thumbnail",function(s){X=s.shiftKey||s.ctrlKey}),reset_webp_serving_method_btn.on("click",function(s){s.preventDefault(),N("reset_webp_serving_method",{},function(s){s.success?D("#wpo_reset_webp_serving_method_done").show().delay(3e3).fadeOut():(console.log("[Failed] WebP server capability detection"),D("#enable_webp_conversion").prop("checked",!1),D("#smush-information-modal .smush-information").text(s.error_message),j(D("#smush-information-modal")))})});var Y=!1;D("#wp-optimize-nav-tab-wrapper__wpo_images .nav-tab").on("click",function(){Y||D(this).is("#wp-optimize-nav-tab-wpo_images-smush")&&n(!1)}),D("#wp-optimize-wrap").on("page-change",function(s,e){Y||"wpo_images"==e.page&&D("#wp-optimize-nav-tab-wrapper__wpo_images .nav-tab-active").is("#wp-optimize-nav-tab-wpo_images-smush")&&n(!1)}),D("#smush-metabox").length>0&&x();var $=null;E.on("click",".wpo_smush_image",function(s){var e=D('#wpo_smush_images_grid input[type="checkbox"]'),a=D(this).find(".wpo_smush_image__input"),i=!a.prop("checked");if($||(D(this).find(".wpo_smush_image__input").prop("checked",i),$=a),!0===X){var t=e.index(a),n=e.index($);t===n?e.slice(Math.min(t,n),Math.max(t,n)+1).prop("checked",i):!0===$.prop("checked")&&e.slice(Math.min(t,n),Math.max(t,n)+1).prop("checked",i)}$=a,o()}),o(),compression_server_select.on("change",function(s){x(),_()}),L.off().on("click",function(){return 0==D('#wpo_smush_images_grid input[type="checkbox"]:checked').length?(D("#smush-information-modal .smush-information").text(wposmush.please_select_images),void j(D("#smush-information-modal"),D.unblockUI)):(D("#smush-information-modal .smush-information").text(wposmush.server_check),j(D("#smush-information-modal")),data={server:D("input[name='compression_server']:checked").val()},void N("check_server_status",data,function(s){s.online?m():(s.error?(error_message=s.error+"<br>"+wposmush.server_error,D("#smush-information-modal .smush-information").html(error_message)):D("#smush-information-modal .smush-information").text(wposmush.server_error),j(D("#smush-information-modal"),D.unblockUI))}))}),R.off().on("click",function(){if(0==D('#wpo_smush_images_grid input[type="checkbox"]:checked').length)return D("#smush-information-modal .smush-information").text(wposmush.please_select_compressed_images),void j(D("#smush-information-modal"),D.unblockUI);var s,e=[];D("#wpo_smush_images_grid input:checked").each(function(){s={attachment_id:D(this).val(),blog_id:D(this).data("blog")},e.push(s)}),j(wposmush.please_updating_images_info),N("mark_as_compressed",{selected_images:e},function(s){D("#smush-information-modal .smush-information").text(s.summary),j(D("#smush-information-modal"),D.unblockUI),n()})}),smush_mark_all_as_uncompressed_btn.on("click",function(){if(confirm(wposmush.mark_all_images_uncompressed)){var s=confirm(wposmush.restore_images_from_backup);j(D("#smush-information-modal-cancel-btn")),D("#smush-information-modal-cancel-btn .smush-information").text(wposmush.please_wait),smush_mark_all_as_uncompressed=!0,a(s)}}),restore_all_compressed_images_btn.on("click",function(){confirm(wposmush.restore_all_compressed_images)&&(j(D("#smush-information-modal-cancel-btn")),D("#smush-information-modal-cancel-btn .smush-information").text(wposmush.please_wait),smush_mark_all_as_uncompressed=!0,a(!0,!0))}),D('#smush-information-modal-cancel-btn input[type="button"]').on("click",function(){smush_mark_all_as_uncompressed=!1,n(),D.unblockUI()}),A.off().on("click",function(){n(!1)}),Z.off().on("click",function(){D('#wpo_smush_images_grid input[type="checkbox"]').prop("checked",!0),$=null,o()}),B.off().on("click",function(){D('#wpo_smush_images_grid input[type="checkbox"]').prop("checked",!1),$=null,o()}),smush_view_logs_btn.off().on("click",function(){D("#log-panel").text("Please wait, fetching logs."),N("get_smush_logs",{},function(s){D.blockUI({message:D("#smush-log-modal"),onOverlayClick:D.unblockUI(),css:{width:"80%",height:"80%",top:"15%",left:"15%"}}),D("#log-panel").html("<pre>"+s+"</pre>"),download_link=ajaxurl+"?action=updraft_smush_ajax&subaction=get_smush_logs&nonce="+wposmush.smush_ajax_nonce,D("#smush-log-modal a").attr("href",download_link)},!1)}),smush_delete_backup_images_btn.on("click",function(){if(confirm(wposmush.delete_image_backup_confirm)){smush_delete_backup_images_btn.prop("disabled",!0);var s=D("#wpo_smush_delete_backup_spinner"),e=D("#wpo_smush_delete_backup_done");s.show(),N("clean_all_backup_images",{},function(){s.hide(),smush_delete_backup_images_btn.prop("disabled",!1),e.css("display","inline-block").delay(3e3).fadeOut()})}}),G.off().on("click",function(s){D("#wpo_smush_images_clear_stats_spinner").show().delay(3e3).fadeOut(),N("clear_smush_stats",{},function(s){D("#wpo_smush_images_clear_stats_spinner").hide(),D("#wpo_smush_images_clear_stats_done").show().delay(3e3).fadeOut()})}),Q.off().on("click",function(s){D("#smush-information-modal .smush-information").text(wposmush.server_check),j(D("#smush-information-modal"),D.unblockUI),data={server:D("input[name='compression_server']:checked").val()},N("check_server_status",data,function(s){s.online?(d(),N("process_pending_images",{},function(s){q(s,w)})):(s.error?(error_message=s.error+"<br>"+wposmush.server_error,D("#smush-information-modal .smush-information").html(error_message)):D("#smush-information-modal .smush-information").text(wposmush.server_error),j(D("#smush-information-modal"),D.unblockUI))})}),D("body").on("click","#wpo_smush_images_pending_tasks_cancel_button",function(s){wposmush.cancel===pending_tasks_cancel_btn.val()&&(pending_tasks_cancel_btn.val(wposmush.cancelling),pending_tasks_cancel_btn.prop("disabled",!0)),N("clear_pending_images",{},function(s){D.unblockUI(),s.status?(n(),v()):console.log("Cancelling pending images apparently failed.",s),pending_tasks_cancel_btn.val(wposmush.cancel),pending_tasks_cancel_btn.prop("disabled",!1)})}),D("body").on("click",".wpo_smush_single_image .button",function(){image={attachment_id:D(this).data("id"),blog_id:D(this).data("blog")},D("#enable_custom_compression").is(":checked")?image_quality=D("#custom_compression_slider").val():image_quality=D("#enable_lossy_compression").is(":checked")?60:92,lossy_compression=image_quality<92,smush_options={compression_server:D("input[name='compression_server_"+image.attachment_id+"']:checked").val(),image_quality:image_quality,lossy_compression:lossy_compression,back_up_original:D("#smush_backup_"+image.attachment_id).is(":checked"),preserve_exif:D("#smush_exif_"+image.attachment_id).is(":checked")},data={server:D("input[name='compression_server_"+D(this).attr("id").substring(15)+"']:checked").val()},j(wposmush.server_check),N("check_server_status",data,function(s){s.online?O(image,smush_options):s.error?(error_message=s.error+"<br>"+wposmush.server_error,j(error_message,D.unblockUI)):j(wposmush.server_error,D.unblockUI)})}),D("body").on("click",".wpo_restore_single_image .button",function(){var s=D(this);blog_id=s.data("blog"),image_id=s.data("id"),image_id&&blog_id&&U(blog_id,image_id)}),D("body").on("click",".wpo_smush_mark_single_image .button",function(){var s={attachment_id:D(this).data("id"),blog_id:D(this).data("blog")},e=D(this).closest("#smush-metabox-inside-wrapper");j(wposmush.please_updating_images_info),N("mark_as_compressed",{selected_images:[s]},function(s){D("#smush-information-modal .smush-information").text(s.summary),j(D("#smush-information-modal"),D.unblockUI),s.status&&(D(".wpo_smush_single_image",e).hide(),D(".wpo-toggle-advanced-options",e).removeClass("opened"),D(".wpo_smush_mark_single_image",e).hide(),D(".wpo_smush_unmark_single_image",e).show(),D(".wpo_restore_single_image",e).show(),D("#smush_info",e).text(s.info))})}),D("body").on("click",".wpo_smush_unmark_single_image .button",function(){var s={attachment_id:D(this).data("id"),blog_id:D(this).data("blog")},e=D(this).closest("#smush-metabox-inside-wrapper");j(wposmush.please_updating_images_info),N("mark_as_compressed",{selected_images:[s],unmark:!0},function(s){D("#smush-information-modal .smush-information").text(s.summary),j(D("#smush-information-modal"),D.unblockUI),s.status&&(D(".wpo_smush_single_image",e).show(),D(".wpo_smush_mark_single_image",e).show(),D(".wpo_smush_unmark_single_image",e).hide(),D(".wpo_restore_single_image",e).hide(),D("#smush_info",e).text(""))})}),D("body").on("click","#wpo_smush_details .wpo-collapsible",t),D("body").on("click",".column-wpo_smush .wpo-collapsible",t),D("body").on("click","#smush-log-modal .close, #smush-information-modal .information-modal-close",function(){D.unblockUI(),smush_from_media_library&&J()}),D("body").on("click",".wpo_smush_stats_cta_btn, .wpo_smush_get_logs, #smush-complete-summary .close",function(){if(D.unblockUI(),smush_from_media_library){var s=W();N("get_smush_details",{selected_images:s},function(s){s.success?(window.clearInterval(smush_timer_handle),f(s.smush_details)):console.log(s)})}else n(),setTimeout(v,500)}),D("body").on("click",".wpo-toggle-advanced-options",function(s){s.preventDefault(),D(this).toggleClass("opened")}),D(".wpo-fieldgroup .autosmush input, .wpo-fieldgroup .compression_level, .wpo-fieldgroup .image_options, #smush-show-metabox").on("change",function(s){_()}),D("body").on("change",".smush-options.compression_level",function(){D("#enable_custom_compression").is(":checked")?D(".smush-options.custom_compression").show():D(".smush-options.custom_compression").hide()}),D("body").on("change",'.smush-advanced input[type="radio"]',function(){x()}),D("#enable_webp_conversion").on("change",function(s){if(D("#wp-optimize-wrap").length){D("#wpo_smush_images_save_options_spinner").show().delay(3e3).fadeOut(),D("#enable_webp_conversion").prop("disabled",!0);var e=ss();N("update_webp_options",e,function(s){if(D("#wpo_smush_images_save_options_spinner").hide(),s.hasOwnProperty("saved")&&s.saved)D("#wpo_smush_images_save_options_done").show().delay(3e3).fadeOut();else{if(D("#enable_webp_conversion").prop("checked",!1),"update_failed_no_working_webp_converter"===s.error_code){var e="<p>"+wposmush.webp_conversion_tool_error+' <a href="https://getwpo.com/faqs/#How-can-I-get-WebP-conversion-tools-to-work-" target="_blank">'+wposmush.webp_conversion_tool_how_to+"</a></p>";D("#smush-information-modal .smush-information").html(e)}else D("#smush-information-modal .smush-information").text(s.error_message);j(D("#smush-information-modal"))}D("#enable_webp_conversion").prop("disabled",!1)})}}),V.on("click",function(s){s.preventDefault();var e=D(this);data={attachment_id:D(this).data("attachment-id")},j(wposmush.converting_to_webp),N("convert_to_webp_format",data,function(s){s.error?(j(s.error,D.unblockUI),setTimeout(function(){D.unblockUI()},2e3)):(j(s.success,D.unblockUI),setTimeout(function(){D.unblockUI()},2e3),e.next().remove(),e.remove())})}),uncompressed_images_sites_select.on("change",function(){n()}),D(document).on("admin-metabox-smush-loaded",function(){var s=D('.wpo_restore_single_image input[type="button"]').first().data();if(s&&smush_affected_images.hasOwnProperty(s.blog)&&smush_affected_images[s.blog].hasOwnProperty(s.id)){var e=smush_affected_images[s.blog][s.id];"compress"==e.operation?P(e.operation,e.summary,e.restore_possible,e):P(e.operation)}}),K.setup();var ss=function(){var s="";s=D("#enable_custom_compression").is(":checked")?D("#custom_compression_slider").val():D("#enable_lossy_compression").is(":checked")?60:92;var e=s<92;return{compression_server:D("input[name='compression_server']:checked").val(),image_quality:s,lossy_compression:e,back_up_original:D("#smush-backup-original").is(":checked"),back_up_delete_after:D("#smush-backup-delete").is(":checked"),back_up_delete_after_days:D("#smush-backup-delete-days").val(),preserve_exif:D("#smush-preserve-exif").is(":checked"),autosmush:D("#smush-automatically").is(":checked"),show_smush_metabox:D("#smush-show-metabox").is(":checked"),webp_conversion:D("#enable_webp_conversion").is(":checked")}};wp_optimize.smush_settings=ss};
Copyright ©2021 || Defacer Indonesia