<commit_before>'use babel';

export default class GodsDjsView {

  constructor(serializedState) {
    // Create root element
    this.element = document.createElement('div');
    this.element.classList.add('godsdjs');
	this.element.addEventListener("click", this.toggle);

    // Create message element
    const toggle = document.createElement('span');
	toggle.classList.add('icon', 'icon-flame');
    this.element.appendChild(toggle);

	this.playing = serializedState ? serializedState.playing : false;
  }



  // Returns an object that can be retrieved when package is activated
  serialize() {
	return {
		playing: this.playing
	};
  }

  toggle() {
	if (this.playing) {
		this.playing = false;
		this.getElement().classList.remove("pulsating");
		if (this.audio) {
			this.audio.removeAttribute("src");
		    this.getElement().removeChild(this.audio);
		}
	} else {
		this.playing = true;
		this.getElement().classList.add("pulsating");
		this.audio = document.createElement('audio');
		this.audio.setAttribute("autoplay", null);
		this.audio.setAttribute("src", "http://www.godsdjsradio.com:8080/stream");
		this.audio = this.getElement().appendChild(this.audio);
	}

  }

  // Tear down any state and detach
  destroy() {
	this.element.removeEventListener("click", this.toggle);
    this.element.remove();
  }

  getElement() {
    return this.element;
  }

}
<commit_msg>ahhh ... now! gotcha ...<commit_after>'use babel';

export default class GodsDjsView {

  constructor(serializedState) {
    // Create root element
    this.element = document.createElement('div');
    this.element.classList.add('godsdjs', 'inline-block');
	this.element.addEventListener("click", this.toggle);

    // Create message element
    const toggle = document.createElement('span');
	toggle.classList.add('icon', 'icon-flame');
    this.element.appendChild(toggle);

	this.playing = serializedState ? serializedState.playing : false;
  }



  // Returns an object that can be retrieved when package is activated
  serialize() {
	return {
		playing: this.playing
	};
  }

  toggle() {
	if (this.playing) {
		this.playing = false;
		this.getElement().classList.remove("pulsating");
		if (this.audio) {
			this.audio.removeAttribute("src");
		    this.getElement().removeChild(this.audio);
		}
	} else {
		this.playing = true;
		this.getElement().classList.add("pulsating");
		this.audio = document.createElement('audio');
		this.audio.setAttribute("autoplay", null);
		this.audio.setAttribute("src", "http://www.godsdjsradio.com:8080/stream");
		this.audio = this.getElement().appendChild(this.audio);
	}

  }

  // Tear down any state and detach
  destroy() {
	this.element.removeEventListener("click", this.toggle);
    this.element.remove();
  }

  getElement() {
    return this.element;
  }

}

{'fraction_non_alphanumeric': 0.15249372084678867, 'fraction_numerical': 0.0028704700394689632, 'mean_word_length': 3.8656195462478187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2805381', 'n_tokens_mistral': 909, 'n_tokens_neox': 840, 'n_words': 160}