<commit_before><div class="modal-header">
  <h3 class="modal-title">Create watcher</h3>
</div>
<div class="modal-body">

<form name="outerForm" class="form-horizontal">
  <tabset active="activeForm">
    <tab index="0" heading="General">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-2"></div>
        <div class="col-md-6">
          <button
            type="button"
            class="btn btn-sm btn-success"
            ng-click="watcher._source.disable = !watcher._source.disable; toggleWatcher()"
            ng-class="{true: 'btn-warning', false: 'btn-success'}[watcher._source.disable]"
            >{{form.status}}</button>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-2 control-label" for="title">Title:</label>
        <div class="col-md-6">
          <input
            type="text"
            id="title"
            name="title"
            value="{{watcher._source.title}}"
            class="form-control"
            placeholder="{{watcher._source.uuid}}"
            ng-model="watcher._source.title"
            ng-disabled="form.disabled">
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-2 control-label" for="schedule">Schedule:</label>
        <div class="col-md-6">
          <input
            type="text"
            id="schedule"
            name="schedule"
            value="{{watcher._source.trigger.schedule.later}}"
            class="form-control"
            placeholder="every 1m"
            ng-model="watcher._source.trigger.schedule.later"
            ng-disabled="form.disabled">
        </div>
          <!-- TO-DO: add timepicker and datepicker -->
          <!-- angular ui v0.12
          <timepicker
            ng-model="form.time.now"
            ng-change="changed()"
            hour-step="form.time.hstep"
            minute-step="form.time.mstep"
            show-meridian="form.time.ismeridian"></timepicker>
          -->
          <!-- angular ui v2.5
          <div uib-timepicker
            ng-model="form.time.now"
            ng-change="changed()"
            hour-step="form.time.hstep"
            minute-step="form.time.mstep"
            show-meridian="form.time.ismeridian"
            ng-disabled="disabled"></div>
        </div>
          -->
      </div>
    </tab>
    <tab index="1" heading="Input" select="getInput()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="inputEdit"
            class="aceditor"
            ng-model="watcher._source._input"
            ui-ace="{ mode: 'json' }">{{ watcher._source._input }}</div>
        </div>
      </div>
    </tab>
    <tab index="2" heading="Condition" select="getCondition()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="conditionEdit"
            class="aceditor"
            ng-model="watcher._source._condition"
            ui-ace="{ mode: 'javascript' }">{{ watcher._source._condition }}</div>
        </div>
      </div>
    </tab>
    <tab index="3" heading="Transform" select="getTransform()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="transformEdit"
            ng-model="watcher._source._transform"
            ui-ace="{ mode: 'javascript' }"
            class="aceditor">{{ watcher._source._transform }}</div>
        </div>
      </div>
    </tab>
    <tab index="4" heading="Actions">
      <div class="form-group">
        <p></p>
      </div>

      <div class="form-group">
        <div class="col-md-1">
        </div>
        <div class="col-md-11">
          <a href=""
            ng-class="{'fa': true, 'fa-plus': !form.actions.new.edit, 'fa-minus': form.actions.new.edit}"
            ng-click="addAction()"></a>
          <div ng-if="form.actions.new.edit">
            <new-action></new-action>
          </div>
        </div>
      </div>

      <div class="form-group">
        <div class="col-md-1">
        </div>
        <div class="col-md-11">
          <ul class="formActionsList"
            ng-repeat="(actionName, actionSettings) in watcher._source.actions" style="list-style-type:none;">
            <li>
              <a href="" class="fa fa-minus" ng-click="removeAction(actionName)"></a>
              <a href="" ng-click="editAction(actionName, actionSettings)">{{actionName}}</a>
              <div class="form-group" ng-if="actionSettings.webhook._edit || actionSettings.email._edit">
                <label class="col-md-2 control-label" for="throttle_period">Throttle period:</label>
                <div class="col-md-2">
                  <input
                    type="text"
                    id="throttle_period"
                    name="throttle_period"
                    value="{{actionSettings.throttle_period}}"
                    class="form-control"
                    placeholder="1m"
                    ng-model="actionSettings.throttle_period"
                    ng-disabled="form.disabled">
                </div>
              </div>
              <div ng-if="actionSettings.webhook._edit">
                <webhook-action name="{{actionName}}"></webhook-action>
              </div>
              <div ng-if="actionSettings.email._edit">
                <email-action name="{{actionName}}"></email-action>
              </div>
              <div ng-if="actionSettings.report._edit">
                <report-action name="{{actionName}}"></report-action>
              </div>
            </li>
          </ul>
        </div>
      </div>
<commit_msg>Enable actions to save text in ace editor while you switch between them. ng-show reload the directive function, thus you loose your changes while navigating through the actions.<commit_after><div class="modal-header">
  <h3 class="modal-title">Create watcher</h3>
</div>
<div class="modal-body">

