[General] Running Lively from a Subdirectory: How To
Philip Weaver
philmaker at gmail.com
Sun Apr 19 01:34:37 CEST 2009
The following is description of one way to be able to run your Lively worlds
while the kernel resides inside a subdirectory. The benefit is that all of
your world documents can exist at the top level of your root directory and
are easier to locate and manage. This also makes updating from svn much
simpler. You can also keep your localconfig in the root directory while the
defaultconfig resides in the Lively subdirectory.
*Concerns*
These instructions may become obsolete once
"lively.lang.Namespace.defaultBase" begins to reflect a Config setting.
"lively.lang.Namespace.defaultBase" is not available when the Config files
are loaded.
For portability, these instructions use a relative path for Config.codeBase
(below). Haven't delved into the ramifications but it works fine in my
worlds. example.xhtml has a few problems perhaps because some paths are in
subdirectories. "lively.lang.Namespace.defaultBase" is not to easy to modify
because it does not yet exist when the Config files are loaded. Overall,
something in the kernel or in Namespace.uri() needs to change in the
repository so that the BaseExtension.js patch (below) would not be
necessary. The patch is placed in "your-lib/BaseExtension.js" to make future
updates from svn easier.
Please post to the list if you find improvements to this solution for
tidying the Lively installation. (a weekday is fine :-) ) Please post to the
list if discover and resolve the problems with loading example.xhtml
*Instructions*
*
*
*Make a backup of your Lively directory before continuing.*
Create a new directory named "lively" inside the root kernel directory. Move
the contents of the root kernel directory into "lively".
In each of your world documents, replace:
- xlink:href="
with:
- xlink:href="lively/
Next, in each of your world documents, also replace:
- <script type="text/ecmascript" xlink:href="lively/Base.js"/>
with:
- <script type="text/ecmascript" xlink:href="lively/Base.js"/>
<script type="text/ecmascript" xlink:href="your-libs/BaseExtension.js"/>
*your-libs/BaseExtension.js*
Config.codeBase = '/lively/';
lively.lang.Namespace.prototype.uri =
lively.lang.Namespace.prototype.uri.wrap(function(proceed) {
lively.lang.Namespace.defaultBase = Config.codeBase;
var result = proceed();
return result;
});
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090418/7f1bf836/attachment.html
More information about the lively-kernel
mailing list