<commit_before>/**
 * The app view for the map module.
 *
 * @class A Backbone view to handle the app.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.View}
 */
var AppView = Backbone.View.extend(
    /** @lends AppView */
    {

      /**
       * @constructs
       */
      initialize: function (options) {
        _.bindAll(this,
            "render",
            'locationCallback',
            'campusCallback',
            'menuSelectCallback',
            "startGPSPositioning",
            'handleZoomChanged'
        );

        $(document).on("deviceready.appview", this.startGPSPositioning);

        this.title = options.title;
        this.mapModel = new MapModel();

        var filterByCampus = this.model.get('filterByCampus');
        var showMenu = this.model.get('menu');

        var self = this;

        i18n.init({resGetPath: '../i18n/__lng__.json'}, function () {
          self.$el.i18n();
          $('#search-box').i18n();
        });


        this.mapView = new MapView({
          el: $('#map_canvas'),
          model: this.mapModel,
          appModel: this.model
        });

        this.searchView = new SearchView({
          el: $('#search-box'),
          collection: this.model.getFilterCollection(),
          placeholderSuffix: options.title ? options.title.toLowerCase() : undefined
        });


        this.searchView.on('selected', function (selectedElement) {
          if (filterByCampus) {
            self.campusCallback(selectedElement);
          }
          else {
            self.locationCallback(selectedElement);
          }
        });

        this.mapView.on('zoom_changed', this.handleZoomChanged);
        this.model.on('change:campus', this.changeCampus, this);
        this.model.locations.on("reset change", function () {
          self.mapView.replacePoints(self.model.locations);
        });

        this.updateLocations();

        // Display a menu button
        if (showMenu) {
          this.menuPopupView = new MenuPopupView({
            el: $('#menupopup'),
            campuses: this.model.campuses,
            appModel: this.model
          });

          this.menuPopupView.on('selected', this.menuSelectCallback);

          this.changeCampus();
        }
      },
<commit_msg>MOB-118 - Removed change event, it breaks markers.<commit_after>/**
 * The app view for the map module.
 *
 * @class A Backbone view to handle the app.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.View}
 */
var AppView = Backbone.View.extend(
    /** @lends AppView */
    {

      /**
       * @constructs
       */
      initialize: function (options) {
        _.bindAll(this,
            "render",
            'locationCallback',
            'campusCallback',
            'menuSelectCallback',
            "startGPSPositioning",
            'handleZoomChanged'
        );

        $(document).on("deviceready.appview", this.startGPSPositioning);

        this.title = options.title;
        this.mapModel = new MapModel();

        var filterByCampus = this.model.get('filterByCampus');
        var showMenu = this.model.get('menu');

        var self = this;

        i18n.init({resGetPath: '../i18n/__lng__.json'}, function () {
          self.$el.i18n();
          $('#search-box').i18n();
        });


        this.mapView = new MapView({
          el: $('#map_canvas'),
          model: this.mapModel,
          appModel: this.model
        });

        this.searchView = new SearchView({
          el: $('#search-box'),
          collection: this.model.getFilterCollection(),
          placeholderSuffix: options.title ? options.title.toLowerCase() : undefined
        });


        this.searchView.on('selected', function (selectedElement) {
          if (filterByCampus) {
            self.campusCallback(selectedElement);
          }
          else {
            self.locationCallback(selectedElement);
          }
        });

        this.mapView.on('zoom_changed', this.handleZoomChanged);
        this.model.on('change:campus', this.changeCampus, this);
        this.model.locations.on("reset", function () {
          self.mapView.replacePoints(self.model.locations);
        });

        this.updateLocations();

        // Display a menu button
        if (showMenu) {
          this.menuPopupView = new MenuPopupView({
            el: $('#menupopup'),
            campuses: this.model.campuses,
            appModel: this.model
          });

          this.menuPopupView.on('selected', this.menuSelectCallback);

          this.changeCampus();
        }
      },

{'fraction_non_alphanumeric': 0.1454316848281643, 'fraction_numerical': 0.003981559094719195, 'mean_word_length': 1.9756857855361596, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '5812846', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1355, 'n_words': 245}