<form name="outerForm" class="form-horizontal">
  <tabset active="activeForm">
    <tab index="0" heading="General">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-2"></div>
        <div class="col-md-6">
          <button
            type="button"
            class="btn btn-sm btn-success"
            ng-click="watcher._source.disable = !watcher._source.disable; toggleWatcher()"
            ng-class="{true: 'btn-warning', false: 'btn-success'}[watcher._source.disable]"
            >{{form.status}}</button>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-2 control-label" for="title">Title:</label>
        <div class="col-md-6">
          <input
            type="text"
            id="title"
            name="title"
            value="{{watcher._source.title}}"
            class="form-control"
            placeholder="{{watcher._source.uuid}}"
            ng-model="watcher._source.title"
            ng-disabled="form.disabled">
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-2 control-label" for="schedule">Schedule:</label>
        <div class="col-md-6">
          <input
            type="text"
            id="schedule"
            name="schedule"
            value="{{watcher._source.trigger.schedule.later}}"
            class="form-control"
            placeholder="every 1m"
            ng-model="watcher._source.trigger.schedule.later"
            ng-disabled="form.disabled">
        </div>
          <!-- TO-DO: add timepicker and datepicker -->
          <!-- angular ui v0.12
          <timepicker
            ng-model="form.time.now"
            ng-change="changed()"
            hour-step="form.time.hstep"
            minute-step="form.time.mstep"
            show-meridian="form.time.ismeridian"></timepicker>
          -->
          <!-- angular ui v2.5
          <div uib-timepicker
            ng-model="form.time.now"
            ng-change="changed()"
            hour-step="form.time.hstep"
            minute-step="form.time.mstep"
            show-meridian="form.time.ismeridian"
            ng-disabled="disabled"></div>
        </div>
          -->
      </div>
    </tab>
    <tab index="1" heading="Input" select="getInput()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="inputEdit"
            class="aceditor"
            ng-model="watcher._source._input"
            ui-ace="{ mode: 'json' }">{{ watcher._source._input }}</div>
        </div>
      </div>
    </tab>
    <tab index="2" heading="Condition" select="getCondition()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="conditionEdit"
            class="aceditor"
            ng-model="watcher._source._condition"
            ui-ace="{ mode: 'javascript' }">{{ watcher._source._condition }}</div>
        </div>
      </div>
    </tab>
    <tab index="3" heading="Transform" select="getTransform()">
      <div class="form-group">
        <p></p>
      </div>
      <div class="form-group">
        <div class="col-md-12">
          <div id="transformEdit"
            ng-model="watcher._source._transform"
            ui-ace="{ mode: 'javascript' }"
            class="aceditor">{{ watcher._source._transform }}</div>
        </div>
      </div>
    </tab>
    <tab index="4" heading="Actions">
      <div class="form-group">
        <p></p>
      </div>

      <div class="form-group">
        <div class="col-md-1">
        </div>
        <div class="col-md-11">
          <a href=""
            ng-class="{'fa': true, 'fa-plus': !form.actions.new.edit, 'fa-minus': form.actions.new.edit}"
            ng-click="addAction()"></a>
          <div ng-if="form.actions.new.edit">
            <new-action></new-action>
          </div>
        </div>
      </div>

      <div class="form-group">
        <div class="col-md-1">
        </div>
        <div class="col-md-11">
          <ul class="formActionsList"
            ng-repeat="(actionName, actionSettings) in watcher._source.actions" style="list-style-type:none;">
            <li>
              <a href="" class="fa fa-minus" ng-click="removeAction(actionName)"></a>
              <a href="" ng-click="editAction(actionName, actionSettings)">{{actionName}}</a>
              <div class="form-group" ng-if="actionSettings.webhook._edit || actionSettings.email._edit">
                <label class="col-md-2 control-label" for="throttle_period">Throttle period:</label>
                <div class="col-md-2">
                  <input
                    type="text"
                    id="throttle_period"
                    name="throttle_period"
                    value="{{actionSettings.throttle_period}}"
                    class="form-control"
                    placeholder="1m"
                    ng-model="actionSettings.throttle_period"
                    ng-disabled="form.disabled">
                </div>
              </div>
              <div ng-show="actionSettings.webhook._edit">
                <webhook-action name="{{actionName}}"></webhook-action>
              </div>
              <div ng-show="actionSettings.email._edit">
                <email-action name="{{actionName}}"></email-action>
              </div>
              <div ng-show="actionSettings.report._edit">
                <report-action name="{{actionName}}"></report-action>
              </div>
            </li>
          </ul>
        </div>
      </div>

{'fraction_non_alphanumeric': 0.17163797511505027, 'fraction_numerical': 0.005795125276972899, 'mean_word_length': 1.7347937543696108, 'pattern_counts': {'":': 0, '<': 261, '<?xml version=': 0, '>': 261, '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': '7467539', 'n_tokens_mistral': 3509, 'n_tokens_neox': 3415, 'n_words': 573}