Skip to content

Commit

Permalink
Move screenViewRoot to base class, see: https://github.com/phetsims/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Sep 7, 2022
1 parent 11f7e8d commit 73bfb89
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 55 deletions.
6 changes: 3 additions & 3 deletions js/JohnTravoltageStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ type StringsType = {
}
};

const johnTravoltageStrings = getStringModule( 'JOHN_TRAVOLTAGE' ) as StringsType;
const JohnTravoltageStrings = getStringModule( 'JOHN_TRAVOLTAGE' ) as StringsType;

johnTravoltage.register( 'johnTravoltageStrings', johnTravoltageStrings );
johnTravoltage.register( 'JohnTravoltageStrings', JohnTravoltageStrings );

export default johnTravoltageStrings;
export default JohnTravoltageStrings;
4 changes: 2 additions & 2 deletions js/john-travoltage-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import Sim from '../../joist/js/Sim.js';
import simLauncher from '../../joist/js/simLauncher.js';
import Tandem from '../../tandem/js/Tandem.js';
import JohnTravoltageScreen from './john-travoltage/JohnTravoltageScreen.js';
import johnTravoltageStrings from './johnTravoltageStrings.js';
import JohnTravoltageStrings from './JohnTravoltageStrings.js';

const johnTravoltageTitleStringProperty = johnTravoltageStrings[ 'john-travoltage' ].titleStringProperty;
const johnTravoltageTitleStringProperty = JohnTravoltageStrings[ 'john-travoltage' ].titleStringProperty;

//Workaround for #30
const newChild = document.createElement( 'audio' );
Expand Down
40 changes: 20 additions & 20 deletions js/john-travoltage/AppendageRangeMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@

import Range from '../../../dot/js/Range.js';
import johnTravoltage from '../johnTravoltage.js';
import johnTravoltageStrings from '../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../JohnTravoltageStrings.js';

const farthestFromDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.farthestFromDoorknob;
const veryFarFromDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.veryFarFromDoorknob;
const farFromDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.farFromDoorknob;
const notSoCloseToDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.notSoCloseToDoorknob;
const closeToDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.closeToDoorknob;
const veryCloseToDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.veryCloseToDoorknob;
const justAboveDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.justAboveDoorknob;
const atDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.atDoorknob;
const justBelowDoorknobString = johnTravoltageStrings.a11y.appendages.arm.positions.justBelowDoorknob;
const farthestFromDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.farthestFromDoorknob;
const veryFarFromDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.veryFarFromDoorknob;
const farFromDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.farFromDoorknob;
const notSoCloseToDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.notSoCloseToDoorknob;
const closeToDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.closeToDoorknob;
const veryCloseToDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.veryCloseToDoorknob;
const justAboveDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.justAboveDoorknob;
const atDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.atDoorknob;
const justBelowDoorknobString = JohnTravoltageStrings.a11y.appendages.arm.positions.justBelowDoorknob;

const handPointingAwayString = johnTravoltageStrings.a11y.appendages.arm.positions.handPointingAway;
const handPointingStraightUpString = johnTravoltageStrings.a11y.appendages.arm.positions.handPointingStraightUp;
const handPointingAtUpperDoorString = johnTravoltageStrings.a11y.appendages.arm.positions.handPointingAtUpperDoor;
const handPointingAtLowerDoorString = johnTravoltageStrings.a11y.appendages.arm.positions.handPointingAtLowerDoor;
const handPointingStraightDownString = johnTravoltageStrings.a11y.appendages.arm.positions.handPointingStraightDown;
const farthestFromDoorknobLastString = johnTravoltageStrings.a11y.appendages.arm.positions.farthestFromDoorknobLast;
const handPointingAwayString = JohnTravoltageStrings.a11y.appendages.arm.positions.handPointingAway;
const handPointingStraightUpString = JohnTravoltageStrings.a11y.appendages.arm.positions.handPointingStraightUp;
const handPointingAtUpperDoorString = JohnTravoltageStrings.a11y.appendages.arm.positions.handPointingAtUpperDoor;
const handPointingAtLowerDoorString = JohnTravoltageStrings.a11y.appendages.arm.positions.handPointingAtLowerDoor;
const handPointingStraightDownString = JohnTravoltageStrings.a11y.appendages.arm.positions.handPointingStraightDown;
const farthestFromDoorknobLastString = JohnTravoltageStrings.a11y.appendages.arm.positions.farthestFromDoorknobLast;

const footOffRugPointingBackwardsString = johnTravoltageStrings.a11y.appendages.leg.positions.footOffRugPointingBackwards;
const footOffRugString = johnTravoltageStrings.a11y.appendages.leg.positions.footOffRug;
const footRubbingOnRugString = johnTravoltageStrings.a11y.appendages.leg.positions.footRubbingOnRug;
const footOffRugPointingForwardString = johnTravoltageStrings.a11y.appendages.leg.positions.footOffRugPointingForward;
const footOffRugPointingBackwardsString = JohnTravoltageStrings.a11y.appendages.leg.positions.footOffRugPointingBackwards;
const footOffRugString = JohnTravoltageStrings.a11y.appendages.leg.positions.footOffRug;
const footRubbingOnRugString = JohnTravoltageStrings.a11y.appendages.leg.positions.footRubbingOnRug;
const footOffRugPointingForwardString = JohnTravoltageStrings.a11y.appendages.leg.positions.footOffRugPointingForward;


