-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move UtteranceQueue to its own repo #1
Comments
Initial commit is done, next steps:
|
@zepumph and I worked on adding initialization code to scenery and supporting self build tonight. We moved initialization code from Sim.js to Display.js, and then modified scenery's config files to require utteranceQueue (and added the necessary main.js file to utterance-queue). We were able to successfully build and run the built version of scenery with utteranceQueue in it. However, we realized in some runtimes where more than one display is being created, this implementation breaks everything because utteranceQueue is initialized multiple times (and it is a singleton). For that reason, we didn't commit as-is (see patch below). We think the way forward is to not make utteranceQueue a singleton so that there is one utteranceQueue initialized per display, as opposed to a single global utteranceQueue. @jessegreenberg what do you think about this? Index: utterance-queue/js/utteranceQueue.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utterance-queue/js/utteranceQueue.js (revision 0cace57cddb4eb8c3af5b4b68aaea8cf941b8c18)
+++ utterance-queue/js/utteranceQueue.js (date 1571791047000)
@@ -284,6 +284,7 @@
* @public
*/
initialize() {
+ assert && assert( !this._initialized, 'cannot initialize utteranceQueue twice' );
this._initialized = true;
// begin stepping the queue
Index: scenery/js/display/Display.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/display/Display.js (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/js/display/Display.js (date 1571786292000)
@@ -88,6 +88,7 @@
require( 'SCENERY/util/Trail' );
// const SceneryStyle = require( 'SCENERY/util/SceneryStyle' );
const AccessibleInstance = require( 'SCENERY/accessibility/AccessibleInstance' );
+ const ariaHerald = require( 'UTTERANCE_QUEUE/ariaHerald' );
const CanvasNodeBoundsOverlay = require( 'SCENERY/overlays/CanvasNodeBoundsOverlay' );
const FittedBlockBoundsOverlay = require( 'SCENERY/overlays/FittedBlockBoundsOverlay' );
const FocusIO = require( 'SCENERY/accessibility/FocusIO' );
@@ -97,6 +98,7 @@
const PointerAreaOverlay = require( 'SCENERY/overlays/PointerAreaOverlay' );
const PointerOverlay = require( 'SCENERY/overlays/PointerOverlay' );
const Util = require( 'SCENERY/util/Util' );
+ const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
/**
* Constructs a Display that will show the rootNode and its subtree in a visual state. Default options provided below
@@ -188,6 +190,7 @@
// @public (scenery-internal) {boolean} - Whether accessibility is enabled for this particular display.
this._accessible = options.accessibility;
+
this._allowWebGL = options.allowWebGL;
// The (integral, > 0) dimensions of the Display's DOM element (only updates the DOM element on updateDisplay())
@@ -319,6 +322,10 @@
// add the accessible DOM as a child of this DOM element
this._domElement.appendChild( this._rootAccessibleInstance.peer.primarySibling );
+
+ // utteranceQueue depends on ariaHerald so initialize it first.
+ ariaHerald.initialize();
+ utteranceQueue.initialize();
}
}
Index: scenery/js/scenery-test-config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-test-config.js (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/js/scenery-test-config.js (date 1571790802000)
@@ -39,9 +39,10 @@
SCENERY_PHET: '../../scenery-phet/js',
SUN: '../../sun/js',
TAMBO: '../../tambo/js',
- TANDEM: '../../tandem/js'
+ TANDEM: '../../tandem/js',
+ UTTERANCE_QUEUE: '../../utterance-queue/js'
},
- // optional cache bust to make browser refresh load all included scripts, can be disabled with ?cacheBust=false
+ // Cache busting is applied by default, but can be disabled via ?cacheBust=false, see initialize-globals.js
urlArgs: phet.chipper.getCacheBustArgs()
} );
Index: scenery/js/scenery-config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-config.js (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/js/scenery-config.js (date 1571792350000)
@@ -24,8 +24,10 @@
DOT: '../../dot/js',
PHET_CORE: '../../phet-core/js',
AXON: '../../axon/js',
+ UTTERANCE_QUEUE: '../../utterance-queue/js',
TANDEM: '../../tandem/js',
+
REPOSITORY: '..'
},
Index: scenery/js/scenery-main.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-main.js (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/js/scenery-main.js (date 1571792350000)
@@ -13,6 +13,7 @@
window.dot = require( 'DOT/main' );
window.kite = require( 'KITE/main' );
window.phetCore = require( 'PHET_CORE/main' );
+ window.utteranceQueue = require( 'UTTERANCE_QUEUE/main' );
window.scenery = require( 'main' );
window.scenery.Util.polyfillRequestAnimationFrame();
} );
Index: scenery/js/config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/config.js (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/js/config.js (date 1571787439000)
@@ -8,7 +8,7 @@
require.config( {
// depends on all of Scenery, Kite, Dot, Axon and phet-core
- deps: [ 'main', 'KITE/main', 'DOT/main', 'AXON/main', 'PHET_CORE/main' ],
+ deps: [ 'main', 'KITE/main', 'DOT/main', 'AXON/main', 'PHET_CORE/main', 'UTTERANCE_QUEUE/main'],
paths: {
@@ -26,7 +26,8 @@
PHET_CORE: '../../phet-core/js',
SCENERY: '.',
TANDEM: '../../tandem/js',
-
+ UTTERANCE_QUEUE: '../../utterance-queue/js',
+
REPOSITORY: '..'
},
Index: scenery/scenery-tests.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/scenery-tests.html (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/scenery-tests.html (date 1571790802000)
@@ -7,7 +7,7 @@
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="phet-sim-level" content="development">
- <link rel="stylesheet" href="../sherpa/lib/qunit-2.4.1.css">
+ <link rel="stylesheet" href="../sherpa/lib/qunit-2.4.1.css">
<title>scenery</title>
</head>
@@ -25,58 +25,61 @@
</div>
<script type="text/javascript">
- ( function() {
- // Identify the brand (assume generated brand if not provided with query parameters)
- var brandMatch = location.search.match( /brand=([^&]+)/ );
- var brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
+ // Identify the brand (assume generated brand if not provided with query parameters)
+ const brandMatch = location.search.match( /brand=([^&]+)/ );
+ const brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
+
+ // Cache busting is applied by default, but can be disabled via ?cacheBust=false, see initialize-globals.js
+ const isCacheBustDisabled = /(^|\?|&)cacheBust=false/.test( location.search );
+ const queryAppend = isCacheBustDisabled ? '' : `?bust=${Date.now()}`;
- // Preloads, with more included for phet-io brand
- var preloads = [
- '../sherpa/lib/jquery-2.1.0.js',
- '../sherpa/lib/lodash-4.17.4.js',
- '../sherpa/lib/FileSaver-b8054a2.js',
- '../sherpa/lib/himalaya-0.2.7.js',
- '../sherpa/lib/he-1.1.1.js',
- '../assert/js/assert.js',
- '../query-string-machine/js/QueryStringMachine.js',
- '../chipper/js/initialize-globals.js',
- '../phet-core/js/copyWithSortedKeys.js',
- '../sherpa/lib/seedrandom-2.4.2.js',
- '../sherpa/lib/game-up-camera-1.0.0.js',
- '../sherpa/lib/base64-js-1.2.0.js',
- '../sherpa/lib/TextEncoderLite-3c9f6f0.js',
- '../tandem/js/PhetioIDUtils.js',
- '../sherpa/lib/qunit-2.4.1.js',
- '../aqua/js/qunit-connector.js'
- ];
+ // Preloads, with more included for phet-io brand
+ let preloads = [
+ '../sherpa/lib/jquery-2.1.0.js',
+ '../sherpa/lib/lodash-4.17.4.js',
+ '../sherpa/lib/FileSaver-b8054a2.js',
+ '../sherpa/lib/himalaya-0.2.7.js',
+ '../sherpa/lib/he-1.1.1.js',
+ '../assert/js/assert.js',
+ '../query-string-machine/js/QueryStringMachine.js',
+ '../chipper/js/initialize-globals.js',
+ '../phet-core/js/copyWithSortedKeys.js',
+ '../sherpa/lib/seedrandom-2.4.2.js',
+ '../sherpa/lib/game-up-camera-1.0.0.js',
+ '../sherpa/lib/base64-js-1.2.0.js',
+ '../sherpa/lib/TextEncoderLite-3c9f6f0.js',
+ '../tandem/js/PhetioIDUtils.js',
+ '../chipper/js/SimVersion.js',
+ '../sherpa/lib/qunit-2.4.1.js',
+ '../aqua/js/qunit-connector.js'
+ ];
- if ( brand === 'phet-io' ) {
- preloads = preloads.concat( [
- '../phet-io/js/phet-io-initialize-globals.js'
- ] );
- }
+ if ( brand === 'phet-io' ) {
+ preloads = preloads.concat( [
+ '../phet-io/js/phet-io-initialize-globals.js'
+ ] );
+ }
- // Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
- // See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
- // load all of the scripts with this method, so they are treated the same (and placed in the correct execution
- // order).
- function loadURL( preloadURL, main ) {
- var script = document.createElement( 'script' );
- if ( typeof main === 'string' ) {
- script.setAttribute( 'data-main', main );
- }
- script.type = 'text/javascript';
- script.src = preloadURL;
- script.async = false;
- document.head.appendChild( script );
- }
+ // Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
+ // See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
+ // load all of the scripts with this method, so they are treated the same (and placed in the correct execution
+ // order).
+ const loadURL = ( preloadURL, main ) => {
+ const script = document.createElement( 'script' );
+ if ( typeof main === 'string' ) {
+ script.setAttribute( 'data-main', main );
+ }
+ script.type = 'text/javascript';
+ script.src = preloadURL + queryAppend;
+ script.async = false;
+ document.head.appendChild( script );
+ };
- // Queue all of the preloads to be loaded.
- preloads.forEach( loadURL );
+ // Queue all of the preloads to be loaded.
+ preloads.forEach( loadURL );
- loadURL( '../sherpa/lib/require-2.3.6.js', 'js/scenery-test-config.js' );
- } )();
+ loadURL( '../sherpa/lib/require-2.3.6.js', 'js/scenery-test-config.js' );
</script>
</body>
-</html>
+</html>
\ No newline at end of file
Index: scenery/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/package.json (revision 7ebcb28b8f65bd19793ce61831c7aeba3fac98a1)
+++ scenery/package.json (date 1571790189000)
@@ -21,7 +21,8 @@
"kite": "KITE/main",
"dot": "DOT/main",
"axon": "AXON/main",
- "phetCore": "PHET_CORE/main"
+ "phetCore": "PHET_CORE/main",
+ "utteranceQueue": "UTTERANCE_QUEUE/main"
},
"finalizeJS": "scenery.Util.polyfillRequestAnimationFrame();"
},
Index: joist/js/Sim.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- joist/js/Sim.js (revision 6036d95ea43eb7a3c0589568246cf82477f6f23b)
+++ joist/js/Sim.js (date 1571786408000)
@@ -14,7 +14,6 @@
// modules
const Action = require( 'AXON/Action' );
- const ariaHerald = require( 'UTTERANCE_QUEUE/ariaHerald' );
const BarrierRectangle = require( 'SCENERY_PHET/BarrierRectangle' );
const BooleanProperty = require( 'AXON/BooleanProperty' );
const Bounds2 = require( 'DOT/Bounds2' );
@@ -50,7 +49,7 @@
const timer = require( 'AXON/timer' );
const updateCheck = require( 'JOIST/updateCheck' );
const Util = require( 'SCENERY/util/Util' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
+
// ifphetio
const phetioEngine = require( 'ifphetio!PHET_IO/phetioEngine' );
@@ -433,9 +432,6 @@
// public (read-only) {boolean} - if true, add support specific to accessible technology that work with touch devices.
this.supportsTouchA11y = this.isAccessible && SUPPORTS_TOUCH_A11Y;
- // Set up accessibility features for the sim.
- this.isAccessible && initializeAccessibility();
-
// @public (joist-internal, read-only)
this.keyboardHelpNode = options.keyboardHelpNode;
@@ -664,16 +660,6 @@
joist.register( 'Sim', Sim );
- /**
- * Initialized all features of accessibility that should be enabled for the simulation.
- */
- function initializeAccessibility() {
-
- // utteranceQueue depends on ariaHerald so initialize it first.
- ariaHerald.initialize();
- utteranceQueue.initialize();
- }
-
return inherit( Object, Sim, {
/**
</details> |
@twant changes in #1 (comment) look great! I agree, it seems like having one utteranceQueue and one ariaHerald per Display makes most sense. Especially since the aria-live elements are going to move under the Display div. |
We worked on this more today, and got much further. There are some minor tweaks to try to work out, but we got things working with two large patches to come (no commits) Here are next steps for us:
We ran aqua fuzzing on phet brand and fuzzBoard, but there is more to do. Ways we need to test:
Here is the patch with the main logic. These changes include:
Feature patchIndex: molarity/molarity_a11y_view.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molarity/molarity_a11y_view.html (revision 4b1c5ca92f1e763c7e0f8ff5bccc23e719e1c0bc)
+++ molarity/molarity_a11y_view.html (date 1572399328054)
@@ -269,10 +269,10 @@
var PDOMCopy = PDOMRoot.cloneNode( true );
// get the alert dom elements from the iframe's inner document
- var politeElement1 = innerDoc.getElementById( 'polite-1' );
- var politeElement2 = innerDoc.getElementById( 'polite-2' );
- var politeElement3 = innerDoc.getElementById( 'polite-3' );
- var politeElement4 = innerDoc.getElementById( 'polite-4' );
+ var politeElement1 = innerDoc.getElementById( 'elements-1-polite-1' );
+ var politeElement2 = innerDoc.getElementById( 'elements-1-polite-2' );
+ var politeElement3 = innerDoc.getElementById( 'elements-1-polite-3' );
+ var politeElement4 = innerDoc.getElementById( 'elements-1-polite-4' );
// get the alert dom elements from the PDOM copy
var alertList = document.getElementById( 'alert-list' );
Index: molarity/molarity_en.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molarity/molarity_en.html (revision 4b1c5ca92f1e763c7e0f8ff5bccc23e719e1c0bc)
+++ molarity/molarity_en.html (date 1572399327594)
@@ -14,14 +14,6 @@
<!-- body is only made black for the loading phase so that the splash screen is black -->
<body style="background-color:black;">
-<!-- a11y - aria-live attribute is used to send alerts and status updates to screen readers, otherwise invisible -->
-<div id='aria-live-elements'
- style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; clip: rect(0px 0px 0px 0px); pointer-events: none;">
- <p id="polite-1" aria-live="polite"></p>
- <p id="polite-2" aria-live="polite"></p>
- <p id="polite-3" aria-live="polite"></p>
- <p id="polite-4" aria-live="polite"></p>
-</div>
<script type="text/javascript">
Index: molarity/js/phet-io/molarity-phet-io-elements-baseline.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molarity/js/phet-io/molarity-phet-io-elements-baseline.js (revision 4b1c5ca92f1e763c7e0f8ff5bccc23e719e1c0bc)
+++ molarity/js/phet-io/molarity-phet-io-elements-baseline.js (date 1572399335246)
@@ -421,6 +421,174 @@
"phetioStudioControl": true,
"phetioTypeName": "EmitterIO<>"
},
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": false,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PhetioCapsuleIO<DialogIO>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "DialogIO"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NodeIO"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.enabledProperty": {
+ "phetioDocumentation": "When disabled, the button is grayed out and cannot be pressed",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": true,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.firedEmitter": {
+ "phetioDocumentation": "Emits when the button is fired No arguments.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "EmitterIO<>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.opacityProperty": {
+ "phetioDocumentation": "Opacity of the parent NodeIO, between 0 (invisible) and 1 (fully visible)",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NumberPropertyIO"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.pickableProperty": {
+ "phetioDocumentation": "Sets whether the node will be pickable (and hence interactive), see the NodeIO documentation for more details",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.pressListener.pressAction": {
+ "phetioDocumentation": "Executes whenever a press occurs. The first argument when executing can be used to convey info about the Event. The arguments are:<br/><ol><li>event: EventIO</li></ol>",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "ActionIO<EventIO>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.pressListener.releaseAction": {
+ "phetioDocumentation": "Executes whenever a release occurs. The arguments are:<br/><ol><li>event: NullableIO<EventIO></li></ol>",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "ActionIO<NullableIO<EventIO>>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.closeButton.visibleProperty": {
+ "phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": true,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.isShowingProperty": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.opacityProperty": {
+ "phetioDocumentation": "Opacity of the parent NodeIO, between 0 (invisible) and 1 (fully visible)",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NumberPropertyIO"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.pickableProperty": {
+ "phetioDocumentation": "Sets whether the node will be pickable (and hence interactive), see the NodeIO documentation for more details",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
+ },
+ "molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.keyboardHelpDialogCapsule.prototype.visibleProperty": {
+ "phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
"molarity.general.navigationBar.a11yButtonsHBox.keyboardHelpButton.opacityProperty": {
"phetioDocumentation": "Opacity of the parent NodeIO, between 0 (invisible) and 1 (fully visible)",
"phetioDynamicElement": false,
@@ -529,6 +697,174 @@
"phetioStudioControl": true,
"phetioTypeName": "PhetMenuIO"
},
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": false,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PhetioCapsuleIO<DialogIO>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "DialogIO"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NodeIO"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.enabledProperty": {
+ "phetioDocumentation": "When disabled, the button is grayed out and cannot be pressed",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": true,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.firedEmitter": {
+ "phetioDocumentation": "Emits when the button is fired No arguments.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "EmitterIO<>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.opacityProperty": {
+ "phetioDocumentation": "Opacity of the parent NodeIO, between 0 (invisible) and 1 (fully visible)",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NumberPropertyIO"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.pickableProperty": {
+ "phetioDocumentation": "Sets whether the node will be pickable (and hence interactive), see the NodeIO documentation for more details",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.pressListener.pressAction": {
+ "phetioDocumentation": "Executes whenever a press occurs. The first argument when executing can be used to convey info about the Event. The arguments are:<br/><ol><li>event: EventIO</li></ol>",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "ActionIO<EventIO>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.pressListener.releaseAction": {
+ "phetioDocumentation": "Executes whenever a release occurs. The arguments are:<br/><ol><li>event: NullableIO<EventIO></li></ol>",
+ "phetioDynamicElement": true,
+ "phetioEventType": "USER",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": false,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "ActionIO<NullableIO<EventIO>>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.closeButton.visibleProperty": {
+ "phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": true,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.isShowingProperty": {
+ "phetioDocumentation": "",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.opacityProperty": {
+ "phetioDocumentation": "Opacity of the parent NodeIO, between 0 (invisible) and 1 (fully visible)",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "NumberPropertyIO"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.pickableProperty": {
+ "phetioDocumentation": "Sets whether the node will be pickable (and hence interactive), see the NodeIO documentation for more details",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
+ },
+ "molarity.general.navigationBar.phetButton.phetMenu.aboutDialogCapsule.prototype.visibleProperty": {
+ "phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
+ "phetioDynamicElement": true,
+ "phetioEventType": "MODEL",
+ "phetioFeatured": false,
+ "phetioHighFrequency": false,
+ "phetioPlayback": false,
+ "phetioReadOnly": true,
+ "phetioState": false,
+ "phetioStudioControl": true,
+ "phetioTypeName": "PropertyIO<BooleanIO>"
+ },
"molarity.general.navigationBar.phetButton.phetMenu.aboutMenuItem": {
"phetioDocumentation": "This menu item shows a dialog with information about the simulation.",
"phetioDynamicElement": false,
Index: joist/js/Sim.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- joist/js/Sim.js (revision 21d163d28b186bf0a7b3226ca769402a0d8a0d38)
+++ joist/js/Sim.js (date 1572395937998)
@@ -14,7 +14,6 @@
// modules
const Action = require( 'AXON/Action' );
- const ariaHerald = require( 'UTTERANCE_QUEUE/ariaHerald' );
const BarrierRectangle = require( 'SCENERY_PHET/BarrierRectangle' );
const BooleanProperty = require( 'AXON/BooleanProperty' );
const Bounds2 = require( 'DOT/Bounds2' );
@@ -50,7 +49,7 @@
const timer = require( 'AXON/timer' );
const updateCheck = require( 'JOIST/updateCheck' );
const Util = require( 'SCENERY/util/Util' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
+
// ifphetio
const phetioEngine = require( 'ifphetio!PHET_IO/phetioEngine' );
@@ -433,9 +432,6 @@
// public (read-only) {boolean} - if true, add support specific to accessible technology that work with touch devices.
this.supportsTouchA11y = this.isAccessible && SUPPORTS_TOUCH_A11Y;
- // Set up accessibility features for the sim.
- this.isAccessible && initializeAccessibility();
-
// @public (joist-internal, read-only)
this.keyboardHelpNode = options.keyboardHelpNode;
@@ -664,16 +660,6 @@
joist.register( 'Sim', Sim );
- /**
- * Initialized all features of accessibility that should be enabled for the simulation.
- */
- function initializeAccessibility() {
-
- // utteranceQueue depends on ariaHerald so initialize it first.
- ariaHerald.initialize();
- utteranceQueue.initialize();
- }
-
return inherit( Object, Sim, {
/**
Index: chipper/templates/sim-a11y-view.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- chipper/templates/sim-a11y-view.html (revision 7a0c29de8746960f3120a28fd859f0402afae48a)
+++ chipper/templates/sim-a11y-view.html (date 1572396734230)
@@ -269,10 +269,10 @@
var PDOMCopy = PDOMRoot.cloneNode( true );
// get the alert dom elements from the iframe's inner document
- var politeElement1 = innerDoc.getElementById( 'polite-1' );
- var politeElement2 = innerDoc.getElementById( 'polite-2' );
- var politeElement3 = innerDoc.getElementById( 'polite-3' );
- var politeElement4 = innerDoc.getElementById( 'polite-4' );
+ var politeElement1 = innerDoc.getElementById( 'elements-1-polite-1' );
+ var politeElement2 = innerDoc.getElementById( 'elements-1-polite-2' );
+ var politeElement3 = innerDoc.getElementById( 'elements-1-polite-3' );
+ var politeElement4 = innerDoc.getElementById( 'elements-1-polite-4' );
// get the alert dom elements from the PDOM copy
var alertList = document.getElementById( 'alert-list' );
Index: chipper/templates/sim.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- chipper/templates/sim.html (revision 7a0c29de8746960f3120a28fd859f0402afae48a)
+++ chipper/templates/sim.html (date 1572395937983)
@@ -21,15 +21,6 @@
-->
<!-- body is only made black for the loading phase so that the splash screen is black -->
<body style="background-color:black;">
-
-<!-- a11y - aria-live attribute is used to send alerts and status updates to screen readers, otherwise invisible -->
-<div id='aria-live-elements' style="position: fixed; left: 0px; top: 0px; width: 0px; height: 0px; clip: rect(0px 0px 0px 0px); pointer-events: none;">
- <p id="polite-1" aria-live="polite"></p>
- <p id="polite-2" aria-live="polite"></p>
- <p id="polite-3" aria-live="polite"></p>
- <p id="polite-4" aria-live="polite"></p>
-</div>
-
{{PHET_SIM_SCRIPTS}}
</body>
</html>
Index: chipper/templates/sim-development.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- chipper/templates/sim-development.html (revision 7a0c29de8746960f3120a28fd859f0402afae48a)
+++ chipper/templates/sim-development.html (date 1572395937991)
@@ -14,14 +14,6 @@
<!-- body is only made black for the loading phase so that the splash screen is black -->
<body{{BODYSTYLE}}>
{{BODYSTART}}
-<!-- a11y - aria-live attribute is used to send alerts and status updates to screen readers, otherwise invisible -->
-<div id='aria-live-elements'
- style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; clip: rect(0px 0px 0px 0px); pointer-events: none;">
- <p id="polite-1" aria-live="polite"></p>
- <p id="polite-2" aria-live="polite"></p>
- <p id="polite-3" aria-live="polite"></p>
- <p id="polite-4" aria-live="polite"></p>
-</div>
<script type="text/javascript">
Index: utterance-queue/js/ariaHerald.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utterance-queue/js/ariaHerald.js (revision 36e55ff8b3dc4e4d9a4d4ee166228669c7ddf7a0)
+++ utterance-queue/js/AriaHerald.js (date 1572399456420)
@@ -21,10 +21,6 @@
* Many aria-live and related attributes were tested, but none were well supported or particularly useful for PhET sims,
* see https://github.com/phetsims/chipper/issues/472.
*
- * NOTE: ariaHerald needs to be initialized before use as a singleton.
- * As of this writing (Nov 2017) this initialization occurs in Sim.js. Therefore if something uses ariaHerald
- * before Sim.js has initialized this file, the result will be a silent no-op.
- *
* @author Jesse Greenberg
* @author John Blanco
*/
@@ -38,55 +34,50 @@
const utteranceQueueNamespace = require( 'UTTERANCE_QUEUE/utteranceQueueNamespace' );
const timer = require( 'AXON/timer' );
- // DOM elements which will receive the updated content. By having four elements and cycling through each one, we
- // can get around a VoiceOver bug where a new alert would interrupt the previous alert if it wasn't finished
- // speaking, see https://github.com/phetsims/scenery-phet/issues/362
- const politeElement1 = document.getElementById( 'polite-1' );
- const politeElement2 = document.getElementById( 'polite-2' );
- const politeElement3 = document.getElementById( 'polite-3' );
- const politeElement4 = document.getElementById( 'polite-4' );
- const ariaLiveElements = [ politeElement1, politeElement2, politeElement3, politeElement4 ];
+ // one indexed for the element ids
+ let ariaHeraldIndex = 1;
class AriaHerald {
constructor() {
- // {boolean} - whether or not this instance has been initialized or not
- this.initialized = false;
- // index of current aria-live element to use, updated every time an event triggers
+ // @private index of current aria-live element to use, updated every time an event triggers
this.elementIndex = 0;
// @public {null|Emitter} - set in initialize method. Emit whenever we announce.
- this.announcingEmitter = null;
- }
-
- /**
- * Initialize AriaHerald to allow usage of its features. If not initialized, then it will no-op. This allows
- * AriaHerald to be disabled completely if a11y is not enabled.
- */
- initialize() {
-
- // verify that all DOM elements with aria-live are in the document
- assert && assert( document.getElementById( 'aria-live-elements' ), 'No alert container element found in document' );
- assert && assert( politeElement1, 'aria-live element 1 missing from document, all are required' );
- assert && assert( politeElement2, 'aria-live element 2 missing from document, all are required' );
- assert && assert( politeElement3, 'aria-live element 3 missing from document, all are required' );
- assert && assert( politeElement4, 'aria-live element 4 missing from document, all are required' );
-
- this.initialized = true;
-
this.announcingEmitter = new Emitter( {
parameters: [ { valueType: 'string' } ]
} );
+ // @public (read-only)
+ this.ariaLiveContainer = document.createElement( 'div' ); //container div
+ this.ariaLiveContainer.setAttribute( 'id', 'aria-live-elements' );
+ this.ariaLiveContainer.setAttribute( 'style', 'position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; ' +
+ 'clip: rect(0px 0px 0px 0px); pointer-events: none;' );
+ for ( let i = 0; i < 4; i++ ) {
+ const newParagraph = document.createElement( 'p' );
+ newParagraph.setAttribute( 'id', `elements-${ariaHeraldIndex}-polite-${i + 1}` );
+ this.ariaLiveContainer.setAttribute( 'aria-live', 'polite' );
+ this.ariaLiveContainer.appendChild( newParagraph );
+ }
+
+ // DOM elements which will receive the updated content. By having four elements and cycling through each one, we
+ // can get around a VoiceOver bug where a new alert would interrupt the previous alert if it wasn't finished
+ // speaking, see https://github.com/phetsims/scenery-phet/issues/362
+ // @private
+ this.ariaLiveElements = [ ...this.ariaLiveContainer.children ];
+
+
// no need to be removed, exists for the lifetime of the simulation.
this.announcingEmitter.addListener( textContent => {
- const element = ariaLiveElements[ this.elementIndex ];
+ const element = this.ariaLiveElements[ this.elementIndex ];
this.updateLiveElement( element, textContent );
// update index for next time
- this.elementIndex = ( this.elementIndex + 1 ) % ariaLiveElements.length;
+ this.elementIndex = ( this.elementIndex + 1 ) % this.ariaLiveElements.length;
} );
+
+ ariaHeraldIndex++;
}
/**
@@ -111,11 +102,6 @@
*/
updateLiveElement( liveElement, textContent ) {
- // no-op if not initialized
- if ( !this.initialized ) {
- return;
- }
-
// fully clear the old textContent so that sequential alerts with identical text will be announced, which
// some screen readers might have prevented
liveElement.textContent = '';
@@ -141,5 +127,5 @@
}
}
- return utteranceQueueNamespace.register( 'ariaHerald', new AriaHerald() );
+ return utteranceQueueNamespace.register( 'AriaHerald', AriaHerald );
} );
\ No newline at end of file
Index: utterance-queue/js/main.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utterance-queue/js/main.js (date 1572395938076)
+++ utterance-queue/js/main.js (date 1572395938076)
@@ -0,0 +1,28 @@
+// Copyright 2013-2019, University of Colorado Boulder
+
+/**
+ * Module that includes all Scenery dependencies, so that requiring this module will return an object
+ * that consists of the entire exported 'scenery' namespace API.
+ *
+ * The API is actually generated by the 'scenery' module, so if this module (or all other modules) are
+ * not included, the 'scenery' namespace may not be complete.
+ *
+ * @author Jonathan Olson <[email protected]>
+ */
+
+define( [
+ 'UTTERANCE_QUEUE/utteranceQueueNamespace',
+
+ 'UTTERANCE_QUEUE/ActivationUtterance',
+ 'UTTERANCE_QUEUE/AlertableDef',
+ 'UTTERANCE_QUEUE/ariaHerald',
+ 'UTTERANCE_QUEUE/Utterance',
+ 'UTTERANCE_QUEUE/utteranceQueue',
+ 'UTTERANCE_QUEUE/UtteranceQueueIO',
+ 'UTTERANCE_QUEUE/ValueChangeUtterance'
+], function( utteranceQueueNamespace ) {
+ 'use strict';
+
+ // note: we don't need any of the other parts, we just need to specify them as dependencies so they fill in the scenery namespace
+ return utteranceQueueNamespace;
+} );
Index: utterance-queue/js/UtteranceTests.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utterance-queue/js/UtteranceTests.js (revision 36e55ff8b3dc4e4d9a4d4ee166228669c7ddf7a0)
+++ utterance-queue/js/UtteranceTests.js (date 1572399198385)
@@ -9,13 +9,14 @@
'use strict';
// modules
- const ariaHerald = require( 'UTTERANCE_QUEUE/ariaHerald' );
const timer = require( 'AXON/timer' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
+ const UtteranceQueue = require( 'UTTERANCE_QUEUE/UtteranceQueue' );
let sleepTiming = null;
+ const utteranceQueue = new UtteranceQueue();
+
// helper es6 functions from https://stackoverflow.com/questions/33289726/combination-of-async-function-await-settimeout/33292942
function timeout( ms ) {
return new Promise( resolve => setTimeout( resolve, ms ) );
@@ -42,16 +43,11 @@
timer.emit( timerInterval ); // step timer in seconds, every millisecond
}, timerInterval * 1000 );
- ariaHerald.initialize();
-
// whenever announcing, get a callback and populate the alerts array
- ariaHerald.announcingEmitter.addListener( text => {
+ utteranceQueue.ariaHerald.announcingEmitter.addListener( text => {
alerts.unshift( text );
} );
- // initialize the queue
- utteranceQueue.initialize();
-
// slightly slower than the interval that the utteranceQueue will wait so we don't have a race condition
sleepTiming = timerInterval * 1000 * 1.1;
},
@@ -94,7 +90,7 @@
} );
const alert4 = async () => {
- for( let i = 0; i < 4; i++ ) {
+ for ( let i = 0; i < 4; i++ ) {
utteranceQueue.addToBack( alert );
await timeout( sleepTiming );
}
Index: utterance-queue/js/utteranceQueue.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utterance-queue/js/utteranceQueue.js (revision 36e55ff8b3dc4e4d9a4d4ee166228669c7ddf7a0)
+++ utterance-queue/js/UtteranceQueue.js (date 1572398505374)
@@ -9,7 +9,7 @@
* others use first-in-first-out order, others just read the last alert that was provided. This queue
* manages order and improves consistency.
*
- * NOTE: utteranceQueue is a type but instantiated and returned as a singleton. It is initialized by Sim.js and if
+ * NOTE: UtteranceQueue is a type but instantiated and returned as a singleton. It is initialized by Sim.js and if
* something adds an alert to the queue before Sim.js has initialized the queue, the result will be a silent no-op.
*
* @author Jesse Greenberg (PhET Interactive Simulations)
@@ -20,7 +20,7 @@
// modules
const AlertableDef = require( 'UTTERANCE_QUEUE/AlertableDef' );
- const ariaHerald = require( 'UTTERANCE_QUEUE/ariaHerald' );
+ const AriaHerald = require( 'UTTERANCE_QUEUE/AriaHerald' );
const PhetioObject = require( 'TANDEM/PhetioObject' );
const utteranceQueueNamespace = require( 'UTTERANCE_QUEUE/utteranceQueueNamespace' );
const Tandem = require( 'TANDEM/Tandem' );
@@ -28,17 +28,29 @@
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
const UtteranceQueueIO = require( 'UTTERANCE_QUEUE/UtteranceQueueIO' );
- /**
- * Can't be called, used only for a singleton, see end of this file.
- * @constructor
- */
class UtteranceQueue extends PhetioObject {
- constructor() {
- super();
+
+ /**
+ * @param {boolean} implementAsSkeleton=false - if true, all functions will be no ops. Used to support runtimes
+ * that don't use aria-live mixed with those that do.
+ */
+ constructor( implementAsSkeleton = false ) {
+
+ let superTypeOptions = null;
+
+ if ( !implementAsSkeleton ) {
+ superTypeOptions = {
+ tandem: Tandem.generalTandem.createTandem( 'utteranceQueue' ),
+ phetioType: UtteranceQueueIO,
+ phetioState: false
+ };
+ }
+
+ super( superTypeOptions );
// @private {boolean} initialization is like utteranceQueue's constructor. No-ops all around if not
// initialized (cheers). See initialize();
- this._initialized = false;
+ this._initialized = !implementAsSkeleton;
// @public (tests) {Array.<Utterance>} - array of Utterances, spoken in first to last order
this.queue = [];
@@ -48,8 +60,25 @@
// whether the UtterancesQueue is alerting, and if you can add/remove utterances
this._enabled = true;
+
+ // @public (read-only) - the interface with the dom elements
+ this.ariaHerald = new AriaHerald();
+
+ if ( !implementAsSkeleton ) {
+
+ // begin stepping the queue
+ timer.addListener( this.stepQueue.bind( this ) );
+ }
}
+ /**
+ * Get the HTMLElement that houses all aria-live elements needed for the utterance queue to alert.
+ * @public
+ * @returns {HTMLDivElement}
+ */
+ getAriaLiveContainer() {
+ return this.ariaHerald.ariaLiveContainer;
+ }
/**
* Add an utterance ot the end of the queue. If the utterance has a type of alert which
@@ -268,7 +297,7 @@
this.phetioStartEvent( 'announced', { utterance: text } );
// Pass the utterance text on to be set in the PDOM.
- ariaHerald.announcePolite( text );
+ this.ariaHerald.announcePolite( text );
// after speaking the utterance, reset time in queue for the next time it gets added back in
nextUtterance.timeInQueue = 0;
@@ -276,27 +305,7 @@
this.phetioEndEvent();
}
}
-
- /**
- * Basically a constructor for the queue. Setup necessary processes for running the queue and register
- * the phet-io tandem. If utteranceQueue is not initialized (say, when accessibility is not enabled), all functions
- * will be no-ops. See type documentation above for NOTE.
- * @public
- */
- initialize() {
- this._initialized = true;
-
- // begin stepping the queue
- timer.addListener( this.stepQueue.bind( this ) );
-
- // TODO: can this be moved to the constructor?
- this.initializePhetioObject( {}, {
- tandem: Tandem.generalTandem.createTandem( 'utteranceQueue' ),
- phetioType: UtteranceQueueIO,
- phetioState: false
- } );
- }
}
- return utteranceQueueNamespace.register( 'utteranceQueue', new UtteranceQueue() );
+ return utteranceQueueNamespace.register( 'UtteranceQueue', UtteranceQueue );
} );
\ No newline at end of file
Index: scenery/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/package.json (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/package.json (date 1572395938063)
@@ -20,7 +20,8 @@
"kite": "KITE/main",
"dot": "DOT/main",
"axon": "AXON/main",
- "phetCore": "PHET_CORE/main"
+ "phetCore": "PHET_CORE/main",
+ "utteranceQueue": "UTTERANCE_QUEUE/main"
},
"finalizeJS": "scenery.Util.polyfillRequestAnimationFrame();"
},
Index: scenery/js/display/Display.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/display/Display.js (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/js/display/Display.js (date 1572399287562)
@@ -97,6 +97,7 @@
const PointerAreaOverlay = require( 'SCENERY/overlays/PointerAreaOverlay' );
const PointerOverlay = require( 'SCENERY/overlays/PointerOverlay' );
const Util = require( 'SCENERY/util/Util' );
+ const UtteranceQueue = require( 'UTTERANCE_QUEUE/UtteranceQueue' );
/**
* Constructs a Display that will show the rootNode and its subtree in a visual state. Default options provided below
@@ -188,6 +189,7 @@
// @public (scenery-internal) {boolean} - Whether accessibility is enabled for this particular display.
this._accessible = options.accessibility;
+
this._allowWebGL = options.allowWebGL;
// The (integral, > 0) dimensions of the Display's DOM element (only updates the DOM element on updateDisplay())
@@ -276,6 +278,8 @@
// global reference if we have a Display (useful)
this.scenery = scenery;
+ this.utteranceQueue = new UtteranceQueue( !this.options.accessibility );
+
if ( this.options.accessibility ) {
if ( this.options.isApplication ) {
this._domElement.setAttribute( 'aria-role', 'application' );
@@ -319,6 +323,8 @@
// add the accessible DOM as a child of this DOM element
this._domElement.appendChild( this._rootAccessibleInstance.peer.primarySibling );
+
+ this._domElement.appendChild( this.utteranceQueue.getAriaLiveContainer() );
}
}
@@ -499,8 +505,8 @@
}
const drawableBlockCountMessage = 'drawable block changes: ' + this.perfDrawableBlockChangeCount + ' for' +
- ' -' + this.perfDrawableOldIntervalCount +
- ' +' + this.perfDrawableNewIntervalCount;
+ ' -' + this.perfDrawableOldIntervalCount +
+ ' +' + this.perfDrawableNewIntervalCount;
if ( this.perfDrawableBlockChangeCount > 200 ) {
sceneryLog.PerfCritical && sceneryLog.PerfCritical( drawableBlockCountMessage );
}
@@ -772,10 +778,10 @@
this._backgroundColor instanceof scenery.Color );
const newBackgroundCSS = this._backgroundColor === null ?
- '' :
- ( this._backgroundColor.toCSS ?
- this._backgroundColor.toCSS() :
- this._backgroundColor );
+ '' :
+ ( this._backgroundColor.toCSS ?
+ this._backgroundColor.toCSS() :
+ this._backgroundColor );
if ( newBackgroundCSS !== this._currentBackgroundCSS ) {
this._currentBackgroundCSS = newBackgroundCSS;
@@ -1495,11 +1501,11 @@
*/
getDebugURI() {
return 'data:text/html;charset=utf-8,' + encodeURIComponent(
- '<!DOCTYPE html>' +
- '<html lang="en">' +
- '<head><title>Scenery Debug Snapshot</title></head>' +
- '<body style="font-size: 12px;">' + this.getDebugHTML() + '</body>' +
- '</html>'
+ '<!DOCTYPE html>' +
+ '<html lang="en">' +
+ '<head><title>Scenery Debug Snapshot</title></head>' +
+ '<body style="font-size: 12px;">' + this.getDebugHTML() + '</body>' +
+ '</html>'
);
},
@@ -1760,12 +1766,12 @@
// Create an SVG container with a foreignObject.
const data = '<svg xmlns="http://www.w3.org/2000/svg" width="' + width + '" height="' + height + '">' +
- '<foreignObject width="100%" height="100%">' +
- '<div xmlns="http://www.w3.org/1999/xhtml">' +
- xhtml +
- '</div>' +
- '</foreignObject>' +
- '</svg>';
+ '<foreignObject width="100%" height="100%">' +
+ '<div xmlns="http://www.w3.org/1999/xhtml">' +
+ xhtml +
+ '</div>' +
+ '</foreignObject>' +
+ '</svg>';
// Load an <img> with the SVG data URL, and when loaded draw it into our Canvas
const img = new window.Image();
Index: scenery/js/scenery-main.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-main.js (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/js/scenery-main.js (date 1572395938055)
@@ -13,6 +13,7 @@
window.dot = require( 'DOT/main' );
window.kite = require( 'KITE/main' );
window.phetCore = require( 'PHET_CORE/main' );
+ window.utteranceQueue = require( 'UTTERANCE_QUEUE/main' );
window.scenery = require( 'main' );
window.scenery.Util.polyfillRequestAnimationFrame();
} );
Index: scenery/js/scenery-config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-config.js (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/js/scenery-config.js (date 1572395938050)
@@ -24,8 +24,10 @@
DOT: '../../dot/js',
PHET_CORE: '../../phet-core/js',
AXON: '../../axon/js',
+ UTTERANCE_QUEUE: '../../utterance-queue/js',
TANDEM: '../../tandem/js',
+
REPOSITORY: '..'
},
Index: scenery/js/config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/config.js (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/js/config.js (date 1572395938045)
@@ -8,7 +8,7 @@
require.config( {
// depends on all of Scenery, Kite, Dot, Axon and phet-core
- deps: [ 'main', 'KITE/main', 'DOT/main', 'AXON/main', 'PHET_CORE/main' ],
+ deps: [ 'main', 'KITE/main', 'DOT/main', 'AXON/main', 'PHET_CORE/main', 'UTTERANCE_QUEUE/main'],
paths: {
@@ -26,7 +26,8 @@
PHET_CORE: '../../phet-core/js',
SCENERY: '.',
TANDEM: '../../tandem/js',
-
+ UTTERANCE_QUEUE: '../../utterance-queue/js',
+
REPOSITORY: '..'
},
Index: scenery/js/scenery-test-config.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/js/scenery-test-config.js (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/js/scenery-test-config.js (date 1572395938058)
@@ -39,9 +39,10 @@
SCENERY_PHET: '../../scenery-phet/js',
SUN: '../../sun/js',
TAMBO: '../../tambo/js',
- TANDEM: '../../tandem/js'
+ TANDEM: '../../tandem/js',
+ UTTERANCE_QUEUE: '../../utterance-queue/js'
},
- // optional cache bust to make browser refresh load all included scripts, can be disabled with ?cacheBust=false
+ // Cache busting is applied by default, but can be disabled via ?cacheBust=false, see initialize-globals.js
urlArgs: phet.chipper.getCacheBustArgs()
} );
Index: scenery/scenery-tests.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery/scenery-tests.html (revision 0c92f189c1a58a457e3f83c96549dc055c26751d)
+++ scenery/scenery-tests.html (date 1572395938068)
@@ -7,7 +7,7 @@
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="phet-sim-level" content="development">
- <link rel="stylesheet" href="../sherpa/lib/qunit-2.4.1.css">
+ <link rel="stylesheet" href="../sherpa/lib/qunit-2.4.1.css">
<title>scenery</title>
</head>
@@ -25,58 +25,61 @@
</div>
<script type="text/javascript">
- ( function() {
- // Identify the brand (assume generated brand if not provided with query parameters)
- var brandMatch = location.search.match( /brand=([^&]+)/ );
- var brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
+ // Identify the brand (assume generated brand if not provided with query parameters)
+ const brandMatch = location.search.match( /brand=([^&]+)/ );
+ const brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
+
+ // Cache busting is applied by default, but can be disabled via ?cacheBust=false, see initialize-globals.js
+ const isCacheBustDisabled = /(^|\?|&)cacheBust=false/.test( location.search );
+ const queryAppend = isCacheBustDisabled ? '' : `?bust=${Date.now()}`;
- // Preloads, with more included for phet-io brand
- var preloads = [
- '../sherpa/lib/jquery-2.1.0.js',
- '../sherpa/lib/lodash-4.17.4.js',
- '../sherpa/lib/FileSaver-b8054a2.js',
- '../sherpa/lib/himalaya-0.2.7.js',
- '../sherpa/lib/he-1.1.1.js',
- '../assert/js/assert.js',
- '../query-string-machine/js/QueryStringMachine.js',
- '../chipper/js/initialize-globals.js',
- '../phet-core/js/copyWithSortedKeys.js',
- '../sherpa/lib/seedrandom-2.4.2.js',
- '../sherpa/lib/game-up-camera-1.0.0.js',
- '../sherpa/lib/base64-js-1.2.0.js',
- '../sherpa/lib/TextEncoderLite-3c9f6f0.js',
- '../tandem/js/PhetioIDUtils.js',
- '../sherpa/lib/qunit-2.4.1.js',
- '../aqua/js/qunit-connector.js'
- ];
+ // Preloads, with more included for phet-io brand
+ let preloads = [
+ '../sherpa/lib/jquery-2.1.0.js',
+ '../sherpa/lib/lodash-4.17.4.js',
+ '../sherpa/lib/FileSaver-b8054a2.js',
+ '../sherpa/lib/himalaya-0.2.7.js',
+ '../sherpa/lib/he-1.1.1.js',
+ '../assert/js/assert.js',
+ '../query-string-machine/js/QueryStringMachine.js',
+ '../chipper/js/initialize-globals.js',
+ '../phet-core/js/copyWithSortedKeys.js',
+ '../sherpa/lib/seedrandom-2.4.2.js',
+ '../sherpa/lib/game-up-camera-1.0.0.js',
+ '../sherpa/lib/base64-js-1.2.0.js',
+ '../sherpa/lib/TextEncoderLite-3c9f6f0.js',
+ '../tandem/js/PhetioIDUtils.js',
+ '../chipper/js/SimVersion.js',
+ '../sherpa/lib/qunit-2.4.1.js',
+ '../aqua/js/qunit-connector.js'
+ ];
- if ( brand === 'phet-io' ) {
- preloads = preloads.concat( [
- '../phet-io/js/phet-io-initialize-globals.js'
- ] );
- }
+ if ( brand === 'phet-io' ) {
+ preloads = preloads.concat( [
+ '../phet-io/js/phet-io-initialize-globals.js'
+ ] );
+ }
- // Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
- // See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
- // load all of the scripts with this method, so they are treated the same (and placed in the correct execution
- // order).
- function loadURL( preloadURL, main ) {
- var script = document.createElement( 'script' );
- if ( typeof main === 'string' ) {
- script.setAttribute( 'data-main', main );
- }
- script.type = 'text/javascript';
- script.src = preloadURL;
- script.async = false;
- document.head.appendChild( script );
- }
+ // Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
+ // See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
+ // load all of the scripts with this method, so they are treated the same (and placed in the correct execution
+ // order).
+ const loadURL = ( preloadURL, main ) => {
+ const script = document.createElement( 'script' );
+ if ( typeof main === 'string' ) {
+ script.setAttribute( 'data-main', main );
+ }
+ script.type = 'text/javascript';
+ script.src = preloadURL + queryAppend;
+ script.async = false;
+ document.head.appendChild( script );
+ };
- // Queue all of the preloads to be loaded.
- preloads.forEach( loadURL );
+ // Queue all of the preloads to be loaded.
+ preloads.forEach( loadURL );
- loadURL( '../sherpa/lib/require-2.3.6.js', 'js/scenery-test-config.js' );
- } )();
+ loadURL( '../sherpa/lib/require-2.3.6.js', 'js/scenery-test-config.js' );
</script>
</body>
-</html>
+</html>
\ No newline at end of file
Here is the patch where we updated utteranceQueue singleton usages to support coming from the sim's display. Usages of utteranceQueueIndex: sun/js/accessibility/AccessibleValueHandler.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sun/js/accessibility/AccessibleValueHandler.js (revision da585bb71ca9947717434a3a3e34c5b120e71be7)
+++ sun/js/accessibility/AccessibleValueHandler.js (date 1572399129562)
@@ -29,9 +29,7 @@
const sun = require( 'SUN/sun' );
const Util = require( 'DOT/Util' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // constants
+// constants
const DEFAULT_TAG_NAME = 'input';
const toString = v => v + '';
@@ -349,6 +347,7 @@
*/
setUtteranceAndAlert() {
if ( this.a11yCreateValueChangeAlert ) {
+ const utteranceQueue = phet.joist.sim.display.utteranceQueue;
this.onEndInteractionUtterance.resetTimingVariables();
Index: molarity/js/molarity/view/molarityAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molarity/js/molarity/view/molarityAlertManager.js (revision 4b1c5ca92f1e763c7e0f8ff5bccc23e719e1c0bc)
+++ molarity/js/molarity/view/molarityAlertManager.js (date 1572399001045)
@@ -14,8 +14,7 @@
const molarity = require( 'MOLARITY/molarity' );
const MolarityA11yStrings = require( 'MOLARITY/molarity/MolarityA11yStrings' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
+const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
const ValueChangeUtterance = require( 'UTTERANCE_QUEUE/ValueChangeUtterance' );
// a11y strings
@@ -128,8 +127,8 @@
this.useQuantitativeDescriptionsProperty );
// clears the utteranceQueue to remove utterances from previous saturation region, then adds the saturation utterance.
- utteranceQueue.clear();
- utteranceQueue.addToFront( this.saturationUtterance );
+ phet.joist.sim.display.utteranceQueue.clear();
+ phet.joist.sim.display.utteranceQueue.addToFront( this.saturationUtterance );
}
/**
@@ -141,7 +140,7 @@
this.sliderUtterance.alert = useQuantitativeDescriptionsProperty.value ?
noSoluteQuantitativeAlertString :
noSoluteQualitativeAlertString;
- utteranceQueue.addToBack( this.sliderUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.sliderUtterance );
}
/**
@@ -150,7 +149,7 @@
*/
alertSoluteChanged() {
this.soluteUtterance.alert = this.soluteDescriber.getSoluteChangedAlertString( this.useQuantitativeDescriptionsProperty );
- utteranceQueue.addToBack( this.soluteUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.soluteUtterance );
}
/**
@@ -162,7 +161,7 @@
this.valuesVisibleUtterance.alert = valuesVisibleProperty ?
solutionValuesCheckedAlertString :
solutionValuesUncheckedAlertString;
- utteranceQueue.addToBack( this.valuesVisibleUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.valuesVisibleUtterance );
}
/**
@@ -200,7 +199,7 @@
}
this.sliderUtterance.alert = alertText;
- utteranceQueue.addToBack( this.sliderUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.sliderUtterance );
}
@@ -223,7 +222,7 @@
}
this.sliderUtterance.alert = alertText;
- utteranceQueue.addToBack( this.sliderUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.sliderUtterance );
}
}
Index: inverse-square-law-common/js/view/ISLCAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- inverse-square-law-common/js/view/ISLCAlertManager.js (date 1572388326000)
+++ inverse-square-law-common/js/view/ISLCAlertManager.js (date 1572399000920)
@@ -15,9 +15,7 @@
const ActivationUtterance = require( 'UTTERANCE_QUEUE/ActivationUtterance' );
const inverseSquareLawCommon = require( 'INVERSE_SQUARE_LAW_COMMON/inverseSquareLawCommon' );
const ISLCA11yStrings = require( 'INVERSE_SQUARE_LAW_COMMON/ISLCA11yStrings' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // strings
+// strings
const forceValuesHiddenString = ISLCA11yStrings.forceValuesHidden.value;
class ISLCAlertManager {
@@ -52,7 +50,7 @@
}
this.showForceValuesUtterance.alert = alert;
- utteranceQueue.addToBack( this.showForceValuesUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.showForceValuesUtterance );
}
}
Index: inverse-square-law-common/js/view/ISLCRulerNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- inverse-square-law-common/js/view/ISLCRulerNode.js (date 1572388326000)
+++ inverse-square-law-common/js/view/ISLCRulerNode.js (date 1572399000916)
@@ -27,8 +27,7 @@
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Util = require( 'DOT/Util' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Vector2 = require( 'DOT/Vector2' );
+const Vector2 = require( 'DOT/Vector2' );
// strings
const unitsCentimetersString = require( 'string!INVERSE_SQUARE_LAW_COMMON/units.centimeters' );
@@ -202,7 +201,7 @@
onGrab: () => {
grabbedUtterance.alert = rulerDescriber.getRulerGrabbedAlertable();
- utteranceQueue.addToBack( grabbedUtterance);
+ phet.joist.sim.display.utteranceQueue.addToBack( grabbedUtterance);
},
listenersForDrag: [ keyboardDragListener ]
Index: gravity-force-lab-basics/js/gravity-force-lab-basics/view/GFLBAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- gravity-force-lab-basics/js/gravity-force-lab-basics/view/GFLBAlertManager.js (revision a33a6c6c8312eb563102c08c08bf1a8e69127ae0)
+++ gravity-force-lab-basics/js/gravity-force-lab-basics/view/GFLBAlertManager.js (date 1572399000945)
@@ -13,9 +13,7 @@
const GFLBA11yStrings = require( 'GRAVITY_FORCE_LAB_BASICS/gravity-force-lab-basics/GFLBA11yStrings' );
const GravityForceLabAlertManager = require( 'GRAVITY_FORCE_LAB/gravity-force-lab/view/GravityForceLabAlertManager' );
const gravityForceLabBasics = require( 'GRAVITY_FORCE_LAB_BASICS/gravityForceLabBasics' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const distanceArrowVisibleString = GFLBA11yStrings.distanceArrowVisible.value;
const distanceArrowRemovedString = GFLBA11yStrings.distanceArrowRemoved.value;
@@ -50,7 +48,7 @@
*/
alertDistanceVisible( showDistance ) {
this.distanceVisibleUtterance.alert = showDistance ? distanceArrowVisibleString : distanceArrowRemovedString;
- utteranceQueue.addToBack( this.distanceVisibleUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.distanceVisibleUtterance );
}
}
Index: ohms-law/js/ohms-law/view/ControlPanel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ohms-law/js/ohms-law/view/ControlPanel.js (revision 8e6f079f1ec1bb311df4637d32b61935541f638b)
+++ ohms-law/js/ohms-law/view/ControlPanel.js (date 1572399000948)
@@ -23,8 +23,7 @@
const SliderUnit = require( 'OHMS_LAW/ohms-law/view/SliderUnit' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Util = require( 'DOT/Util' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const ValueChangeUtterance = require( 'UTTERANCE_QUEUE/ValueChangeUtterance' );
+const ValueChangeUtterance = require( 'UTTERANCE_QUEUE/ValueChangeUtterance' );
// strings
const resistanceString = require( 'string!OHMS_LAW/resistance' );
@@ -105,7 +104,7 @@
const fixedCurrent = Util.toFixed( currentProperty.get(), OhmsLawConstants.CURRENT_SIG_FIGS );
voltageUtterance.alert = self.getValueChangeAlertString( letterVString, sizeChange, sizeChange, fixedCurrent );
- utteranceQueue.addToBack( voltageUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( voltageUtterance );
}
}
},
@@ -140,7 +139,7 @@
iSizeChange += Math.abs( currentChange ) > twoSizeCurrentThreshhold ? ' ' + aLotString : '';
resistanceUtterance.alert = self.getValueChangeAlertString( letterRString, rSizeChange, iSizeChange, fixedCurrent );
- utteranceQueue.addToBack( resistanceUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( resistanceUtterance );
}
};
Index: gravity-force-lab/js/gravity-force-lab/view/GravityForceLabAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- gravity-force-lab/js/gravity-force-lab/view/GravityForceLabAlertManager.js (date 1572388793000)
+++ gravity-force-lab/js/gravity-force-lab/view/GravityForceLabAlertManager.js (date 1572399000955)
@@ -16,8 +16,7 @@
const ISLCAlertManager = require( 'INVERSE_SQUARE_LAW_COMMON/view/ISLCAlertManager' );
const merge = require( 'PHET_CORE/merge' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const ValueChangeUtterance = require( 'UTTERANCE_QUEUE/ValueChangeUtterance' );
+const ValueChangeUtterance = require( 'UTTERANCE_QUEUE/ValueChangeUtterance' );
// a11y strings
const constantRadiusThinkDensityPatternString = GravityForceLabA11yStrings.constantRadiusThinkDensityPattern.value;
@@ -74,7 +73,7 @@
model.constantRadiusProperty.lazyLink( constantRadius => {
constantRadiusUtterance.alert = constantRadius ? constantRadiusAlert :
massDescriber.getM1RelativeSize();
- utteranceQueue.addToBack( constantRadiusUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( constantRadiusUtterance );
} );
if ( options.linkToScientificNotationProperty ) {
@@ -111,7 +110,7 @@
*/
alertScientificNotation() {
this.scientificNotationUtterance.alert = this.forceDescriber.getScientificNotationAlertText();
- utteranceQueue.addToBack( this.scientificNotationUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.scientificNotationUtterance );
}
/**
@@ -137,7 +136,7 @@
massClause: massClause,
forceClause: this.forceDescriber.getVectorChangeClause( forceBiggerOverride, false )
} );
- utteranceQueue.addToBack( this.massChangedUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.massChangedUtterance );
}
/**
@@ -147,7 +146,7 @@
this.massChangedUtterance.alert = StringUtils.fillIn( sentencePatternString, {
sentence: this.forceDescriber.getVectorChangeClause( false, true )
} );
- utteranceQueue.addToBack( this.massChangedUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.massChangedUtterance );
}
}
Index: molecules-and-light/js/moleculesandlight/view/MoleculeSelectionPanel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molecules-and-light/js/moleculesandlight/view/MoleculeSelectionPanel.js (revision 2f58fbc6e168d52f8d8faaad723e73354a18739b)
+++ molecules-and-light/js/moleculesandlight/view/MoleculeSelectionPanel.js (date 1572399000988)
@@ -34,8 +34,7 @@
const RichText = require( 'SCENERY/nodes/RichText' );
const Shape = require( 'KITE/Shape' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Vector2 = require( 'DOT/Vector2' );
+const Vector2 = require( 'DOT/Vector2' );
//strings
const molecularNamePatternString = require( 'string!MOLECULES_AND_LIGHT/molecularNamePattern' );
@@ -191,7 +190,7 @@
// var handleMoleculeChange = function( event ) {
// var photonTarget = model.photonTargetProperty.get();
// var utteranceText = StringUtils.fillIn( moleculeSelectionAlertPatternString, { target: PhotonTarget.getMoleculeName( photonTarget ) } );
- // utteranceQueue.addToBack( new Utterance( { alert: utteranceText } );
+ // phet.joist.sim.display.utteranceQueue.addToBack( new Utterance( { alert: utteranceText } );
// };
// radioButtons.addInputListener( {
@@ -203,7 +202,7 @@
*/
const moleculeChangeAlert = function( target ) {
const utteranceText = StringUtils.fillIn( moleculeSelectionAlertPatternString, { target: PhotonTarget.getMoleculeName( target ) } );
- utteranceQueue.addToBack( utteranceText );
+ phet.joist.sim.display.utteranceQueue.addToBack( utteranceText );
};
model.photonTargetProperty.link( moleculeChangeAlert );
Index: molecules-and-light/js/moleculesandlight/view/QuadEmissionFrequencyControlPanel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- molecules-and-light/js/moleculesandlight/view/QuadEmissionFrequencyControlPanel.js (revision 2f58fbc6e168d52f8d8faaad723e73354a18739b)
+++ molecules-and-light/js/moleculesandlight/view/QuadEmissionFrequencyControlPanel.js (date 1572399000959)
@@ -27,8 +27,7 @@
const RadioButtonGroup = require( 'SUN/buttons/RadioButtonGroup' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Text = require( 'SCENERY/nodes/Text' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const WavelengthConstants = require( 'MOLECULES_AND_LIGHT/photon-absorption/model/WavelengthConstants' );
+const WavelengthConstants = require( 'MOLECULES_AND_LIGHT/photon-absorption/model/WavelengthConstants' );
// images
const flashlight2Image = require( 'mipmap!MOLECULES_AND_LIGHT/flashlight.png' );
@@ -207,7 +206,7 @@
wavelengthSelectionAlertPatternString,
{ wavelength: WavelengthConstants.getLightSourceName( wavelength ) }
);
- utteranceQueue.addToBack( utteranceText );
+ phet.joist.sim.display.utteranceQueue.addToBack( utteranceText );
};
photonAbsorptionModel.photonWavelengthProperty.link( handleWavelengthChangeAlert );
Index: balloons-and-static-electricity/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- balloons-and-static-electricity/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js (revision 57c986671ab8d938a4ff9a7b4a019b81593b1789)
+++ balloons-and-static-electricity/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js (date 1572399000969)
@@ -34,8 +34,7 @@
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const SweaterDescriber = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloons-and-static-electricity/view/describers/SweaterDescriber' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Vector2 = require( 'DOT/Vector2' );
+const Vector2 = require( 'DOT/Vector2' );
const WallDescriber = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloons-and-static-electricity/view/describers/WallDescriber' );
// a11y strings
@@ -174,13 +173,13 @@
// the first charge pickup and subsequent pickups (behind a refresh rate) should be announced
if ( self.alertNextPickup || self.alertFirstPickup ) {
alert = self.getChargePickupDescription( self.alertFirstPickup );
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
// announce pickup of last charge, as long as charges are visible
if ( Math.abs( chargeVal ) === BASEConstants.MAX_BALLOON_CHARGE && self.showChargesProperty.get() !== 'none' ) {
alert = self.getLastChargePickupDescription();
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
// reset flags
@@ -191,7 +190,7 @@
// when visibility changes, generate the alert and be sure to describe initial movement the next time the
// balloon is released or added to the play area
balloon.isVisibleProperty.lazyLink( function( isVisible ) {
- utteranceQueue.addToBack( self.getVisibilityChangedDescription() );
+ phet.joist.sim.display.utteranceQueue.addToBack( self.getVisibilityChangedDescription() );
self.initialMovementDescribed = false;
self.preventNoMovementAlert = true;
} );
@@ -199,7 +198,7 @@
// a11y - if we enter/leave the sweater announce that immediately
balloon.onSweaterProperty.link( function( onSweater ) {
if ( balloon.isDraggedProperty.get() ) {
- utteranceQueue.addToBack( self.movementDescriber.getOnSweaterString( onSweater ) );
+ phet.joist.sim.display.utteranceQueue.addToBack( self.movementDescriber.getOnSweaterString( onSweater ) );
}
// entering sweater, indicate that we need to alert the next charge pickup
@@ -212,7 +211,7 @@
if ( !self.balloonModel.jumping ) {
if ( self.describeDirection ) {
self.directionUtterance.alert = self.movementDescriber.getDirectionChangedDescription();
- utteranceQueue.addToBack( self.directionUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( self.directionUtterance );
}
}
} );
@@ -713,13 +712,13 @@
if ( model.onSweater() || model.touchingWall() ) {
// while dragging, just attractive state and location
- utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() );
}
}
else if ( model.onSweater() ) {
// if we stop on the sweater, announce that we are sticking to it
- utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() );
}
else {
@@ -727,7 +726,7 @@
// special case: if the balloon is touching the wall for the first time, don't describe this because
// the section of this function observing that state will describe this
if ( nextTouchingWall === this.describedTouchingWall ) {
- utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() );
}
}
}
@@ -778,7 +777,7 @@
// assign an id so that we only announce the most recent alert in the utteranceQueue
this.movementUtterance.alert = utterance;
- utteranceQueue.addToBack( this.movementUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.movementUtterance );
}
// describe the change in induced charge due to balloon dragging
@@ -795,7 +794,7 @@
}
this.inducedChargeChangeUtterance.alert = utterance;
- utteranceQueue.addToBack( this.inducedChargeChangeUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.inducedChargeChangeUtterance );
}
// update flags that indicate which alerts should come next
@@ -818,14 +817,14 @@
if ( !model.jumping ) {
if ( nextTouchingWall ) {
if ( model.isDraggedProperty.get() && this.showChargesProperty.get() === 'all' ) {
- utteranceQueue.addToBack( this.getWallRubbingDescriptionWithChargePairs() );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.getWallRubbingDescriptionWithChargePairs() );
this.describeWallRub = false;
}
else {
// generates a description of how the balloon interacts with the wall
if ( nextVisible ) {
- utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() );
}
}
}
@@ -838,7 +837,7 @@
if ( nextIsDragged ) {
utterance = this.movementDescriber.getGrabbedAlert();
- utteranceQueue.addToBack( utterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( utterance );
// we have been picked up successfully, start describing direction
this.describeDirection = true;
@@ -876,7 +875,7 @@
if ( !nextVelocity.equals( Vector2.ZERO ) ) {
utterance = this.movementDescriber.getInitialReleaseDescription();
- utteranceQueue.addToBack( utterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( utterance );
// after describing initial movement, continue to describe direction changes
this.describeDirection = true;
@@ -887,7 +886,7 @@
// when the balloon is first added to the play area
if ( !this.preventNoMovementAlert ) {
utterance = this.movementDescriber.getNoChangeReleaseDescription();
- utteranceQueue.addToBack( utterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( utterance );
}
this.preventNoMovementAlert = false;
}
@@ -901,7 +900,7 @@
// if the balloon is moving slowly, alert a continuous movement description
if ( this.movementDescriber.balloonMovingAtContinousDescriptionVelocity() ) {
utterance = this.movementDescriber.getContinuousReleaseDescription();
- utteranceQueue.addToBack( utterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( utterance );
// reset timer
this.timeSinceReleaseAlert = 0;
@@ -915,7 +914,7 @@
if ( this.rubAlertDirty ) {
if ( nextIsDragged && model.onSweater() ) {
this.chargeUtterance.alert = this.getNoChargePickupDescription();
- utteranceQueue.addToBack( this.chargeUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.chargeUtterance );
}
}
}
Index: balloons-and-static-electricity/js/balloons-and-static-electricity/view/ControlPanel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- balloons-and-static-electricity/js/balloons-and-static-electricity/view/ControlPanel.js (revision 57c986671ab8d938a4ff9a7b4a019b81593b1789)
+++ balloons-and-static-electricity/js/balloons-and-static-electricity/view/ControlPanel.js (date 1572399000943)
@@ -29,8 +29,7 @@
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Text = require( 'SCENERY/nodes/Text' );
const TwoSceneSelectionNode = require( 'BALLOONS_AND_STATIC_ELECTRICITY/balloons-and-static-electricity/view/TwoSceneSelectionNode' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const VBox = require( 'SCENERY/nodes/VBox' );
+const VBox = require( 'SCENERY/nodes/VBox' );
const VerticalAquaRadioButtonGroup = require( 'SUN/VerticalAquaRadioButtonGroup' );
// images
@@ -110,7 +109,7 @@
self.wallButton.innerContent = model.wall.isVisibleProperty.get() ? removeWallString : addWallString;
const alertDescription = wallVisible ? wallAddedString : wallRemovedString;
- utteranceQueue.addToBack( alertDescription );
+ phet.joist.sim.display.utteranceQueue.addToBack( alertDescription );
} );
// Radio buttons related to charges
@@ -168,7 +167,7 @@
}
assert && assert( alertString, 'no interactive alert for showChargesProperty value ' + value );
- utteranceQueue.addToBack( alertString );
+ phet.joist.sim.display.utteranceQueue.addToBack( alertString );
} );
// Radio buttons for selecting 1 vs 2 balloons
@@ -228,17 +227,17 @@
const resetBalloonButtonListener = function() {
// disable other alerts until after we are finished resetting the balloons
- utteranceQueue.enabled = false;
+ phet.joist.sim.display.utteranceQueue.enabled = false;
model.sweater.reset();
model.balloons.forEach( function( balloon ) {
balloon.reset( true );
} );
- utteranceQueue.enabled = true;
+ phet.joist.sim.display.utteranceQueue.enabled = true;
// alert to assistive technology
- utteranceQueue.addToBack( StringUtils.fillIn( resetBalloonsAlertPatternString, {
+ phet.joist.sim.display.utteranceQueue.addToBack( StringUtils.fillIn( resetBalloonsAlertPatternString, {
balloons: model.greenBalloon.isVisibleProperty.get() ? balloonsString : balloonString
} ) );
};
Index: balloons-and-static-electricity/js/balloons-and-static-electricity/view/BalloonNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- balloons-and-static-electricity/js/balloons-and-static-electricity/view/BalloonNode.js (revision 57c986671ab8d938a4ff9a7b4a019b81593b1789)
+++ balloons-and-static-electricity/js/balloons-and-static-electricity/view/BalloonNode.js (date 1572399000934)
@@ -37,8 +37,7 @@
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const Shape = require( 'KITE/Shape' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Vector2 = require( 'DOT/Vector2' );
+const Vector2 = require( 'DOT/Vector2' );
// a11y - critical x locations for the balloon
const X_LOCATIONS = PlayAreaMap.X_LOCATIONS;
@@ -236,7 +235,7 @@
if ( self.attemptToMoveBeyondBoundary( event.domEvent.keyCode ) ) {
const attemptedDirection = self.getAttemptedMovementDirection( event.domEvent.keyCode );
boundaryUtterance.alert = self.describer.movementDescriber.getTouchingBoundaryDescription( attemptedDirection );
- utteranceQueue.addToBack( boundaryUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( boundaryUtterance );
}
}
} );
@@ -365,11 +364,11 @@
this.model.setCenter( center );
// clear the queue of utterances that collected as position changed
- utteranceQueue.clear();
+ phet.joist.sim.display.utteranceQueue.clear();
// Send a custom alert, depending on where the balloon was moved to
this.jumpingUtterance.alert = this.describer.movementDescriber.getJumpingDescription( center );
- utteranceQueue.addToBack( this.jumpingUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( this.jumpingUtterance );
// reset forces in tracked values in describer that determine description for induced charge change
this.describer.chargeDescriber.resetReferenceForces();
Index: friction/js/friction/view/describers/TemperatureIncreasingDescriber.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- friction/js/friction/view/describers/TemperatureIncreasingDescriber.js (revision f3fd4a7fa06ca9f7df0d6f9b140f9a8213e39b60)
+++ friction/js/friction/view/describers/TemperatureIncreasingDescriber.js (date 1572399000976)
@@ -23,9 +23,7 @@
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const timer = require( 'AXON/timer' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const moreString = FrictionA11yStrings.more.value;
const fasterString = FrictionA11yStrings.faster.value;
const nowHotterString = FrictionA11yStrings.nowHotter.value;
@@ -159,7 +157,7 @@
* @private
*/
alertMaxTemp() {
- this.alert( () => { utteranceQueue.addToBack( this.maxTempUtterance ); } );
+ this.alert( () => { phet.joist.sim.display.utteranceQueue.addToBack( this.maxTempUtterance ); } );
}
/**
Index: friction/js/friction/view/describers/BreakAwayDescriber.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- friction/js/friction/view/describers/BreakAwayDescriber.js (revision f3fd4a7fa06ca9f7df0d6f9b140f9a8213e39b60)
+++ friction/js/friction/view/describers/BreakAwayDescriber.js (date 1572399001013)
@@ -14,9 +14,7 @@
const FrictionModel = require( 'FRICTION/friction/model/FrictionModel' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const timer = require( 'AXON/timer' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const capitalizedVeryHotString = FrictionA11yStrings.capitalizedVeryHot.value;
const breakAwaySentenceFirstString = FrictionA11yStrings.breakAwaySentenceFirst.value;
const breakAwaySentenceAgainString = FrictionA11yStrings.breakAwaySentenceAgain.value;
@@ -76,10 +74,10 @@
// If there aren't any more atoms to break away
if ( this.model.numberOfAtomsEvaporated >= FrictionModel.NUMBER_OF_EVAPORABLE_ATOMS ) {
assert && assert( this.alertedBreakAwayProperty.value, 'If this is the first alert, then we have problems' );
- utteranceQueue.addToFront( BREAK_AWAY_NONE_LEFT );
+ phet.joist.sim.display.utteranceQueue.addToFront( BREAK_AWAY_NONE_LEFT );
}
else {
- utteranceQueue.addToFront( this.alertedBreakAwayProperty.value ? BREAK_AWAY_THRESHOLD_AGAIN : BREAK_AWAY_THRESHOLD_FIRST );
+ phet.joist.sim.display.utteranceQueue.addToFront( this.alertedBreakAwayProperty.value ? BREAK_AWAY_THRESHOLD_AGAIN : BREAK_AWAY_THRESHOLD_FIRST );
}
this.alertedBreakAwayProperty.value = true;
Index: friction/js/friction/view/FrictionGrabDragInteraction.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- friction/js/friction/view/FrictionGrabDragInteraction.js (revision f3fd4a7fa06ca9f7df0d6f9b140f9a8213e39b60)
+++ friction/js/friction/view/FrictionGrabDragInteraction.js (date 1572399000957)
@@ -13,9 +13,7 @@
const FrictionModel = require( 'FRICTION/friction/model/FrictionModel' );
const GrabDragInteraction = require( 'SCENERY_PHET/accessibility/GrabDragInteraction' );
const merge = require( 'PHET_CORE/merge' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const initialGrabbedNotTouchingString = FrictionA11yStrings.initialGrabbedNotTouching.value;
const grabbedNotTouchingString = FrictionA11yStrings.grabbedNotTouching.value;
const initialGrabbedTouchingString = FrictionA11yStrings.initialGrabbedTouching.value;
@@ -55,7 +53,7 @@
if ( this.successfullyInteracted ) {
alert = alerts.subsequent;
}
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
};
super( wrappedNode, options );
Index: friction/js/friction/view/FrictionAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- friction/js/friction/view/FrictionAlertManager.js (revision f3fd4a7fa06ca9f7df0d6f9b140f9a8213e39b60)
+++ friction/js/friction/view/FrictionAlertManager.js (date 1572399000949)
@@ -12,9 +12,7 @@
const FrictionA11yStrings = require( 'FRICTION/friction/FrictionA11yStrings' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const frictionIncreasingAtomsJigglingTemperatureFirstPatternString = FrictionA11yStrings.frictionIncreasingAtomsJigglingTemperatureFirstPattern.value;
const frictionIncreasingAtomsJigglingTemperaturePatternString = FrictionA11yStrings.frictionIncreasingAtomsJigglingTemperaturePattern.value;
const atomsJiggleTinyBitTempCoolString = FrictionA11yStrings.atomsJiggleTinyBitTempCool.value;
@@ -49,7 +47,7 @@
} );
temperatureJiggleUtterance.alert = string;
- utteranceQueue.addToBack( temperatureJiggleUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( temperatureJiggleUtterance );
},
/**
@@ -57,7 +55,7 @@
* @public
*/
alertSettledAndCool: function() {
- utteranceQueue.addToBack( atomsJiggleTinyBitTempCoolString );
+ phet.joist.sim.display.utteranceQueue.addToBack( atomsJiggleTinyBitTempCoolString );
},
// Threshold that must be reached from initial temp to new temp to alert that the temperature changed, in amplitude (see model for more info)
Index: joist/js/NavigationBarSoundToggleButton.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- joist/js/NavigationBarSoundToggleButton.js (revision 21d163d28b186bf0a7b3226ca769402a0d8a0d38)
+++ joist/js/NavigationBarSoundToggleButton.js (date 1572399000912)
@@ -23,8 +23,7 @@
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const Shape = require( 'KITE/Shape' );
const ToggleNode = require( 'SUN/ToggleNode' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Vector2 = require( 'DOT/Vector2' );
+const Vector2 = require( 'DOT/Vector2' );
// a11y strings
const soundOnOffString = JoistA11yStrings.soundOnOffButton.value;
@@ -156,7 +155,7 @@
self.setAccessibleAttribute( 'aria-pressed', !value );
soundUtterance.alert = value ? simSoundOnString : simSoundOffString;
- utteranceQueue.addToBack( soundUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( soundUtterance );
};
soundEnabledProperty.lazyLink( pressedListener );
this.setAccessibleAttribute( 'aria-pressed', !soundEnabledProperty.get() );
Index: a11y-research/js/abswitch-test/js/abswitch-test/view/AbswitchTestScreenView.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- a11y-research/js/abswitch-test/js/abswitch-test/view/AbswitchTestScreenView.js (revision b2786f488dfee56e4f937d06553afcc02f242787)
+++ a11y-research/js/abswitch-test/js/abswitch-test/view/AbswitchTestScreenView.js (date 1572399129567)
@@ -17,8 +17,7 @@
const Circle = require( 'SCENERY/nodes/Circle' );
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const Node = require( 'SCENERY/nodes/Node' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
- const Text = require( 'SCENERY/nodes/Text' );
+const Text = require( 'SCENERY/nodes/Text' );
const VBox = require( 'SCENERY/nodes/VBox' );
const PhetFont = require( 'SCENERY_PHET/PhetFont' );
@@ -30,6 +29,8 @@
ScreenView.call( this );
+ const utteranceQueue = phet.joist.sim.display.utteranceQueue;
+
var font = new PhetFont( 20 );
//--------------------------------------------------------------------------
Index: faradays-law/js/faradays-law/view/FaradaysLawAlertManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- faradays-law/js/faradays-law/view/FaradaysLawAlertManager.js (revision b478ead61bbb2d9e3be7ccb72aadaf62c0b29ff6)
+++ faradays-law/js/faradays-law/view/FaradaysLawAlertManager.js (date 1572399001028)
@@ -7,9 +7,7 @@
const faradaysLaw = require( 'FARADAYS_LAW/faradaysLaw' );
const MagnetDescriber = require( 'FARADAYS_LAW/faradays-law/view/MagnetDescriber' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // the alert manager
+// the alert manager
class FaradaysLawAlertManager {
constructor( describer ) {
@@ -22,37 +20,37 @@
magnetFocusAlert() {
const alert = this.describer.magnetFocusAlertText;
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
movementEndAlert() {
this.keyboardMovementUtterance.alert = this.describer.magnetMovedAlertText();
- utteranceQueue.addToFront( this.keyboardMovementUtterance );
+ phet.joist.sim.display.utteranceQueue.addToFront( this.keyboardMovementUtterance );
}
flipMagnetAlert( orientation ) {
const alert = this.describer.getFlipMagnetAlertText( orientation );
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
static magnetSlidingAlert( speed, direction ) {
const alert = MagnetDescriber.getMagnetSlidingAlertText( speed, direction );
- utteranceQueue.addToFront( alert );
+ phet.joist.sim.display.utteranceQueue.addToFront( alert );
}
static voltmeterAttachmentAlert( showVoltmeter ) {
const alert = MagnetDescriber.getVoltmeterAttachmentAlertText( showVoltmeter );
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
static fieldLinesVisibilityAlert( showLines ) {
const alert = MagnetDescriber.getFieldLinesVisibilityAlertText( showLines );
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
static coilConnectionAlert( showTopCoil ) {
const alert = MagnetDescriber.getCoilConnectionAlertText( showTopCoil );
- utteranceQueue.addToBack( alert );
+ phet.joist.sim.display.utteranceQueue.addToBack( alert );
}
}
Index: faradays-law/js/faradays-law/view/ControlPanelNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- faradays-law/js/faradays-law/view/ControlPanelNode.js (revision b478ead61bbb2d9e3be7ccb72aadaf62c0b29ff6)
+++ faradays-law/js/faradays-law/view/ControlPanelNode.js (date 1572398653397)
@@ -151,7 +151,7 @@
model.voltmeterVisibleProperty.lazyLink( function( showVoltmeter ) {
FaradaysLawAlertManager.voltmeterAttachmentAlert( showVoltmeter );
// const attachmentState = showVoltmeter ? connectedString : removedString;
- // utteranceQueue.addToBack( StringUtils.fillIn( voltmeterAlertPatternString, { attachmentState } ) );
+ // phet.joist.sim.display.utteranceQueue.addToBack( StringUtils.fillIn( voltmeterAlertPatternString, { attachmentState } ) );
} );
// Create the label for the "Show Field Lines" checkbox, scaling it if it's too long.
Index: john-travoltage/js/john-travoltage/view/ElectronLayerNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- john-travoltage/js/john-travoltage/view/ElectronLayerNode.js (revision bb800c4fc427a0211e6d899c23c2fbbda95b4b02)
+++ john-travoltage/js/john-travoltage/view/ElectronLayerNode.js (date 1572399000940)
@@ -19,9 +19,7 @@
const Node = require( 'SCENERY/nodes/Node' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const electronsTotalString = JohnTravoltageA11yStrings.electronsTotal.value;
const electronsTotalAfterDischargeString = JohnTravoltageA11yStrings.electronsTotalAfterDischarge.value;
@@ -72,7 +70,7 @@
}
electronUtterance.alert = alertString;
- utteranceQueue.addToBack( electronUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( electronUtterance );
// for haptic feedback, experimental
model.utteranceAddedEmitter.emit( alertString );
Index: scenery-phet/js/buttons/SoundToggleButton.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery-phet/js/buttons/SoundToggleButton.js (date 1572388327000)
+++ scenery-phet/js/buttons/SoundToggleButton.js (date 1572399000991)
@@ -22,9 +22,7 @@
const sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
const SceneryPhetA11yStrings = require( 'SCENERY_PHET/SceneryPhetA11yStrings' );
const Shape = require( 'KITE/Shape' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // constants
+// constants
const WIDTH = 45;
const HEIGHT = 45;
const MARGIN = 4;
@@ -79,7 +77,7 @@
self.setAccessibleAttribute( 'aria-pressed', !value );
const alertString = value ? simSoundOnString : simSoundOffString;
- utteranceQueue.addToBack( alertString );
+ phet.joist.sim.display.utteranceQueue.addToBack( alertString );
};
property.lazyLink( pressedListener );
self.setAccessibleAttribute( 'aria-pressed', !property.get() );
Index: scenery-phet/js/accessibility/describers/BorderAlertsDescriber.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery-phet/js/accessibility/describers/BorderAlertsDescriber.js (date 1572388327000)
+++ scenery-phet/js/accessibility/describers/BorderAlertsDescriber.js (date 1572399000924)
@@ -17,9 +17,7 @@
const SceneryPhetA11yStrings = require( 'SCENERY_PHET/SceneryPhetA11yStrings' );
const Util = require( 'DOT/Util' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const leftBorderAlertString = SceneryPhetA11yStrings.leftBorderAlert.value;
const rightBorderAlertString = SceneryPhetA11yStrings.rightBorderAlert.value;
const topBorderAlertString = SceneryPhetA11yStrings.topBorderAlert.value;
@@ -179,7 +177,7 @@
}
alert() {
- utteranceQueue.addToBackIfDefined( this.getAlert() );
+ phet.joist.sim.display.utteranceQueue.addToBackIfDefined( this.getAlert() );
this._numberOfTimesAlerted++;
}
Index: scenery-phet/js/accessibility/describers/MovementDescriber.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery-phet/js/accessibility/describers/MovementDescriber.js (date 1572388327000)
+++ scenery-phet/js/accessibility/describers/MovementDescriber.js (date 1572399000952)
@@ -20,9 +20,7 @@
const sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
const SceneryPhetA11yStrings = require( 'SCENERY_PHET/SceneryPhetA11yStrings' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const downString = SceneryPhetA11yStrings.down.value;
const leftString = SceneryPhetA11yStrings.left.value;
const rightString = SceneryPhetA11yStrings.right.value;
@@ -124,7 +122,7 @@
* @param {AlertableDef} alertable - anything that can be passed to UtteranceQueue
*/
alert( alertable ) {
- utteranceQueue.addToBack( alertable );
+ phet.joist.sim.display.utteranceQueue.addToBack( alertable );
this.lastAlertedLocation = this.locationProperty.get();
}
Index: scenery-phet/js/accessibility/GrabDragInteraction.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery-phet/js/accessibility/GrabDragInteraction.js (date 1572388327000)
+++ scenery-phet/js/accessibility/GrabDragInteraction.js (date 1572399000929)
@@ -47,9 +47,7 @@
const sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
const SceneryPhetA11yStrings = require( 'SCENERY_PHET/SceneryPhetA11yStrings' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // a11y strings
+// a11y strings
const grabPatternString = SceneryPhetA11yStrings.grabPattern.value;
const movableString = SceneryPhetA11yStrings.movable.value;
const defaultObjectToGrabString = SceneryPhetA11yStrings.defaultObjectToGrab.value;
@@ -217,7 +215,7 @@
// @private - wrap the optional onRelease in logic that is needed for the core type.
this.onRelease = () => {
options.onRelease && options.onRelease();
- utteranceQueue.addToBack( releasedString );
+ phet.joist.sim.display.utteranceQueue.addToBack( releasedString );
};
this.onGrab = options.onGrab; // @private
Index: scenery-phet/js/buttons/ResetAllButton.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- scenery-phet/js/buttons/ResetAllButton.js (date 1572388327000)
+++ scenery-phet/js/buttons/ResetAllButton.js (date 1572399000918)
@@ -23,9 +23,7 @@
const sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
const SceneryPhetA11yStrings = require( 'SCENERY_PHET/SceneryPhetA11yStrings' );
const Tandem = require( 'TANDEM/Tandem' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // constants
+// constants
const RESET_ALL_BUTTON_RADIUS = 20.8;
// a11y strings - not translatable
@@ -69,13 +67,13 @@
// alert that everything was reset.
const resetUtterance = new ActivationUtterance( { alert: resetAllAlertString } );
this.isFiringProperty.lazyLink( function( isFiring ) {
- utteranceQueue.enabled = !isFiring;
+ phet.joist.sim.display.utteranceQueue.enabled = !isFiring;
if ( isFiring ) {
- utteranceQueue.clear();
+ phet.joist.sim.display.utteranceQueue.clear();
}
else {
- utteranceQueue.addToBack( resetUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( resetUtterance );
}
} );
}
Index: resistance-in-a-wire/js/resistance-in-a-wire/view/ControlPanel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- resistance-in-a-wire/js/resistance-in-a-wire/view/ControlPanel.js (revision 0a36acb0d8e86ab78971063223e39cd30c85ee89)
+++ resistance-in-a-wire/js/resistance-in-a-wire/view/ControlPanel.js (date 1572399000995)
@@ -25,9 +25,7 @@
const Text = require( 'SCENERY/nodes/Text' );
const Util = require( 'DOT/Util' );
const Utterance = require( 'UTTERANCE_QUEUE/Utterance' );
- const utteranceQueue = require( 'UTTERANCE_QUEUE/utteranceQueue' );
-
- // strings
+// strings
const areaString = require( 'string!RESISTANCE_IN_A_WIRE/area' );
const areaSymbolString = require( 'string!RESISTANCE_IN_A_WIRE/areaSymbol' );
const cmString = require( 'string!RESISTANCE_IN_A_WIRE/cm' );
@@ -138,7 +136,7 @@
// rapidly
if ( deltaRho && deltaResistance ) {
changeUtterance.alert = getSizeChangeAlert( resistance, deltaResistance, deltaRho, letterRhoString );
- utteranceQueue.addToBack( changeUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( changeUtterance );
}
},
sliderOptions: {
@@ -171,7 +169,7 @@
// rapidly
if ( deltaLength && deltaResistance ) {
changeUtterance.alert = getSizeChangeAlert( resistance, deltaResistance, deltaLength, letterLString );
- utteranceQueue.addToBack( changeUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( changeUtterance );
}
},
sliderOptions: {
@@ -204,7 +202,7 @@
// rapidly
if ( deltaArea && deltaResistance ) {
changeUtterance.alert = getSizeChangeAlert( resistance, deltaResistance, deltaArea, letterAString );
- utteranceQueue.addToBack( changeUtterance );
+ phet.joist.sim.display.utteranceQueue.addToBack( changeUtterance );
}
},
sliderOptions: {
|
Note: we really hate how large of a patch this is getting, but it still seems preferable to having N branches (at least 6, but could be more if we added usages). This is part of why we separated out the usages into another changeset, to keep the breadth down menially. |
@twant and I couldn't reproduce this today. We think it was caused because last week we didn't rebuild the a11y view before testing. |
|
…number of live elements, phetsims/utterance-queue#1
Above are changes to the a11y view that remove assumptions about aria live element ids, and the number of them to monitor. We also created some side issues. We are ready to close this issue. |
Actually. This was a massive set of changes. It would be good to have @jessegreenberg look over it. Here is a list of files to look at for recent changes:
EDIT: JG converting to checkbox list to indicate what I reviewed. |
These are looking great, additional things I noticed have new issues or have the open issues that you described. Is this ready to be closed? |
This was a side project that was discussed in the last few weeks with @emily-phet and @jessegreenberg as something that @twant may be able to tackle as a back burner project. The priority of it may shift as we think about phetsims/molarity#155 and how a fix for alerts firing in full-screen mode in Chrome may be to have scenery control the
UtteranceQueue
.On hold until we decide exactly what to do over in that issue.
The text was updated successfully, but these errors were encountered: