<commit_before>import {inject} from 'aurelia-framework';
import {GeoGoogleService} from './services/geo-google';
import {EventAggregator} from 'aurelia-event-aggregator';

@inject(GeoGoogleService, EventAggregator)
export class GeoDemo {
  heading = 'Geo Demo';
  constructor(geo, eventAggregator) {
    this.geo = geo;
    this.eventAggregator = eventAggregator;
  }

  activate() {
    this.setGeo();
    this.eventAggregator.subscribe('googleMaps:markerClick', index => this.highlightPlace(index));
  }

  async setGeo() {
    try {
      this.geoData = await this.geo.getGeoposition();
      this.address = await this.geo.getAddressForLatLong(this.geoData);

      let opts = {
        geo: this.geoData,
        mapElementSelector: 'mapfeed',
        pinCenter: true,
        type: 'ROADMAP'
      };
      this.geo.drawMap(opts);
    } catch (err) {
      console.log('ERR: ' , err);
    }
  }

  async searchPlaces() {
    this.geo.clearMarkers();
    this.places = [];
    let opts = {
      geo: this.geoData,
      radius: 500,
      query: this.query,
      pinMarkers: true
    };

    this.places = await this.geo.getNearbyPlaces(opts);
  }

  showMarkerInfoWindow(i) {
    this.geo.placeListingClick(window.markers[i]);
  }

  highlightPlace(index) {
    $('.place-active').removeClass('place-active');
    this.places[index].class="place-active";
  }
}<commit_msg>pattern for keeping track of active index item<commit_after>import {inject} from 'aurelia-framework';
import {GeoGoogleService} from './services/geo-google';
import {EventAggregator} from 'aurelia-event-aggregator';

@inject(GeoGoogleService, EventAggregator)
export class GeoDemo {
  heading = 'Geo Demo';
  constructor(geo, eventAggregator) {
    this.geo = geo;
    this.eventAggregator = eventAggregator;
  }

  activate() {
    this.setGeo();
    this.eventAggregator.subscribe('googleMaps:markerClick', index => this.highlightPlace(index));
  }

  async setGeo() {
    try {
      this.geoData = await this.geo.getGeoposition();
      this.address = await this.geo.getAddressForLatLong(this.geoData);

      let opts = {
        geo: this.geoData,
        mapElementSelector: 'mapfeed',
        pinCenter: true,
        type: 'ROADMAP'
      };
      this.geo.drawMap(opts);
    } catch (err) {
      console.log('ERR: ' , err);
    }
  }

  async searchPlaces() {
    this.geo.clearMarkers();
    this.places = [];
    let opts = {
      geo: this.geoData,
      radius: 500,
      query: this.query,
      pinMarkers: true
    };

    this.places = await this.geo.getNearbyPlaces(opts);
  }

  showMarkerInfoWindow(i) {
    this.geo.placeListingClick(window.markers[i]);
  }

  highlightPlace(index) {
    if (this.activeClass !== undefined) {
      this.places[this.activeClass].class='';
    }
    this.activeClass=index;
    this.places[index].class='place-active';
  }
}
{'fraction_non_alphanumeric': 0.13841314225795176, 'fraction_numerical': 0.0020971688220901784, 'mean_word_length': 3.042372881355932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3181250', 'n_tokens_mistral': 977, 'n_tokens_neox': 943, 'n_words': 165}