<commit_before><style lang="stylus">
  
  html, body
    width: 100%
    height: 100%
    margin: 0
    padding: 0
  
  #schedule
    display: flex
    flex-direction: row
    align-items: flex-end
    
    .day
      width: 180px
      margin-right: 10px
      float: left
      
    .day:last-of-type
      margin-right: 0
      
    .countdown
      margin: 1px 0 2px 0
      float: left
      font-size: 24px
      font-weight: 300
      line-height: 24px
      
</style>
<template>
  <div id="schedule">
    <div v-for="day in week" class="day">
      <!-- TODO: How should I filter out lunches? -->
      <Block v-for="block in createSchedule(day)" :block="block"></Block>
        <header class="dayHeader">{{ now | dateText(day, i) }}</header>
              <div class="countdown" v-if="j === _countdown.index &&
                day === _countdown.day && _countdown.before">
                {{ _countdown.text }}
              </div>
                <span class="blockName" v-if="block.name && block.lunch">
                  <span class="lunch" @click="toggleLunch(day, block.lunch)"
                    title="Toggle Lunch">{{ block.lunch | lunchText }}</span> {{ block.name }}
                </span>
              <div class="countdown" v-if="j === _countdown.index &&
                day === _countdown.day && !_countdown.before">
                {{ _countdown.text }}
              </div>
    </div>
  </div>
</template>
<script>
  
  import schedule from './schedule.json'
  
  import _ from 'lodash'
  
  // Map lunch number to the text version
  Vue.filter('lunchText', (lunch) => {
    return (lunch === 1) ? 'First' : 'Second'
  })
  
  // Update date headers based current time, so they automatically change
  Vue.filter('dateText', (now, day, i) => {
    return `${day}, ${moment(now).day(i + 1).format('M/D')}`
  })
  
  export default {
    data() {
      return {
        // Define default lunches and classes schema so updates are faster/cached
        lunches: { 'Monday': 1, 'Tuesday': 1, 'Wednesday': 1, 'Thursday': 1, 'Friday': 1 },
        classes: { 1: '', 2: '', 3: '', 4: '', 5: '', 6: '', 7: '' },
        isCrawler: /bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent),
    watch: {
      // Update title of page with current time (a full old BearTime replacement!)
      '_countdown.text'() {
        if (this.isCrawler) return
        let text = this._countdown.text
        document.title = (text) ? `${text} \u2022 BearTime` : 'BearTime'
      },
      'lunches': {
        handler() {
          this.updatePrefs('lunches')
        },
        deep: true
      },
      'classes': {
        handler() {
          this.updatePrefs('classes')
        },
        deep: true
      }
    },
    mounted() {
      // Restore preferences
      this.restorePrefs('lunches')
      this.restorePrefs('classes')
    },
    methods: {<commit_msg>Add initial data and constants to Vue<commit_after><style lang="stylus">
  
  html, body
    width: 100%
    height: 100%
    margin: 0
    padding: 0
  
  #schedule
    display: flex
    flex-direction: row
    align-items: flex-end
    
    .day
      width: 180px
      margin-right: 10px
      float: left
      
    .day:last-of-type
      margin-right: 0
      
    .countdown
      margin: 1px 0 2px 0
      float: left
      font-size: 24px
      font-weight: 300
      line-height: 24px
      
</style>
<template>
  <div id="schedule">
    <div v-for="day in week" class="day">
      <!-- TODO: How should I filter out lunches? -->
      <Block v-for="block in createSchedule(day)" :block="block"></Block>
        <header class="dayHeader">{{ now | dateText(day, i) }}</header>
              <div class="countdown" v-if="j === _countdown.index &&
                day === _countdown.day && _countdown.before">
                {{ _countdown.text }}
              </div>
                <span class="blockName" v-if="block.name && block.lunch">
                  <span class="lunch" @click="toggleLunch(day, block.lunch)"
                    title="Toggle Lunch">{{ block.lunch | lunchText }}</span> {{ block.name }}
                </span>
              <div class="countdown" v-if="j === _countdown.index &&
                day === _countdown.day && !_countdown.before">
                {{ _countdown.text }}
              </div>
    </div>
  </div>
</template>
<script>
  
  import schedule from './schedule.json'
  
  import _ from 'lodash'
  import Vue from 'vue'
  import moment from 'moment'
  import 'moment-duration-format'
  
  // Map lunch number to the text version
  Vue.filter('lunchText', (lunch) => {
    return (lunch === 1) ? 'First' : 'Second'
  })
  
  // Update date headers based current time, so they automatically change
  Vue.filter('dateText', (now, day, i) => {
    return `${day}, ${moment(now).day(i + 1).format('M/D')}`
  })
  
  export default {
    data() {
      return {
        // Define default lunches and classes schema so updates are faster/cached
        lunches: { 'Monday': 1, 'Tuesday': 1, 'Wednesday': 1, 'Thursday': 1, 'Friday': 1 },
        classes: { 1: '', 2: '', 3: '', 4: '', 5: '', 6: '', 7: '' },
        // Constants, pretty much
        schedule,
        sizing: 1.2,
        week: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
        colors: ['#3F51B5', '#1976D2', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A'],
        isCrawler: /bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent),
        // Important to trigger updates for countdown timer
        now: moment().valueOf()
      }
    },
    watch: {
      // Update title of page with current time (a full old BearTime replacement!)
      '_countdown.text'() {
        if (this.isCrawler) return
        let text = this._countdown.text
        document.title = (text) ? `${text} \u2022 BearTime` : 'BearTime'
      },
      'lunches': {
        handler() {
          this.updatePrefs('lunches')
        },
        deep: true
      },
      'classes': {
        handler() {
          this.updatePrefs('classes')
        },
        deep: true
      }
    },
    mounted() {
      // Restore preferences
      this.restorePrefs('lunches')
      this.restorePrefs('classes')
    },
    methods: {
{'fraction_non_alphanumeric': 0.1571863483416119, 'fraction_numerical': 0.018586764941515784, 'mean_word_length': 2.0009615384615387, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 51, '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': '167313', 'n_tokens_mistral': 2089, 'n_tokens_neox': 1968, 'n_words': 491}