<commit_before>document.addEventListener('DOMContentLoaded', () => {
  console.log('Initialized app');
});

AFRAME.registerComponent('teleport', {
  init: function () {
    this.el.addEventListener('click', this.handleClick.bind(this));
  },
  handleClick: function (e) {
    var camera = this.el.sceneEl.camera.el;
    var hotspotPosition = e.target.getAttribute('position');
    var hotspotRotation = e.target.getAttribute('rotation');
    var cameraPosition = camera.getAttribute('position');
    camera.setAttribute('position', {
      x: hotspotPosition.x,
      y: cameraPosition.y,
      z: hotspotPosition.z
    });
    camera.setAttribute('rotation', {
      y: hotspotRotation.y
    });
  }
});<commit_msg>use play & pause callbacks<commit_after>document.addEventListener('DOMContentLoaded', () => {
  console.log('Initialized app');
});

AFRAME.registerComponent('teleport', {
  play: function () {
    this.el.addEventListener('click', this.handleClick.bind(this));
  },

  pause: function () {
    this.el.removeEventListener('click', this.handleClick.bind(this));
  },

  handleClick: function (e) {
    var camera = this.el.sceneEl.camera.el;
    var hotspotPosition = e.target.getAttribute('position');
    var hotspotRotation = e.target.getAttribute('rotation');
    var cameraPosition = camera.getAttribute('position');
    camera.setAttribute('position', {
      x: hotspotPosition.x,
      y: cameraPosition.y,
      z: hotspotPosition.z
    });
    camera.setAttribute('rotation', {
      y: hotspotRotation.y
    });
  }
});
{'fraction_non_alphanumeric': 0.1558861578266494, 'fraction_numerical': 0.0, 'mean_word_length': 3.926751592356688, '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': '525700', 'n_tokens_mistral': 450, 'n_tokens_neox': 457, 'n_words': 73}