%PDF- %PDF-
Direktori : /home/t/r/a/tradesc/www/relax/wp-content/plugins/woocommerce/assets/js/admin/ |
Current File : /home/t/r/a/tradesc/www/relax/wp-content/plugins/woocommerce/assets/js/admin/system-status.min.js |
jQuery(function(t){var e={init:function(){t(document.body).on("click","a.help_tip, a.woocommerce-help-tip, woocommerce-product-type-tip",this.preventTipTipClick).on("click","a.debug-report",this.generateReport).on("click","#copy-for-support",this.copyReport).on("click","#copy-for-github",this.copyGithubReport).on("aftercopy","#copy-for-support, #copy-for-github",this.copySuccess).on("aftercopyfailure","#copy-for-support, #copy-for-github",this.copyFail).on("click","#download-for-support",this.downloadReport)},preventTipTipClick:function(){return!1},generateReport:function(){var e="";t(".wc_status_table thead, .wc_status_table tbody").each(function(){if(t(this).is("thead")){var o=t(this).find("th:eq(0)").data("exportLabel")||t(this).text();e=e+"\n### "+o.trim()+" ###\n\n"}else t("tr",t(this)).each(function(){var o=(t(this).find("td:eq(0)").data("exportLabel")||t(this).find("td:eq(0)").text()).trim().replace(/(<([^>]+)>)/gi,""),r=t(this).find("td:eq(2)").clone();r.find(".private").remove(),r.find(".dashicons-yes").replaceWith("✔"),r.find(".dashicons-no-alt, .dashicons-warning").replaceWith("❌");var i=r.text().trim(),n=i.split(", ");if(n.length>1){var a="";t.each(n,function(t,e){a=a+e+"\n"}),i=a}e=e+""+o+": "+i+"\n"})});try{return t("#debug-report").slideDown(),t("#debug-report").find("textarea").val("`"+e+"`").trigger("focus").trigger("select"),t(this).fadeOut(),!1}catch(o){console.log(o)}return!1},copyReport:function(e){wcClearClipboard(),wcSetClipboard(t("#debug-report").find("textarea").val(),t(this)),e.preventDefault()},applyRedactions:t=>([{regex:/(WordPress address \(URL\):)[^\n]*/,replacement:"$1 [Redacted]"},{regex:/(Site address \(URL\):)[^\n]*/,replacement:"$1 [Redacted]"},{regex:/(### Database ###\n)([\s\S]*?)(\n### Post Type Counts ###)/,replacement:"$1\n[REDACTED]\n$3"}].forEach(function(e){t=t.replace(e.regex,e.replacement)}),t),copyGithubReport:function(o){wcClearClipboard();var r=t("#debug-report").find("textarea").val(),i=e.applyRedactions(r);wcSetClipboard("<details><summary>System Status Report</summary>\n\n``"+i+"``\n</details>",t(this)),o.preventDefault()},copySuccess:function(e){t(e.target).tipTip({attribute:"data-tip",activation:"focus",fadeIn:50,fadeOut:50,delay:0}).trigger("focus")},copyFail:function(){t(".copy-error").removeClass("hidden"),t("#debug-report").find("textarea").trigger("focus").trigger("select")},downloadReport:function(){var e=new Blob([t("#debug-report").find("textarea").val()],{type:"text/plain"}),o=window.location.hostname,r=(new Date).toISOString().slice(0,19).replace(/:/g,"-"),i=document.createElement("a");i.download="SystemStatusReport_"+o+"_"+r+".txt",i.href=window.URL.createObjectURL(e),i.textContent="Download ready",i.style="display:none",i.click(),i.remove()}};e.init(),t(".wc_status_table").on("click",".run-tool .button",function(t){return t.stopImmediatePropagation(),window.confirm(woocommerce_admin_system_status.run_tool_confirmation)}),t("#log-viewer-select").on("click","h2 a.page-title-action",function(t){return t.stopImmediatePropagation(),window.confirm(woocommerce_admin_system_status.delete_log_confirmation)})});