Skip to content

Commit

Permalink
add edge alerts for min/max mass interaction attempt, phetsims/gravit…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 5, 2019
1 parent 6d38643 commit 89a8c43
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
5 changes: 4 additions & 1 deletion js/ISLCA11yStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ define( require => {
forceMagnitude: {
value: 'Force magnitude'
},
forceVectorSizePattern: {
value: '{{forceVector}} is {{size}}'
},
forceAndVectorPattern: {
value: '{{forceVector}} is {{size}}, and points directly at {{otherObjectLabel}}.'
value: '{{forceVectorSize}}, and points directly at {{otherObjectLabel}}.'
},
forceVector: {
value: 'Force vector'
Expand Down
22 changes: 16 additions & 6 deletions js/view/describers/ForceDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define( require => {
const summaryVectorSizeValueUnitsPatternString = ISLCA11yStrings.summaryVectorSizeValueUnitsPattern.value;
const forceVectorMagnitudeUnitsPatternString = ISLCA11yStrings.forceVectorMagnitudeUnitsPattern.value;
const forceAndVectorPatternString = ISLCA11yStrings.forceAndVectorPattern.value;
const forceVectorSizePatternString = ISLCA11yStrings.forceVectorSizePattern.value;
const robotPullSummaryPatternString = ISLCA11yStrings.robotPullSummaryPattern.value;
const robotPushSummaryPatternString = ISLCA11yStrings.robotPushSummaryPattern.value;
const vectorsString = ISLCA11yStrings.vectors.value;
Expand Down Expand Up @@ -166,7 +167,7 @@ define( require => {
this.forceVectorMagnitudeUnitsPatternString = StringUtils.fillIn( forceVectorMagnitudeUnitsPatternString, {
forceMagnitude: options.forceMagnitudeString
} );
this.forceAndVectorPatternString = StringUtils.fillIn( forceAndVectorPatternString, {
this.forceVectorSizePatternString = StringUtils.fillIn( forceVectorSizePatternString, {
forceVector: options.forceVectorString
} );

Expand Down Expand Up @@ -228,20 +229,29 @@ define( require => {
} );
}

/**
* Get the size of the vectors clause.
* @public
* @returns {string}
*/
getForceVectorSize() {
return StringUtils.fillIn( this.forceVectorSizePatternString, {
size: this.getVectorSize()
} );
}

/**
* @param {string} thisObjectLabel
* @param {string} otherObjectLabel
* @returns {string}
* @public
*/
getForceBetweenAndVectorText( thisObjectLabel, otherObjectLabel ) {
const pattern = this.forceAndVectorPatternString;
const fillObject = {
return StringUtils.fillIn( forceAndVectorPatternString, {
thisObjectLabel: thisObjectLabel,
otherObjectLabel: otherObjectLabel,
size: this.getVectorSize()
};
return StringUtils.fillIn( pattern, fillObject );
forceVectorSize: this.getForceVectorSize()
} );
}

/**
Expand Down

0 comments on commit 89a8c43

Please sign in to comment.