const AppendageRangeMaps = {
Expand Down
6 changes: 3 additions & 3 deletions js/john-travoltage/view/ArmNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import LinearFunction from '../../../../dot/js/LinearFunction.js';
import merge from '../../../../phet-core/js/merge.js';
import arm_png from '../../../images/arm_png.js';
import johnTravoltage from '../../johnTravoltage.js';
import johnTravoltageStrings from '../../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../../JohnTravoltageStrings.js';
import AppendageRangeMaps from '../AppendageRangeMaps.js';
import AppendageNode from './AppendageNode.js';

// constants
const handInteractionHintString = johnTravoltageStrings.a11y.voicing.handInteractionHint;
const appendageArmLabelString = johnTravoltageStrings.a11y.appendages.arm.label;
const handInteractionHintString = JohnTravoltageStrings.a11y.voicing.handInteractionHint;
const appendageArmLabelString = JohnTravoltageStrings.a11y.appendages.arm.label;

class ArmNode extends AppendageNode {

Expand Down
6 changes: 3 additions & 3 deletions js/john-travoltage/view/ElectronLayerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import { Node, Voicing } from '../../../../scenery/js/imports.js';
import Utterance from '../../../../utterance-queue/js/Utterance.js';
import johnTravoltage from '../../johnTravoltage.js';
import johnTravoltageStrings from '../../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../../JohnTravoltageStrings.js';
import ElectronNode from './ElectronNode.js';

const electronsTotalDescriptionPatternString = johnTravoltageStrings.a11y.electrons.totalDescriptionPattern;
const electronsTotalAfterDischargePatternString = johnTravoltageStrings.a11y.electrons.totalAfterDischargePattern;
const electronsTotalDescriptionPatternString = JohnTravoltageStrings.a11y.electrons.totalDescriptionPattern;
const electronsTotalAfterDischargePatternString = JohnTravoltageStrings.a11y.electrons.totalAfterDischargePattern;

const QUALITATIVE_DESCRIPTION_MAP = new Map();
QUALITATIVE_DESCRIPTION_MAP.set( new Range( 0, 0 ), 'No' );
Expand Down
12 changes: 6 additions & 6 deletions js/john-travoltage/view/JohnTravoltageKeyboardHelpContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import KeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/Keybo
import KeyboardHelpSectionRow from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpSectionRow.js';
import TwoColumnKeyboardHelpContent from '../../../../scenery-phet/js/keyboard/help/TwoColumnKeyboardHelpContent.js';
import johnTravoltage from '../../johnTravoltage.js';
import johnTravoltageStrings from '../../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../../JohnTravoltageStrings.js';

const handOrFootString = johnTravoltageStrings.handOrFoot;
const moveFootString = johnTravoltageStrings.moveFoot;
const moveHandString = johnTravoltageStrings.moveHand;
const handOrFootString = JohnTravoltageStrings.handOrFoot;
const moveFootString = JohnTravoltageStrings.moveFoot;
const moveHandString = JohnTravoltageStrings.moveHand;

const moveFootDescriptionString = johnTravoltageStrings.a11y.keyboardHelpDialog.moveFootDescription;
const moveHandDescriptionString = johnTravoltageStrings.a11y.keyboardHelpDialog.moveHandDescription;
const moveFootDescriptionString = JohnTravoltageStrings.a11y.keyboardHelpDialog.moveFootDescription;
const moveHandDescriptionString = JohnTravoltageStrings.a11y.keyboardHelpDialog.moveHandDescription;

class JohnTravoltageKeyboardHelpContent extends TwoColumnKeyboardHelpContent {
constructor() {
Expand Down
28 changes: 14 additions & 14 deletions js/john-travoltage/view/JohnTravoltageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Shape } from '../../../../kite/js/imports.js';
import platform from '../../../../phet-core/js/platform.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.js';
import sceneryPhetStrings from '../../../../scenery-phet/js/sceneryPhetStrings.js';
import SceneryPhetStrings from '../../../../scenery-phet/js/SceneryPhetStrings.js';
import { Circle, Line, Node, Path, PDOMPeer } from '../../../../scenery/js/imports.js';
import PitchedPopGenerator from '../../../../tambo/js/sound-generators/PitchedPopGenerator.js';
import SoundClip from '../../../../tambo/js/sound-generators/SoundClip.js';
Expand All @@ -31,7 +31,7 @@ import electricDischarge_mp3 from '../../../sounds/electricDischarge_mp3.js';
import gazouch_mp3 from '../../../sounds/gazouch_mp3.js';
import ouch_mp3 from '../../../sounds/ouch_mp3.js';
import johnTravoltage from '../../johnTravoltage.js';
import johnTravoltageStrings from '../../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../../JohnTravoltageStrings.js';
import AppendageRangeMaps from '../AppendageRangeMaps.js';
import JohnTravoltageQueryParameters from '../JohnTravoltageQueryParameters.js';
import JohnTravoltageModel from '../model/JohnTravoltageModel.js';
Expand All @@ -46,18 +46,18 @@ import LegNode from './LegNode.js';
import SparkNode from './SparkNode.js';
import vibrationController from './vibrationController.js';

const screenSummaryBodyDescriptionPatternString = johnTravoltageStrings.a11y.screenSummary.bodyDescriptionPattern;
const electronsSingleDescriptionString = johnTravoltageStrings.a11y.electrons.singleDescription;
const electronsMultipleDescriptionPatternString = johnTravoltageStrings.a11y.electrons.multipleDescriptionPattern;
const descriptionWithChargePatternString = johnTravoltageStrings.a11y.screenSummary.descriptionWithChargePattern;
const voicingContentHintString = johnTravoltageStrings.a11y.voicing.contentHint;
const voicingDetailedContentHintString = johnTravoltageStrings.a11y.voicing.detailedContentHint;
const previousDischargePatternString = johnTravoltageStrings.a11y.voicing.previousDischargePattern;
const screenSummaryWithPreviousDischargePatternString = johnTravoltageStrings.a11y.voicing.screenSummaryWithPreviousDischargePattern;
const screenSummarySingleScreenIntroPatternString = sceneryPhetStrings.a11y.voicing.simSection.screenSummary.singleScreenIntroPattern;
const overviewPatternString = johnTravoltageStrings.a11y.voicing.overviewPattern;
const voicingChargedContentHintString = johnTravoltageStrings.a11y.voicing.chargedContentHint;
const multipleElectronsOnBodyPatternString = johnTravoltageStrings.a11y.voicing.multipleElectronsOnBodyPattern;
const screenSummaryBodyDescriptionPatternString = JohnTravoltageStrings.a11y.screenSummary.bodyDescriptionPattern;
const electronsSingleDescriptionString = JohnTravoltageStrings.a11y.electrons.singleDescription;
const electronsMultipleDescriptionPatternString = JohnTravoltageStrings.a11y.electrons.multipleDescriptionPattern;
const descriptionWithChargePatternString = JohnTravoltageStrings.a11y.screenSummary.descriptionWithChargePattern;
const voicingContentHintString = JohnTravoltageStrings.a11y.voicing.contentHint;
const voicingDetailedContentHintString = JohnTravoltageStrings.a11y.voicing.detailedContentHint;
const previousDischargePatternString = JohnTravoltageStrings.a11y.voicing.previousDischargePattern;
const screenSummaryWithPreviousDischargePatternString = JohnTravoltageStrings.a11y.voicing.screenSummaryWithPreviousDischargePattern;
const screenSummarySingleScreenIntroPatternString = SceneryPhetStrings.a11y.voicing.simSection.screenSummary.singleScreenIntroPattern;
const overviewPatternString = JohnTravoltageStrings.a11y.voicing.overviewPattern;
const voicingChargedContentHintString = JohnTravoltageStrings.a11y.voicing.chargedContentHint;
const multipleElectronsOnBodyPatternString = JohnTravoltageStrings.a11y.voicing.multipleElectronsOnBodyPattern;

// constants
const OUCH_EXCLAMATION_DELAY = 0.5; // in seconds
Expand Down
8 changes: 4 additions & 4 deletions js/john-travoltage/view/LegNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import merge from '../../../../phet-core/js/merge.js';
import Utterance from '../../../../utterance-queue/js/Utterance.js';
import leg_png from '../../../images/leg_png.js';
import johnTravoltage from '../../johnTravoltage.js';
import johnTravoltageStrings from '../../johnTravoltageStrings.js';
import JohnTravoltageStrings from '../../JohnTravoltageStrings.js';
import AppendageRangeMaps from '../AppendageRangeMaps.js';
import JohnTravoltageModel from '../model/JohnTravoltageModel.js';
import AppendageNode from './AppendageNode.js';

// constants
const appendageLegLabelString = johnTravoltageStrings.a11y.appendages.leg.label;
const footInteractionHintString = johnTravoltageStrings.a11y.voicing.footInteractionHint;
const johnFullyChargedString = johnTravoltageStrings.a11y.voicing.johnFullyCharged;
const appendageLegLabelString = JohnTravoltageStrings.a11y.appendages.leg.label;
const footInteractionHintString = JohnTravoltageStrings.a11y.voicing.footInteractionHint;
const johnFullyChargedString = JohnTravoltageStrings.a11y.voicing.johnFullyCharged;

const ALERTS_FOR_MAX_CHARGE = 2;

Expand Down

0 comments on commit 73bfb89

Please sign in to comment.