function init() {
 
  createMarkers(locations);
  retrieveWeather(locations);
  retrieveForecast(locations, populateForecast);
  
  let forecastButton = document.getElementById('forecast-menu');
  for (let i = 0; i < 5; i++) {
    for (let j = 0; j < 8; j++) {
      let button = document.createElement('div');
      button.className = "item";
      button.textContent = i * 8 + j;
      forecastButton.children[i].children[0].appendChild(button);
    }
  }

  var closeBox = document.getElementById('close');
  closeBox.onclick = function () {
      chrome.app.window.current().close();
  };

  let powerButton = document.getElementById('power-button');
  powerButton.onclick = function() {
      togglePower();
  };

  let currentButton = document.getElementById('current-weather');
  currentButton.onclick = function() {
    for (let loc of locations) {
      updateMarker(loc.weather.main.temp, loc.weather.weather[0].main, loc.id);
    }
  }


  let newWindow = document.getElementById('new-window');
  newWindow.onclick = () => {
    chrome.app.window.create('connect.html', {
      id: 'connect-window',
      minHeight: 300,
      minWidth: 200,
      bounds: {
        height: 400,
        width: 300
      }
    }, onInitConnect);
  };

  // createMarkers(locations);
  let x = document.getElementById(locations[0].id);
  console.log(x);

  document.addEventListener("click", findMousePos);

  // for the forecast dropdown menu
  $('.ui.dropdown.link.item')
  .dropdown()
;

}
// Bind the functions to the buttons
Bind the functions to the buttons
Bind the functions to the buttons
function init() {
  createMarkers(locations);
  retrieveWeather(locations);
  retrieveForecast(locations, populateForecast);
  let forecastButton = document.getElementById('forecast-menu');
  for (let i = 0; i < 5; i++) {
    for (let j = 0; j < 8; j++) {
      let button = document.createElement('div');
      button.className = "item";
      button.textContent = i * 8 + j;
      forecastButton.children[i].children[0].appendChild(button);
    }
  }
  var closeBox = document.getElementById('close');
  closeBox.onclick = function () {
      chrome.app.window.current().close();
  };
  let powerButton = document.getElementById('power-button');
  powerButton.onclick = function() {
      togglePower();
  };
  let currentButton = document.getElementById('current-weather');
  currentButton.onclick = function() {
    for (let loc of locations) {
      updateMarker(loc.weather.main.temp, loc.weather.weather[0].main, loc.id);
    }
  }
  let newWindow = document.getElementById('new-window');
  newWindow.onclick = () => {
    chrome.app.window.create('connect.html', {
      id: 'connect-window',
      minHeight: 300,
      minWidth: 200,
      bounds: {
        height: 400,
        width: 300
      }
    }, onInitConnect);
  };
  let x = document.getElementById(locations[0].id);
  console.log(x);
  document.addEventListener("click", findMousePos);
  $('.ui.dropdown.link.item')
  .dropdown()
;
}
function init ( ) { createMarkers ( locations ) ; retrieveWeather ( locations ) ; retrieveForecast ( locations , populateForecast ) ; let forecastButton = document . getElementById ( 'forecast-menu' ) ; for ( let i = 0 ; i < 5 ; i ++ ) { for ( let j = 0 ; j < 8 ; j ++ ) { let button = document . createElement ( 'div' ) ; button . className = "item" ; button . textContent = i * 8 + j ; forecastButton . children [ i ] . children [ 0 ] . appendChild ( button ) ; } } var closeBox = document . getElementById ( 'close' ) ; closeBox . onclick = function ( ) { chrome . app . window . current ( ) . close ( ) ; } ; let powerButton = document . getElementById ( 'power-button' ) ; powerButton . onclick = function ( ) { togglePower ( ) ; } ; let currentButton = document . getElementById ( 'current-weather' ) ; currentButton . onclick = function ( ) { for ( let loc of locations ) { updateMarker ( loc . weather . main . temp , loc . weather . weather [ 0 ] . main , loc . id ) ; } } let newWindow = document . getElementById ( 'new-window' ) ; newWindow . onclick = ( ) => { chrome . app . window . create ( 'connect.html' , { id : 'connect-window' , minHeight : 300 , minWidth : 200 , bounds : { height : 400 , width : 300 } } , onInitConnect ) ; } ; let x = document . getElementById ( locations [ 0 ] . id ) ; console . log ( x ) ; document . addEventListener ( "click" , findMousePos ) ; $ ( '.ui.dropdown.link.item' ) . dropdown ( ) ; }
Bind the functions to the buttons
Bind the functions to the buttons
// createMarkers(locations); // for the forecast dropdown menu