Skip to content

Commit

Permalink
refactor sims to use screen-based keyboard help content, phetsims/joi…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 5, 2020
1 parent d5eaea5 commit 461137c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions js/john-travoltage-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import simLauncher from '../../joist/js/simLauncher.js';
import WebSpeechDialogContent from '../../scenery-phet/js/accessibility/speaker/WebSpeechDialogContent.js';
import Tandem from '../../tandem/js/Tandem.js';
import vibrationManager from '../../tappi/js/vibrationManager.js';
import johnTravoltageStrings from './johnTravoltageStrings.js';
import JohnTravoltageScreen from './john-travoltage/JohnTravoltageScreen.js';
import JohnTravoltageKeyboardHelpContent from './john-travoltage/view/JohnTravoltageKeyboardHelpContent.js';
import johnTravoltageStrings from './johnTravoltageStrings.js';

const johnTravoltageTitleString = johnTravoltageStrings[ 'john-travoltage' ].title;

Expand All @@ -29,9 +28,6 @@ newChild.tabIndex = -1;

const tandem = Tandem.ROOT;

// help content to describe keyboard interactions
const keyboardHelpContent = new JohnTravoltageKeyboardHelpContent();

const simOptions = {
credits: {
leadDesign: 'Noah Podolefsky, Carl Wieman, Sam Reid',
Expand All @@ -44,7 +40,7 @@ const simOptions = {
thanks: 'Thanks to Mobile Learner Labs for working with the PhET development team ' +
'to convert this simulation to HTML5.'
},
keyboardHelpNode: keyboardHelpContent,
hasKeyboardHelpContent: true,
createOptionsDialogContent: phet.chipper.queryParameters.supportsSelfVoicing ? () => new WebSpeechDialogContent() : null,

// protoypal vibration feedback, see https://github.com/phetsims/john-travoltage/issues/337
Expand Down
4 changes: 3 additions & 1 deletion js/john-travoltage/JohnTravoltageScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Property from '../../../axon/js/Property.js';
import Screen from '../../../joist/js/Screen.js';
import johnTravoltage from '../johnTravoltage.js';
import JohnTravoltageModel from './model/JohnTravoltageModel.js';
import JohnTravoltageKeyboardHelpContent from './view/JohnTravoltageKeyboardHelpContent.js';
import JohnTravoltageView from './view/JohnTravoltageView.js';

class JohnTravoltageScreen extends Screen {
Expand All @@ -26,7 +27,8 @@ class JohnTravoltageScreen extends Screen {
return new JohnTravoltageView( model, tandem.createTandem( 'view' ) );
}, {
backgroundColorProperty: new Property( '#9ddcf8' ),
tandem: tandem
tandem: tandem,
keyboardHelpNode: new JohnTravoltageKeyboardHelpContent()
}
);
}
Expand Down

0 comments on commit 461137c

Please sign in to comment.