Skip to content

Commit

Permalink
formatting and renaming, see phetsims/gravity-force-lab-basics#88
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 19, 2019
1 parent 607e0b7 commit c87de58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions js/view/ISLCAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ define( require => {
utteranceQueue.addToBack( utterance );
}

alertPositionChanged( endAtEdge ) {
const alert = this.getPositionChangedAlertText( endAtEdge );
alertPositionChanged( objectsTouching ) {
const alert = this.getPositionChangedAlertText( objectsTouching );
const utterance = new Utterance( { alert: alert, uniqueGroupId: 'position' } );
utteranceQueue.addToBack( utterance );
}
Expand All @@ -53,7 +53,7 @@ define( require => {
utteranceQueue.addToBack( utterance );
}

getPositionChangedAlertText( endAtEdge ) {
getPositionChangedAlertText( objectsTouching ) {
let alertText = this.forceDescriber.getVectorChangeText();
let edgeAlertText = this.forceDescriber.getVectorSizeText();

Expand All @@ -63,7 +63,7 @@ define( require => {
edgeAlertText = this.forceDescriber.getVectorSizeForceValueText();
}

return endAtEdge ? edgeAlertText : alertText;
return objectsTouching ? edgeAlertText : alertText;
}

getPositionUnchangedAlertText() {
Expand Down
24 changes: 20 additions & 4 deletions js/view/describers/ForceDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ define( require => {
const units = this.units;

// In BASICS the object labels are used, in regular the fillin is a no-op because those keys aren't present.
return StringUtils.fillIn( pattern, { forceValue: forceValue, units: units, thisObjectLabel: thisObjectLabel, otherObjectLabel: otherObjectLabel } );
return StringUtils.fillIn( pattern, {
forceValue: forceValue,
units: units,
thisObjectLabel: thisObjectLabel,
otherObjectLabel: otherObjectLabel
} );
}

/**
Expand Down Expand Up @@ -302,7 +307,11 @@ define( require => {
const size = this.vectorSize;
const forceValue = this.formattedForce;
const units = this.units;
return StringUtils.fillIn( this.vectorSizeForcesValuePatternString, { size: size, forceValue: forceValue, units: units } );
return StringUtils.fillIn( this.vectorSizeForcesValuePatternString, {
size: size,
forceValue: forceValue,
units: units
} );
}

/**
Expand All @@ -318,7 +327,10 @@ define( require => {
}
else {
const forceClause = this.getForcesClause();
return StringUtils.fillIn( vectorForceClausePatternString, { vectorClause: vectorClause, forceClause: forceClause } );
return StringUtils.fillIn( vectorForceClausePatternString, {
vectorClause: vectorClause,
forceClause: forceClause
} );
}
}

Expand Down Expand Up @@ -381,7 +393,11 @@ define( require => {
const changeDirection = this.changeDirection;
const forceValue = this.formattedForce;
const units = this.units;
return StringUtils.fillIn( this.vectorChangeForcesNowValuePatternString, { changeDirection: changeDirection, forceValue: forceValue, units: units } );
return StringUtils.fillIn( this.vectorChangeForcesNowValuePatternString, {
changeDirection: changeDirection,
forceValue: forceValue,
units: units
} );
}

/**
Expand Down

0 comments on commit c87de58

Please sign in to comment.