js/decklist/main.js
// Parse the GET attributes, locking out fields as needed
Parse the GET attributes, locking out fields as needed
Parse the GET attributes locking out fields as needed
function parseGET() {
  var params = ['firstname', 'lastname', 'dcinumber', 'event', 'eventdate', 'eventlocation', 'deckmain', 'deckside'];
  for (var i = 0; i < params.length; i++) {
    var param = params[i];
    var field = '#' + param;
    if ($._GET[ param ] != undefined) {
      $(field).val( $._GET[param] );    
      if ((param != 'deckmain') && (param != 'deckside')) {
        $(field).prop('disabled', true);  
      }
    }
  }
  if ($._GET['logo'] == undefined) { $._GET['logo'] = 'dcilogo'; } 
  var logos = ['dcilogo', 'legion', 'gpsanantonio'];
  for (var i = 0; i < logos.length; i++) {
    if ($._GET['logo'] == logos[i]) {
      var element = document.createElement('script');
      element.src = 'images/' + logos[i] + '.js';
      element.type = 'text/javascript';
      element.id = 'logo';
      element.onload = function () { generateDecklistPDF(); };
      document.getElementsByTagName('head')[0].appendChild(element);
    }
  }
  if ($._GET[ 'uploadURL' ] != undefined) {
    $('#upload').css('display', 'inline-block');
  }
}
function parseGET ( ) { var params = [ 'firstname' , 'lastname' , 'dcinumber' , 'event' , 'eventdate' , 'eventlocation' , 'deckmain' , 'deckside' ] ; for ( var i = 0 ; i < params . length ; i ++ ) { var param = params [ i ] ; var field = '#' + param ; if ( $ . _GET [ param ] != undefined ) { $ ( field ) . val ( $ . _GET [ param ] ) ; if ( ( param != 'deckmain' ) && ( param != 'deckside' ) ) { $ ( field ) . prop ( 'disabled' , true ) ; } } } if ( $ . _GET [ 'logo' ] == undefined ) { $ . _GET [ 'logo' ] = 'dcilogo' ; } var logos = [ 'dcilogo' , 'legion' , 'gpsanantonio' ] ; for ( var i = 0 ; i < logos . length ; i ++ ) { if ( $ . _GET [ 'logo' ] == logos [ i ] ) { var element = document . createElement ( 'script' ) ; element . src = 'images/' + logos [ i ] + '.js' ; element . type = 'text/javascript' ; element . id = 'logo' ; element . onload = function ( ) { generateDecklistPDF ( ) ; } ; document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( element ) ; } } if ( $ . _GET [ 'uploadURL' ] != undefined ) { $ ( '#upload' ) . css ( 'display' , 'inline-block' ) ; } }
Parse the GET attributes, locking out fields as needed
Parse the GET attributes locking out fields as needed
// check for event, eventdate, or eventlocation and lock down those input fields // set it to the GET variable // disable all decklist fields that are in the URL // load the logo // if logo isn't specified, use the DCI logo // make the upload button visible, if uploadURL exists