joostn/OpenJsCad — pull request #17 by tonious (2013-01-12 04:59:36+00:00)
Title: Added path related helper functions.

This patch adds two path related helper function.

OpenJsCad.Processor.setOpenJsCadPath( path );

This function allows the user to set a path to the
OpenJsCad folder.

OpenJsCad.Processor.addLibrary( library );

This function allows users to import additional javascript
files. Objects within those files can then be referenced
within the OpenJsCad web worker context.

In both cases, paths can be relative or absolute.

The use case of both functions is to be able to add
OpenJsCad as a git submodule, and allow use of OpenJsCad
without necessarily forking OpenJsCad.

Both functions rely on the addition of an options hash to
OpenJsCad.Processor. This hash is then passed through
OpenJsCad.parseJsCadScriptASync. This involved changing the
call parameters to add said hash.

This patch was inspired by iamwillhelms pull request[1] but
varies in syntax somewhat to better represent the actual
goal of each function.

[1]: https://github.com/joostn/OpenJsCad/pull/1