kaepora/miniLock — pull request #76 by 45678 (2014-07-31 03:13:14+00:00)
Title: Re-assignable path to source files to help use miniLock in another program

I ran into a snag loading `js/workers/crypto.js` when I included miniLock in a web page of my own because my copies of the miniLock files were in an unexpected location. I was trying to load them from the `node_modules` folder in my project like this:

```

```

An error occurs when I include the `master` scripts like this because `miniLock.js` attempts to load `js/workers/crypto.js` which doesn’t exist on my host – my copy of the file is located at `node_modules/miniLock/src/js/workers/crypto.js`. This pull request demonstrates how I fixed that particular problem without resorting to a `js` symlink in my project folder.

The changeset adds `miniLock.setting.pathToSourceFiles` so that tinkerers can specify the path when they load miniLock on a page of their own. For example my project is set it up something like this:

```

```

To accommodate the new setting the crypto worker is constructed on demand instead of script load. Code that previously referred to `miniLock.crypto.worker` now calls `miniLock.crypto.worker()` to get a handle on the worker (or create it if it doesn’t exist).

@kaepora, I know this pull isn’t a priority given the looming public release so please feel free to ignore or close it for now if you want to stay focused on other issues.