<commit_before>class LinkButton extends Phaser.Button {

  constructor (game, x, key) {
    super(game, x, 47, key, this._openPopup, this, 1, 0);

    this.input.useHandCursor = true;
  }

  // --------------------------------------------------------------------------

  _openPopup () {
    // TODO
    console.info('Launching pop-up for "%s".', this._url);
  }

  // --------------------------------------------------------------------------

  get _url () {
    // if (this.key === LinkButton.FACEBOOK) {
    //   return 'fb';
    // }
    // else if (this.key === LinkButton.TWITTER) {
    //   return 'tt';
    // }
    // else if (this.key === LinkButton.DEVIANTART) {
    //   return 'da';
    // }
    // else if (this.key === LinkButton.ADVENTURE_ISLANDS) {
    //   return 'ai';
    // }
    return this.key;
  }
}


LinkButton.GITHUB            = 'button-link-github';
LinkButton.FACEBOOK          = 'button-link-facebook';
LinkButton.TWITTER           = 'button-link-twitter';
LinkButton.DEVIANTART        = 'button-link-deviantart';
LinkButton.ADVENTURE_ISLANDS = 'button-link-adventure-islands';

export default LinkButton;
<commit_msg>Making the link button actually work.<commit_after>class LinkButton extends Phaser.Button {

  constructor (game, x, key, url = null) {
    super(game, x, 47, key, this._openPopup, this, 1, 0);

    this.input.useHandCursor = true;
    this.url = url;
  }

  // --------------------------------------------------------------------------

  _openPopup () {
    if (this.url !== null) window.open(this.url);
  }

}


LinkButton.GITHUB            = 'button-link-github';
LinkButton.FACEBOOK          = 'button-link-facebook';
LinkButton.TWITTER           = 'button-link-twitter';
LinkButton.DEVIANTART        = 'button-link-deviantart';
LinkButton.ADVENTURE_ISLANDS = 'button-link-adventure-islands';

export default LinkButton;

{'fraction_non_alphanumeric': 0.2526652452025586, 'fraction_numerical': 0.0042643923240938165, 'mean_word_length': 1.7007194244604316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3810673', 'n_tokens_mistral': 600, 'n_tokens_neox': 573, 'n_words': 110}