<commit_before>/*
 *= require lib/preference_storage
 *= require lib/utils
 */
/* global PreferenceStorage, Utils */

"use strict";

var DiasporaSharer = (function() {
  function DiasporaSharer() {
    this._loader = false;
    this._params = Utils.locationSearchToObject();
    this._prefs = new PreferenceStorage();
  }

  DiasporaSharer.prototype = {
    earlyRedirect: function() {
      if (!(this._params.title || this._params.url)) {
        this.redirect("/about.html");
      }

      var autojumpPod = this._prefs.get("autojumpPod");
      if (autojumpPod && !this._params.nojump) {
        this.shareToPod(autojumpPod);
      }
    },

    initDom: function(selectors) {
      if (!selectors) {
        return;
      }

      var customHostForm = document.querySelector(selectors.customHostForm),
        customHostInput = document.querySelector(selectors.customHostInput);
      if (customHostForm && customHostInput) {
        customHostInput.value = this._prefs.get("lastCustomHost");

        customHostForm.addEventListener("submit", function(event) {
          event.preventDefault();
          this._prefs.set("lastCustomHost", customHostInput.value);
          this.shareToPod(customHostInput.value);<commit_msg>Return after setting the URL to the about-page to avoid funny states<commit_after>/*
 *= require lib/preference_storage
 *= require lib/utils
 */
/* global PreferenceStorage, Utils */

"use strict";

var DiasporaSharer = (function() {
  function DiasporaSharer() {
    this._loader = false;
    this._params = Utils.locationSearchToObject();
    this._prefs = new PreferenceStorage();
  }

  DiasporaSharer.prototype = {
    earlyRedirect: function() {
      if (!(this._params.title || this._params.url)) {
        this.redirect("/about.html");
        return;
      }

      var autojumpPod = this._prefs.get("autojumpPod");
      if (autojumpPod && !this._params.nojump) {
        this.shareToPod(autojumpPod);
      }
    },

    initDom: function(selectors) {
      if (!selectors) {
        return;
      }

      var customHostForm = document.querySelector(selectors.customHostForm),
        customHostInput = document.querySelector(selectors.customHostInput);
      if (customHostForm && customHostInput) {
        customHostInput.value = this._prefs.get("lastCustomHost");

        customHostForm.addEventListener("submit", function(event) {
          event.preventDefault();
          this._prefs.set("lastCustomHost", customHostInput.value);
          this.shareToPod(customHostInput.value);
{'fraction_non_alphanumeric': 0.12475325700750099, 'fraction_numerical': 0.0, 'mean_word_length': 3.1136363636363638, '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': '7047290', 'n_tokens_mistral': 752, 'n_tokens_neox': 731, 'n_words': 125}