From 32decb23939082e773f81eac03fe276e408e06d1 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 30 May 2014 15:28:59 -0500 Subject: [PATCH] * VRFS-1575 - don't resync if minimum input/outputs aren't selected. also don't attempt score on refocus if minimum input/outputs aren't selected --- .../wizard/gear/step_select_gear.js | 27 +++++++++-- web/app/assets/stylesheets/client/client.css | 1 + .../client/wizard/gearWizard.css.scss | 41 ----------------- .../stylesheets/client/wizard/wizard.css.scss | 45 +++++++++++++++++++ 4 files changed, 69 insertions(+), 45 deletions(-) create mode 100644 web/app/assets/stylesheets/client/wizard/wizard.css.scss diff --git a/web/app/assets/javascripts/wizard/gear/step_select_gear.js b/web/app/assets/javascripts/wizard/gear/step_select_gear.js index 3c2a83b75..a254f6c07 100644 --- a/web/app/assets/javascripts/wizard/gear/step_select_gear.js +++ b/web/app/assets/javascripts/wizard/gear/step_select_gear.js @@ -592,7 +592,7 @@ function initializeKnobs() { $frameSize.unbind('change').change(function () { logger.debug("frameize changed: " + selectedFramesize()); - context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['bottom']}); + context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']}); updateDefaultBuffers(); jamClient.FTUESetFrameSize(selectedFramesize()); invalidateScore(); @@ -600,14 +600,14 @@ $bufferIn.unbind('change').change(function () { logger.debug("buffer-in changed: " + selectedBufferIn()); - context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['bottom']}); + context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']}); jamClient.FTUESetInputLatency(selectedBufferIn()); invalidateScore(); }); $bufferOut.unbind('change').change(function () { logger.debug("buffer-out changed: " + selectedBufferOut()); - context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['bottom']}); + context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']}); jamClient.FTUESetOutputLatency(selectedBufferOut()); invalidateScore(); }); @@ -646,8 +646,27 @@ }); } + function getSelectedInputs() { + return $inputChannels.find('input[type="checkbox"]:checked'); + } + + function getSelectedOutputs() { + return $outputChannels.find('input[type="checkbox"]:checked'); + } + function initializeResync() { $resyncBtn.unbind('click').click(function () { + + if (getSelectedInputs().length == 0) { + context.JK.Banner.showAlert("You must have at least one input port to resync."); + return false; + } + + if (getSelectedOutputs().length < 2) { + context.JK.Banner.showAlert("You must have exactly two output ports to resync."); + return false; + } + attemptScore(); return false; }) @@ -1066,7 +1085,7 @@ } function onFocus() { - if(!scoring && validDevice) { + if(!scoring && validDevice && getSelectedInputs().length > 0 && getSelectedOutputs().length == 2 ) { // in the case the user has been unselecting ports, re-enforce minimum viable channels validDevice = autoSelectMinimumValidChannels(); attemptScore(true); diff --git a/web/app/assets/stylesheets/client/client.css b/web/app/assets/stylesheets/client/client.css index d168085d8..c267797f0 100644 --- a/web/app/assets/stylesheets/client/client.css +++ b/web/app/assets/stylesheets/client/client.css @@ -34,6 +34,7 @@ *= require ./search *= require ./ftue *= require ./jamServer + *= require ./wizard/wizard *= require ./wizard/gearWizard *= require ./whatsNextDialog *= require ./invitationDialog diff --git a/web/app/assets/stylesheets/client/wizard/gearWizard.css.scss b/web/app/assets/stylesheets/client/wizard/gearWizard.css.scss index 043145469..9264961d2 100644 --- a/web/app/assets/stylesheets/client/wizard/gearWizard.css.scss +++ b/web/app/assets/stylesheets/client/wizard/gearWizard.css.scss @@ -58,47 +58,6 @@ margin-top:20px; } - .wizard-buttons { - position: absolute; - bottom: 0; - width:100%; - @include border_box_sizing; - padding-right:45px; - padding-bottom:15px; - - } - - .wizard-buttons-holder { - float:right; - } - - .wizard-step { - display:none; - position:relative; - } - - .wizard-step-content { - margin-top:20px; - padding-bottom:12px; - - .wizard-step-column{ - position:relative; - float:left; - vertical-align:top; - @include border_box_sizing; - padding-right:12px; - height:300px; - } - - .wizard-step-column:last-child { - //padding-right:0; - } - - p:nth-of-type(1) { - margin-top:0; - } - } - h2 { color: #FFFFFF; font-size: 15px; diff --git a/web/app/assets/stylesheets/client/wizard/wizard.css.scss b/web/app/assets/stylesheets/client/wizard/wizard.css.scss new file mode 100644 index 000000000..02ef8e802 --- /dev/null +++ b/web/app/assets/stylesheets/client/wizard/wizard.css.scss @@ -0,0 +1,45 @@ +@import "client/common.css.scss"; +@charset "UTF-8"; + +.dialog { + .wizard-buttons { + position: absolute; + bottom: 0; + width:100%; + @include border_box_sizing; + padding-right:45px; + padding-bottom:15px; + + } + + .wizard-buttons-holder { + float:right; + } + + .wizard-step { + display:none; + position:relative; + } + + .wizard-step-content { + margin-top:20px; + padding-bottom:12px; + + .wizard-step-column{ + position:relative; + float:left; + vertical-align:top; + @include border_box_sizing; + padding-right:12px; + height:300px; + } + + .wizard-step-column:last-child { + //padding-right:0; + } + + p:nth-of-type(1) { + margin-top:0; + } + } +} \ No newline at end of file