<commit_before>(function(module) {

  iconContext = {};

  iconContext.weatherIcons = [
    {
      conditionText : 'Light Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Snow Grains',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow Grains',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Crystals',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Ice Crystals',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Pellets',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Ice Pellets',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Mist',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Mist',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Fog Patches',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Fog Patches',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Smoke',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Smoke',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Volcanic Ash',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Volcanic Ash',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Haze',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Haze',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Spray',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Spray',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Dust Whirls',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Dust Whirls',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Sandstorm',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Sandstorm',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Low Drifting Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Low Drifting Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Low Drifting Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Blowing Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Blowing Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Blowing Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Blowing Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Blowing Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Blowing Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Rain Mist',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Rain Mist',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Rain Showers',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Rain Showers',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Snow Showers',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Show Showers',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Snow Blowing Snow Mist',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow Blowing Snow Mist',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Pellet Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Ice Pellet Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Small Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Small Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Thunderstorm',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorm',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Rain',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Rain',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Snow',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Snow',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Ice Pellets',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Ice Pellets',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms with Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms with Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms with Small Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms with Small Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Freezing Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Freezing Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Freezing Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Freezing Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Freezing Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Freezing Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Patches of Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Shallow Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Partial Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Overcast',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Clear',
      conditionIcon : 'img/weather/Sun.svg'
    },
    {
      conditionText : 'Partly Cloudy',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Mostly Cloudy',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Scattered Clouds',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Small Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Squalls',
      conditionIcon : 'img/weather/Windy.svg'
    },
    {
      conditionText : 'Funnel Clouds',
      conditionIcon : 'img/weather/Tornado.svg'
    },
    {
      conditionText : 'Unknown Precipitation',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Unknown',
      conditionIcon : 'img/weather/Shades.svg'
    }
  ];

  module.iconContext = iconContext;
})(window);
<commit_msg>adding in the non-light, non-heavy weather conditions that the API documentation omitted<commit_after>(function(module) {

  iconContext = {};

  iconContext.weatherIcons = [
    {
      conditionText : 'Light Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Snow Grains',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Snow Grains',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow Grains',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Crystals',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Ice Crystals',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Ice Crystals',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Pellets',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Ice Pellets',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Ice Pellets',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Mist',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Mist',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Mist',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Fog Patches',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Fog Patches',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Fog Patches',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Smoke',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Smoke',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Smoke',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Volcanic Ash',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Volcanic Ash',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Volcanic Ash',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Haze',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Haze',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Haze',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Spray',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Spray',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Spray',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Light Dust Whirls',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Dust Whirls',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Dust Whirls',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Sandstorm',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Sandstorm',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Sandstorm',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Low Drifting Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Low Drifting Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Low Drifting Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Low Drifting Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Low Drifting Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Low Drifting Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Low Drifting Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Blowing Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Blowing Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Blowing Snow',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Blowing Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Blowing Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Blowing Widespread Dust',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Blowing Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Blowing Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Heavy Blowing Sand',
      conditionIcon : 'img/weather/Smoke.svg'
    },
    {
      conditionText : 'Light Rain Mist',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Rain Mist',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Rain Mist',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Rain Showers',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Rain Showers',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Rain Showers',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Snow Showers',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Snow Showers',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Show Showers',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Snow Blowing Snow Mist',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Snow Blowing Snow Mist',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Heavy Snow Blowing Snow Mist',
      conditionIcon : 'img/weather/Snow.svg'
    },
    {
      conditionText : 'Light Ice Pellet Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Ice Pellet Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Ice Pellet Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Small Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Small Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Heavy Small Hail Showers',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Light Thunderstorm',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorm',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorm',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Rain',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorms and Rain',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Rain',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Snow',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorms and Snow',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Snow',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms and Ice Pellets',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorms and Ice Pellets',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms and Ice Pellets',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms with Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorms with Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms with Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Thunderstorms with Small Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Thunderstorms with Small Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Heavy Thunderstorms with Small Hail',
      conditionIcon : 'img/weather/Lightening.svg'
    },
    {
      conditionText : 'Light Freezing Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Freezing Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Heavy Freezing Drizzle',
      conditionIcon : 'img/weather/Drizzle.svg'
    },
    {
      conditionText : 'Light Freezing Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Freezing Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Heavy Freezing Rain',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Light Freezing Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Freezing Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Heavy Freezing Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Patches of Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Shallow Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Partial Fog',
      conditionIcon : 'img/weather/Fog.svg'
    },
    {
      conditionText : 'Overcast',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Clear',
      conditionIcon : 'img/weather/Sun.svg'
    },
    {
      conditionText : 'Partly Cloudy',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Mostly Cloudy',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Scattered Clouds',
      conditionIcon : 'img/weather/Overcast.svg'
    },
    {
      conditionText : 'Small Hail',
      conditionIcon : 'img/weather/Hail.svg'
    },
    {
      conditionText : 'Squalls',
      conditionIcon : 'img/weather/Windy.svg'
    },
    {
      conditionText : 'Funnel Clouds',
      conditionIcon : 'img/weather/Tornado.svg'
    },
    {
      conditionText : 'Unknown Precipitation',
      conditionIcon : 'img/weather/Rain.svg'
    },
    {
      conditionText : 'Unknown',
      conditionIcon : 'img/weather/Shades.svg'
    }
  ];

  module.iconContext = iconContext;
})(window);
<|endoftext|>


<commit_before>var format = {

  fixFloatingPoint: function(n) {
    return parseFloat(n.toFixed(3));
  },

  percentage: function(f) {
    if (isNaN(f)) {
      return '-- %';
    }
    else {
      return parseInt(Math.round(f * 100), 10) + '%';
    }
  }

};

module.exports = format;
<commit_msg>add function to format milliseconds-in-24-hours value as a hour string - e.g., '12:00 am'<commit_after>var d3 = require('../../lib/').d3;

var format = {

  MS_IN_24: 86400000,

  fixFloatingPoint: function(n) {
    return parseFloat(n.toFixed(3));
  },

  percentage: function(f) {
    if (isNaN(f)) {
      return '-- %';
    }
    else {
      return parseInt(Math.round(f * 100), 10) + '%';
    }
  },

  millisecondsAsTimeOfDay: function(i) {
    var d = new Date(i);
    return d3.time.format.utc('%-I:%M %p')(d);
  }

};

module.exports = format;
<|endoftext|>


<commit_before>var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
  entry: './src/js/aos.js',
  devtool: 'source-map',
  output: {
    path: './dist',
    publicPath: 'dist/',
    filename: 'aos.js',
    library: 'AOS',
    libraryTarget: 'umd',
    sourceMapFilename: '[file].map'
  },
  devServer: {
    contentBase: 'demo/'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader'
      },
      {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!sass-loader")
      }
    ]
  },
  plugins: [
    new ExtractTextPlugin('aos.css'),
    new webpack.optimize.UglifyJsPlugin()
  ]
}
<commit_msg>Adding autoprefixer to webpack config<commit_after>var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer');

module.exports = {
  entry: './src/js/aos.js',
  devtool: 'source-map',
  output: {
    path: './dist',
    publicPath: 'dist/',
    filename: 'aos.js',
    library: 'AOS',
    libraryTarget: 'umd',
    sourceMapFilename: '[file].map'
  },
  devServer: {
    contentBase: 'demo/'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader'
      },
      {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!sass-loader!postcss-loader")
      }
    ]
  },
  postcss: function (webpack) {
    return [
      autoprefixer
    ];
  },
  plugins: [
    new ExtractTextPlugin('aos.css'),
    new webpack.optimize.UglifyJsPlugin()
  ]
}
<|endoftext|>


<commit_before>'use strict';
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const webpack = require('webpack');
const CleanPlugin = require('clean-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const HtmlInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const HtmlPlugin = require('html-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// const SizePlugin = require('size-plugin');
// const WebpackDeepScopeAnalysisPlugin = require('webpack-deep-scope-plugin').default;

module.exports = function(env, argv) {
    env = env || {};
    env.production = Boolean(env.production);
    env.optimizeImages = env.production || Boolean(env.optimizeImages);
    env.copyClipboardyFallbacks = env.production || Boolean(env.copyClipboardyFallbacks);

    if (!env.copyClipboardyFallbacks && !fs.existsSync(path.resolve(__dirname, 'fallbacks'))) {
        env.copyClipboardyFallbacks = true;
    }

    return [getExtensionConfig(env), getUIConfig(env)];
};

function getExtensionConfig(env) {
    const clean = ['dist'];
    if (env.copyClipboardyFallbacks) {
        clean.push('fallbacks');
    }

    const plugins = [
        // https://github.com/GoogleChromeLabs/size-plugin/issues/12
        // new SizePlugin(),
        new CleanPlugin(clean, { verbose: false }),
        new webpack.IgnorePlugin(/^spawn-sync$/)
    ];

    if (env.copyClipboardyFallbacks) {
        plugins.push(
            // @ts-ignore
            new FileManagerPlugin({
                onEnd: [
                    {
                        copy: [
                            {
                                source: path.resolve(__dirname, 'node_modules/clipboardy/fallbacks'),
                                destination: 'fallbacks/'
                            }
                        ]
                    }
                ]
            })
        );
    }

    // if (env.production) {
    // plugins.push(new WebpackDeepScopeAnalysisPlugin());
    // }

    return {
        name: 'extension',
        entry: './src/extension.ts',
        mode: env.production ? 'production' : 'development',
        target: 'node',
        node: {
            __dirname: false
        },
        devtool: !env.production ? 'eval-source-map' : undefined,
        output: {
            libraryTarget: 'commonjs2',
            filename: 'extension.js',
            path: path.resolve(__dirname, 'dist'),
            devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]'
        },
        externals: {
            vscode: 'commonjs vscode'
        },
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    enforce: 'pre',
                    use: 'tslint-loader'
                },
                {
                    test: /\.tsx?$/,
                    use: 'ts-loader',
                    exclude: /node_modules/
                }
            ]
        },
        resolve: {
            extensions: ['.ts', '.tsx', '.js', '.jsx']
        },
        plugins: plugins,
        stats: {
            all: false,
            assets: true,
            builtAt: true,
            env: true,
            errors: true,
            timings: true,
            warnings: true
        }
    };
}

