<commit_before>var request = require('request')
var drop = require('drag-and-drop-files')
var filereader = require('filereader-stream')
var mdns = require('multicast-dns')()
var concat = require('concat-stream')
var vtt = require('srt-to-vtt')
var ipc = require('ipc')
var http = require('http')
var rangeParser = require('range-parser')
var pump = require('pump')
var fs = require('fs')
var eos = require('end-of-stream')
var minimist = require('minimist')
var JSONStream = require('JSONStream')
var network = require('network-address')
var player = require('./player')
var playlist = require('./playlist')
var mouseidle = require('./mouseidle')

var argv = minimist(JSON.parse(window.location.toString().split('#')[1]), {
  alias: {follow: 'f'},
  boolean: ['follow']
})

var on = function (el, name, fn) {
  el.addEventListener(name, fn, false)
}

var $ = document.querySelector.bind(document)
var media = player($('#player'))
var list = playlist()

drop($('body'), function (files) {
  var onsubs = function (data) {
    media.subtitles(data)
  }

  filereader(files[0]).pipe(vtt()).pipe(concat(onsubs))
})

var isFullscreen = false

on($('#controls-fullscreen'), 'click', function (e) {
  var $icon = $('#controls-fullscreen .mega-octicon')
  if (isFullscreen) {
    isFullscreen = false
    $icon.className = 'mega-octicon octicon-screen-full'
    ipc.send('exit-full-screen')
  } else {
    isFullscreen = true
    $icon.className = 'mega-octicon octicon-screen-normal'
    ipc.send('enter-full-screen')
  }
})

on($('#controls-timeline'), 'click', function (e) {
  var time = e.pageX / $('#controls-timeline').offsetWidth * media.duration
  media.time(time)
})

mouseidle($('#drag'), 4000, 'hide-cursor')

list.on('select', function () {
  $('#controls-name').innerText = list.selected.name
  media.play('http://127.0.0.1:' + server.address().port + '/' + list.selected.id)
})

list.once('update', function () {
  list.select(list.entries.length - 1)
})

var formatTime = function (secs) {
  var hours = (secs / 3600) | 0<commit_msg>3s timeout on cursor hide<commit_after>var request = require('request')
var drop = require('drag-and-drop-files')
var filereader = require('filereader-stream')
var mdns = require('multicast-dns')()
var concat = require('concat-stream')
var vtt = require('srt-to-vtt')
var ipc = require('ipc')
var http = require('http')
var rangeParser = require('range-parser')
var pump = require('pump')
var fs = require('fs')
var eos = require('end-of-stream')
var minimist = require('minimist')
var JSONStream = require('JSONStream')
var network = require('network-address')
var player = require('./player')
var playlist = require('./playlist')
var mouseidle = require('./mouseidle')

var argv = minimist(JSON.parse(window.location.toString().split('#')[1]), {
  alias: {follow: 'f'},
  boolean: ['follow']
})

var on = function (el, name, fn) {
  el.addEventListener(name, fn, false)
}

var $ = document.querySelector.bind(document)
var media = player($('#player'))
var list = playlist()

drop($('body'), function (files) {
  var onsubs = function (data) {
    media.subtitles(data)
  }

  filereader(files[0]).pipe(vtt()).pipe(concat(onsubs))
})

var isFullscreen = false

on($('#controls-fullscreen'), 'click', function (e) {
  var $icon = $('#controls-fullscreen .mega-octicon')
  if (isFullscreen) {
    isFullscreen = false
    $icon.className = 'mega-octicon octicon-screen-full'
    ipc.send('exit-full-screen')
  } else {
    isFullscreen = true
    $icon.className = 'mega-octicon octicon-screen-normal'
    ipc.send('enter-full-screen')
  }
})

on($('#controls-timeline'), 'click', function (e) {
  var time = e.pageX / $('#controls-timeline').offsetWidth * media.duration
  media.time(time)
})

mouseidle($('#drag'), 3000, 'hide-cursor')

list.on('select', function () {
  $('#controls-name').innerText = list.selected.name
  media.play('http://127.0.0.1:' + server.address().port + '/' + list.selected.id)
})

list.once('update', function () {
  list.select(list.entries.length - 1)
})

var formatTime = function (secs) {
  var hours = (secs / 3600) | 0
{'fraction_non_alphanumeric': 0.19198827552515876, 'fraction_numerical': 0.00903761602344895, 'mean_word_length': 4.63273727647868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4271683', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1373, 'n_words': 297}