PageSourceSearch

https://www.firstmailing.co.uk/wp-content/plugins/download-monitor/assets/js/dlm-xhr.min.js?ver=4.7.72

js firstmailing.co.uk collected 2026-10-05 19:42:56 UTC 8,176 bytes, 1 lines download raw bytes

1jQuery(function(e){new DLM_XHR_Download});class DLM_XHR_Download{constructor(){(dlmXHRinstance=this).init()}init(){dlmXHRinstance.attachButtonEvent()}attachButtonEvent(){jQuery("html, body").on("click",".dlm-no-access-modal-overlay, .dlm-no-access-modal-close",function(e){jQuery("#dlm-no-access-modal").remove()}),jQuery("html, body").on("click","a",function(e){const d=jQuery(this).attr("href");if(jQuery(this).hasClass("dlm-no-xhr-download"))return!0;0<=d.indexOf(dlmXHRGlobalLinks)&&dlmXHRinstance.handleDownloadClick(this,e)})}handleDownloadClick(e,d){d.stopPropagation();var o=e.getAttribute("href");let t={button:e,href:o,buttonObj:jQuery(e)};-1===t.href.indexOf("blob:http")&&"#"!==t.href&&(d.preventDefault(),dlmXHRinstance.retrieveBlob(t))}retrieveBlob(e){let{button:l,href:n,buttonObj:a}=e,s;const i=new XMLHttpRequest,m=dlmXHR.prevent_duplicates,c=a.attr("target");let p=a.attr("class");p=void 0!==p&&""!==p?p.replace("dlm-download-started","").replace("dlm-download-completed",""):"",a.addClass("dlm-download-started"),l.setAttribute("href","#"),l.removeAttribute("download"),l.setAttribute("disabled","disabled");e='<img src="'+dlmXHRgif+'" class="dlm-xhr-loading-gif" style="display:inline-block; vertical-align: middle; margin-left:15px;">',l.innerHTML+=e,e=0<n.indexOf("?")?n+"&nonce="+dlmXHR.nonce:n+"?nonce="+dlmXHR.nonce;jQuery(document).trigger("dlm_download_triggered",[this,l,a,s]),i.responseType="blob",i.onreadystatechange=function(){var{status:e,readyState:d,statusText:o}=i;let t=i.getAllResponseHeaders().split("\r\n").reduce((e,d)=>{var[d,o]=d.split(": ");return e[d]=o,e},{});if(2===i.readyState){if(void 0!==t["dlm-no-waypoints"]&&(i.abort(),window.location.href=n),void 0!==t["dlm-external-download"]){i.abort();let e="";return void 0!==t["dlm-file-name"]?(e=t["dlm-file-name"].replace(/\"/g,"").replace(";",""),e=decodeURI(e)):void 0!==t["content-disposition"]&&(e=(e=t["content-disposition"].split("filename=")[1]).replace(/\"/g,"").replace(";",""),e=decodeURI(e)),void dlmXHRinstance.dlmExternalDownload(t,l,a,e,n)}var r=Object.keys(t).filter(e=>-1!==e.indexOf("dlm-")).length;if(0===r&&(i.abort(),window.location.href=n),void 0!==t["dlm-no-access"]&&"true"===t["dlm-no-access"]&&void 0!==t["dlm-no-access-modal"]&&0!=t["dlm-no-access-modal"])return dlmXHRinstance.dlmNoAccessModal(t),l.removeAttribute("download"),l.setAttribute("href",n),a.removeClass().addClass(p).find("span.dlm-xhr-progress").remove(),a.find(".dlm-xhr-loading-gif").remove(),void i.abort();if(void 0!==t["dlm-error"]&&""!==t["dlm-error"]&&null!==t["dlm-error"])return dlmXHRinstance.dlmLogDownload(t,"failed",!1),l.removeAttribute("download"),l.setAttribute("href",n),a.removeClass().addClass(p).find("span.dlm-xhr-progress").remove(),a.find(".dlm-xhr-loading-gif").remove(),i.abort(),void(void 0!==t["dlm-no-access-modal"]&&0!=t["dlm-no-access-modal"]?dlmXHRinstance.dlmNoAccessModal(t["dlm-download-id"],t["dlm-version-id"],t["dlm-no-access-modal-text"]):a.append('<span class="dlm-xhr-error">'+t["dlm-error"]+"</span>"));if(void 0!==t["dlm-redirect"]&&""!==t["dlm-redirect"]&&null!==t["dlm-redirect"])return dlmXHRinstance.dlmLogDownload(t,"redirected",!1,t["dlm-redirect"],t["dlm-no-access"],c),l.removeAttribute("download"),l.setAttribute("href",n),a.removeClass().addClass(p).find("span.dlm-xhr-progress").remove(),a.find(".dlm-xhr-loading-gif").remove(),void i.abort()}if(404==e&&2==d){let e=document.createElement("p");e.innerHTML=o,l.parentNode.appendChild(e)}if(401==e&&2==d&&(window.location.href=o),403==e&&2==d){let e=document.createElement("p");e.innerHTML=o,l.parentNode.appendChild(e)}if(200==e&&4==d){r=i.response;let e=t["content-disposition"].split("filename=")[1];e=e.replace(/\"/g,"").replace(";",""),e=decodeURI(e),s=URL.createObjectURL(r),l.removeEventListener("click",dlmXHRinstance.handleDownloadClick),l.setAttribute("download",""+e),l.setAttribute("href",s),l.click(),a.removeClass().addClass(p+" dlm-download-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,l,a,s]),dlmXHRinstance.dlmLogDownload(t,"completed",m),window.URL.revokeObjectURL(s),l.removeAttribute("download"),l.setAttribute("href",n),a.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){a.removeClass().addClass(p).find("span.dlm-xhr-progress").remove()},4e3)}},i.addEventListener("progress",function(e){let d=e.loaded/e.total*100;d=d.toFixed();var o;
1a.find("span.dlm-xhr-progress").remove(),o="dlm-download-started download-"+10*Math.ceil(d/10),1/0!=d&&a.append('<span class="dlm-xhr-progress">&nbsp;'+d+"%</span>"),a.removeClass().addClass(p+" "+o),jQuery(document).trigger("dlm_download_progress",[this,l,a,s,e,d])}),i.onerror=function(){l.removeAttribute("download"),l.setAttribute("href",n),a.removeClass().addClass(p+" dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),a.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")},i.open("GET",e,!0),i.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),i.send()}dlmLogDownload(e,d,o,t=null,r=null,l="_self"){null!==r?window.location.href=t:(r=window.location.href,d={download_id:e["dlm-download-id"],version_id:e["dlm-version-id"],status:d,cookie:o,currentURL:r,action:"log_dlm_xhr_download",responseHeaders:e,nonce:dlmXHR.nonce},jQuery.post(dlmXHR.ajaxUrl,d,function(e){null!==t&&(null==l&&(l="_self"),window.open(t,l))}))}dlmNoAccessModal(e){let d="empty-download",o="empty-version",t="empty-restriction",r="";void 0!==e["dlm-download-id"]&&(d=e["dlm-download-id"]),void 0!==e["dlm-version-id"]&&(o=e["dlm-version-id"]),void 0!==e["dlm-no-access-modal-text"]&&(r=e["dlm-no-access-modal-text"]),void 0!==e["dlm-no-access-restriction"]&&(t=e["dlm-no-access-restriction"]);const l={download_id:d,version_id:o,modal_text:r,restriction:t,action:"no_access_dlm_xhr_download",nonce:dlmXHR.nonce};jQuery.post(dlmXHR.ajaxUrl,l,function(e){jQuery("#dlm-no-access-modal").remove(),jQuery("body").append(e),jQuery(document).trigger("dlm_no_access_modal_response",[e,l])})}dlmExternalDownload(e,t,r,l,n){const a=new XMLHttpRequest,d=e["dlm-external-download"];r.attr("target");let s=r.attr("class"),i;s=void 0!==s&&""!==s?s.replace("dlm-download-started","").replace("dlm-download-completed",""):"",r.addClass("dlm-download-started"),t.setAttribute("href","#"),t.removeAttribute("download"),t.setAttribute("disabled","disabled"),jQuery(document).trigger("dlm_download_triggered",[this,t,r,i]),a.responseType="blob",a.onreadystatechange=function(){var{status:e,readyState:d}=a,o=a.getAllResponseHeaders().split("\r\n").reduce((e,d)=>{var[d,o]=d.split(": ");return e[d]=o,e},{});if(403===e)return dlmXHRinstance.dlmLogDownload(o,"failed",!1),a.abort(),void r.append('<span class="dlm-xhr-error">Acces Denied to file.</span>');200==e&&4==d&&(e=a.response,i=URL.createObjectURL(e),t.removeEventListener("click",dlmXHRinstance.handleDownloadClick),t.setAttribute("download",""+l),t.setAttribute("href",i),t.click(),r.removeClass().addClass(s+" dlm-download-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,t,r,i]),dlmXHRinstance.dlmLogDownload(o,"completed",!1),window.URL.revokeObjectURL(i),t.removeAttribute("download"),t.setAttribute("href",n),r.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){r.removeClass().addClass(s).find("span.dlm-xhr-progress").remove()},1e3))},a.addEventListener("progress",function(e){let d=e.loaded/e.total*100;d=d.toFixed();var o;r.find("span.dlm-xhr-progress").remove(),o="dlm-download-started download-"+10*Math.ceil(d/10),1/0!=d&&r.append('<span class="dlm-xhr-progress">&nbsp;'+d+"%</span>"),r.removeClass().addClass(s+" "+o),jQuery(document).trigger("dlm_download_progress",[this,t,r,i,e,d])}),a.onerror=function(){t.removeAttribute("download"),t.setAttribute("href",n),r.removeClass().addClass(s+" .dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),r.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")},a.open("GET",d,!0),a.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),a.send()}}

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.