function getUIConfig(env) {
    const clean = ['settings.html', 'welcome.html'];
    if (env.optimizeImages) {
        console.log('Optimizing images (src/ui/images/settings/*.png)...');
        clean.push('images/settings');
    }

    const plugins = [
        // https://github.com/GoogleChromeLabs/size-plugin/issues/12
        // new SizePlugin(),
        new CleanPlugin(clean, { verbose: false }),
        new MiniCssExtractPlugin({
            filename: '[name].css'
        }),
        new HtmlPlugin({
            excludeAssets: [/.*\.main\.js/],
            excludeChunks: ['welcome'],
            template: 'settings/index.html',
            filename: path.resolve(__dirname, 'settings.html'),
            inject: true,
            inlineSource: env.production ? '.(js|css)$' : undefined,
            // inlineSource: '.(js|css)$',
            minify: env.production
                ? {
                      removeComments: true,
                      collapseWhitespace: true,
                      removeRedundantAttributes: true,
                      useShortDoctype: true,
                      removeEmptyAttributes: true,
                      removeStyleLinkTypeAttributes: true,
                      keepClosingSlash: true
                  }
                : false
        }),
        new HtmlPlugin({
            excludeAssets: [/.*\.main\.js/],
            excludeChunks: ['settings'],
            template: 'welcome/index.html',
            filename: path.resolve(__dirname, 'welcome.html'),
            inject: true,
            inlineSource: env.production ? '.(js|css)$' : undefined,
            // inlineSource: '.(js|css)$',
            minify: env.production
                ? {
                      removeComments: true,
                      collapseWhitespace: true,
                      removeRedundantAttributes: true,
                      useShortDoctype: true,
                      removeEmptyAttributes: true,
                      removeStyleLinkTypeAttributes: true,
                      keepClosingSlash: true
                  }
                : false
        }),
        new HtmlInlineSourcePlugin(),
        new ImageminPlugin({
            disable: !env.optimizeImages,
            externalImages: {
                context: path.resolve(__dirname, 'src/ui/images'),
                sources: glob.sync('src/ui/images/settings/*.png'),
                destination: path.resolve(__dirname, 'images')
            },
            cacheFolder: path.resolve(__dirname, '.cache-images'),
            gifsicle: null,
            jpegtran: null,
            optipng: null,
            pngquant: {
                quality: '85-100',
                speed: env.production ? 1 : 10
            },
            svgo: null
        })
    ];

    // if (env.production) {
    // plugins.push(new WebpackDeepScopeAnalysisPlugin());
    // }

    return {
        name: 'ui',
        context: path.resolve(__dirname, 'src/ui'),
        // This is ugly having main.scss on both bundles, but if it is added separately it will generate a js bundle :(
        entry: {
            settings: ['./settings/index.ts', './scss/main.scss'],
            welcome: ['./welcome/index.ts', './scss/main.scss']
            // main: ['./scss/main.scss']
        },
        mode: env.production ? 'production' : 'development',
        devtool: !env.production ? 'eval-source-map' : undefined,
        output: {
            filename: '[name].js',
            path: path.resolve(__dirname, 'dist/ui'),
            publicPath: '{{root}}/dist/ui/'
        },
        optimization: {
            splitChunks: {
                cacheGroups: {
                    styles: {
                        name: 'styles',
                        test: /\.css$/,
                        chunks: 'all',
                        enforce: true
                    }
                }
            }
        },
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    enforce: 'pre',
                    use: [
                        {
                            loader: 'tslint-loader',
                            options: {
                                tsConfigFile: 'ui.tsconfig.json'
                            }
                        }
                    ]
                },
                {
                    test: /\.tsx?$/,
                    use: {
                        loader: 'ts-loader',
                        options: {
                            configFile: 'ui.tsconfig.json'
                        }
                    },
                    exclude: /node_modules/
                },
                {
                    test: /\.scss$/,
                    use: [
                        {
                            loader: MiniCssExtractPlugin.loader
                        },
                        {
                            loader: 'css-loader',
                            options: {
                                minimize: env.production,
                                sourceMap: !env.production,
                                url: false
                            }
                        },
                        {
                            loader: 'sass-loader',
                            options: {
                                sourceMap: !env.production
                            }
                        }
                    ],
                    exclude: /node_modules/
                }
            ]
        },
        resolve: {
            extensions: ['.ts', '.tsx', '.js', '.jsx'],
            modules: [path.resolve(__dirname, 'src/ui'), 'node_modules']
        },
        plugins: plugins,
        stats: {
            all: false,
            assets: true,
            builtAt: true,
            env: true,
            errors: true,
            timings: true,
            warnings: true
        }
    };
}
<commit_msg>Adds image optimization if folder is missing<commit_after>'use strict';
const fs = require('fs');
const glob = require('glob');
const path = require('path');
const webpack = require('webpack');
const CleanPlugin = require('clean-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const HtmlInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const HtmlPlugin = require('html-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// const SizePlugin = require('size-plugin');
// const WebpackDeepScopeAnalysisPlugin = require('webpack-deep-scope-plugin').default;

module.exports = function(env, argv) {
    env = env || {};
    env.production = Boolean(env.production);
    env.optimizeImages = env.production || Boolean(env.optimizeImages);
    env.copyClipboardyFallbacks = env.production || Boolean(env.copyClipboardyFallbacks);

    if (!env.optimizeImages && !fs.existsSync(path.resolve(__dirname, 'images/settings'))) {
        env.optimizeImages = true;
    }

    if (!env.copyClipboardyFallbacks && !fs.existsSync(path.resolve(__dirname, 'fallbacks'))) {
        env.copyClipboardyFallbacks = true;
    }

    return [getExtensionConfig(env), getUIConfig(env)];
};

function getExtensionConfig(env) {
    const clean = ['dist'];
    if (env.copyClipboardyFallbacks) {
        clean.push('fallbacks');
    }

    const plugins = [
        // https://github.com/GoogleChromeLabs/size-plugin/issues/12
        // new SizePlugin(),
        new CleanPlugin(clean, { verbose: false }),
        new webpack.IgnorePlugin(/^spawn-sync$/)
    ];

    if (env.copyClipboardyFallbacks) {
        plugins.push(
            // @ts-ignore
            new FileManagerPlugin({
                onEnd: [
                    {
                        copy: [
                            {
                                source: path.resolve(__dirname, 'node_modules/clipboardy/fallbacks'),
                                destination: 'fallbacks/'
                            }
                        ]
                    }
                ]
            })
        );
    }

    // if (env.production) {
    // plugins.push(new WebpackDeepScopeAnalysisPlugin());
    // }

    return {
        name: 'extension',
        entry: './src/extension.ts',
        mode: env.production ? 'production' : 'development',
        target: 'node',
        node: {
            __dirname: false
        },
        devtool: !env.production ? 'eval-source-map' : undefined,
        output: {
            libraryTarget: 'commonjs2',
            filename: 'extension.js',
            path: path.resolve(__dirname, 'dist'),
            devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]'
        },
        externals: {
            vscode: 'commonjs vscode'
        },
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    enforce: 'pre',
                    use: 'tslint-loader'
                },
                {
                    test: /\.tsx?$/,
                    use: 'ts-loader',
                    exclude: /node_modules/
                }
            ]
        },
        resolve: {
            extensions: ['.ts', '.tsx', '.js', '.jsx']
        },
        plugins: plugins,
        stats: {
            all: false,
            assets: true,
            builtAt: true,
            env: true,
            errors: true,
            timings: true,
            warnings: true
        }
    };
}

