diff --git a/ruby/Gemfile b/ruby/Gemfile index c1f1b078e..252c1f546 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -54,7 +54,7 @@ group :test do gem 'spork', '0.9.0' gem 'database_cleaner', '0.7.0' gem 'faker' - gem 'resque_spec', :path => "/home/jam/src/resque_spec/" + gem 'resque_spec' #, :path => "/home/jam/src/resque_spec/" gem 'timecop' end diff --git a/web/app/assets/javascripts/gear_wizard.js b/web/app/assets/javascripts/gear_wizard.js index 05031cbbe..4926c6777 100644 --- a/web/app/assets/javascripts/gear_wizard.js +++ b/web/app/assets/javascripts/gear_wizard.js @@ -16,6 +16,11 @@ var self = null; var operatingSystem = null; + // SELECT DEVICE STATE + var validScore = false; + + // SELECT TRACKS STATE + var TOTAL_STEPS = 7; var STEP_INTRO = 0; var STEP_SELECT_DEVICE = 1; @@ -58,6 +63,10 @@ var $watchVideoOutput = $currentWizardStep.find('.watch-video.audio-output'); var $audioInput = $currentWizardStep.find('.select-audio-input-device'); var $audioOutput = $currentWizardStep.find('.select-audio-output-device'); + var $bufferIn = $currentWizardStep.find('.select-buffer-in'); + var $bufferOut = $currentWizardStep.find('.select-buffer-out'); + var $nextButton = $ftueButtons.find('.btn-next'); + var $frameSize = $currentWizardStep.find('.select-frame-size'); // returns a deviceInfo hash for the device matching the deviceId, or null. function findDevice(deviceId) { @@ -72,6 +81,20 @@ return $audioOutput.val(); } + function initializeNextButtonState() { + $nextButton.removeClass('button-orange button-grey'); + + if(validScore) $nextButton.addClass('button-orange'); + else $nextButton.addClass('button-grey'); + } + + function audioDeviceUnselected() { + validScore = false; + + + initializeNextButtonState(); + } + function initializeWatchVideo() { $watchVideoInput.unbind('click').click(function() { @@ -118,6 +141,20 @@ function initializeAudioInputChanged() { $audioInput.unbind('change').change(function(evt) { + + var audioDeviceId = selectedAudioInput(); + + if(!audioDeviceId) { + audioDeviceUnselected(); + return false; + } + + var audioDevice = findDevice(selectedAudioInput()); + + if(!audioDevice) { + context.JK.alertSupportedNeeded('Unable to find device information for: ' + audioDevice); + } + releaseDropdown(function () { renderStartNewFtueLatencyTesting(); var $select = $(evt.currentTarget); @@ -199,6 +236,7 @@ }) } function initializeStep() { + initializeNextButtonState(); initializeWatchVideo(); initializeAudioInputChanged(); } @@ -328,12 +366,15 @@ } function back() { + if($(this).is('.button-grey')) return; step = step - 1; moveToStep(); return false; } function next() { + if($(this).is('.button-grey')) return; + step = step + 1; moveToStep();