1jQuery(function ($) { 2 /* 3 localized variables passed through params object: 4 nfpaypal_nfpluginsettings.clearLogRestUrl 5 nfpaypal_nfpluginsettings.clearLogButtonId 6 nfpaypal_nfpluginsettings.downloadLogRestUrl 7 nfpaypal_nfpluginsettings.downloadLogButtonId 8 nfpaypal_nfpluginsettings._wpnonce 9 10 */ 11 12 $("#" + nfpaypal_nfpluginsettings.clearLogButtonId).on("click", () => { 13 $.post( 14 nfpaypal_nfpluginsettings.clearLogRestUrl, 15 { 16 _wpnonce: nfpaypal_nfpluginsettings._wpnonce, 17 }, 18 function (json) { 19 console.log(json.result); 20 } 21 ); 22 }); 23 24 $("#" + nfpaypal_nfpluginsettings.downloadLogButtonId).on("click", () => { 25 $.post( 26 nfpaypal_nfpluginsettings.downloadLogRestUrl, 27 { 28 _wpnonce: nfpaypal_nfpluginsettings._wpnonce, 29 }, 30 function (json) { 31 let download = json.data; 32 33 var blob = new Blob([download], { type: "json" }); 34 35 var a = document.createElement("a"); 36 a.download = "nf-paypal-debug-log.json"; 37 a.href = URL.createObjectURL(blob); 38 a.dataset.downloadurl = ["json", a.download, a.href].join(":"); 39 a.style.display = "none"; 40 document.body.appendChild(a); 41 a.click(); 42 document.body.removeChild(a); 43 setTimeout(function () { 44 URL.revokeObjectURL(a.href); 45 }, 15000); 46 } 47 ); 48 }); 49 50 return; 51});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.