function getUIConfig(env) {
    const clean = ['settings.html', 'welcome.html'];
    if (env.optimizeImages) {
        console.log('Optimizing images (src/ui/images/settings/*.png)...');
        clean.push('images/settings');
    }

    const plugins = [
        // https://github.com/GoogleChromeLabs/size-plugin/issues/12
        // new SizePlugin(),
        new CleanPlugin(clean, { verbose: false }),
        new MiniCssExtractPlugin({
            filename: '[name].css'
        }),
        new HtmlPlugin({
            excludeAssets: [/.*\.main\.js/],
            excludeChunks: ['welcome'],
            template: 'settings/index.html',
            filename: path.resolve(__dirname, 'settings.html'),
            inject: true,
            inlineSource: env.production ? '.(js|css)$' : undefined,
            // inlineSource: '.(js|css)$',
            minify: env.production
                ? {
                      removeComments: true,
                      collapseWhitespace: true,
                      removeRedundantAttributes: true,
                      useShortDoctype: true,
                      removeEmptyAttributes: true,
                      removeStyleLinkTypeAttributes: true,
                      keepClosingSlash: true
                  }
                : false
        }),
        new HtmlPlugin({
            excludeAssets: [/.*\.main\.js/],
            excludeChunks: ['settings'],
            template: 'welcome/index.html',
            filename: path.resolve(__dirname, 'welcome.html'),
            inject: true,
            inlineSource: env.production ? '.(js|css)$' : undefined,
            // inlineSource: '.(js|css)$',
            minify: env.production
                ? {
                      removeComments: true,
                      collapseWhitespace: true,
                      removeRedundantAttributes: true,
                      useShortDoctype: true,
                      removeEmptyAttributes: true,
                      removeStyleLinkTypeAttributes: true,
                      keepClosingSlash: true
                  }
                : false
        }),
        new HtmlInlineSourcePlugin(),
        new ImageminPlugin({
            disable: !env.optimizeImages,
            externalImages: {
                context: path.resolve(__dirname, 'src/ui/images'),
                sources: glob.sync('src/ui/images/settings/*.png'),
                destination: path.resolve(__dirname, 'images')
            },
            cacheFolder: path.resolve(__dirname, '.cache-images'),
            gifsicle: null,
            jpegtran: null,
            optipng: null,
            pngquant: {
                quality: '85-100',
                speed: env.production ? 1 : 10
            },
            svgo: null
        })
    ];

    // if (env.production) {
    // plugins.push(new WebpackDeepScopeAnalysisPlugin());
    // }

    return {
        name: 'ui',
        context: path.resolve(__dirname, 'src/ui'),
        // This is ugly having main.scss on both bundles, but if it is added separately it will generate a js bundle :(
        entry: {
            settings: ['./settings/index.ts', './scss/main.scss'],
            welcome: ['./welcome/index.ts', './scss/main.scss']
            // main: ['./scss/main.scss']
        },
        mode: env.production ? 'production' : 'development',
        devtool: !env.production ? 'eval-source-map' : undefined,
        output: {
            filename: '[name].js',
            path: path.resolve(__dirname, 'dist/ui'),
            publicPath: '{{root}}/dist/ui/'
        },
        optimization: {
            splitChunks: {
                cacheGroups: {
                    styles: {
                        name: 'styles',
                        test: /\.css$/,
                        chunks: 'all',
                        enforce: true
                    }
                }
            }
        },
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    enforce: 'pre',
                    use: [
                        {
                            loader: 'tslint-loader',
                            options: {
                                tsConfigFile: 'ui.tsconfig.json'
                            }
                        }
                    ]
                },
                {
                    test: /\.tsx?$/,
                    use: {
                        loader: 'ts-loader',
                        options: {
                            configFile: 'ui.tsconfig.json'
                        }
                    },
                    exclude: /node_modules/
                },
                {
                    test: /\.scss$/,
                    use: [
                        {
                            loader: MiniCssExtractPlugin.loader
                        },
                        {
                            loader: 'css-loader',
                            options: {
                                minimize: env.production,
                                sourceMap: !env.production,
                                url: false
                            }
                        },
                        {
                            loader: 'sass-loader',
                            options: {
                                sourceMap: !env.production
                            }
                        }
                    ],
                    exclude: /node_modules/
                }
            ]
        },
        resolve: {
            extensions: ['.ts', '.tsx', '.js', '.jsx'],
            modules: [path.resolve(__dirname, 'src/ui'), 'node_modules']
        },
        plugins: plugins,
        stats: {
            all: false,
            assets: true,
            builtAt: true,
            env: true,
            errors: true,
            timings: true,
            warnings: true
        }
    };
}
<|endoftext|>


<commit_before>// Copyright 2014-2015, University of Colorado Boulder

/**
 * Demonstration of scenery-phet buttons
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var EyeToggleButton = require( 'SCENERY_PHET/buttons/EyeToggleButton' );
  var inherit = require( 'PHET_CORE/inherit' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var Property = require( 'AXON/Property' );
  var RefreshButton = require( 'SCENERY_PHET/buttons/RefreshButton' );
  var ResetAllButton = require( 'SCENERY_PHET/buttons/ResetAllButton' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var SoundToggleButton = require( 'SCENERY_PHET/buttons/SoundToggleButton' );
  var StarButton = require( 'SCENERY_PHET/buttons/StarButton' );
  var Text = require( 'SCENERY/nodes/Text' );
  var TimerToggleButton = require( 'SCENERY_PHET/buttons/TimerToggleButton' );
  var sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );

  // constants
  var BUTTON_CAPTION_FONT = new PhetFont( 12 );
  var BUTTON_CAPTION_SPACING = 10; // space between buttons and their captions

  /**
   * @constructor
   */
  function ButtonsView() {
    ScreenView.call( this );

    // Refresh button
    var refreshButton = new RefreshButton( {
      listener: function() { console.log( 'Refresh pressed' ); },
      right: this.layoutBounds.width - 20,
      top: 10
    } );
    this.addChild( refreshButton );
    var refreshButtonLabel = new Text( 'Refresh: ', {
      font: BUTTON_CAPTION_FONT,
      right: refreshButton.left - 5,
      centerY: refreshButton.centerY
    } );
    this.addChild( refreshButtonLabel );

    // Return-to-level-selection button
    var returnToLevelSelectButton = new StarButton( {
      listener: function() { console.log( 'Return to Level Selection pressed' ); },
      centerX: refreshButton.centerX,
      top: refreshButton.bottom + BUTTON_CAPTION_SPACING
    } );
    this.addChild( returnToLevelSelectButton );
    var returnToLevelSelectButtonLabel = new Text( 'Return to Level Selection: ', {
      font: BUTTON_CAPTION_FONT,
      right: returnToLevelSelectButton.left - 5,
      centerY: returnToLevelSelectButton.centerY
    } );
    this.addChild( returnToLevelSelectButtonLabel );

    // Sound toggle button
    var soundEnableProperty = new Property( true );
    var soundToggleButton = new SoundToggleButton( soundEnableProperty, {
      centerX: refreshButton.centerX,
      top: returnToLevelSelectButton.bottom + BUTTON_CAPTION_SPACING * 5
    } );
    this.addChild( soundToggleButton );
    var soundToggleButtonLabel = new Text( 'Sound: ', {
      font: BUTTON_CAPTION_FONT,
      right: soundToggleButton.left - 5,
      centerY: soundToggleButton.centerY
    } );
    this.addChild( soundToggleButtonLabel );

    // Timer toggle button
    var timerEnableProperty = new Property( true );
    var timerToggleButton = new TimerToggleButton( timerEnableProperty, { centerX: refreshButton.centerX, y: soundToggleButton.bottom + 5 } );
    this.addChild( timerToggleButton );
    var timerToggleButtonLabel = new Text( 'Timer: ', {
      font: BUTTON_CAPTION_FONT,
      right: timerToggleButton.left - 5,
      centerY: timerToggleButton.centerY
    } );
    this.addChild( timerToggleButtonLabel );

    // Eye toggle
    var eyeToggleProperty = new Property( true );
    eyeToggleProperty.lazyLink( function( eyeToggle ) {
       console.log( 'eyeToggle=' + eyeToggle );
    } );
    var eyeToggleButton = new EyeToggleButton( eyeToggleProperty, {
      right: timerToggleButton.right,
      top: timerToggleButton.bottom + 5
    } );
    this.addChild( eyeToggleButton );

    // Reset All button
    var resetAllButton = new ResetAllButton( {
      listener: function() {
        soundEnableProperty.reset();
        timerEnableProperty.reset();
      },
      radius: 22,
      right:  this.layoutBounds.right - 10,
      bottom: this.layoutBounds.bottom - 10
    } );
    this.addChild( resetAllButton );
  }

  sceneryPhet.register( 'ButtonsView', ButtonsView );

  return inherit( ScreenView, ButtonsView );
} );<commit_msg>major cleanup of scenery-phet ButtonsView demo<commit_after>// Copyright 2014-2015, University of Colorado Boulder

