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 245f05c commit 3574de7
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 89 deletions.
51 changes: 44 additions & 7 deletions area-model-algebra_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@

<script type="text/javascript">

window.phet = window.phet || {};
window.phet.chipper = window.phet.chipper || {};
window.phet.chipper.packageObject = {
"name": "area-model-algebra",
"version": "1.3.0-dev.0",
"license": "GPL-3.0",
"repository": { "type": "git", "url": "https://github.com/phetsims/area-model-algebra.git" },
"devDependencies": { "grunt": "~1.0.0" },
"phet": {
"colorProfile": true,
"requirejsNamespace": "AREA_MODEL_ALGEBRA",
"phetLibs": [ "area-model-common", "twixt", "vegas" ],
"runnable": true,
"supportedBrands": [ "phet", "adapted-from-phet" ],
"supportsSound": true,
"simulation": true
},
"eslintConfig": { "extends": "../chipper/eslint/sim_eslintrc.js" }
};
window.phet.chipper.stringRepos = [ {
"repo": "area-model-algebra",
"requirejsNamespace": "AREA_MODEL_ALGEBRA"
}, { "repo": "area-model-common", "requirejsNamespace": "AREA_MODEL_COMMON" }, {
"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 +61,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 +89,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/area-model-algebra-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/area-model-algebra-main.js', 'module' );
</script>
</body>
</html>
52 changes: 0 additions & 52 deletions js/area-model-algebra-config.js

This file was deleted.

56 changes: 26 additions & 30 deletions js/area-model-algebra-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,33 @@
*
* @author Jonathan Olson <[email protected]>
*/
define( require => {
'use strict';

// modules
const ExploreScreen = require( 'AREA_MODEL_COMMON/screens/ExploreScreen' );
const GenericScreen = require( 'AREA_MODEL_COMMON/screens/GenericScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const VariablesGameScreen = require( 'AREA_MODEL_COMMON/screens/VariablesGameScreen' );
const VariablesScreen = require( 'AREA_MODEL_COMMON/screens/VariablesScreen' );
import ExploreScreen from '../../area-model-common/js/screens/ExploreScreen.js';
import GenericScreen from '../../area-model-common/js/screens/GenericScreen.js';
import VariablesGameScreen from '../../area-model-common/js/screens/VariablesGameScreen.js';
import VariablesScreen from '../../area-model-common/js/screens/VariablesScreen.js';
import Sim from '../../joist/js/Sim.js';
import SimLauncher from '../../joist/js/SimLauncher.js';
import areaModelAlgebraStrings from './area-model-algebra-strings.js';

// strings
const areaModelAlgebraTitleString = require( 'string!AREA_MODEL_ALGEBRA/area-model-algebra.title' );
const areaModelAlgebraTitleString = areaModelAlgebraStrings[ 'area-model-algebra' ].title;

const simOptions = {
credits: {
leadDesign: 'Amy Hanson, Amanda McGarry',
softwareDevelopment: 'Jonathan Olson',
team: 'Karina Hensberry, Susan Miller, Ariel Paul, Kathy Perkins, Oliver Nix',
qualityAssurance: 'Steele Dalton, Bryce Griebenow, Ethan Johnson, Liam Mulhall, Ben Roberts, Jacob Romero, Ethan Ward, Clara Wilson, Kathryn Woessner',
graphicArts: 'Mariah Hermsmeyer, Amanda McGarry, Diana L\u00f3pez Tavares'
}
};
const simOptions = {
credits: {
leadDesign: 'Amy Hanson, Amanda McGarry',
softwareDevelopment: 'Jonathan Olson',
team: 'Karina Hensberry, Susan Miller, Ariel Paul, Kathy Perkins, Oliver Nix',
qualityAssurance: 'Steele Dalton, Bryce Griebenow, Ethan Johnson, Liam Mulhall, Ben Roberts, Jacob Romero, Ethan Ward, Clara Wilson, Kathryn Woessner',
graphicArts: 'Mariah Hermsmeyer, Amanda McGarry, Diana L\u00f3pez Tavares'
}
};

SimLauncher.launch( function() {
const sim = new Sim( areaModelAlgebraTitleString, [
new ExploreScreen(),
new GenericScreen(),
new VariablesScreen(),
new VariablesGameScreen()
], simOptions );
sim.start();
} );
} );
SimLauncher.launch( function() {
const sim = new Sim( areaModelAlgebraTitleString, [
new ExploreScreen(),
new GenericScreen(),
new VariablesScreen(),
new VariablesGameScreen()
], simOptions );
sim.start();
} );
14 changes: 14 additions & 0 deletions js/area-model-algebra-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 areaModelAlgebra from './areaModelAlgebra.js';

const areaModelAlgebraStrings = getStringModule( 'AREA_MODEL_ALGEBRA' );

areaModelAlgebra.register( 'areaModelAlgebraStrings', areaModelAlgebraStrings );

export default areaModelAlgebraStrings;
10 changes: 10 additions & 0 deletions js/areaModelAlgebra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2020, University of Colorado Boulder

/**
* Creates the namespace for this simulation.
*/

// modules
import Namespace from '../../phet-core/js/Namespace.js';

export default new Namespace( 'areaModelAlgebra' );

0 comments on commit 3574de7

Please sign in to comment.