<!DOCTYPE html>
<html>
  <head>
    <title>Folder selection</title>
    <link href='./libs/template.css' media='all' rel='stylesheet' type='text/css' />
  </head>
  <body>
    <div class='app'>

      <div class='form-row'>
        <input type='file' id='dir' webkitdirectory directory multiple />
      </div>
      <div class='form-row'>
        <input type='text' class='text' id='selected' disabled />
      </div>
      <div class='form-row'>
        <textarea id='log' disabled></textarea>
      </div>

    </div>


    <script>
    window.onload = function () {
      var ipc = require('ipc');
      var watcher = require('./libs/watcher');

      var dir = document.querySelector('#dir');
      var selected = document.querySelector('#selected');
      var log = document.querySelector('#log');

      dir.addEventListener('change', function (e) {
        selected.value = e.target.files[0].path;
        watcher(e.target.files[0].path, function (e, filename) {
          log.value += 'Event: ' + e + '\nFilename: ' + filename + '\n';
        });
      });
    };
    </script>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <title>Folder selection</title>
    <link href='./libs/template.css' media='all' rel='stylesheet' type='text/css' />
  </head>
  <body>
    <div class='app'>

      <div class='form-row'>
        <input type='file' id='dir' webkitdirectory directory multiple />
      </div>
      <div class='form-row'>
        <input type='text' class='text' id='selected' disabled />
      </div>
      <div class='form-row'>
        <textarea id='log' disabled></textarea>
      </div>

    </div>


    <script>
    window.onload = function () {
      var ipc = require('ipc');
      var watcher = require('./libs/watcher');

      var dir = document.querySelector('#dir');
      var selected = document.querySelector('#selected');
      var log = document.querySelector('#log');

      dir.addEventListener('change', function (e) {
        selected.value = e.target.files[0].path;
        watcher.watch(e.target.files[0].path, function (e, filename) {
          log.value += 'Event: ' + e + '\nFilename: ' + filename + '\n';
        });
      });
    };
    </script>
  </body>
</html>

Update app to work with new watcher
Update app to work with new watcher
