Skip to content

Commit

Permalink
feat(pacer): Add a helper to identify combined PDF pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ERosendo committed Jul 20, 2023
1 parent 96c3772 commit 4108509
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,27 @@ let PACER = {
inputs[inputs.length-1].value === "Download Documents"
return !!pageCheck
},

// Returns true if this is a combined PDF page (confirmation of
// pricing for all documents to receive a combined PDF file with
// all of them)
isCombinedPdfPage: function (url, document) {
// This method checks the page has the following elements:
// - The URL contains the "zipit" parameters and its value is 0
// - The URL contains the word "show_multidocs.pl"
// - shows 2 or more buttons
let queryParameters = new URLSearchParams(window.location.search);
let isZipFile = queryParameters.get('zipit');
let buttons = document.getElementsByTagName('input');
let pageCheck =
!!url.match(/\/show_multidocs\.pl\?/) &&
isZipFile == 0 &&
buttons.length > 1 &&
buttons[buttons.length - 1].value === 'View Document';

return !!pageCheck;
},

// Claims Register Page includes an h2 tag with the court and words "Claims Register"
// exampleUrl: https://ecf.nyeb.uscourts.gov/cgi-bin/SearchClaims.pl?610550152546515-L_1_0-1
// exampleHeader: <h2>Eastern District of New York<br>Claims Register </h2>
Expand Down

0 comments on commit 4108509

Please sign in to comment.