function generateDecklistPDF(outputtype = 'dataurlstring') {
  // clear the input timeout before we can generate the PDF
  pdfChangeTimer = null;

  // don't generate the preview if showpreview === false
  if ((outputtype === 'dataurlstring') && !PDFPreviewSupport()) {
    $('#decklistpreview').empty();
    $('#decklistpreview').html('Automatic decklist preview only supported in non-mobile Firefox, Safari, and Chrome.<br /><br />');
  }

  // Parse the deck list
  const parsedInput = Decklist.parse();

  // Validate the input
  validateInput(parsedInput);

  // get complete PDF
  const dl = generateDecklistLayout(parsedInput);

  // Output the dl as a blob to add to the DOM
  if (outputtype === 'dataurlstring') {
    const domdl = dl.output('dataurlstring');

    // Put the DOM into the live preview iframe
    $('iframe').attr('src', domdl);
  }
  else if (outputtype === 'raw') {
    const rawPDF = dl.output();
    return(rawPDF);
  }
  else {
    dl.save('decklist.pdf');
  }
}
// Performs validation on user input and updates PDF
Performs validation on user input and updates PDF
Performs validation on user input and updates PDF
function generateDecklistPDF(outputtype = 'dataurlstring') {
  pdfChangeTimer = null;
  if ((outputtype === 'dataurlstring') && !PDFPreviewSupport()) {
    $('#decklistpreview').empty();
    $('#decklistpreview').html('Automatic decklist preview only supported in non-mobile Firefox, Safari, and Chrome.<br /><br />');
  }
  const parsedInput = Decklist.parse();
  validateInput(parsedInput);
  const dl = generateDecklistLayout(parsedInput);
  if (outputtype === 'dataurlstring') {
    const domdl = dl.output('dataurlstring');
    $('iframe').attr('src', domdl);
  }
  else if (outputtype === 'raw') {
    const rawPDF = dl.output();
    return(rawPDF);
  }
  else {
    dl.save('decklist.pdf');
  }
}
function generateDecklistPDF ( outputtype = 'dataurlstring' ) { pdfChangeTimer = null ; if ( ( outputtype === 'dataurlstring' ) && ! PDFPreviewSupport ( ) ) { $ ( '#decklistpreview' ) . empty ( ) ; $ ( '#decklistpreview' ) . html ( 'Automatic decklist preview only supported in non-mobile Firefox, Safari, and Chrome.<br /><br />' ) ; } const parsedInput = Decklist . parse ( ) ; validateInput ( parsedInput ) ; const dl = generateDecklistLayout ( parsedInput ) ; if ( outputtype === 'dataurlstring' ) { const domdl = dl . output ( 'dataurlstring' ) ; $ ( 'iframe' ) . attr ( 'src' , domdl ) ; } else if ( outputtype === 'raw' ) { const rawPDF = dl . output ( ) ; return ( rawPDF ) ; } else { dl . save ( 'decklist.pdf' ) ; } }
Performs validation on user input and updates PDF
Performs validation on user input and updates PDF
// clear the input timeout before we can generate the PDF // don't generate the preview if showpreview === false // Parse the deck list // Validate the input // get complete PDF // Output the dl as a blob to add to the DOM // Put the DOM into the live preview iframe