<!DOCTYPE html>
<html>
    <head>
        <title>Crumbs</title>
    </head>
    <body>
        <strong>Please choose the CSV file to dump:</strong><br />
        <input type="file" id="file" />
        <input type="button" value="Load file" onclick="dump();" />
        <script type="text/javascript">
            var dump = function() {
                console.log('Dump started.');
                var file = document.getElementById('file').files[0];
                if (file) {
                    var reader = new FileReader();
                    reader.readAsText(file);
                    reader.onload = function(event) {
                        console.log('File loaded.');
                        var payload = {
                            url: window.location.protocol + '//' + window.location.host + '/' + window.location.pathname.split('/')[1] + '/',
                            data: event.target.result
                        };
                        var worker = new Worker('crumbs-worker.js');
                        worker.onmessage = function(message) {
                            console.log(message.data);
                        };
                        worker.postMessage(payload);
                    };
                }
            };
        </script>
    </body>
</html>

<!DOCTYPE html>
<html>
    <head>
        <title>Crumbs</title>
    </head>
    <body>
        <strong>Please choose the CSV file to dump:</strong><br />
        <input type="file" id="file" />
        <input type="button" value="Load file" onclick="dump();" />
        <img id="spinner" src="../../../_utils/image/spinner.gif" style="display: none;" />
        <script type="text/javascript">
            var dump = function() {
                console.log('Dump started.');
                toggleSpinner();
                var file = document.getElementById('file').files[0];
                if (file) {
                    var reader = new FileReader();
                    reader.readAsText(file);
                    reader.onload = function(event) {
                        console.log('File loaded.');
                        var payload = {
                            url: window.location.protocol + '//' + window.location.host + '/' + window.location.pathname.split('/')[1] + '/',
                            data: event.target.result
                        };
                        var worker = new Worker('crumbs-worker.js');
                        worker.onmessage = function(message) {
                            console.log(message.data);
                            toggleSpinner();
                        };
                        worker.postMessage(payload);
                    };
                }
            };
            var toggleSpinner = function() {
                var spinner = document.getElementById('spinner');
                if (spinner.getAttribute('style').indexOf('none') == -1) {
                    spinner.setAttribute('style', 'display: none');
                } else {
                    spinner.setAttribute('style', 'display: show');
                }
            };
        </script>
    </body>
</html>

Use spinner as status indicator.
Use spinner as status indicator.
