Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 9, 2019
1 parent 9956c04 commit 9e6cbc0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
28 changes: 14 additions & 14 deletions js/circuit-construction-kit-dc-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
require( 'SCENERY/nodes/Image' ); // Image is required for making toDataURLNodeSynchronous work in the built version
var IntroScreen = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/intro/IntroScreen' );
var KeyboardUtil = require( 'SCENERY/accessibility/KeyboardUtil' );
var LabScreen = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/lab/LabScreen' );
var Sim = require( 'JOIST/Sim' );
var SimLauncher = require( 'JOIST/SimLauncher' );
var Tandem = require( 'TANDEM/Tandem' );
const IntroScreen = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/intro/IntroScreen' );
const KeyboardUtil = require( 'SCENERY/accessibility/KeyboardUtil' );
const LabScreen = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/lab/LabScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const Tandem = require( 'TANDEM/Tandem' );

// constants
var tandem = Tandem.rootTandem;
const tandem = Tandem.rootTandem;

// strings
var circuitConstructionKitDcTitleString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_DC/circuit-construction-kit-dc.title' );
const circuitConstructionKitDcTitleString = require( 'string!CIRCUIT_CONSTRUCTION_KIT_DC/circuit-construction-kit-dc.title' );

var simOptions = {
const simOptions = {
credits: {
leadDesign: 'Amy Rouinfar',
softwareDevelopment: 'Sam Reid, Denzell Barnett',
Expand All @@ -37,8 +37,8 @@ define( function( require ) {

// Support accessibility for deleting selected circuit elements, but don't support broader tab navigation until it
// is complete
document.addEventListener( 'keydown', function( event ) {
var keyCode = event.keyCode || event.which;
document.addEventListener( 'keydown', event => {
const keyCode = event.keyCode || event.which;
if ( keyCode === KeyboardUtil.KEY_TAB ) {
event.preventDefault();
}
Expand All @@ -48,10 +48,10 @@ define( function( require ) {
// order to load the classes into an accessible namespace, the *-config.js and *-main.js are loaded however, when
// running the unit tests we don't also want to launch the simulation.
if ( !window.circuitConstructionKitTestSuite ) {
SimLauncher.launch( function() {
SimLauncher.launch( () => {

// Launch the simulation once everything is ready
var sim = new Sim( circuitConstructionKitDcTitleString, [
const sim = new Sim( circuitConstructionKitDcTitleString, [
new IntroScreen( tandem.createTandem( 'introScreen' ) ),
new LabScreen( tandem.createTandem( 'labScreen' ) )
], simOptions );
Expand Down
4 changes: 2 additions & 2 deletions js/circuitConstructionKitDc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var Namespace = require( 'PHET_CORE/Namespace' );
const Namespace = require( 'PHET_CORE/Namespace' );

return new Namespace( 'circuitConstructionKitDc' );
} );
2 changes: 1 addition & 1 deletion js/intro/IntroScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
Expand Down
6 changes: 3 additions & 3 deletions js/intro/model/IntroModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
var CircuitConstructionKitModel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/CircuitConstructionKitModel' );
const circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
const CircuitConstructionKitModel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/CircuitConstructionKitModel' );

class IntroModel extends CircuitConstructionKitModel {

Expand Down
16 changes: 8 additions & 8 deletions js/intro/view/IntroScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var CCKCScreenView = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKCScreenView' );
var circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
var CircuitElementToolFactory = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitElementToolFactory' );
var Node = require( 'SCENERY/nodes/Node' );
const CCKCScreenView = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CCKCScreenView' );
const circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
const CircuitElementToolFactory = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/view/CircuitElementToolFactory' );
const Node = require( 'SCENERY/nodes/Node' );

class IntroScreenView extends CCKCScreenView {

Expand All @@ -21,13 +21,13 @@ define( function( require ) {
* @param {Tandem} tandem
*/
constructor( model, tandem ) {
var circuitElementToolFactory = new CircuitElementToolFactory( model.circuit, model.showLabelsProperty, model.viewTypeProperty,
const circuitElementToolFactory = new CircuitElementToolFactory( model.circuit, model.showLabelsProperty, model.viewTypeProperty,
point => this.circuitLayerNode.globalToLocalPoint( point ) );

var wireToolNode = circuitElementToolFactory.createWireToolNode( 25, tandem.createTandem( 'wireToolNode' ) );
const wireToolNode = circuitElementToolFactory.createWireToolNode( 25, tandem.createTandem( 'wireToolNode' ) );

// Tool nodes that appear on every screen. Pagination for the carousel, each page should begin with wire node
var circuitElementToolNodes = [
const circuitElementToolNodes = [

// This page is duplicated in the Lab Screen View
wireToolNode,
Expand Down
2 changes: 1 addition & 1 deletion js/lab/LabScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
Expand Down
6 changes: 3 additions & 3 deletions js/lab/model/LabModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
var circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
var CircuitConstructionKitModel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/CircuitConstructionKitModel' );
const circuitConstructionKitDc = require( 'CIRCUIT_CONSTRUCTION_KIT_DC/circuitConstructionKitDc' );
const CircuitConstructionKitModel = require( 'CIRCUIT_CONSTRUCTION_KIT_COMMON/model/CircuitConstructionKitModel' );

class LabModel extends CircuitConstructionKitModel {

Expand Down
2 changes: 1 addition & 1 deletion js/lab/view/LabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Sam Reid (PhET Interactive Simulations)
*/
define( function( require ) {
define( require => {
'use strict';

// modules
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"simulation": true
},
"eslintConfig": {
"extends": "../chipper/eslint/sim_eslintrc.js"
"extends": "../chipper/eslint/sim_es6_eslintrc.js"
}
}

0 comments on commit 9e6cbc0

Please sign in to comment.