<commit_before>Teikei.module("User", function(User, App, Backbone, Marionette, $, _) {

  User.Controller = Backbone.Marionette.Controller.extend({

    initialize: function() {
      this.model = new Teikei.User.Model();
      this.megaDropView = new Teikei.User.MegaDropView();
      this.menuView = new Teikei.User.MenuView({
        model: this.model
      });

      this.menuView.bind("signin:selected", this.signInPopup, this);
      this.menuView.bind("signup:selected", this.signUpPopup, this);
      this.menuView.bind("logout:selected", this.logout, this);
    },

    initializeLoginView: function() {
      this.loginView = new Teikei.User.LoginView({
        model: this.model
      });

      this.loginView.bind("signInForm:submit", this.signIn, this);
      this.loginView.bind("signUpForm:submit", this.signUp, this);
      this.loginView.bind("signin:tab:click", this.navigateToSignIn, this);
      this.loginView.bind("signup:tab:click", this.navigateToSignUp, this);
    },

    signInPopup: function() {
      if (!this.model.tokenIsPresent()) {
        this.initializeLoginView();
        App.modalRegion.show(this.loginView);
      }
    },

    signUpPopup: function() {
      if (!this.model.tokenIsPresent()) {
        this.initializeLoginView();
        App.modalRegion.show(this.loginView);
        this.loginView.showSignUpForm();
      }
    },<commit_msg>Allow signup form to be triggered using the global event bus.<commit_after>Teikei.module("User", function(User, App, Backbone, Marionette, $, _) {

  User.Controller = Backbone.Marionette.Controller.extend({

    initialize: function() {
      this.model = new Teikei.User.Model();
      this.megaDropView = new Teikei.User.MegaDropView();
      this.menuView = new Teikei.User.MenuView({
        model: this.model
      });

      App.vent.on("show:signup", this.signUpPopup, this);

      this.menuView.bind("signin:selected", this.signInPopup, this);
      this.menuView.bind("signup:selected", this.signUpPopup, this);
      this.menuView.bind("logout:selected", this.logout, this);
    },

    initializeLoginView: function() {
      this.loginView = new Teikei.User.LoginView({
        model: this.model
      });

      this.loginView.bind("signInForm:submit", this.signIn, this);
      this.loginView.bind("signUpForm:submit", this.signUp, this);
      this.loginView.bind("signin:tab:click", this.navigateToSignIn, this);
      this.loginView.bind("signup:tab:click", this.navigateToSignUp, this);
    },

    signInPopup: function() {
      if (!this.model.tokenIsPresent()) {
        this.initializeLoginView();
        App.modalRegion.show(this.loginView);
      }
    },

    signUpPopup: function() {
      if (!this.model.tokenIsPresent()) {
        this.initializeLoginView();
        App.modalRegion.show(this.loginView);
        this.loginView.showSignUpForm();
      }
    },
{'fraction_non_alphanumeric': 0.14717112113849357, 'fraction_numerical': 0.0, 'mean_word_length': 3.1467625899280574, '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': '3430323', 'n_tokens_mistral': 918, 'n_tokens_neox': 907, 'n_words': 135}