Skip to content

Commit

Permalink
Add repo to migration list, see phetsims/chipper#875
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 27, 2020
1 parent 62a818b commit 4fa5d86
Show file tree
Hide file tree
Showing 58 changed files with 3,532 additions and 3,339 deletions.
48 changes: 41 additions & 7 deletions arithmetic_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@

<script type="text/javascript">

window.phet = window.phet || {};
window.phet.chipper = window.phet.chipper || {};
window.phet.chipper.packageObject = {
"name": "arithmetic",
"version": "1.1.0-dev.3",
"license": "GPL-3.0",
"repository": { "type": "git", "url": "https://github.com/phetsims/arithmetic.git" },
"devDependencies": { "grunt": "~1.0.0" },
"phet": {
"requirejsNamespace": "ARITHMETIC",
"phetLibs": [ "twixt", "vegas" ],
"runnable": true,
"supportedBrands": [ "phet", "adapted-from-phet", "phet-io" ],
"supportsSound": true,
"simulation": true,
"phet-io": { "wrappers": [ "phet-io-wrapper-arithmetic" ] }
},
"eslintConfig": { "extends": "../chipper/eslint/sim_eslintrc.js" }
};
window.phet.chipper.stringRepos = [ { "repo": "arithmetic", "requirejsNamespace": "ARITHMETIC" }, {
"repo": "joist",
"requirejsNamespace": "JOIST"
}, { "repo": "scenery-phet", "requirejsNamespace": "SCENERY_PHET" }, {
"repo": "sun",
"requirejsNamespace": "SUN"
}, { "repo": "tambo", "requirejsNamespace": "TAMBO" }, {
"repo": "twixt",
"requirejsNamespace": "TWIXT"
}, { "repo": "vegas", "requirejsNamespace": "VEGAS" } ];

// 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';
Expand All @@ -28,6 +58,7 @@
// Preloads, with more included for phet-io brand
let preloads = [
'../sherpa/lib/mdn-array-from-polyfill.js',
'../sherpa/lib/es6-promise-1e68dc.auto.min.js',
'../joist/js/splash.js',
'../sherpa/lib/jquery-2.1.0.js',
'../sherpa/lib/lodash-4.17.4.js',
Expand Down Expand Up @@ -55,25 +86,28 @@
] );
}

// TODO: es6 modules won't need a "main" param in this function
// 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 loadURL = ( preloadURL, type = 'text/javascript' ) => {
const script = document.createElement( 'script' );
if ( typeof main === 'string' ) {
script.setAttribute( 'data-main', main );
}
script.type = 'text/javascript';
script.type = type;
script.src = preloadURL + queryAppend;
script.async = false;
document.head.appendChild( script );
};

// Kick off string loading immediately
loadURL( '../chipper/js/load-runtime-strings.js' );

// Queue all of the preloads to be loaded.
preloads.forEach( loadURL );
preloads.forEach( preload => loadURL( preload ) );

loadURL( '../sherpa/lib/require-2.3.6.js', 'js/arithmetic-config.js' );
// Module loading in compilation-free (development) mode will be kicked off once strings are loaded.
// This is done in load-runtime-strings.js
window.phet.chipper.loadModules = () => loadURL( 'js/arithmetic-main.js', 'module' );
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions images/large-pointing-hand_png.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions images/small-pointing-hand_png.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions js/arithmetic-config.js

This file was deleted.

