function assessGenerateButton() {
    if ($('.filter-control:visible').length === 0) {
      // No filters are enabled.
      // Disable the generate button!
      $('#generate-button').prop('disabled', true);
      return;
    }
    if ($('#search-query-control').is(':visible')) {
      if ($('#search-query').val().length === 0) {
        // The search query filter has been enabled but no text has been entered.
        // Disable the generate button!
        $('#generate-button').prop('disabled', true);
        return;
      }
    }
    if ($('#upload-date-control').is(':visible')) {
      if ($('#datetimepicker-beginning > :input').val().length === 0 || $('#datetimepicker-end > :input').val().length === 0) {
        // The upload date filter has been enabled but both dates have not been selected yet.
        // Disable the generate button!
        $('#generate-button').prop('disabled', true);
        return;
      }
    }
    // If we make it to this point, then everything looks fine.
    // Enable the generate button!
    $('#generate-button').prop('disabled', false);
  }
// the generate button is disabled.
the generate button is disabled.
the generate button is disabled .
function assessGenerateButton() {
    if ($('.filter-control:visible').length === 0) {
      $('#generate-button').prop('disabled', true);
      return;
    }
    if ($('#search-query-control').is(':visible')) {
      if ($('#search-query').val().length === 0) {
        $('#generate-button').prop('disabled', true);
        return;
      }
    }
    if ($('#upload-date-control').is(':visible')) {
      if ($('#datetimepicker-beginning > :input').val().length === 0 || $('#datetimepicker-end > :input').val().length === 0) {
        $('#generate-button').prop('disabled', true);
        return;
      }
    }
    $('#generate-button').prop('disabled', false);
  }
function assessGenerateButton ( ) { if ( $ ( '.filter-control:visible' ) . length === 0 ) { $ ( '#generate-button' ) . prop ( 'disabled' , true ) ; return ; } if ( $ ( '#search-query-control' ) . is ( ':visible' ) ) { if ( $ ( '#search-query' ) . val ( ) . length === 0 ) { $ ( '#generate-button' ) . prop ( 'disabled' , true ) ; return ; } } if ( $ ( '#upload-date-control' ) . is ( ':visible' ) ) { if ( $ ( '#datetimepicker-beginning > :input' ) . val ( ) . length === 0 || $ ( '#datetimepicker-end > :input' ) . val ( ) . length === 0 ) { $ ( '#generate-button' ) . prop ( 'disabled' , true ) ; return ; } } $ ( '#generate-button' ) . prop ( 'disabled' , false ) ; }
the generate button is disabled.
the generate button is disabled .
// No filters are enabled. // Disable the generate button! // The search query filter has been enabled but no text has been entered. // Disable the generate button! // The upload date filter has been enabled but both dates have not been selected yet. // Disable the generate button! // If we make it to this point, then everything looks fine. // Enable the generate button!