<commit_before><template>
  <v-container>
    <date-picker></date-picker>
    <task-list v-if="!loading"></task-list>
    <v-layout>
     <v-flex xs12 class="text-xs-center">
       <v-progress-circular
         indeterminate
         class="primary--text"
         :width="7"
         :size="70"
         v-if="loading"></v-progress-circular>
     </v-flex>
   </v-layout>
   <total-time></total-time>
  </v-container>
</template>

<script>
  import TaskList from './TaskList.vue'
  import TotalTime from './TotalTime.vue'
  import DatePicker from './DatePicker.vue'
  import mockTaskList from '../../model/mock-task-list'

  export default {
    components: {
      'task-list': TaskList,
      'date-picker': DatePicker,
      'total-time': TotalTime
    },
    computed: {
      loading () {
        return this.$store.getters.loading
      }
    }
  }
</script>

<style>
  ol, ul {
    padding-left: 0;
    width: 100%;
  }
</style><commit_msg>add(TimeTracker): check active task when closing window<commit_after><template>
  <v-container>
    <date-picker></date-picker>
    <task-list v-if="!loading"></task-list>
    <v-layout>
     <v-flex xs12 class="text-xs-center">
       <v-progress-circular
         indeterminate
         class="primary--text"
         :width="7"
         :size="70"
         v-if="loading"></v-progress-circular>
     </v-flex>
   </v-layout>
   <total-time></total-time>
  </v-container>
</template>

<script>
  import TaskList from './TaskList.vue'
  import TotalTime from './TotalTime.vue'
  import DatePicker from './DatePicker.vue'
  import mockTaskList from '../../model/mock-task-list'

  export default {
    components: {
      'task-list': TaskList,
      'date-picker': DatePicker,
      'total-time': TotalTime
    },
    mounted() {
      window.addEventListener('beforeunload', this.checkActiveTaskWhenClosing);
    },
    computed: {
      loading () {
        return this.$store.getters.loading
      }
    },
    methods: {
      checkActiveTaskWhenClosing(event) {
        if(this.$store.getters.activeTask) {
          event.returnValue = 'Are you sure?';
          return "You have active task!"
        }
      }
    }
  }
</script>

<style>
  ol, ul {
    padding-left: 0;
    width: 100%;
  }
  @media only screen and (max-width: 960px) {
    .container {
      max-width: 100%;
    }
  }
</style>
{'fraction_non_alphanumeric': 0.16100254885301615, 'fraction_numerical': 0.010195412064570943, 'mean_word_length': 2.2572614107883817, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '3301414', 'n_tokens_mistral': 799, 'n_tokens_neox': 779, 'n_words': 147}