<commit_before><ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:rich="http://richfaces.org/rich"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata"
  template="../WEB-INF/template/template_nobanner.xhtml">

  <ui:define name="page_title">#{msgs['jsf.InactiveAccount']}</ui:define>

  <ui:define name="center_content">
    <a4j:jsFunction name="sendActivationEmail"
      action="#{inactiveAccountAction.sendActivationEmail}"/>

    <script type="application/javascript">
      function getNewEmailField() {
        return jQuery('#' + jqSelector('#{rich:clientId('emailInput')}'));
      }

      function getInactiveAccountForm() {
        return jQuery('#' + jqSelector('#{rich:clientId('inactiveAccountForm')}'));
      }

      getInactiveAccountForm().keypress(function(e) {
        if(e.which == 13) {
          if(getNewEmailField().is(":focus")) {
            e.preventDefault();
            e.stopPropagation();
            jQuery('#' + jqSelector('#{rich:clientId('updateEmail')}')).click();
            return false;
          }
        }
      });
    </script>

    <div class="header__logo-only">
      <h:link outcome="/home.xhtml" id="home" tabindex="1">
        <img src="#{assets['img/logo/logo.svg']}" alt="Zanata"/>
      </h:link>
    </div>

    <div class="g--centered">
      <div class="g__item l--constrain-medium">
        <div class="l--push-v-1">
          <div class="l--push-top-half g__item">
            <h2 class="gamma heading--sub">#{msgs['jsf.InactiveAccount']}</h2>
            <h:form id="inactiveAccountForm" styleClass="l--push-top-half l--pad-all-1 bg--pop-higher">

              <button id="resendEmail" class="button button--full button--primary loader"
                onclick="sendActivationEmail()">
                <span class="loader__label">
                  #{msgs['jsf.ResendActivationEmail']}
                </span>
              </button>

              <h:outputText value="#{msgs['jsf.or']}"/>

              <zanata:decorate id="email" styleClass="l--push-top-quarter" componentId="emailInputField">
                <div class="form--inline">
                  <h:inputText id="emailInput" styleClass="form--inline__input" value="#{inactiveAccountAction.email}"
                    placeholder="#{msgs['jsf.email.placeholder']}">
                    <a4j:ajax event="blur" render="emailInputField"/>
                  </h:inputText>

                  <div class="form--inline__suffix">
                    <h:commandButton id="updateEmail" styleClass="form--inline__addon button--primary"
                      value="#{msgs['jsf.UpdateEmail']}"
                      action="#{inactiveAccountAction.changeEmail}"/>
                  </div>
                </div>
              </zanata:decorate>
            </h:form>
          </div>
        </div>
      </div>
    </div>
  </ui:define>

</ui:composition>
<commit_msg>fix(account activation): handle enter key pressed<commit_after><ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:rich="http://richfaces.org/rich"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata"
  template="../WEB-INF/template/template_nobanner.xhtml">

  <ui:define name="page_title">#{msgs['jsf.InactiveAccount']}</ui:define>

  <ui:define name="center_content">
    <a4j:jsFunction name="sendActivationEmail"
      action="#{inactiveAccountAction.sendActivationEmail}"/>

    <script type="application/javascript">
      function getNewEmailField() {
        return jQuery('#' + jqSelector('#{rich:clientId('emailInput')}'));
      }

      function getInactiveAccountForm() {
        return jQuery('#' + jqSelector('#{rich:clientId('inactiveAccountForm')}'));
      }

      jQuery(document).ready(function() {
        getInactiveAccountForm().keypress(function(e) {
          if(e.which == 13) {
            if(getNewEmailField().is(":focus")) {
              e.preventDefault();
              e.stopPropagation();
              jQuery('#' + jqSelector('#{rich:clientId('updateEmail')}')).click();
              return false;
            }
          }
        });
      });
    </script>

    <div class="header__logo-only">
      <h:link outcome="/home.xhtml" id="home" tabindex="1">
        <img src="#{assets['img/logo/logo.svg']}" alt="Zanata"/>
      </h:link>
    </div>

    <div class="g--centered">
      <div class="g__item l--constrain-medium">
        <div class="l--push-v-1">
          <div class="l--push-top-half g__item">
            <h2 class="gamma heading--sub">#{msgs['jsf.InactiveAccount']}</h2>
            <h:form id="inactiveAccountForm" styleClass="l--push-top-half l--pad-all-1 bg--pop-higher">

              <button id="resendEmail" class="button button--full button--primary loader"
                onclick="sendActivationEmail()">
                <span class="loader__label">
                  #{msgs['jsf.ResendActivationEmail']}
                </span>
              </button>

              <h:outputText value="#{msgs['jsf.or']}"/>

              <zanata:decorate id="email" styleClass="l--push-top-quarter" componentId="emailInputField">
                <div class="form--inline">
                  <h:inputText id="emailInput" styleClass="form--inline__input" value="#{inactiveAccountAction.email}"
                    placeholder="#{msgs['jsf.email.placeholder']}">
                    <a4j:ajax event="blur" render="emailInputField"/>
                  </h:inputText>

                  <div class="form--inline__suffix">
                    <h:commandButton id="updateEmail" styleClass="form--inline__addon button--primary"
                      value="#{msgs['jsf.UpdateEmail']}"
                      action="#{inactiveAccountAction.changeEmail}"/>
                  </div>
                </div>
              </zanata:decorate>
            </h:form>
          </div>
        </div>
      </div>
    </div>
  </ui:define>

</ui:composition>

{'fraction_non_alphanumeric': 0.17705290490100617, 'fraction_numerical': 0.00519311911716975, 'mean_word_length': 2.3241639697950376, 'pattern_counts': {'":': 2, '<': 85, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, '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': '6124833', 'n_tokens_mistral': 1949, 'n_tokens_neox': 1862, 'n_words': 234}