Skip to content

Commit

Permalink
new a11y strings, new implementation for getting position slider text…
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarlow12 committed Dec 12, 2018
1 parent 4252621 commit 2665901
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 90 deletions.
28 changes: 25 additions & 3 deletions js/ISLCA11yStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define( require => {
summaryInteractionHintPattern: {
value: 'Move spheres or change their {{massOrCharge}} to begin observations.'
},
distanceSpaceAndValueSummaryPattern: {
distanceAndValueSummaryPattern: {
value: '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other, centers exactly {{distance}} {{distanceUnits}} apart.'
},

Expand Down Expand Up @@ -71,12 +71,34 @@ define( require => {
value: '{{position}} mark, {{region}}, last stop.'
},

/*
* 12/11/18 update for position slider aria-valuetext
*/
positionDistanceFromOtherObjectPattern: {
value: '{{position}} mark, {{distance}} {{units}} from {{otherObjectLabel}}.'
},
distanceFromOtherObjectPattern: {
value: '{{distance}} {{units}} from {{otherObjectLabel}}.'
},
progressDistanceFromOtherObjectPattern: {
value: '{{progress}}, {{distance}} {{units}} from {{otherObjectLabel}}.'
},
lastStopDistanceFromOtherObjectPattern: {
value: '{{region}}, last stop, {{distance}} {{units}} from {{otherObjectLabel}}.'
},

/************************
* Force vector strings *
************************/
forceVectorsSize: {
value: 'Force vectors {{size}}.'
},
vectorAlertNoValuePattern: {
value: 'Vectors {{changeOrSize}}.'
},
vectorAlertWithValuePattern: {
value: 'Vectors {{changeOrSize}}, forces now {{valueAndUnits}}.'
},

/**********************
* Qualitative Values *
Expand Down Expand Up @@ -160,8 +182,8 @@ define( require => {
closer: {
value: 'closer'
},
farther: {
value: 'farther'
fartherAway: {
value: 'Farther away'
},


Expand Down
2 changes: 2 additions & 0 deletions js/model/ISLCModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ define( function( require ) {

// update range if radius changed with "constant radius" setting (which didn't trigger other model updates)
updateRange( object1 );
updateRange( object2 );
} );

this.object2.radiusProperty.link( function() {
Expand All @@ -111,6 +112,7 @@ define( function( require ) {

// update range if radius changed with "constant radius" setting (which didn't trigger other model updates)
updateRange( object2 );
updateRange( object1 );
} );
}

Expand Down
6 changes: 6 additions & 0 deletions js/model/ISLCObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ define( function( require ) {
reset: function() {
this.valueProperty.reset();
this.positionProperty.reset();
},

isAtEdgeOfRange: function() {
var range = this.enabledRangeProperty.get();
var x = this.positionProperty.get();
return x === range.min || x === range.max;
}
} );
} );
9 changes: 0 additions & 9 deletions js/view/ISLCObjectNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ define( function( require ) {
this.modelViewTransform = modelViewTransform;

// @public
this.interactionCount = 0;
this.enum = object === model.object1 ? ISLCObjectEnum.OBJECT_ONE : ISLCObjectEnum.OBJECT_TWO;

// the full range of force for the arrow node (note: this is distinct)
Expand Down Expand Up @@ -307,7 +306,6 @@ define( function( require ) {
},
startDrag: function() {
object.isDragging = true;
self.interactionCount++;
},
endDrag: function() {
object.isDragging = false;
Expand All @@ -324,13 +322,6 @@ define( function( require ) {
accessibleSliderOptions
);

this.addInputListener( {
focus: function( event ) {
self.interactionCount = 0;
self.resetAriaValueText();
}
} );

this.objectModel.radiusProperty.link( function() {

// a11y - update the focusHighlight with the radius (Accessibility.js setter)
Expand Down
Loading

0 comments on commit 2665901

Please sign in to comment.