From 1f27fb6607b9ca8c06c389a2aa5a2c3d12adc3f8 Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 10 Oct 2019 21:16:08 -0800 Subject: [PATCH] convert _.extend to merge in zepumph responsible sims, https://github.com/phetsims/phet-core/issues/71 --- js/friction/view/BookRubSoundGenerator.js | 3 ++- js/friction/view/CoolingSoundGenerator.js | 3 ++- js/friction/view/CueArrow.js | 3 ++- js/friction/view/FrictionDragHandler.js | 3 ++- js/friction/view/FrictionGrabDragInteraction.js | 3 ++- js/friction/view/FrictionKeyboardHelpContent.js | 3 ++- js/friction/view/MoleculeMotionSoundGenerator.js | 3 ++- js/friction/view/book/BookNode.js | 3 ++- js/friction/view/book/CoverNode.js | 3 ++- js/friction/view/magnifier/MagnifierTargetNode.js | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/js/friction/view/BookRubSoundGenerator.js b/js/friction/view/BookRubSoundGenerator.js index 6739b394..16c2ebf4 100644 --- a/js/friction/view/BookRubSoundGenerator.js +++ b/js/friction/view/BookRubSoundGenerator.js @@ -11,6 +11,7 @@ define( require => { // modules const BooleanProperty = require( 'AXON/BooleanProperty' ); const friction = require( 'FRICTION/friction' ); + const merge = require( 'PHET_CORE/merge' ); const NoiseGenerator = require( 'TAMBO/sound-generators/NoiseGenerator' ); const NumberProperty = require( 'AXON/NumberProperty' ); const Property = require( 'AXON/Property' ); @@ -31,7 +32,7 @@ define( require => { */ constructor( topBookPositionProperty, contactProperty, options ) { - options = _.extend( { + options = merge( { noiseType: 'pink', centerFrequency: FRICTION_SOUND_CENTER_FREQUENCY, qFactor: 2, diff --git a/js/friction/view/CoolingSoundGenerator.js b/js/friction/view/CoolingSoundGenerator.js index 336b0efc..71cdb295 100644 --- a/js/friction/view/CoolingSoundGenerator.js +++ b/js/friction/view/CoolingSoundGenerator.js @@ -10,6 +10,7 @@ define( require => { // modules const friction = require( 'FRICTION/friction' ); + const merge = require( 'PHET_CORE/merge' ); const NoiseGenerator = require( 'TAMBO/sound-generators/NoiseGenerator' ); // constants @@ -26,7 +27,7 @@ define( require => { */ constructor( moleculeOscillationAmplitudeProperty, options ) { - options = _.extend( { + options = merge( { noiseType: 'pink', centerFrequency: 6000, qFactor: 4, diff --git a/js/friction/view/CueArrow.js b/js/friction/view/CueArrow.js index f81505d3..77aabfee 100644 --- a/js/friction/view/CueArrow.js +++ b/js/friction/view/CueArrow.js @@ -11,6 +11,7 @@ define( require => { const ArrowNode = require( 'SCENERY_PHET/ArrowNode' ); const FocusHighlightPath = require( 'SCENERY/accessibility/FocusHighlightPath' ); const friction = require( 'FRICTION/friction' ); + const merge = require( 'PHET_CORE/merge' ); /** * @@ -21,7 +22,7 @@ define( require => { constructor( options ) { // these values were empirically determined based on visual appearance - options = _.extend( { + options = merge( { headHeight: 32, headWidth: 30, tailWidth: 15, diff --git a/js/friction/view/FrictionDragHandler.js b/js/friction/view/FrictionDragHandler.js index 036bb525..c59bc6d0 100644 --- a/js/friction/view/FrictionDragHandler.js +++ b/js/friction/view/FrictionDragHandler.js @@ -11,6 +11,7 @@ define( require => { // modules const friction = require( 'FRICTION/friction' ); const inherit = require( 'PHET_CORE/inherit' ); + const merge = require( 'PHET_CORE/merge' ); const SimpleDragHandler = require( 'SCENERY/input/SimpleDragHandler' ); const Vector2 = require( 'DOT/Vector2' ); @@ -25,7 +26,7 @@ define( require => { function FrictionDragHandler( model, temperatureIncreasingDescriber, temperatureDecreasingDescriber, bookMovementDescriber, tandem, options ) { - options = _.extend( { + options = merge( { // {SoundClip} - sounds to be played at start and end of drag startSound: null, diff --git a/js/friction/view/FrictionGrabDragInteraction.js b/js/friction/view/FrictionGrabDragInteraction.js index 845a640f..52d98b76 100644 --- a/js/friction/view/FrictionGrabDragInteraction.js +++ b/js/friction/view/FrictionGrabDragInteraction.js @@ -12,6 +12,7 @@ define( require => { const FrictionA11yStrings = require( 'FRICTION/friction/FrictionA11yStrings' ); const FrictionModel = require( 'FRICTION/friction/model/FrictionModel' ); const GrabDragInteraction = require( 'SCENERY_PHET/accessibility/GrabDragInteraction' ); + const merge = require( 'PHET_CORE/merge' ); const utteranceQueue = require( 'SCENERY_PHET/accessibility/utteranceQueue' ); // a11y strings @@ -33,7 +34,7 @@ define( require => { class FrictionGrabDragInteraction extends GrabDragInteraction { constructor( model, wrappedNode, options ) { - options = _.extend( { + options = merge( { // Function that returns whether or not the drag cue should be shown. successfulDrag: () => { diff --git a/js/friction/view/FrictionKeyboardHelpContent.js b/js/friction/view/FrictionKeyboardHelpContent.js index e3908053..335ff24d 100644 --- a/js/friction/view/FrictionKeyboardHelpContent.js +++ b/js/friction/view/FrictionKeyboardHelpContent.js @@ -13,6 +13,7 @@ define( require => { const FrictionA11yStrings = require( 'FRICTION/friction/FrictionA11yStrings' ); const GeneralKeyboardHelpSection = require( 'SCENERY_PHET/keyboard/help/GeneralKeyboardHelpSection' ); const KeyboardHelpSection = require( 'SCENERY_PHET/keyboard/help/KeyboardHelpSection' ); + const merge = require( 'PHET_CORE/merge' ); const TwoColumnKeyboardHelpContent = require( 'SCENERY_PHET/keyboard/help/TwoColumnKeyboardHelpContent' ); // strings @@ -65,7 +66,7 @@ define( require => { * @param {Object} [options] */ constructor( options ) { - options = _.extend( { + options = merge( { // icon options arrowKeysScale: 0.55 diff --git a/js/friction/view/MoleculeMotionSoundGenerator.js b/js/friction/view/MoleculeMotionSoundGenerator.js index 4de2c95c..6cbb37c0 100644 --- a/js/friction/view/MoleculeMotionSoundGenerator.js +++ b/js/friction/view/MoleculeMotionSoundGenerator.js @@ -21,6 +21,7 @@ define( require => { const friction = require( 'FRICTION/friction' ); const FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); const FrictionModel = require( 'FRICTION/friction/model/FrictionModel' ); + const merge = require( 'PHET_CORE/merge' ); const SoundClip = require( 'TAMBO/sound-generators/SoundClip' ); const SoundGenerator = require( 'TAMBO/sound-generators/SoundGenerator' ); @@ -36,7 +37,7 @@ define( require => { */ constructor( moleculeAmplitudeProperty, options ) { - options = _.extend( { + options = merge( { maxOutputLevel: 1 // max gain for this sound generator, sets the overall output of this sound generator }, options ); diff --git a/js/friction/view/book/BookNode.js b/js/friction/view/book/BookNode.js index 561dfe79..a703f4dc 100644 --- a/js/friction/view/book/BookNode.js +++ b/js/friction/view/book/BookNode.js @@ -23,6 +23,7 @@ define( require => { const FrictionGrabDragInteraction = require( 'FRICTION/friction/view/FrictionGrabDragInteraction' ); const FrictionKeyboardDragListener = require( 'FRICTION/friction/view/FrictionKeyboardDragListener' ); const inherit = require( 'PHET_CORE/inherit' ); + const merge = require( 'PHET_CORE/merge' ); const Node = require( 'SCENERY/nodes/Node' ); const Shape = require( 'KITE/Shape' ); const SoundClip = require( 'TAMBO/sound-generators/SoundClip' ); @@ -53,7 +54,7 @@ define( require => { bookMovementDescriber, tandem, options ) { const self = this; - options = _.extend( { + options = merge( { // whether or not we can drag the book drag: false, diff --git a/js/friction/view/book/CoverNode.js b/js/friction/view/book/CoverNode.js index 3b995b60..0105fefc 100644 --- a/js/friction/view/book/CoverNode.js +++ b/js/friction/view/book/CoverNode.js @@ -14,6 +14,7 @@ define( require => { const friction = require( 'FRICTION/friction' ); const FrictionConstants = require( 'FRICTION/friction/FrictionConstants' ); const inherit = require( 'PHET_CORE/inherit' ); + const merge = require( 'PHET_CORE/merge' ); const Node = require( 'SCENERY/nodes/Node' ); const Path = require( 'SCENERY/nodes/Path' ); const PhetFont = require( 'SCENERY_PHET/PhetFont' ); @@ -38,7 +39,7 @@ define( require => { */ function CoverNode( title, tandem, options ) { - options = _.extend( { + options = merge( { stroke: 'gray', color: 'black' }, options ); diff --git a/js/friction/view/magnifier/MagnifierTargetNode.js b/js/friction/view/magnifier/MagnifierTargetNode.js index c530c6ca..751d5bcc 100644 --- a/js/friction/view/magnifier/MagnifierTargetNode.js +++ b/js/friction/view/magnifier/MagnifierTargetNode.js @@ -14,6 +14,7 @@ define( require => { // modules const friction = require( 'FRICTION/friction' ); const inherit = require( 'PHET_CORE/inherit' ); + const merge = require( 'PHET_CORE/merge' ); const Node = require( 'SCENERY/nodes/Node' ); const Path = require( 'SCENERY/nodes/Path' ); const Rectangle = require( 'SCENERY/nodes/Rectangle' ); @@ -32,7 +33,7 @@ define( require => { */ function MagnifierTargetNode( x, y, width, height, cornerRadius, leftAnchor, rightAnchor, options ) { - options = _.extend( { + options = merge( { stroke: 'black' }, options );