/**
 * Demonstration of scenery-phet buttons
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var EyeToggleButton = require( 'SCENERY_PHET/buttons/EyeToggleButton' );
  var inherit = require( 'PHET_CORE/inherit' );
  var PropertySet = require( 'AXON/PropertySet' );
  var RefreshButton = require( 'SCENERY_PHET/buttons/RefreshButton' );
  var ResetAllButton = require( 'SCENERY_PHET/buttons/ResetAllButton' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var SoundToggleButton = require( 'SCENERY_PHET/buttons/SoundToggleButton' );
  var StarButton = require( 'SCENERY_PHET/buttons/StarButton' );
  var TimerToggleButton = require( 'SCENERY_PHET/buttons/TimerToggleButton' );
  var sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
  var VBox = require( 'SCENERY/nodes/VBox' );

  /**
   * @constructor
   */
  function ButtonsView() {

    ScreenView.call( this );

    var buttonProperties = new PropertySet( {
      soundEnabled: true,
      timerEnabled: true,
      eyeOpen: true
    } );

    // Refresh button
    var refreshButton = new RefreshButton( {
      listener: function() { console.log( 'RefreshButton pressed' ); }
    } );

    // Star button
    var starButton = new StarButton( {
      listener: function() { console.log( 'StarButton pressed' ); }
    } );

    // Sound toggle button
    var soundToggleButton = new SoundToggleButton( buttonProperties.soundEnabledProperty );
    buttonProperties.soundEnabledProperty.lazyLink( function( soundEnabled ) {
      console.log( 'soundEnabled=' + soundEnabled );
    } );

    // Timer toggle button
    var timerToggleButton = new TimerToggleButton( buttonProperties.timerEnabledProperty );
    buttonProperties.timerEnabledProperty.lazyLink( function( timerEnabled ) {
      console.log( 'timerEnabled=' + timerEnabled );
    } );

    // Eye toggle button
    var eyeToggleButton = new EyeToggleButton( buttonProperties.eyeOpenProperty );
    buttonProperties.eyeOpenProperty.lazyLink( function( eyeOpen ) {
      console.log( 'eyeOpen=' + eyeOpen );
    } );

    this.addChild( new VBox( {
      children: [
        refreshButton,
        starButton,
        soundToggleButton,
        timerToggleButton,
        eyeToggleButton
      ],
      spacing: 10,
      align: 'center',
      center: this.layoutBounds.center
    } ) );

    // Reset All button, in its usual lower-right position
    var resetAllButton = new ResetAllButton( {
      listener: function() {
        buttonProperties.reset();
      },
      radius: 22,
      right: this.layoutBounds.right - 10,
      bottom: this.layoutBounds.bottom - 10
    } );
    this.addChild( resetAllButton );
  }

  sceneryPhet.register( 'ButtonsView', ButtonsView );

  return inherit( ScreenView, ButtonsView );
} );<|endoftext|>


<commit_before>/*jslint vars: true, plusplus: true, devel: true, nomen: true, maxerr: 50, regexp: true, browser: true, white: true */
/*global $, google */

