installing jsolait

use a prebuilt jsolait

All you need to do to use jsolait in your own project is.

  • download a build
  • unpack it into the folder with your html/svg/??? files
  • reference jsolait in your your html/svg/??? file

Example directory structure:

|
+--trying-jsolait
|   |
|   +--jsolait
|   |   |
|   |   +--lib
|   |   +--jsolait.js
|   |   +--jsolait.wsf
|   |
|   +--yourhtml.html
|   +--yourscript.js
|
 

content of yourhtml.html:

<html>
 <head>
  <script type="text/javascript" src="./jsolait/jsolait.js"></script>
  <script type="text/javascript" src="./yourscript.js"></script>
 </head>
 <body>
 </body>
</html>   

If your own script is a module then you don't even need to add it using a script tag. You can just import your module in the body's onload event and run a startup method.

<html>
 <head>
  <script type="text/javascript" src="/jsolait/jsolait.js"></script>
 </head>
 <body onload="imprt('yourscript').doSomething()">
 </body>
</html>   

If you want to install jsolait into a different location (not ./jsolait/jsolait.js you must tell jsolait where it is installed by changing jsolait.baseURI="location of jsolait installation". For example, below jsolait was installed in the document root of the www server. The second script tells jsolait where it is installed. The default for jsolait.baseURI is ./jsolait.

<html>
 <head>
  <script type="text/javascript" src="/jsolait/jsolait.js"></script>
  <script type="text/javascript">jsolait.baseURI='/jsolait';</script>
 </head>
 <body onload="imprt('yourscript').doSomething()">
 </body>
</html>   

build your own jsolait

You can also rebuild jsolait using the build.js found in /trunk/tools/ in the source tree. What you need to do is:

For now the build only runs on windows but it is planned to either rewrite it in python or provide a common js environment for windows/linux/??? using mozilla's spidermonkey engine.

There are a number of options you can set in the build script:

  • mod.sourcePath = '../jsolait' - defines where to find the jsolait source code.
  • mod.buildPath = '../build/jsolait' - defines where the built files will go.
  • mod.docPath = '../build/doc' - defines where the auto generated documentation will go.
  • mod.jsolaitBaseURI='./jsolait' - defines what the default baseURI for the built jsolait will be set to.
  • mod.libFolders=['lib', 'lib3rdparty'] - defines folders that the build script should use to find modules that will integrated into the final build. the build script will use this information to add a module lookup table to the jsolait.js file so that the import functionality can easily find these modules without having to guess their location.

The build script needs to be run by jsolait. You can just use the source files you downloaded or any other compatible jsolait build.
cscript /nologo "path-to-jsolait-source\trunk\jsolait\jsolait.wsf" "file://path-to-jsolait-source\trunk\tools\build.js"

As long as all files to build are well formed they will be compressed and put into the build folder. The build script will fail and report errors about source files not being well formed.

Thats it, you have a ready to use build.