57 changes: 27 additions & 30 deletions js/arithmetic-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,36 @@
*
* @author John Blanco, Andrey Zelenkov (MLearner)
*/
define( require => {
'use strict';

// modules
const DivideScreen = require( 'ARITHMETIC/divide/DivideScreen' );
const FactorScreen = require( 'ARITHMETIC/factor/FactorScreen' );
const MultiplyScreen = require( 'ARITHMETIC/multiply/MultiplyScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const Tandem = require( 'TANDEM/Tandem' );
import Sim from '../../joist/js/Sim.js';
import SimLauncher from '../../joist/js/SimLauncher.js';
import Tandem from '../../tandem/js/Tandem.js';
import arithmeticStrings from './arithmetic-strings.js';
import DivideScreen from './divide/DivideScreen.js';
import FactorScreen from './factor/FactorScreen.js';
import MultiplyScreen from './multiply/MultiplyScreen.js';

// strings and images
const arithmeticTitleString = require( 'string!ARITHMETIC/arithmetic.title' );
// strings and images
const arithmeticTitleString = arithmeticStrings.arithmetic.title;

// constants
const tandem = Tandem.ROOT;
// constants
const tandem = Tandem.ROOT;

const simOptions = {
credits: {
leadDesign: 'Michael Dubson, Amanda McGarry',
softwareDevelopment: 'John Blanco, Michael Dubson',
team: 'Bryce Gruneich, Karina K. R. Hensberry, Trish Loeblein, Ariel Paul, Kathy Perkins, Beth Stade',
qualityAssurance: 'Steele Dalton, Bryce Griebenow, Elise Morgan, Oliver Orejola, Ben Roberts, Bryan Yoelin',
thanks: 'Thanks to Mobile Learner Labs for working with the PhET development team to convert this simulation to HTML5.'
}
};
const simOptions = {
credits: {
leadDesign: 'Michael Dubson, Amanda McGarry',
softwareDevelopment: 'John Blanco, Michael Dubson',
team: 'Bryce Gruneich, Karina K. R. Hensberry, Trish Loeblein, Ariel Paul, Kathy Perkins, Beth Stade',
qualityAssurance: 'Steele Dalton, Bryce Griebenow, Elise Morgan, Oliver Orejola, Ben Roberts, Bryan Yoelin',
thanks: 'Thanks to Mobile Learner Labs for working with the PhET development team to convert this simulation to HTML5.'
}
};

SimLauncher.launch( function() {
// Create and start the sim
new Sim( arithmeticTitleString, [
new MultiplyScreen( { tandem: tandem.createTandem( 'multiplyScreen' ) } ),
new FactorScreen( { tandem: tandem.createTandem( 'factorScreen' ) } ),
new DivideScreen( { tandem: tandem.createTandem( 'divideScreen' ) } )
], simOptions ).start();
} );
SimLauncher.launch( function() {
// Create and start the sim
new Sim( arithmeticTitleString, [
new MultiplyScreen( { tandem: tandem.createTandem( 'multiplyScreen' ) } ),
new FactorScreen( { tandem: tandem.createTandem( 'factorScreen' ) } ),
new DivideScreen( { tandem: tandem.createTandem( 'divideScreen' ) } )
], simOptions ).start();
} );
14 changes: 14 additions & 0 deletions js/arithmetic-strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2020, University of Colorado Boulder

/**
* Auto-generated from modulify, DO NOT manually modify.
*/

import getStringModule from '../../chipper/js/getStringModule.js';
import arithmetic from './arithmetic.js';

const arithmeticStrings = getStringModule( 'ARITHMETIC' );

arithmetic.register( 'arithmeticStrings', arithmeticStrings );

export default arithmeticStrings;
8 changes: 2 additions & 6 deletions js/arithmetic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
*
* @author John Blanco
*/
define( require => {
'use strict';

// modules
const Namespace = require( 'PHET_CORE/Namespace' );
import Namespace from '../../phet-core/js/Namespace.js';

return new Namespace( 'arithmetic' );
} );
export default new Namespace( 'arithmetic' );
35 changes: 15 additions & 20 deletions js/common/ArithmeticConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@
* @author Andrey Zelenkov (MLearner)
*/

define( require => {
'use strict';
import Screen from '../../../joist/js/Screen.js';
import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import arithmetic from '../arithmetic.js';

// modules
const arithmetic = require( 'ARITHMETIC/arithmetic' );
const PhetFont = require( 'SCENERY_PHET/PhetFont' );
const Screen = require( 'JOIST/Screen' );
const ArithmeticConstants = {
BACKGROUND_COLOR: 'rgb( 173, 202, 255 )',
CURSOR_BLINK_INTERVAL: 500, // duration of animation in milliseconds
EQUATION_FONT_TEXT: new PhetFont( { size: 32 } ),
ICON_BACKGROUND_COLOR: 'rgb( 173, 202, 255 )',
INPUT_LENGTH_MAX: 3, // max input length
SCREEN_ICON_SIZE: Screen.MINIMUM_HOME_SCREEN_ICON_SIZE, // size of screen icons
NUM_STARS: 5, // number of stars in select level buttons
WORKSPACE_BACKGROUND_COLOR: 'rgb(130,181,252)'
};

const ArithmeticConstants = {
BACKGROUND_COLOR: 'rgb( 173, 202, 255 )',
CURSOR_BLINK_INTERVAL: 500, // duration of animation in milliseconds
EQUATION_FONT_TEXT: new PhetFont( { size: 32 } ),
ICON_BACKGROUND_COLOR: 'rgb( 173, 202, 255 )',
INPUT_LENGTH_MAX: 3, // max input length
SCREEN_ICON_SIZE: Screen.MINIMUM_HOME_SCREEN_ICON_SIZE, // size of screen icons
NUM_STARS: 5, // number of stars in select level buttons
WORKSPACE_BACKGROUND_COLOR: 'rgb(130,181,252)'
};
arithmetic.register( 'ArithmeticConstants', ArithmeticConstants );

arithmetic.register( 'ArithmeticConstants', ArithmeticConstants );

return ArithmeticConstants;
} );
export default ArithmeticConstants;
19 changes: 7 additions & 12 deletions js/common/ArithmeticGlobals.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@
* @author John Blanco
*/

define( require => {
'use strict';
import Property from '../../../axon/js/Property.js';
import arithmetic from '../arithmetic.js';

// modules
const arithmetic = require( 'ARITHMETIC/arithmetic' );
const Property = require( 'AXON/Property' );
const ArithmeticGlobals = {
timerEnabledProperty: new Property( false )
};

const ArithmeticGlobals = {
timerEnabledProperty: new Property( false )
};
arithmetic.register( 'ArithmeticGlobals', ArithmeticGlobals );

arithmetic.register( 'ArithmeticGlobals', ArithmeticGlobals );

return ArithmeticGlobals;
} );
export default ArithmeticGlobals;
Loading

0 comments on commit 4fa5d86

Please sign in to comment.