$(document).ready(function () {

	Array.prototype.contains = function (a) {
		var len = this.length,
			i;

		for (i = 0; i < len; i++) {
			if (this[i] === a) {
				return true;
			}
		}

		return false;
	};

	String.prototype.ucfirst = function () {
		return this.charAt(0).toUpperCase() + this.slice(1);
	};

	if ($('#btn-add-personnels').length) {
		$('#btn-add-personnels').click(function (e) {
			// prevent default action
			e.preventDefault();

			if ($('#team-members').length) {

				// create elements
				var colLeft = $('

'),
					colRight = $('

'),
					colAdmin = $('

'),
					clFormGroup = $('

'),
					clFormControl = $('<select></select>'),
					crFormGroup = $('

'),
					crFormControl = $('<select></select>'),
					caDelButton = $('');

				//set elements' attributes;
				colLeft.addClass('col-md-6');
				colRight.addClass('col-md-5');
				colAdmin.addClass('col-md-1');
				clFormGroup.addClass('form-group');
				clFormControl.addClass('form-control');
				clFormControl.attr('name', 'personnels[number][]');
				crFormGroup.addClass('form-group');
				crFormControl.addClass('form-control');
				crFormControl.attr('name', 'personnels[edu][]');
				caDelButton.addClass('btn btn-danger');
				caDelButton.text('X');

				clFormGroup.append(clFormControl);
				crFormGroup.append(crFormControl);

				colLeft.append(clFormGroup);
				colRight.append(crFormGroup);
				colAdmin.append(caDelButton);

				$('#team-members').append(colLeft, colRight, colAdmin);

				// get academic level
				$.getJSON('index.php?p=api&sp=akademik', function (data) {
					var i,
						fclFrag = $(document.createDocumentFragment()),
						fcrFrag = $(document.createDocumentFragment());

					for (i = 1; i <= 20; i++) {
						var options = $('<option></option>');
						options.attr('value', i);
						options.text(i + ' orang');
						fclFrag.append(options);
					}

					clFormControl.append(fclFrag);

					$.each(data, function(index, element) {
						var options = $('<option></option>');
						options.attr('value', element.key);
						options.text('lulus ' + element.value);
						fcrFrag.append(options);
					});

					crFormControl.append(fcrFrag);
				});

				caDelButton.one('click', function (e) {
					e.preventDefault();
					colLeft.remove();
					colRight.remove();
					colAdmin.remove();
				});
			}

		});
	}

	if ($('#btn-add-products').length) {

		var c = 1;

		$('#btn-add-products').click(function (e) {
			// prevent default action
			e.preventDefault();

			if ($('#products').length) {

				// create elements
				var today = new Date(),
					currentYear = today.getFullYear(),
					startYear = currentYear - 15,
					row = $('

'),
					colName = $('

'),
					colYear = $('

'),
					colPlatform = $('

'),
					colAdmin = $('

'),
					cnFormGroup = $('

'),
					cnFormControl = $('<input></input>'),
					cyFormGroup = $('

'),
					cyFormControl = $('<select></select>'),
					cyDocFrag = $(document.createDocumentFragment()),
					cpFormGroup = $('

'),
					cpDocFrag = $(document.createDocumentFragment()),
					cpWrapper = $('

'),
					caDelButton = $(''),
					platforms = ['desktop', 'mobile'],
					i;

				//set elements' attributes;
				row.addClass('row');
				colName.addClass('col-md-4');
				colYear.addClass('col-md-3');
				colPlatform.addClass('col-md-4');
				colAdmin.addClass('col-md-1');

				cnFormGroup.addClass('form-group');
				cnFormControl.addClass('form-control');
				cnFormControl.attr('type', 'text');
				cnFormControl.attr('placeholder', 'Judul karya');
				cnFormControl.attr('maxlength', 255);
				cnFormControl.attr('name', 'products[name][]');

				cyFormGroup.addClass('form-group');
				cyFormControl.addClass('form-control');
				cyFormControl.attr('name', 'products[year][]');
				// console.log(startYear);
				for (i = startYear; i <= currentYear; i++) {
					var options = $('<option></option>');
					options.attr('value', i);
					options.text(i);
					cyDocFrag.append(options);
				}

				cyFormControl.append(cyDocFrag);

				cpFormGroup.addClass('form-group');
				cpWrapper.addClass('checkbox');

				$.each(platforms, function(index, element) {
					var labels = $(''),
						inputs = $('<input></input>');

					labels.addClass('checkbox-inline');
					inputs.attr('type', 'checkbox');
					inputs.attr('value', element);
					inputs.attr('name', 'products[platform][' + c + '][]');

					labels.append(inputs).append(document.createTextNode(element.ucfirst()));

					cpDocFrag.append(labels);

				});

				cpWrapper.append(cpDocFrag);

				caDelButton.addClass('btn btn-danger');
				caDelButton.text('X');

				cnFormGroup.append(cnFormControl);
				cyFormGroup.append(cyFormControl);
				cpFormGroup.append(cpWrapper);

				colName.append(cnFormGroup);
				colYear.append(cyFormGroup);
				colPlatform.append(cpFormGroup);
				colAdmin.append(caDelButton);

				row.append(colName, colYear, colPlatform, colAdmin);
				$('#products').append(row);

				caDelButton.one('click', function (e) {
					e.preventDefault();
					colName.remove();
					colYear.remove();
					colPlatform.remove();
					colAdmin.remove();
					row.remove();
				});

				c++;
			}

		});
	}

	if ($('#btn-submit').length) {

		$('#btn-submit').click(function (e) {
			e.preventDefault();
			// var inputs = $('#the-survey').serializeArray();
			// console.log(inputs);

			var name = $('#txt-studio-name').val().trim(),
				location = $('#txt-studio-location').val().trim(),
				product = $('#txt-studio-products').val().trim(),
				publications = $('input[name^="publications"]'),
				checkPubCounter = 0,
				doValidate = false;

			// validate user's inputs
			if (doValidate) {
				if (name === '') {
					$('#txt-studio-name').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-name').parent().removeClass('has-error');
				}

				if (location === '') {
					$('#txt-studio-location').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-location').parent().removeClass('has-error');
				}

				if (product === '') {
					$('#txt-studio-products').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-products').parent().removeClass('has-error');
				}

				$.each(publications, function(index, element) {
					if (element.checked) {
						checkPubCounter++;
					}
				});

				if (checkPubCounter === 0) {
					$('input[name^="publications"]').parent().parent().addClass('has-error');
					return;
				} else {
					$('input[name^="publications"]').parent().parent().removeClass('has-error');
				}
			}

			// send data if okay
			$('#the-survey').submit();

		});

	}

});

if ($('#map').length) {

	function drawCharts() {
		drawDistributionMap();
		drawAcademicChart();

	}

	function drawAcademicChart() {
		$.getJSON('index.php?p=api&sp=curang&t=' + Date.now(), function (data) {
			// console.log(data);
			// create academic degree pie chart
			var personnelsDegrees = data.summaries.personnels.degree,
				arrDataAcademicDegree = [
					['Pendidikan', 'Pekerja']
				],
				dataAcademicDegree,
				degreeChart = new google.visualization.PieChart(document.getElementById('edu-degree')),
				degreeChartOptions = {
					chartArea : {
						height: '100%',
						width: '100%'
					},
					is3D: true
				};

				$.each(personnelsDegrees, function(index, element) {
					arrDataAcademicDegree.push([element.name, element.total]);
				});

			dataAcademicDegree = google.visualization.arrayToDataTable(arrDataAcademicDegree);

			degreeChart.draw(dataAcademicDegree, degreeChartOptions);

			// console.log(arrDataAcademicDegree);

		});
	}

	function drawDistributionMap() {
		$.getJSON('index.php?p=api&sp=curang&t=' + Date.now(), function (data) {

			var distinctYears = data.summaries.distinctStudioStartYears;

			function insertYearNavigation() {
				var navFrag = $(document.createDocumentFragment()),
					displayContent = function(year) {
						var allContents = data.summaries.studioDistributionsPerYear,
							selectedContents,
							map = new google.visualization.Map(document.getElementById('map')),
							mapData = [
								['Lat', 'Long']
							],
							mapOptions,
							googleMapData;

						$.each(allContents, function(index, element) {
							if (element.year === year) {
								selectedContents = element.location
							}
						});

						$.each(selectedContents, function(index, element) {
							// console.log(element);
							mapData.push([
								parseFloat(element.lat),
								parseFloat(element.lng)
							]);
						});

						googleMapData = google.visualization.arrayToDataTable(mapData);
						map.draw(googleMapData, mapOptions);

						// console.log(mapData);
					},
					selectYear = function(e) {
						e.preventDefault();
						var btn = $(this),
							items = $('.map-nav-links');

						$.each(items, function(index, element) {
							if (btn.text() === $(element).text()) {
								$(element).parent().addClass('active');
								displayContent(parseInt(btn.text(), 10));
							} else {
								$(element).parent().removeClass('active');
							}
						});
					};

				$.each(distinctYears, function(index, element) {
					var items = $('

'),
						links = $(''),
						isActive = (index === 0) ? ' active' : '';

					items.addClass('map-nav-items' + isActive);
					links.text(element);
					links.addClass('map-nav-links');
					links.attr('href', '#');

					items.append(links);
					navFrag.append(items);
					links.on('click', selectYear);
				});

				$('#map-nav').append(navFrag);

				displayContent(distinctYears[0]);
			}

			insertYearNavigation();

		});
	}

	google.load('visualization', '1', {packages:['corechart', 'map']});
	google.setOnLoadCallback(drawCharts);
}
<commit_msg>fixed parameter passed as string<commit_after>/*jslint vars: true, plusplus: true, devel: true, nomen: true, maxerr: 50, regexp: true, browser: true, white: true */
/*global $, google */

$(document).ready(function () {

	Array.prototype.contains = function (a) {
		var len = this.length,
			i;

		for (i = 0; i < len; i++) {
			if (this[i] === a) {
				return true;
			}
		}

		return false;
	};

	String.prototype.ucfirst = function () {
		return this.charAt(0).toUpperCase() + this.slice(1);
	};

	if ($('#btn-add-personnels').length) {
		$('#btn-add-personnels').click(function (e) {
			// prevent default action
			e.preventDefault();

			if ($('#team-members').length) {

				// create elements
				var colLeft = $('

'),
					colRight = $('

'),
					colAdmin = $('

'),
					clFormGroup = $('

'),
					clFormControl = $('<select></select>'),
					crFormGroup = $('

'),
					crFormControl = $('<select></select>'),
					caDelButton = $('');

				//set elements' attributes;
				colLeft.addClass('col-md-6');
				colRight.addClass('col-md-5');
				colAdmin.addClass('col-md-1');
				clFormGroup.addClass('form-group');
				clFormControl.addClass('form-control');
				clFormControl.attr('name', 'personnels[number][]');
				crFormGroup.addClass('form-group');
				crFormControl.addClass('form-control');
				crFormControl.attr('name', 'personnels[edu][]');
				caDelButton.addClass('btn btn-danger');
				caDelButton.text('X');

				clFormGroup.append(clFormControl);
				crFormGroup.append(crFormControl);

				colLeft.append(clFormGroup);
				colRight.append(crFormGroup);
				colAdmin.append(caDelButton);

				$('#team-members').append(colLeft, colRight, colAdmin);

				// get academic level
				$.getJSON('index.php?p=api&sp=akademik', function (data) {
					var i,
						fclFrag = $(document.createDocumentFragment()),
						fcrFrag = $(document.createDocumentFragment());

					for (i = 1; i <= 20; i++) {
						var options = $('<option></option>');
						options.attr('value', i);
						options.text(i + ' orang');
						fclFrag.append(options);
					}

					clFormControl.append(fclFrag);

					$.each(data, function(index, element) {
						var options = $('<option></option>');
						options.attr('value', element.key);
						options.text('lulus ' + element.value);
						fcrFrag.append(options);
					});

					crFormControl.append(fcrFrag);
				});

				caDelButton.one('click', function (e) {
					e.preventDefault();
					colLeft.remove();
					colRight.remove();
					colAdmin.remove();
				});
			}

		});
	}

	if ($('#btn-add-products').length) {

		var c = 1;

		$('#btn-add-products').click(function (e) {
			// prevent default action
			e.preventDefault();

			if ($('#products').length) {

				// create elements
				var today = new Date(),
					currentYear = today.getFullYear(),
					startYear = currentYear - 15,
					row = $('

'),
					colName = $('

'),
					colYear = $('

'),
					colPlatform = $('

'),
					colAdmin = $('

'),
					cnFormGroup = $('

'),
					cnFormControl = $('<input></input>'),
					cyFormGroup = $('

'),
					cyFormControl = $('<select></select>'),
					cyDocFrag = $(document.createDocumentFragment()),
					cpFormGroup = $('

'),
					cpDocFrag = $(document.createDocumentFragment()),
					cpWrapper = $('

'),
					caDelButton = $(''),
					platforms = ['desktop', 'mobile'],
					i;

				//set elements' attributes;
				row.addClass('row');
				colName.addClass('col-md-4');
				colYear.addClass('col-md-3');
				colPlatform.addClass('col-md-4');
				colAdmin.addClass('col-md-1');

				cnFormGroup.addClass('form-group');
				cnFormControl.addClass('form-control');
				cnFormControl.attr('type', 'text');
				cnFormControl.attr('placeholder', 'Judul karya');
				cnFormControl.attr('maxlength', 255);
				cnFormControl.attr('name', 'products[name][]');

				cyFormGroup.addClass('form-group');
				cyFormControl.addClass('form-control');
				cyFormControl.attr('name', 'products[year][]');
				// console.log(startYear);
				for (i = startYear; i <= currentYear; i++) {
					var options = $('<option></option>');
					options.attr('value', i);
					options.text(i);
					cyDocFrag.append(options);
				}

				cyFormControl.append(cyDocFrag);

				cpFormGroup.addClass('form-group');
				cpWrapper.addClass('checkbox');

				$.each(platforms, function(index, element) {
					var labels = $(''),
						inputs = $('<input></input>');

					labels.addClass('checkbox-inline');
					inputs.attr('type', 'checkbox');
					inputs.attr('value', element);
					inputs.attr('name', 'products[platform][' + c + '][]');

					labels.append(inputs).append(document.createTextNode(element.ucfirst()));

					cpDocFrag.append(labels);

				});

				cpWrapper.append(cpDocFrag);

				caDelButton.addClass('btn btn-danger');
				caDelButton.text('X');

				cnFormGroup.append(cnFormControl);
				cyFormGroup.append(cyFormControl);
				cpFormGroup.append(cpWrapper);

				colName.append(cnFormGroup);
				colYear.append(cyFormGroup);
				colPlatform.append(cpFormGroup);
				colAdmin.append(caDelButton);

				row.append(colName, colYear, colPlatform, colAdmin);
				$('#products').append(row);

				caDelButton.one('click', function (e) {
					e.preventDefault();
					colName.remove();
					colYear.remove();
					colPlatform.remove();
					colAdmin.remove();
					row.remove();
				});

				c++;
			}

		});
	}

	if ($('#btn-submit').length) {

		$('#btn-submit').click(function (e) {
			e.preventDefault();
			// var inputs = $('#the-survey').serializeArray();
			// console.log(inputs);

			var name = $('#txt-studio-name').val().trim(),
				location = $('#txt-studio-location').val().trim(),
				product = $('#txt-studio-products').val().trim(),
				publications = $('input[name^="publications"]'),
				checkPubCounter = 0,
				doValidate = false;

			// validate user's inputs
			if (doValidate) {
				if (name === '') {
					$('#txt-studio-name').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-name').parent().removeClass('has-error');
				}

				if (location === '') {
					$('#txt-studio-location').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-location').parent().removeClass('has-error');
				}

				if (product === '') {
					$('#txt-studio-products').parent().addClass('has-error');
					return;
				} else {
					$('#txt-studio-products').parent().removeClass('has-error');
				}

				$.each(publications, function(index, element) {
					if (element.checked) {
						checkPubCounter++;
					}
				});

				if (checkPubCounter === 0) {
					$('input[name^="publications"]').parent().parent().addClass('has-error');
					return;
				} else {
					$('input[name^="publications"]').parent().parent().removeClass('has-error');
				}
			}

			// send data if okay
			$('#the-survey').submit();

		});

	}

});

if ($('#map').length) {

	function drawCharts() {
		drawDistributionMap();
		drawAcademicChart();
	}

	function drawAcademicChart() {
		$.getJSON('index.php?p=api&sp=curang&t=' + Date.now(), function (data) {
			// console.log(data);
			// create academic degree pie chart
			var personnelsDegrees = data.summaries.personnels.degree,
				arrDataAcademicDegree = [
					['Pendidikan', 'Pekerja']
				],
				dataAcademicDegree,
				degreeChart = new google.visualization.PieChart(document.getElementById('edu-degree')),
				degreeChartOptions = {
					chartArea : {
						height: '100%',
						width: '100%'
					},
					is3D: true
				};

				$.each(personnelsDegrees, function(index, element) {
					arrDataAcademicDegree.push([element.name, element.total]);
				});

			dataAcademicDegree = google.visualization.arrayToDataTable(arrDataAcademicDegree);

			degreeChart.draw(dataAcademicDegree, degreeChartOptions);

			// console.log(arrDataAcademicDegree);

		});
	}

	function drawDistributionMap() {
		$.getJSON('index.php?p=api&sp=curang&t=' + Date.now(), function (data) {

			var distinctYears = data.summaries.distinctStudioStartYears;

			function insertYearNavigation() {
				var navFrag = $(document.createDocumentFragment()),
					displayContent = function(year) {
						var allContents = data.summaries.studioDistributionsPerYear,
							selectedContents,
							map = new google.visualization.Map(document.getElementById('map')),
							mapData = [
								['Lat', 'Long']
							],
							mapOptions,
							googleMapData;

						$.each(allContents, function(index, element) {

							if (element.year === year) {
								selectedContents = element.location
							}
						});

						$.each(selectedContents, function(index, element) {
							// console.log(element);
							mapData.push([
								parseFloat(element.lat),
								parseFloat(element.lng)
							]);
						});

						googleMapData = google.visualization.arrayToDataTable(mapData);
						map.draw(googleMapData, mapOptions);

						// console.log(mapData);
					},
					selectYear = function(e) {
						e.preventDefault();
						var btn = $(this),
							items = $('.map-nav-links');

						$.each(items, function(index, element) {
							if (btn.text() === $(element).text()) {
								$(element).parent().addClass('active');
								displayContent(parseInt(btn.text(), 10));
							} else {
								$(element).parent().removeClass('active');
							}
						});
					};

				$.each(distinctYears, function(index, element) {
					var items = $('

'),
						links = $(''),
						isActive = (index === 0) ? ' active' : '';

					items.addClass('map-nav-items' + isActive);
					links.text(element);
					links.addClass('map-nav-links');
					links.attr('href', '#');

					items.append(links);
					navFrag.append(items);
					links.on('click', selectYear);
				});

				$('#map-nav').append(navFrag);

				displayContent(parseInt(distinctYears[0], 10));
			}

			insertYearNavigation();

		});
	}

	google.load('visualization', '1', {packages:['corechart', 'map']});
	google.setOnLoadCallback(drawCharts);
}
<|endoftext|>


<commit_before>module.exports = require('./webpack.make.js')({
  prerender: false
});
<commit_msg>fix webpack renderer config<commit_after>module.exports = require('./webpack.make.js')({
  renderer: false
});
<|endoftext|>


<commit_before>// Copyright 2002-2014, University of Colorado Boulder

/**
 * Demonstration of scenery-phet sliders
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var ComboBox = require( 'SUN/ComboBox' );
  var HSlider = require( 'SUN/HSlider' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var NumberControl = require( 'SCENERY_PHET/NumberControl' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var Property = require( 'AXON/Property' );
  var Range = require( 'DOT/Range' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var Text = require( 'SCENERY/nodes/Text' );
  var WavelengthSlider = require( 'SCENERY_PHET/WavelengthSlider' );

  function SlidersView() {

    var thisView = this;
    ScreenView.call( this );

    // To add a demo, create an entry here.
    var demos = [
      { label: 'HSlider', node: demoHSlider( this.layoutBounds ) },
      { label: 'NumberControl', node: demoNumberControl( this.layoutBounds ) },
      { label: 'WavelengthSlider', node: demoWavelengthSlider( this.layoutBounds ) }
    ];

    // Sort the demos by label, so that they appear in the combo box in alphabetical order
    demos = _.sortBy( demos, function( demo ) {
      return demo.label;
    } );

    var comboBoxItems = [];

    demos.forEach( function( demo ) {

      // add demo to the combo box
      comboBoxItems.push( ComboBox.createItem( new Text( demo.label, { font: new PhetFont( 20 ) } ), demo.node ) );

      // add demo to the scenegraph
      thisView.addChild( demo.node );

      // demo is invisible until selected via the combo box
      demo.node.visible = false;
    } );

    // Parent for the combo box popup list
    var listParent = new Node();
    this.addChild( listParent );

    // Combo box for selecting which component to view
    var selectedDemoProperty = new Property( demos[ 0 ].node );
    var comboBox = new ComboBox( comboBoxItems, selectedDemoProperty, listParent, {
      buttonFill: 'rgb( 218, 236, 255 )',
      top: 20,
      left: 20
    } );
    this.addChild( comboBox );

    // Make the selected demo visible
    selectedDemoProperty.link( function( demo, oldDemo ) {
      if ( oldDemo ) { oldDemo.visible = false; }
      demo.visible = true;
    } );
  }

  // Creates a demo for HSlider
  var demoHSlider = function( layoutBounds ) {
    var hSliderProperty = new Property( 0 );
    return new HSlider( hSliderProperty, { min: 0, max: 100 }, {
      center: layoutBounds.center
    } );
  };

  // Creates a demo for NumberControl
  var demoNumberControl = function( layoutBounds ) {

    var weightRange = new Range( 0, 300, 100 );
    var weightProperty = new Property( weightRange.defaultValue );

    return new NumberControl( 'Weight:', weightProperty, weightRange, {
      titleFont: new PhetFont( 20 ),
      valueFont: new PhetFont( 20 ),
      units: 'lbs',
      majorTicks: [
        { value: weightRange.min, label: new Text( weightRange.min, new PhetFont( 20 ) ) },
        { value: weightRange.getCenter(), label: new Text( weightRange.getCenter(), new PhetFont( 20 ) ) },
        { value: weightRange.max, label: new Text( weightRange.max, new PhetFont( 20 ) ) }
      ],
      minorTickSpacing: 50,
      center: layoutBounds.center
    } );
  };

  // Creates a demo for WavelengthSlider
  var demoWavelengthSlider = function( layoutBounds ) {
    var wavelengthProperty = new Property( 500 );
    return new WavelengthSlider( wavelengthProperty, {
      center: layoutBounds.center
    } );
  };

  return inherit( ScreenView, SlidersView );
} );<commit_msg>#177 instantiate demos on demand for "Sliders" screen, set initial selection via 'slider' query parameter<commit_after>// Copyright 2002-2014, University of Colorado Boulder

/**
 * Demonstration of scenery-phet sliders.
 * Demos are selected from a combo box, and are instantiated on demand.
 * Use the 'slider' query parameter to set the initial selection of the combo box.
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var ComboBox = require( 'SUN/ComboBox' );
  var HSlider = require( 'SUN/HSlider' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var NumberControl = require( 'SCENERY_PHET/NumberControl' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var Property = require( 'AXON/Property' );
  var Range = require( 'DOT/Range' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var Text = require( 'SCENERY/nodes/Text' );
  var WavelengthSlider = require( 'SCENERY_PHET/WavelengthSlider' );

  function SlidersView() {

    ScreenView.call( this );

    var layoutBounds = this.layoutBounds;

    // To add a demo, create an entry here.
    // Demos are instantiated on demand.
    // A node field will be added to each of these entries when the demo is instantiated.
    var demos = [
      { label: 'HSlider', getNode: function() { return demoHSlider( layoutBounds ); } },
      { label: 'NumberControl', getNode: function() { return demoNumberControl( layoutBounds ); } },
      { label: 'WavelengthSlider', getNode: function() { return demoWavelengthSlider( layoutBounds ); } }
    ];

    // Sort the demos by label, so that they appear in the combo box in alphabetical order
    demos = _.sortBy( demos, function( demo ) {
      return demo.label;
    } );

    // All demos will be children of this node, to maintain rendering order with combo box list
    var demosParent = new Node();
    this.addChild( demosParent );

    // add each demo to the combo box
    var comboBoxItems = [];
    demos.forEach( function( demo ) {
      comboBoxItems.push( ComboBox.createItem( new Text( demo.label, { font: new PhetFont( 20 ) } ), demo ) );
    } );

    // Parent for the combo box popup list
    var listParent = new Node();
    this.addChild( listParent );

    // Set the initial demo based on the (optional) 'slider' query parameter, whose value is a demo 'label' field value.
    var component = phet.chipper.getQueryParameter( 'slider' );
    var selectedDemo = demos.find( function( demo ) {
      return ( demo.label === component );
    } );
    selectedDemo = selectedDemo || demos[ 0 ];

    // Combo box for selecting which component to view
    var selectedDemoProperty = new Property( selectedDemo );
    var comboBox = new ComboBox( comboBoxItems, selectedDemoProperty, listParent, {
      buttonFill: 'rgb( 218, 236, 255 )',
      top: 20,
      left: 20
    } );
    this.addChild( comboBox );

    // Make the selected demo visible
    selectedDemoProperty.link( function( demo, oldDemo ) {

      // make the previous selection invisible
      if ( oldDemo ) {
        oldDemo.node.visible = false;
      }

      if ( demo.node ) {

        // If the selected demo has an associated node, make it visible.
        demo.node.visible = true;
      }
      else {

        // If the selected demo doesn't doesn't have an associated node, create it.
        demo.node = demo.getNode();
        demosParent.addChild( demo.node );
      }
    } );
  }

  // Creates a demo for HSlider
  var demoHSlider = function( layoutBounds ) {
    var hSliderProperty = new Property( 0 );
    return new HSlider( hSliderProperty, { min: 0, max: 100 }, {
      center: layoutBounds.center
    } );
  };

  // Creates a demo for NumberControl
  var demoNumberControl = function( layoutBounds ) {

    var weightRange = new Range( 0, 300, 100 );
    var weightProperty = new Property( weightRange.defaultValue );

    return new NumberControl( 'Weight:', weightProperty, weightRange, {
      titleFont: new PhetFont( 20 ),
      valueFont: new PhetFont( 20 ),
      units: 'lbs',
      majorTicks: [
        { value: weightRange.min, label: new Text( weightRange.min, new PhetFont( 20 ) ) },
        { value: weightRange.getCenter(), label: new Text( weightRange.getCenter(), new PhetFont( 20 ) ) },
        { value: weightRange.max, label: new Text( weightRange.max, new PhetFont( 20 ) ) }
      ],
      minorTickSpacing: 50,
      center: layoutBounds.center
    } );
  };

  // Creates a demo for WavelengthSlider
  var demoWavelengthSlider = function( layoutBounds ) {
    var wavelengthProperty = new Property( 500 );
    return new WavelengthSlider( wavelengthProperty, {
      center: layoutBounds.center
    } );
  };

  return inherit( ScreenView, SlidersView );
} );<|endoftext|>


<commit_before>var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
// var CODE = __dirname+'/src';
var TRACEUR_RUNTIME = require('traceur-compiler-loader').runtime;

module.exports = {
  devtool: '#eval-source-map',
  devServer: {
    contentBase: 'public',
    // publicPath: 'public'
  },
  debug: true,
  cache: false,

  context: __dirname,
  publicPath: 'public',

  entry: {
    shared: [
      // 'zone.js',
      // 'zone.js/long-stack-trace-zone.js',
      'rtts_assert/rtts_assert',
      './src/common/shared'
    ],
    // angular2: 'angular2/angular2',
    app: './src/app/bootstrap'
  },
  output: {
    path: 'public/__build__',
    filename: '[name].js',
    sourceMapFilename: '[name].js.map',
    chunkFilename: '[id].chunk.js'
    // publicPath: 'http://mycdn.com/'
  },

  stats: {
    colors: true,
    reasons: true
  },

  resolve: {
    root: __dirname,
    extensions: [
      '',
      '.js',
      '.es6',
      '.es6.js',
      '.es7',
      '.ts',
      '.json',
      '.webpack.js',
      '.web.js'
    ],
    // Todo: learn more about aslias
    // alias: {
      // 'angular2$': '/node_modules/angular2/atscript/angular2',
      // 'app/*': '/app/*'
      // 'components$': '/src/app/components/'
      // 'decorators/*': '/app/decorators/*.js',
      // 'services/*': '/app/services/*.js',
      // 'stores/*': '/app/stores/*.js'
    // },
    modulesDirectories: [
      'web_modules',
      'node_modules',
      'src/app' // hard coded for now until I figure out alias
    ]
  },

  module: {
    loaders: [
      // Define assert in global
      // { test: require.resolve('angular2/angular2'), loader: "traceur-compiler-loader?" },
      // { test: require.resolve('rtts_assert/rtts_assert'), loader: "imports?window&zone" },
      // Support for *.json files.
      { test: /\.json$/,                    loader: 'json-loader' },
      // Support for CSS (with hot module replacement)
      { test: /\.css$/,                     loader: 'style-loader!css-loader' },
      // Copy all assets in to asset folder (use hash filename)
      { test: /\.(png|jpg|gif|woff|eot|ttf|svg)$/,      loader: 'file-loader?name=assets/[hash].[ext]' },
      // Load all *.jade as templates
      { test: /(?!\.html)\.jade$/,          loader: 'jade-loader' },
      // Copy all .html.jade as static html files (keep filename)
      { test: /index[a-z-]*\.html\.jade$/,  loader: 'file-loader?name=[path][name]&context=./src!jade-html-loader' },
      // Copy all .html as static file (keep filename)
      { test: /index[a-z-]*\.html$/,        loader: 'file-loader?name=[path][name].html&context=./src' },
      // Support for .es6 files.
      { test: /\.es6$/,                      loader: 'babel-loader' },
      // Support for .ts files.
      { test: /\.ts$/,                      loader: 'typescript-loader' },
      // Support for .es7 files.
      { test: /\.es6\.js$/,                      loader: ['traceur-compiler-loader'].concat([
                                              // 'inputSourceMap=true',
                                              // 'imports=true',
                                              'runtime=false',
                                              'sourceMaps=true',
                                              'moduleName=true',
                                              'modules=commonjs',
                                              'experimental',
                                              'types',
                                              'annotations',
                                              'memberVariables'
                                              // 'typeAssertionModule="rtts_assert"'
                                            ].join('&')).join('?')
      }
    ],
    noParse: [
      new RegExp(TRACEUR_RUNTIME),
      /rtts_assert\/src\/rtts_assert/,
      /\/zone\.js$/
    ]
  },

  plugins: [
    // new webpack.optimize.DedupePlugin(),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'shared',

      // filename: "vendor.js"
      // (Give the chunk a different name)

      minChunks: Infinity,
      // (with more entries, this ensures that no other module
      //  goes into the vendor chunk)
    }),
    // new webpack.optimize.UglifyJsPlugin({
    //   compress: {
    //     warnings: false
    //   }
    // })
    new webpack.BannerPlugin(getBanner(), {raw: true})
  ]

};

function getBanner() {
  return '// Angular2 Webpack Seed by @gdi2290 \n';
}

function isDirectory(dir) {
  return fs.lstatSync(dir).isDirectory();
}

<commit_msg>chore: update angular build<commit_after>var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
// var CODE = __dirname+'/src';
var TRACEUR_RUNTIME = require('traceur-compiler-loader').runtime;

module.exports = {
  devtool: '#eval-source-map',
  devServer: {
    contentBase: 'public',
    // publicPath: 'public'
  },
  debug: true,
  cache: false,

  context: __dirname,
  publicPath: 'public',

  entry: {
    shared: [
      // Angular 2 Deps
      'zone.js',
      'reflect-metadata',
      'rtts_assert/rtts_assert',

      './src/common/BrowserDomAdapter',

      'angular2/angular2'
    ],
    app: './src/app/bootstrap'
  },
  output: {
    path: 'public/__build__',
    filename: '[name].js',
    sourceMapFilename: '[name].js.map',
    chunkFilename: '[id].chunk.js'
    // publicPath: 'http://mycdn.com/'
  },

  stats: {
    colors: true,
    reasons: true
  },

  resolve: {
    root: __dirname,
    extensions: [
      '',
      '.js',
      '.ts',
      '.es6',
      '.es6.js',
      '.es7',
      '.json',
      '.webpack.js',
      '.web.js'
    ],
    // Todo: learn more about aslias
    alias: {
      // 'angular2$': '/node_modules/angular2/atscript/angular2',
      // 'app/*': '/app/*'
      // 'components$': '/src/app/components/'
      // 'decorators/*': '/app/decorators/*.js',
      // 'services/*': '/app/services/*.js',
      // 'stores/*': '/app/stores/*.js'
      // 'angular2': 'angular2/es6/dev'
    },
    modulesDirectories: [
      'web_modules',
      'node_modules',
      'src/app' // hard coded for now until I figure out alias
    ]
  },

  module: {
    loaders: [
      // Support for *.json files.
      { test: /\.json$/,                    loader: 'json-loader' },
      // Support for CSS (with hot module replacement)
      { test: /\.css$/,                     loader: 'style-loader!css-loader' },
      // Copy all assets in to asset folder (use hash filename)
      { test: /\.(png|jpg|gif|woff|eot|ttf|svg)$/,      loader: 'file-loader?name=assets/[hash].[ext]' },
      // Copy all .html as static file (keep filename)
      { test: /index[a-z-]*\.html$/,        loader: 'file-loader?name=[path][name].html&context=./src' },
      // Support for .ts files.
      { test: /\.ts$/,                      loader: 'typescript-simple-loader' }
    ],
    noParse: [
      new RegExp(TRACEUR_RUNTIME),
      /rtts_assert\/src\/rtts_assert/
    ]
  },

  plugins: [
    // new webpack.optimize.DedupePlugin(),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'shared',
      minChunks: Infinity,
    }),
    // new webpack.optimize.UglifyJsPlugin({
    //   compress: {
    //     warnings: false
    //   }
    // }),
    new webpack.BannerPlugin(getBanner(), {raw: true})
  ]

};

function getBanner() {
  return '// Angular2 Webpack Seed by @gdi2290 \n';
}

function isDirectory(dir) {
  return fs.lstatSync(dir).isDirectory();
}

<|endoftext|>


<commit_before>// Copyright 2002-2014, University of Colorado Boulder

/**
 * Demonstration of scenery-phet sliders
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var ComboBox = require( 'SUN/ComboBox' );
  var HSlider = require( 'SUN/HSlider' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var NumberControl = require( 'SCENERY_PHET/NumberControl' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var Property = require( 'AXON/Property' );
  var Range = require( 'DOT/Range' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var Text = require( 'SCENERY/nodes/Text' );
  var WavelengthSlider = require( 'SCENERY_PHET/WavelengthSlider' );

  function SlidersView() {

    var thisView = this;
    ScreenView.call( this );

     // To add a demo, create an entry here.
    var demos = [
      { label: 'HSlider', node: demoHSlider( this.layoutBounds ) },
      { label: 'NumberControl', node: demoNumberControl( this.layoutBounds ) },
      { label: 'WavelengthSlider', node: demoWavelengthSlider( this.layoutBounds ) }
    ];

    var comboBoxItems = [];

    demos.forEach( function( demo ) {

      // add demo to the combo box
      comboBoxItems.push( ComboBox.createItem( new Text( demo.label, { font: new PhetFont( 20 ) } ), demo.node ) );

      // add demo to the scenegraph
      thisView.addChild( demo.node );

      // demo is invisible until selected via the combo box
      demo.node.visible = false;
    } );

    // Parent for the combo box popup list
    var listParent = new Node();
    this.addChild( listParent );

    // Combo box for selecting which component to view
    var selectedDemoProperty = new Property( demos[ 0 ].node );
    var comboBox = new ComboBox( comboBoxItems, selectedDemoProperty, listParent, {
      buttonFill: 'rgb( 218, 236, 255 )',
      top: 20,
      left: 20
    } );
    this.addChild( comboBox );

    // Make the selected demo visible
    selectedDemoProperty.link( function( demo, oldDemo ) {
      if ( oldDemo ) { oldDemo.visible = false; }
      demo.visible = true;
    } );
  }

  // Creates a demo for HSlider
  var demoHSlider = function( layoutBounds ) {
    var hSliderProperty = new Property( 0 );
    return new HSlider( hSliderProperty, { min: 0, max: 100 }, {
      center: layoutBounds.center
    } );
  };

  // Creates a demo for WavelengthSlider
  var demoWavelengthSlider = function( layoutBounds ) {
    var wavelengthProperty = new Property( 500 );
    return new WavelengthSlider( wavelengthProperty, {
      center: layoutBounds.center
    } );
  };

  // Creates a demo for NumberControl
  var demoNumberControl = function( layoutBounds ) {

    var weightRange = new Range( 0, 300, 100 );
    var weightProperty = new Property( weightRange.defaultValue );

    return new NumberControl( 'Weight:', weightProperty, weightRange, {
      titleFont: new PhetFont( 20 ),
      valueFont: new PhetFont( 20 ),
      units: 'lbs',
      majorTicks: [
        { value: weightRange.min, label: new Text( weightRange.min, new PhetFont( 20 ) ) },
        { value: weightRange.getCenter(), label: new Text( weightRange.getCenter(), new PhetFont( 20 ) ) },
        { value: weightRange.max, label: new Text( weightRange.max, new PhetFont( 20 ) ) }
      ],
      minorTickSpacing: 50,
      center: layoutBounds.center
    } );
  };

  return inherit( ScreenView, SlidersView );
} );<commit_msg>#177 clean up<commit_after>// Copyright 2002-2014, University of Colorado Boulder

/**
 * Demonstration of scenery-phet sliders
 *
 * @author Sam Reid
 * @author Chris Malley
 */
define( function( require ) {
  'use strict';

  // modules
  var ComboBox = require( 'SUN/ComboBox' );
  var HSlider = require( 'SUN/HSlider' );
  var inherit = require( 'PHET_CORE/inherit' );
  var Node = require( 'SCENERY/nodes/Node' );
  var NumberControl = require( 'SCENERY_PHET/NumberControl' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var Property = require( 'AXON/Property' );
  var Range = require( 'DOT/Range' );
  var ScreenView = require( 'JOIST/ScreenView' );
  var Text = require( 'SCENERY/nodes/Text' );
  var WavelengthSlider = require( 'SCENERY_PHET/WavelengthSlider' );

  function SlidersView() {

    var thisView = this;
    ScreenView.call( this );

    // To add a demo, create an entry here.
    var demos = [
      { label: 'HSlider', node: demoHSlider( this.layoutBounds ) },
      { label: 'NumberControl', node: demoNumberControl( this.layoutBounds ) },
      { label: 'WavelengthSlider', node: demoWavelengthSlider( this.layoutBounds ) }
    ];

    var comboBoxItems = [];

    demos.forEach( function( demo ) {

      // add demo to the combo box
      comboBoxItems.push( ComboBox.createItem( new Text( demo.label, { font: new PhetFont( 20 ) } ), demo.node ) );

      // add demo to the scenegraph
      thisView.addChild( demo.node );

      // demo is invisible until selected via the combo box
      demo.node.visible = false;
    } );

    // Parent for the combo box popup list
    var listParent = new Node();
    this.addChild( listParent );

    // Combo box for selecting which component to view
    var selectedDemoProperty = new Property( demos[ 0 ].node );
    var comboBox = new ComboBox( comboBoxItems, selectedDemoProperty, listParent, {
      buttonFill: 'rgb( 218, 236, 255 )',
      top: 20,
      left: 20
    } );
    this.addChild( comboBox );

    // Make the selected demo visible
    selectedDemoProperty.link( function( demo, oldDemo ) {
      if ( oldDemo ) { oldDemo.visible = false; }
      demo.visible = true;
    } );
  }

  // Creates a demo for HSlider
  var demoHSlider = function( layoutBounds ) {
    var hSliderProperty = new Property( 0 );
    return new HSlider( hSliderProperty, { min: 0, max: 100 }, {
      center: layoutBounds.center
    } );
  };

  // Creates a demo for NumberControl
  var demoNumberControl = function( layoutBounds ) {

    var weightRange = new Range( 0, 300, 100 );
    var weightProperty = new Property( weightRange.defaultValue );

    return new NumberControl( 'Weight:', weightProperty, weightRange, {
      titleFont: new PhetFont( 20 ),
      valueFont: new PhetFont( 20 ),
      units: 'lbs',
      majorTicks: [
        { value: weightRange.min, label: new Text( weightRange.min, new PhetFont( 20 ) ) },
        { value: weightRange.getCenter(), label: new Text( weightRange.getCenter(), new PhetFont( 20 ) ) },
        { value: weightRange.max, label: new Text( weightRange.max, new PhetFont( 20 ) ) }
      ],
      minorTickSpacing: 50,
      center: layoutBounds.center
    } );
  };

  // Creates a demo for WavelengthSlider
  var demoWavelengthSlider = function( layoutBounds ) {
    var wavelengthProperty = new Property( 500 );
    return new WavelengthSlider( wavelengthProperty, {
      center: layoutBounds.center
    } );
  };

  return inherit( ScreenView, SlidersView );
} );<|endoftext|>