Skip to content

Commit

Permalink
Re-ran formatter over all files, see #14.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Jul 15, 2013
1 parent 908b092 commit d7142de
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion js/buildanatom/model/BuildAnAtomModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ define( function( require ) {
},

reset: function() {
callSuper( PropertySet, 'reset', this);
callSuper( PropertySet, 'reset', this );

// Move all particles that are in the atom back into their respective buckets.
this._moveParticlesFromAtomToBucket( this.particleAtom.protons, this.buckets.protonBucket );
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/NumberAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define( function( require ) {

// Default configuration.
options = _.extend( {
protonCount: 0,
protonCount: 0,
neutronCount: 0,
electronCount: 0
},
Expand All @@ -41,7 +41,7 @@ define( function( require ) {
}

inherit( PropertySet, NumberAtom, {
equals : function( otherAtom ){
equals: function( otherAtom ) {
return ( this.protonCount === otherAtom.protonCount &&
this.neutronCount === otherAtom.neutronCount &&
this.electronCount === otherAtom.electronCount );
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/Particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define( function( require ) {
}

inherit( PropertySet, Particle, {
step : function( dt ) {
step: function( dt ) {
if ( !this.userControlled ) {
var distanceToDestination = this.position.distance( this.destination );
if ( distanceToDestination > dt * this.velocity ) {
Expand All @@ -42,7 +42,7 @@ define( function( require ) {
this.position = this.destination;
},

setPositionAndDestination : function( newPosition ) {
setPositionAndDestination: function( newPosition ) {
this.destination = newPosition;
this.moveImmediatelyToDestination();
}
Expand Down
8 changes: 4 additions & 4 deletions js/common/model/ParticleAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ define( function( require ) {
thisAtom.validElectronPositions.forEach( function( validElectronPosition ) {
if ( validElectronPosition.electron === electron ) {
validElectronPosition.electron = null;
if ( Math.abs( validElectronPosition.position.magnitude() - thisAtom.innerElectronShellRadius ) < 1E-5 ){
if ( Math.abs( validElectronPosition.position.magnitude() - thisAtom.innerElectronShellRadius ) < 1E-5 ) {
// An inner-shell electron was removed. If there are electrons
// in the outer shell, move one of them in.
var occupiedOuterShellPositions = _.filter( thisAtom.validElectronPositions, function( validElectronPosition ){
var occupiedOuterShellPositions = _.filter( thisAtom.validElectronPositions, function( validElectronPosition ) {
return ( validElectronPosition.electron !== null && Utils.roughlyEqual( validElectronPosition.position.magnitude(),
thisAtom.outerElectronShellRadius,
1E-5 ));
});
} );
occupiedOuterShellPositions = _.sortBy( occupiedOuterShellPositions, function( occupiedShellPosition ) {
return occupiedShellPosition.position.distance( validElectronPosition.position );
} );
if ( occupiedOuterShellPositions.length > 0 ){
if ( occupiedOuterShellPositions.length > 0 ) {
// Move outer electron to inner spot.
validElectronPosition.electron = occupiedOuterShellPositions[0].electron;
occupiedOuterShellPositions[0].electron = null;
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/AtomNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ define( function( require ) {
this.addChild( electronShell );
var electronCloud = new ElectronCloudView( particleAtom, mvt );
this.addChild( electronCloud );
options.electronShellDepictionProperty.link( function( depiction ){
options.electronShellDepictionProperty.link( function( depiction ) {
electronShell.visible = depiction === 'orbits';
electronCloud.visible = depiction === 'cloud';
});
} );

// Create the textual readout for the element name.
var elementNameCenterPos = mvt.modelToViewPosition( particleAtom.position.plus( new Vector2( 0, particleAtom.innerElectronShellRadius / 2 ) ) );
Expand Down
2 changes: 1 addition & 1 deletion js/game/model/CountsToElementProblem.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define( function( require ) {
if ( submittedAtom.protonCount === this.answerAtom.protonCount &&
submittedAtom.neutronCount === this.answerAtom.neutronCount &&
( ( submittedNeutralOrIon === 'neutral' && this.answerAtom.charge === 0 ) ||
( submittedNeutralOrIon === 'ion' && this.answerAtom.charge !== 0 ) ) ){
( submittedNeutralOrIon === 'ion' && this.answerAtom.charge !== 0 ) ) ) {
// Answer is correct.
// Increment the score.
this.model.score += this.numSubmissions === 1 ? 2 : 1;
Expand Down
12 changes: 6 additions & 6 deletions js/game/view/ProblemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ define( function( require ) {
// Buttons. TODO: i18n of all buttons.
this.buttons = [];
this.checkAnswerButton = new TextButton( 'Check',
function(){ thisNode.checkAnswer(); },
function() { thisNode.checkAnswer(); },
{ font: BUTTON_FONT, rectangleFill: BUTTON_FILL } );
this.addChild( this.checkAnswerButton );
this.buttons.push( this.checkAnswerButton );
Expand All @@ -79,7 +79,7 @@ define( function( require ) {

// Utility function to hide all buttons and the feedback face.
var hideButtonsAndFace = function hideButtonsAndFace() {
thisNode.buttons.forEach( function( button ){
thisNode.buttons.forEach( function( button ) {
button.visible = false;
} );
faceNode.visible = false;
Expand Down Expand Up @@ -137,7 +137,7 @@ define( function( require ) {

// Do an initial layout, but the subclasses can and should move the
// buttons as needed.
this.setButtonCenter(layoutBounds.width * 0.75, layoutBounds.height * 0.8 );
this.setButtonCenter( layoutBounds.width * 0.75, layoutBounds.height * 0.8 );
faceNode.centerX = layoutBounds.width / 2;
faceNode.centerY = layoutBounds.height / 2;
}
Expand All @@ -160,13 +160,13 @@ define( function( require ) {
checkAnswer: function() {},

// Function to set the location of all buttons.
setButtonCenter : function( x, y ){
this.buttons.forEach( function( button ){
setButtonCenter: function( x, y ) {
this.buttons.forEach( function( button ) {
button.centerX = x;
button.centerY = y;
} );
}
}
}
);

return ProblemView;
Expand Down
16 changes: 8 additions & 8 deletions js/game/view/StartSubGameNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ define( function( require ) {

Node.call( this ); // Call super constructor.

var periodicTableGameButton = new GameStartButton( 'Periodic Table Game', function(){
gameModel.startSubGame( 'periodicTableGame');
var periodicTableGameButton = new GameStartButton( 'Periodic Table Game', function() {
gameModel.startSubGame( 'periodicTableGame' );
} );
this.addChild( periodicTableGameButton );
var massAndChangeGameButton = new GameStartButton( 'Mass And Change Game', function(){
gameModel.startSubGame( 'massAndChargeGame');
var massAndChangeGameButton = new GameStartButton( 'Mass And Change Game', function() {
gameModel.startSubGame( 'massAndChargeGame' );
} );
this.addChild( massAndChangeGameButton );
var symbolGameButton = new GameStartButton( 'Symbol Game', function(){
gameModel.startSubGame( 'symbolGame');
var symbolGameButton = new GameStartButton( 'Symbol Game', function() {
gameModel.startSubGame( 'symbolGame' );
} );
this.addChild( symbolGameButton );
var advancedSymbolGameButton = new GameStartButton( 'Advanced Symbol Game', function(){
gameModel.startSubGame( 'advancedSymbolGame');
var advancedSymbolGameButton = new GameStartButton( 'Advanced Symbol Game', function() {
gameModel.startSubGame( 'advancedSymbolGame' );
} );
this.addChild( advancedSymbolGameButton );
var ySpacing = layoutBounds.height / 5;
Expand Down
10 changes: 5 additions & 5 deletions js/game/view/SubGameOverNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ define( function( require ) {

Node.call( this ); // Call super constructor.

var gameOverText = new Text('Game Completed', {font: new BAAFont(20)});
var gameOverText = new Text( 'Game Completed', {font: new BAAFont( 20 )} );
this.addChild( gameOverText );

var doneButton = new RectangleButton( new Text( 'OK', { font: new BAAFont( 24 ) } ),
function() {
gameModel.state = 'selectSubGame';
},
{ fill: 'orange'} );
function() {
gameModel.state = 'selectSubGame';
},
{ fill: 'orange'} );
this.addChild( doneButton );

// Layout
Expand Down
2 changes: 1 addition & 1 deletion js/symbol/view/SymbolTabView.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ define( function( require ) {
this.addChild( symbolBox );

// Add additional reset functionality.
this.resetFunctions.push( function(){ symbolBox.open.reset(); } );
this.resetFunctions.push( function() { symbolBox.open.reset(); } );

// Do the layout.
symbolBox.top = this.periodicTableBox.top + this.periodicTableBox.openHeight + 10;
Expand Down

0 comments on commit d7142de

Please sign in to comment.